var nse=Object.defineProperty;var iB=n=>{throw TypeError(n)};var ise=(n,e,t)=>e in n?nse(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ze=(n,e,t)=>ise(n,typeof e!="symbol"?e+"":e,t),pk=(n,e,t)=>e.has(n)||iB("Cannot "+t);var g=(n,e,t)=>(pk(n,e,"read from private field"),t?t.call(n):e.get(n)),Y=(n,e,t)=>e.has(n)?iB("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),V=(n,e,t,i)=>(pk(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Q=(n,e,t)=>(pk(n,e,"access private method"),t);var Dr=(n,e,t,i)=>({set _(r){V(n,e,r,t)},get _(){return g(n,e,i)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();var Vf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function AP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function rse(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var gk={exports:{}},Y_={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var rB;function sse(){if(rB)return Y_;rB=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,s){var a=null;if(s!==void 0&&(a=""+s),r.key!==void 0&&(a=""+r.key),"key"in r){s={};for(var o in r)o!=="key"&&(s[o]=r[o])}else s=r;return r=s.ref,{$$typeof:n,type:i,key:a,ref:r!==void 0?r:null,props:s}}return Y_.Fragment=e,Y_.jsx=t,Y_.jsxs=t,Y_}var sB;function ase(){return sB||(sB=1,gk.exports=sse()),gk.exports}var J=ase(),mk={exports:{}},Zt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var aB;function ose(){if(aB)return Zt;aB=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;function y(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,_={};function E(j,G,Z){this.props=j,this.context=G,this.refs=_,this.updater=Z||x}E.prototype.isReactComponent={},E.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,G,"setState")},E.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function w(){}w.prototype=E.prototype;function A(j,G,Z){this.props=j,this.context=G,this.refs=_,this.updater=Z||x}var N=A.prototype=new w;N.constructor=A,v(N,E.prototype),N.isPureReactComponent=!0;var k=Array.isArray;function F(){}var C={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function R(j,G,Z){var te=Z.ref;return{$$typeof:n,type:j,key:G,ref:te!==void 0?te:null,props:Z}}function L(j,G){return R(j.type,G,j.props)}function H(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function P(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(Z){return G[Z]})}var O=/\/+/g;function B(j,G){return typeof j=="object"&&j!==null&&j.key!=null?P(""+j.key):G.toString(36)}function re(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(F,F):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function q(j,G,Z,te,ie){var _e=typeof j;(_e==="undefined"||_e==="boolean")&&(j=null);var Ie=!1;if(j===null)Ie=!0;else switch(_e){case"bigint":case"string":case"number":Ie=!0;break;case"object":switch(j.$$typeof){case n:case e:Ie=!0;break;case h:return Ie=j._init,q(Ie(j._payload),G,Z,te,ie)}}if(Ie)return ie=ie(j),Ie=te===""?"."+B(j,0):te,k(ie)?(Z="",Ie!=null&&(Z=Ie.replace(O,"$&/")+"/"),q(ie,G,Z,"",function(Ge){return Ge})):ie!=null&&(H(ie)&&(ie=L(ie,Z+(ie.key==null||j&&j.key===ie.key?"":(""+ie.key).replace(O,"$&/")+"/")+Ie)),G.push(ie)),1;Ie=0;var Pe=te===""?".":te+":";if(k(j))for(var Fe=0;Fe<j.length;Fe++)te=j[Fe],_e=Pe+B(te,Fe),Ie+=q(te,G,Z,_e,ie);else if(Fe=y(j),typeof Fe=="function")for(j=Fe.call(j),Fe=0;!(te=j.next()).done;)te=te.value,_e=Pe+B(te,Fe++),Ie+=q(te,G,Z,_e,ie);else if(_e==="object"){if(typeof j.then=="function")return q(re(j),G,Z,te,ie);throw G=String(j),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Ie}function X(j,G,Z){if(j==null)return j;var te=[],ie=0;return q(j,te,"","",function(_e){return G.call(Z,_e,ie++)}),te}function oe(j){if(j._status===-1){var G=j._result;G=G(),G.then(function(Z){(j._status===0||j._status===-1)&&(j._status=1,j._result=Z)},function(Z){(j._status===0||j._status===-1)&&(j._status=2,j._result=Z)}),j._status===-1&&(j._status=0,j._result=G)}if(j._status===1)return j._result.default;throw j._result}var ue=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},ge={map:X,forEach:function(j,G,Z){X(j,function(){G.apply(this,arguments)},Z)},count:function(j){var G=0;return X(j,function(){G++}),G},toArray:function(j){return X(j,function(G){return G})||[]},only:function(j){if(!H(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Zt.Activity=f,Zt.Children=ge,Zt.Component=E,Zt.Fragment=t,Zt.Profiler=r,Zt.PureComponent=A,Zt.StrictMode=i,Zt.Suspense=l,Zt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,Zt.__COMPILER_RUNTIME={__proto__:null,c:function(j){return C.H.useMemoCache(j)}},Zt.cache=function(j){return function(){return j.apply(null,arguments)}},Zt.cacheSignal=function(){return null},Zt.cloneElement=function(j,G,Z){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var te=v({},j.props),ie=j.key;if(G!=null)for(_e in G.key!==void 0&&(ie=""+G.key),G)!M.call(G,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&G.ref===void 0||(te[_e]=G[_e]);var _e=arguments.length-2;if(_e===1)te.children=Z;else if(1<_e){for(var Ie=Array(_e),Pe=0;Pe<_e;Pe++)Ie[Pe]=arguments[Pe+2];te.children=Ie}return R(j.type,ie,te)},Zt.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:s,_context:j},j},Zt.createElement=function(j,G,Z){var te,ie={},_e=null;if(G!=null)for(te in G.key!==void 0&&(_e=""+G.key),G)M.call(G,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ie[te]=G[te]);var Ie=arguments.length-2;if(Ie===1)ie.children=Z;else if(1<Ie){for(var Pe=Array(Ie),Fe=0;Fe<Ie;Fe++)Pe[Fe]=arguments[Fe+2];ie.children=Pe}if(j&&j.defaultProps)for(te in Ie=j.defaultProps,Ie)ie[te]===void 0&&(ie[te]=Ie[te]);return R(j,_e,ie)},Zt.createRef=function(){return{current:null}},Zt.forwardRef=function(j){return{$$typeof:o,render:j}},Zt.isValidElement=H,Zt.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:oe}},Zt.memo=function(j,G){return{$$typeof:c,type:j,compare:G===void 0?null:G}},Zt.startTransition=function(j){var G=C.T,Z={};C.T=Z;try{var te=j(),ie=C.S;ie!==null&&ie(Z,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(F,ue)}catch(_e){ue(_e)}finally{G!==null&&Z.types!==null&&(G.types=Z.types),C.T=G}},Zt.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},Zt.use=function(j){return C.H.use(j)},Zt.useActionState=function(j,G,Z){return C.H.useActionState(j,G,Z)},Zt.useCallback=function(j,G){return C.H.useCallback(j,G)},Zt.useContext=function(j){return C.H.useContext(j)},Zt.useDebugValue=function(){},Zt.useDeferredValue=function(j,G){return C.H.useDeferredValue(j,G)},Zt.useEffect=function(j,G){return C.H.useEffect(j,G)},Zt.useEffectEvent=function(j){return C.H.useEffectEvent(j)},Zt.useId=function(){return C.H.useId()},Zt.useImperativeHandle=function(j,G,Z){return C.H.useImperativeHandle(j,G,Z)},Zt.useInsertionEffect=function(j,G){return C.H.useInsertionEffect(j,G)},Zt.useLayoutEffect=function(j,G){return C.H.useLayoutEffect(j,G)},Zt.useMemo=function(j,G){return C.H.useMemo(j,G)},Zt.useOptimistic=function(j,G){return C.H.useOptimistic(j,G)},Zt.useReducer=function(j,G,Z){return C.H.useReducer(j,G,Z)},Zt.useRef=function(j){return C.H.useRef(j)},Zt.useState=function(j){return C.H.useState(j)},Zt.useSyncExternalStore=function(j,G,Z){return C.H.useSyncExternalStore(j,G,Z)},Zt.useTransition=function(){return C.H.useTransition()},Zt.version="19.2.4",Zt}var oB;function SP(){return oB||(oB=1,mk.exports=ose()),mk.exports}var Se=SP();const lse=AP(Se);var yk={exports:{}},J_={},vk={exports:{}},_k={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lB;function cse(){return lB||(lB=1,(function(n){function e(q,X){var oe=q.length;q.push(X);e:for(;0<oe;){var ue=oe-1>>>1,ge=q[ue];if(0<r(ge,X))q[ue]=X,q[oe]=ge,oe=ue;else break e}}function t(q){return q.length===0?null:q[0]}function i(q){if(q.length===0)return null;var X=q[0],oe=q.pop();if(oe!==X){q[0]=oe;e:for(var ue=0,ge=q.length,j=ge>>>1;ue<j;){var G=2*(ue+1)-1,Z=q[G],te=G+1,ie=q[te];if(0>r(Z,oe))te<ge&&0>r(ie,Z)?(q[ue]=ie,q[te]=oe,ue=te):(q[ue]=Z,q[G]=oe,ue=G);else if(te<ge&&0>r(ie,oe))q[ue]=ie,q[te]=oe,ue=te;else break e}}return X}function r(q,X){var oe=q.sortIndex-X.sortIndex;return oe!==0?oe:q.id-X.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();n.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,f=null,p=3,y=!1,x=!1,v=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function N(q){for(var X=t(c);X!==null;){if(X.callback===null)i(c);else if(X.startTime<=q)i(c),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(c)}}function k(q){if(v=!1,N(q),!x)if(t(l)!==null)x=!0,F||(F=!0,P());else{var X=t(c);X!==null&&re(k,X.startTime-q)}}var F=!1,C=-1,M=5,R=-1;function L(){return _?!0:!(n.unstable_now()-R<M)}function H(){if(_=!1,F){var q=n.unstable_now();R=q;var X=!0;try{e:{x=!1,v&&(v=!1,w(C),C=-1),y=!0;var oe=p;try{t:{for(N(q),f=t(l);f!==null&&!(f.expirationTime>q&&L());){var ue=f.callback;if(typeof ue=="function"){f.callback=null,p=f.priorityLevel;var ge=ue(f.expirationTime<=q);if(q=n.unstable_now(),typeof ge=="function"){f.callback=ge,N(q),X=!0;break t}f===t(l)&&i(l),N(q)}else i(l);f=t(l)}if(f!==null)X=!0;else{var j=t(c);j!==null&&re(k,j.startTime-q),X=!1}}break e}finally{f=null,p=oe,y=!1}X=void 0}}finally{X?P():F=!1}}}var P;if(typeof A=="function")P=function(){A(H)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,B=O.port2;O.port1.onmessage=H,P=function(){B.postMessage(null)}}else P=function(){E(H,0)};function re(q,X){C=E(function(){q(n.unstable_now())},X)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(q){q.callback=null},n.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<q?Math.floor(1e3/q):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_next=function(q){switch(p){case 1:case 2:case 3:var X=3;break;default:X=p}var oe=p;p=X;try{return q()}finally{p=oe}},n.unstable_requestPaint=function(){_=!0},n.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var oe=p;p=q;try{return X()}finally{p=oe}},n.unstable_scheduleCallback=function(q,X,oe){var ue=n.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ue+oe:ue):oe=ue,q){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=oe+ge,q={id:h++,callback:X,priorityLevel:q,startTime:oe,expirationTime:ge,sortIndex:-1},oe>ue?(q.sortIndex=oe,e(c,q),t(l)===null&&q===t(c)&&(v?(w(C),C=-1):v=!0,re(k,oe-ue))):(q.sortIndex=ge,e(l,q),x||y||(x=!0,F||(F=!0,P()))),q},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(q){var X=p;return function(){var oe=p;p=X;try{return q.apply(this,arguments)}finally{p=oe}}}})(_k)),_k}var cB;function use(){return cB||(cB=1,vk.exports=cse()),vk.exports}var xk={exports:{}},Ms={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var uB;function hse(){if(uB)return Ms;uB=1;var n=SP();function e(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(l,c,h){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:f==null?null:""+f,children:l,containerInfo:c,implementation:h}}var a=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Ms.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ms.createPortal=function(l,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return s(l,c,null,h)},Ms.flushSync=function(l){var c=a.T,h=i.p;try{if(a.T=null,i.p=2,l)return l()}finally{a.T=c,i.p=h,i.d.f()}},Ms.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,i.d.C(l,c))},Ms.prefetchDNS=function(l){typeof l=="string"&&i.d.D(l)},Ms.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var h=c.as,f=o(h,c.crossOrigin),p=typeof c.integrity=="string"?c.integrity:void 0,y=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?i.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:y}):h==="script"&&i.d.X(l,{crossOrigin:f,integrity:p,fetchPriority:y,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Ms.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=o(c.as,c.crossOrigin);i.d.M(l,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&i.d.M(l)},Ms.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,f=o(h,c.crossOrigin);i.d.L(l,h,{crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Ms.preloadModule=function(l,c){if(typeof l=="string")if(c){var h=o(c.as,c.crossOrigin);i.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else i.d.m(l)},Ms.requestFormReset=function(l){i.d.r(l)},Ms.unstable_batchedUpdates=function(l,c){return l(c)},Ms.useFormState=function(l,c,h){return a.H.useFormState(l,c,h)},Ms.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ms.version="19.2.4",Ms}var hB;function dse(){if(hB)return xk.exports;hB=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),xk.exports=hse(),xk.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var dB;function fse(){if(dB)return J_;dB=1;var n=use(),e=SP(),t=dse();function i(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function s(u){var d=u,m=u;if(u.alternate)for(;d.return;)d=d.return;else{u=d;do d=u,(d.flags&4098)!==0&&(m=d.return),u=d.return;while(u)}return d.tag===3?m:null}function a(u){if(u.tag===13){var d=u.memoizedState;if(d===null&&(u=u.alternate,u!==null&&(d=u.memoizedState)),d!==null)return d.dehydrated}return null}function o(u){if(u.tag===31){var d=u.memoizedState;if(d===null&&(u=u.alternate,u!==null&&(d=u.memoizedState)),d!==null)return d.dehydrated}return null}function l(u){if(s(u)!==u)throw Error(i(188))}function c(u){var d=u.alternate;if(!d){if(d=s(u),d===null)throw Error(i(188));return d!==u?null:u}for(var m=u,b=d;;){var I=m.return;if(I===null)break;var U=I.alternate;if(U===null){if(b=I.return,b!==null){m=b;continue}break}if(I.child===U.child){for(U=I.child;U;){if(U===m)return l(I),u;if(U===b)return l(I),d;U=U.sibling}throw Error(i(188))}if(m.return!==b.return)m=I,b=U;else{for(var K=!1,ce=I.child;ce;){if(ce===m){K=!0,m=I,b=U;break}if(ce===b){K=!0,b=I,m=U;break}ce=ce.sibling}if(!K){for(ce=U.child;ce;){if(ce===m){K=!0,m=U,b=I;break}if(ce===b){K=!0,b=U,m=I;break}ce=ce.sibling}if(!K)throw Error(i(189))}}if(m.alternate!==b)throw Error(i(190))}if(m.tag!==3)throw Error(i(188));return m.stateNode.current===m?u:d}function h(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u;for(u=u.child;u!==null;){if(d=h(u),d!==null)return d;u=u.sibling}return null}var f=Object.assign,p=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(u){return u===null||typeof u!="object"?null:(u=H&&u[H]||u["@@iterator"],typeof u=="function"?u:null)}var O=Symbol.for("react.client.reference");function B(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===O?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case E:return"Profiler";case _:return"StrictMode";case k:return"Suspense";case F:return"SuspenseList";case R:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case x:return"Portal";case A:return u.displayName||"Context";case w:return(u._context.displayName||"Context")+".Consumer";case N:var d=u.render;return u=u.displayName,u||(u=d.displayName||d.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case C:return d=u.displayName||null,d!==null?d:B(u.type)||"Memo";case M:d=u._payload,u=u._init;try{return B(u(d))}catch{}}return null}var re=Array.isArray,q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ue=[],ge=-1;function j(u){return{current:u}}function G(u){0>ge||(u.current=ue[ge],ue[ge]=null,ge--)}function Z(u,d){ge++,ue[ge]=u.current,u.current=d}var te=j(null),ie=j(null),_e=j(null),Ie=j(null);function Pe(u,d){switch(Z(_e,d),Z(ie,u),Z(te,null),d.nodeType){case 9:case 11:u=(u=d.documentElement)&&(u=u.namespaceURI)?S6(u):0;break;default:if(u=d.tagName,d=d.namespaceURI)d=S6(d),u=D6(d,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}G(te),Z(te,u)}function Fe(){G(te),G(ie),G(_e)}function Ge(u){u.memoizedState!==null&&Z(Ie,u);var d=te.current,m=D6(d,u.type);d!==m&&(Z(ie,u),Z(te,m))}function ct(u){ie.current===u&&(G(te),G(ie)),Ie.current===u&&(G(Ie),$_._currentValue=oe)}var gt,Mt;function W(u){if(gt===void 0)try{throw Error()}catch(m){var d=m.stack.trim().match(/\n( *(at )?)/);gt=d&&d[1]||"",Mt=-1<m.stack.indexOf(`
    at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
`+gt+u+Mt}var Re=!1;function Te(u,d){if(!u||Re)return"";Re=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(d){var st=function(){throw Error()};if(Object.defineProperty(st.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(st,[])}catch(et){var Ke=et}Reflect.construct(u,[],st)}else{try{st.call()}catch(et){Ke=et}u.call(st.prototype)}}else{try{throw Error()}catch(et){Ke=et}(st=u())&&typeof st.catch=="function"&&st.catch(function(){})}}catch(et){if(et&&Ke&&typeof et.stack=="string")return[et.stack,Ke.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var I=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");I&&I.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var U=b.DetermineComponentFrameRoot(),K=U[0],ce=U[1];if(K&&ce){var De=K.split(`
`),ze=ce.split(`
`);for(I=b=0;b<De.length&&!De[b].includes("DetermineComponentFrameRoot");)b++;for(;I<ze.length&&!ze[I].includes("DetermineComponentFrameRoot");)I++;if(b===De.length||I===ze.length)for(b=De.length-1,I=ze.length-1;1<=b&&0<=I&&De[b]!==ze[I];)I--;for(;1<=b&&0<=I;b--,I--)if(De[b]!==ze[I]){if(b!==1||I!==1)do if(b--,I--,0>I||De[b]!==ze[I]){var it=`
`+De[b].replace(" at new "," at ");return u.displayName&&it.includes("<anonymous>")&&(it=it.replace("<anonymous>",u.displayName)),it}while(1<=b&&0<=I);break}}}finally{Re=!1,Error.prepareStackTrace=m}return(m=u?u.displayName||u.name:"")?W(m):""}function ae(u,d){switch(u.tag){case 26:case 27:case 5:return W(u.type);case 16:return W("Lazy");case 13:return u.child!==d&&d!==null?W("Suspense Fallback"):W("Suspense");case 19:return W("SuspenseList");case 0:case 15:return Te(u.type,!1);case 11:return Te(u.type.render,!1);case 1:return Te(u.type,!0);case 31:return W("Activity");default:return""}}function he(u){try{var d="",m=null;do d+=ae(u,m),m=u,u=u.return;while(u);return d}catch(b){return`
Error generating stack: `+b.message+`
`+b.stack}}var we=Object.prototype.hasOwnProperty,Le=n.unstable_scheduleCallback,$e=n.unstable_cancelCallback,Ce=n.unstable_shouldYield,be=n.unstable_requestPaint,Ee=n.unstable_now,Me=n.unstable_getCurrentPriorityLevel,Xe=n.unstable_ImmediatePriority,dt=n.unstable_UserBlockingPriority,bt=n.unstable_NormalPriority,zt=n.unstable_LowPriority,Nt=n.unstable_IdlePriority,Gt=n.log,on=n.unstable_setDisableYieldValue,ke=null,xe=null;function Ye(u){if(typeof Gt=="function"&&on(u),xe&&typeof xe.setStrictMode=="function")try{xe.setStrictMode(ke,u)}catch{}}var Je=Math.clz32?Math.clz32:Yt,pt=Math.log,mt=Math.LN2;function Yt(u){return u>>>=0,u===0?32:31-(pt(u)/mt|0)|0}var Kt=256,jt=262144,ne=4194304;function le(u){var d=u&42;if(d!==0)return d;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function Ae(u,d,m){var b=u.pendingLanes;if(b===0)return 0;var I=0,U=u.suspendedLanes,K=u.pingedLanes;u=u.warmLanes;var ce=b&134217727;return ce!==0?(b=ce&~U,b!==0?I=le(b):(K&=ce,K!==0?I=le(K):m||(m=ce&~u,m!==0&&(I=le(m))))):(ce=b&~U,ce!==0?I=le(ce):K!==0?I=le(K):m||(m=b&~u,m!==0&&(I=le(m)))),I===0?0:d!==0&&d!==I&&(d&U)===0&&(U=I&-I,m=d&-d,U>=m||U===32&&(m&4194048)!==0)?d:I}function Oe(u,d){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&d)===0}function ft(u,d){switch(u){case 1:case 2:case 4:case 8:case 64:return d+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 d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ht(){var u=ne;return ne<<=1,(ne&62914560)===0&&(ne=4194304),u}function mn(u){for(var d=[],m=0;31>m;m++)d.push(u);return d}function ki(u,d){u.pendingLanes|=d,d!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function ss(u,d,m,b,I,U){var K=u.pendingLanes;u.pendingLanes=m,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=m,u.entangledLanes&=m,u.errorRecoveryDisabledLanes&=m,u.shellSuspendCounter=0;var ce=u.entanglements,De=u.expirationTimes,ze=u.hiddenUpdates;for(m=K&~m;0<m;){var it=31-Je(m),st=1<<it;ce[it]=0,De[it]=-1;var Ke=ze[it];if(Ke!==null)for(ze[it]=null,it=0;it<Ke.length;it++){var et=Ke[it];et!==null&&(et.lane&=-536870913)}m&=~st}b!==0&&Br(u,b,0),U!==0&&I===0&&u.tag!==0&&(u.suspendedLanes|=U&~(K&~d))}function Br(u,d,m){u.pendingLanes|=d,u.suspendedLanes&=~d;var b=31-Je(d);u.entangledLanes|=d,u.entanglements[b]=u.entanglements[b]|1073741824|m&261930}function wr(u,d){var m=u.entangledLanes|=d;for(u=u.entanglements;m;){var b=31-Je(m),I=1<<b;I&d|u[b]&d&&(u[b]|=d),m&=~I}}function Ys(u,d){var m=d&-d;return m=(m&42)!==0?1:as(m),(m&(u.suspendedLanes|d))!==0?0:m}function as(u){switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=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:u=128;break;case 268435456:u=134217728;break;default:u=0}return u}function Ar(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function se(){var u=X.p;return u!==0?u:(u=window.event,u===void 0?32:Y6(u.type))}function me(u,d){var m=X.p;try{return X.p=u,d()}finally{X.p=m}}var fe=Math.random().toString(36).slice(2),de="__reactFiber$"+fe,ye="__reactProps$"+fe,ve="__reactContainer$"+fe,Ve="__reactEvents$"+fe,nt="__reactListeners$"+fe,He="__reactHandles$"+fe,je="__reactResources$"+fe,qe="__reactMarker$"+fe;function ht(u){delete u[de],delete u[ye],delete u[Ve],delete u[nt],delete u[He]}function yt(u){var d=u[de];if(d)return d;for(var m=u.parentNode;m;){if(d=m[ve]||m[de]){if(m=d.alternate,d.child!==null||m!==null&&m.child!==null)for(u=F6(u);u!==null;){if(m=u[de])return m;u=F6(u)}return d}u=m,m=u.parentNode}return null}function Et(u){if(u=u[de]||u[ve]){var d=u.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return u}return null}function ut(u){var d=u.tag;if(d===5||d===26||d===27||d===6)return u.stateNode;throw Error(i(33))}function Tt(u){var d=u[je];return d||(d=u[je]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Ft(u){u[qe]=!0}var qn=new Set,$n={};function gi(u,d){Ns(u,d),Ns(u+"Capture",d)}function Ns(u,d){for($n[u]=d,u=0;u<d.length;u++)qn.add(d[u])}var vl=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]*$"),_l={},Va={};function ed(u){return we.call(Va,u)?!0:we.call(_l,u)?!1:vl.test(u)?Va[u]=!0:(_l[u]=!0,!1)}function ks(u,d,m){if(ed(d))if(m===null)u.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":u.removeAttribute(d);return;case"boolean":var b=d.toLowerCase().slice(0,5);if(b!=="data-"&&b!=="aria-"){u.removeAttribute(d);return}}u.setAttribute(d,""+m)}}function Wa(u,d,m){if(m===null)u.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(d);return}u.setAttribute(d,""+m)}}function ar(u,d,m,b){if(b===null)u.removeAttribute(m);else{switch(typeof b){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(m);return}u.setAttributeNS(d,m,""+b)}}function Vr(u){switch(typeof u){case"bigint":case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function td(u){var d=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function r_(u,d,m){var b=Object.getOwnPropertyDescriptor(u.constructor.prototype,d);if(!u.hasOwnProperty(d)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var I=b.get,U=b.set;return Object.defineProperty(u,d,{configurable:!0,get:function(){return I.call(this)},set:function(K){m=""+K,U.call(this,K)}}),Object.defineProperty(u,d,{enumerable:b.enumerable}),{getValue:function(){return m},setValue:function(K){m=""+K},stopTracking:function(){u._valueTracker=null,delete u[d]}}}}function jn(u){if(!u._valueTracker){var d=td(u)?"checked":"value";u._valueTracker=r_(u,d,""+u[d])}}function Ap(u){if(!u)return!1;var d=u._valueTracker;if(!d)return!0;var m=d.getValue(),b="";return u&&(b=td(u)?u.checked?"true":"false":u.value),u=b,u!==m?(d.setValue(u),!0):!1}function uc(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var Sp=/[\n"\\]/g;function ga(u){return u.replace(Sp,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function d0(u,d,m,b,I,U,K,ce){u.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?u.type=K:u.removeAttribute("type"),d!=null?K==="number"?(d===0&&u.value===""||u.value!=d)&&(u.value=""+Vr(d)):u.value!==""+Vr(d)&&(u.value=""+Vr(d)):K!=="submit"&&K!=="reset"||u.removeAttribute("value"),d!=null?s_(u,K,Vr(d)):m!=null?s_(u,K,Vr(m)):b!=null&&u.removeAttribute("value"),I==null&&U!=null&&(u.defaultChecked=!!U),I!=null&&(u.checked=I&&typeof I!="function"&&typeof I!="symbol"),ce!=null&&typeof ce!="function"&&typeof ce!="symbol"&&typeof ce!="boolean"?u.name=""+Vr(ce):u.removeAttribute("name")}function bE(u,d,m,b,I,U,K,ce){if(U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(u.type=U),d!=null||m!=null){if(!(U!=="submit"&&U!=="reset"||d!=null)){jn(u);return}m=m!=null?""+Vr(m):"",d=d!=null?""+Vr(d):m,ce||d===u.value||(u.value=d),u.defaultValue=d}b=b??I,b=typeof b!="function"&&typeof b!="symbol"&&!!b,u.checked=ce?u.checked:!!b,u.defaultChecked=!!b,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(u.name=K),jn(u)}function s_(u,d,m){d==="number"&&uc(u.ownerDocument)===u||u.defaultValue===""+m||(u.defaultValue=""+m)}function nd(u,d,m,b){if(u=u.options,d){d={};for(var I=0;I<m.length;I++)d["$"+m[I]]=!0;for(m=0;m<u.length;m++)I=d.hasOwnProperty("$"+u[m].value),u[m].selected!==I&&(u[m].selected=I),I&&b&&(u[m].defaultSelected=!0)}else{for(m=""+Vr(m),d=null,I=0;I<u.length;I++){if(u[I].value===m){u[I].selected=!0,b&&(u[I].defaultSelected=!0);return}d!==null||u[I].disabled||(d=u[I])}d!==null&&(d.selected=!0)}}function TE(u,d,m){if(d!=null&&(d=""+Vr(d),d!==u.value&&(u.value=d),m==null)){u.defaultValue!==d&&(u.defaultValue=d);return}u.defaultValue=m!=null?""+Vr(m):""}function id(u,d,m,b){if(d==null){if(b!=null){if(m!=null)throw Error(i(92));if(re(b)){if(1<b.length)throw Error(i(93));b=b[0]}m=b}m==null&&(m=""),d=m}m=Vr(d),u.defaultValue=m,b=u.textContent,b===m&&b!==""&&b!==null&&(u.value=b),jn(u)}function ma(u,d){if(d){var m=u.firstChild;if(m&&m===u.lastChild&&m.nodeType===3){m.nodeValue=d;return}}u.textContent=d}var EE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function a_(u,d,m){var b=d.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?b?u.setProperty(d,""):d==="float"?u.cssFloat="":u[d]="":b?u.setProperty(d,m):typeof m!="number"||m===0||EE.has(d)?d==="float"?u.cssFloat=m:u[d]=(""+m).trim():u[d]=m+"px"}function o_(u,d,m){if(d!=null&&typeof d!="object")throw Error(i(62));if(u=u.style,m!=null){for(var b in m)!m.hasOwnProperty(b)||d!=null&&d.hasOwnProperty(b)||(b.indexOf("--")===0?u.setProperty(b,""):b==="float"?u.cssFloat="":u[b]="");for(var I in d)b=d[I],d.hasOwnProperty(I)&&m[I]!==b&&a_(u,I,b)}else for(var U in d)d.hasOwnProperty(U)&&a_(u,U,d[U])}function f0(u){if(u.indexOf("-")===-1)return!1;switch(u){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wE=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"]]),rd=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function p0(u){return rd.test(""+u)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":u}function xl(){}var l_=null;function Io(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var sd=null,hc=null;function Dp(u){var d=Et(u);if(d&&(u=d.stateNode)){var m=u[ye]||null;e:switch(u=d.stateNode,d.type){case"input":if(d0(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),d=m.name,m.type==="radio"&&d!=null){for(m=u;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+ga(""+d)+'"][type="radio"]'),d=0;d<m.length;d++){var b=m[d];if(b!==u&&b.form===u.form){var I=b[ye]||null;if(!I)throw Error(i(90));d0(b,I.value,I.defaultValue,I.defaultValue,I.checked,I.defaultChecked,I.type,I.name)}}for(d=0;d<m.length;d++)b=m[d],b.form===u.form&&Ap(b)}break e;case"textarea":TE(u,m.value,m.defaultValue);break e;case"select":d=m.value,d!=null&&nd(u,!!m.multiple,d,!1)}}}var g0=!1;function ad(u,d,m){if(g0)return u(d,m);g0=!0;try{var b=u(d);return b}finally{if(g0=!1,(sd!==null||hc!==null)&&(yw(),sd&&(d=sd,u=hc,hc=sd=null,Dp(d),u)))for(d=0;d<u.length;d++)Dp(u[d])}}function bl(u,d){var m=u.stateNode;if(m===null)return null;var b=m[ye]||null;if(b===null)return null;m=b[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(u=u.type,b=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!b;break e;default:u=!1}if(u)return null;if(m&&typeof m!="function")throw Error(i(231,d,typeof m));return m}var Ro=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cp=!1;if(Ro)try{var ri={};Object.defineProperty(ri,"passive",{get:function(){Cp=!0}}),window.addEventListener("test",ri,ri),window.removeEventListener("test",ri,ri)}catch{Cp=!1}var dc=null,c_=null,Ip=null;function u_(){if(Ip)return Ip;var u,d=c_,m=d.length,b,I="value"in dc?dc.value:dc.textContent,U=I.length;for(u=0;u<m&&d[u]===I[u];u++);var K=m-u;for(b=1;b<=K&&d[m-b]===I[U-b];b++);return Ip=I.slice(u,1<b?1-b:void 0)}function Rp(u){var d=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&d===13&&(u=13)):u=d,u===10&&(u=13),32<=u||u===13?u:0}function yu(){return!0}function Tl(){return!1}function os(u){function d(m,b,I,U,K){this._reactName=m,this._targetInst=I,this.type=b,this.nativeEvent=U,this.target=K,this.currentTarget=null;for(var ce in u)u.hasOwnProperty(ce)&&(m=u[ce],this[ce]=m?m(U):U[ce]);return this.isDefaultPrevented=(U.defaultPrevented!=null?U.defaultPrevented:U.returnValue===!1)?yu:Tl,this.isPropagationStopped=Tl,this}return f(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),d}var vu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=os(vu),od=f({},vu,{view:0,detail:0}),h_=os(od),ld,m0,pc,y0=f({},od,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cd,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==pc&&(pc&&u.type==="mousemove"?(ld=u.screenX-pc.screenX,m0=u.screenY-pc.screenY):m0=ld=0,pc=u),ld)},movementY:function(u){return"movementY"in u?u.movementY:m0}}),d_=os(y0),Np=f({},y0,{dataTransfer:0}),AE=os(Np),SE=f({},od,{relatedTarget:0}),kp=os(SE),f_=f({},vu,{animationName:0,elapsedTime:0,pseudoElement:0}),DE=os(f_),v0=f({},vu,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),CE=os(v0),IE=f({},vu,{data:0}),gc=os(IE),RE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NE={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"},kE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ME(u){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(u):(u=kE[u])?!!d[u]:!1}function cd(){return ME}var Js=f({},od,{key:function(u){if(u.key){var d=RE[u.key]||u.key;if(d!=="Unidentified")return d}return u.type==="keypress"?(u=Rp(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?NE[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cd,charCode:function(u){return u.type==="keypress"?Rp(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?Rp(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),FE=os(Js),UE=f({},y0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_u=os(UE),D=f({},od,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cd}),z=os(D),ee=f({},vu,{propertyName:0,elapsedTime:0,pseudoElement:0}),pe=os(ee),Be=f({},y0,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),Qe=os(Be),xt=f({},vu,{newState:0,oldState:0}),ln=os(xt),Zi=[9,13,27,32],Pn=Ro&&"CompositionEvent"in window,Mi=null;Ro&&"documentMode"in document&&(Mi=document.documentMode);var No=Ro&&"TextEvent"in window&&!Mi,mc=Ro&&(!Pn||Mi&&8<Mi&&11>=Mi),El=" ",wl=!1;function Mp(u,d){switch(u){case"keyup":return Zi.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _0(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var x0=!1;function Sie(u,d){switch(u){case"compositionend":return _0(d);case"keypress":return d.which!==32?null:(wl=!0,El);case"textInput":return u=d.data,u===El&&wl?null:u;default:return null}}function Die(u,d){if(x0)return u==="compositionend"||!Pn&&Mp(u,d)?(u=u_(),Ip=c_=dc=null,x0=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return mc&&d.locale!=="ko"?null:d.data;default:return null}}var Cie={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function L5(u){var d=u&&u.nodeName&&u.nodeName.toLowerCase();return d==="input"?!!Cie[u.type]:d==="textarea"}function O5(u,d,m,b){sd?hc?hc.push(b):hc=[b]:sd=b,d=ww(d,"onChange"),0<d.length&&(m=new fc("onChange","change",null,m,b),u.push({event:m,listeners:d}))}var p_=null,g_=null;function Iie(u){x6(u,0)}function PE(u){var d=ut(u);if(Ap(d))return u}function B5(u,d){if(u==="change")return d}var V5=!1;if(Ro){var bR;if(Ro){var TR="oninput"in document;if(!TR){var W5=document.createElement("div");W5.setAttribute("oninput","return;"),TR=typeof W5.oninput=="function"}bR=TR}else bR=!1;V5=bR&&(!document.documentMode||9<document.documentMode)}function H5(){p_&&(p_.detachEvent("onpropertychange",z5),g_=p_=null)}function z5(u){if(u.propertyName==="value"&&PE(g_)){var d=[];O5(d,g_,u,Io(u)),ad(Iie,d)}}function Rie(u,d,m){u==="focusin"?(H5(),p_=d,g_=m,p_.attachEvent("onpropertychange",z5)):u==="focusout"&&H5()}function Nie(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return PE(g_)}function kie(u,d){if(u==="click")return PE(d)}function Mie(u,d){if(u==="input"||u==="change")return PE(d)}function Fie(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var Ha=typeof Object.is=="function"?Object.is:Fie;function m_(u,d){if(Ha(u,d))return!0;if(typeof u!="object"||u===null||typeof d!="object"||d===null)return!1;var m=Object.keys(u),b=Object.keys(d);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var I=m[b];if(!we.call(d,I)||!Ha(u[I],d[I]))return!1}return!0}function G5(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function q5(u,d){var m=G5(u);u=0;for(var b;m;){if(m.nodeType===3){if(b=u+m.textContent.length,u<=d&&b>=d)return{node:m,offset:d-u};u=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=G5(m)}}function $5(u,d){return u&&d?u===d?!0:u&&u.nodeType===3?!1:d&&d.nodeType===3?$5(u,d.parentNode):"contains"in u?u.contains(d):u.compareDocumentPosition?!!(u.compareDocumentPosition(d)&16):!1:!1}function j5(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var d=uc(u.document);d instanceof u.HTMLIFrameElement;){try{var m=typeof d.contentWindow.location.href=="string"}catch{m=!1}if(m)u=d.contentWindow;else break;d=uc(u.document)}return d}function ER(u){var d=u&&u.nodeName&&u.nodeName.toLowerCase();return d&&(d==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||d==="textarea"||u.contentEditable==="true")}var Uie=Ro&&"documentMode"in document&&11>=document.documentMode,b0=null,wR=null,y_=null,AR=!1;function X5(u,d,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;AR||b0==null||b0!==uc(b)||(b=b0,"selectionStart"in b&&ER(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),y_&&m_(y_,b)||(y_=b,b=ww(wR,"onSelect"),0<b.length&&(d=new fc("onSelect","select",null,d,m),u.push({event:d,listeners:b}),d.target=b0)))}function Fp(u,d){var m={};return m[u.toLowerCase()]=d.toLowerCase(),m["Webkit"+u]="webkit"+d,m["Moz"+u]="moz"+d,m}var T0={animationend:Fp("Animation","AnimationEnd"),animationiteration:Fp("Animation","AnimationIteration"),animationstart:Fp("Animation","AnimationStart"),transitionrun:Fp("Transition","TransitionRun"),transitionstart:Fp("Transition","TransitionStart"),transitioncancel:Fp("Transition","TransitionCancel"),transitionend:Fp("Transition","TransitionEnd")},SR={},K5={};Ro&&(K5=document.createElement("div").style,"AnimationEvent"in window||(delete T0.animationend.animation,delete T0.animationiteration.animation,delete T0.animationstart.animation),"TransitionEvent"in window||delete T0.transitionend.transition);function Up(u){if(SR[u])return SR[u];if(!T0[u])return u;var d=T0[u],m;for(m in d)if(d.hasOwnProperty(m)&&m in K5)return SR[u]=d[m];return u}var Y5=Up("animationend"),J5=Up("animationiteration"),Q5=Up("animationstart"),Pie=Up("transitionrun"),Lie=Up("transitionstart"),Oie=Up("transitioncancel"),Z5=Up("transitionend"),eO=new Map,DR="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(" ");DR.push("scrollEnd");function Al(u,d){eO.set(u,d),gi(d,[u])}var LE=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},ko=[],E0=0,CR=0;function OE(){for(var u=E0,d=CR=E0=0;d<u;){var m=ko[d];ko[d++]=null;var b=ko[d];ko[d++]=null;var I=ko[d];ko[d++]=null;var U=ko[d];if(ko[d++]=null,b!==null&&I!==null){var K=b.pending;K===null?I.next=I:(I.next=K.next,K.next=I),b.pending=I}U!==0&&tO(m,I,U)}}function BE(u,d,m,b){ko[E0++]=u,ko[E0++]=d,ko[E0++]=m,ko[E0++]=b,CR|=b,u.lanes|=b,u=u.alternate,u!==null&&(u.lanes|=b)}function IR(u,d,m,b){return BE(u,d,m,b),VE(u)}function Pp(u,d){return BE(u,null,null,d),VE(u)}function tO(u,d,m){u.lanes|=m;var b=u.alternate;b!==null&&(b.lanes|=m);for(var I=!1,U=u.return;U!==null;)U.childLanes|=m,b=U.alternate,b!==null&&(b.childLanes|=m),U.tag===22&&(u=U.stateNode,u===null||u._visibility&1||(I=!0)),u=U,U=U.return;return u.tag===3?(U=u.stateNode,I&&d!==null&&(I=31-Je(m),u=U.hiddenUpdates,b=u[I],b===null?u[I]=[d]:b.push(d),d.lane=m|536870912),U):null}function VE(u){if(50<B_)throw B_=0,ON=null,Error(i(185));for(var d=u.return;d!==null;)u=d,d=u.return;return u.tag===3?u.stateNode:null}var w0={};function Bie(u,d,m,b){this.tag=u,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function za(u,d,m,b){return new Bie(u,d,m,b)}function RR(u){return u=u.prototype,!(!u||!u.isReactComponent)}function xu(u,d){var m=u.alternate;return m===null?(m=za(u.tag,d,u.key,u.mode),m.elementType=u.elementType,m.type=u.type,m.stateNode=u.stateNode,m.alternate=u,u.alternate=m):(m.pendingProps=d,m.type=u.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=u.flags&65011712,m.childLanes=u.childLanes,m.lanes=u.lanes,m.child=u.child,m.memoizedProps=u.memoizedProps,m.memoizedState=u.memoizedState,m.updateQueue=u.updateQueue,d=u.dependencies,m.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},m.sibling=u.sibling,m.index=u.index,m.ref=u.ref,m.refCleanup=u.refCleanup,m}function nO(u,d){u.flags&=65011714;var m=u.alternate;return m===null?(u.childLanes=0,u.lanes=d,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=m.childLanes,u.lanes=m.lanes,u.child=m.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=m.memoizedProps,u.memoizedState=m.memoizedState,u.updateQueue=m.updateQueue,u.type=m.type,d=m.dependencies,u.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),u}function WE(u,d,m,b,I,U){var K=0;if(b=u,typeof u=="function")RR(u)&&(K=1);else if(typeof u=="string")K=Gre(u,m,te.current)?26:u==="html"||u==="head"||u==="body"?27:5;else e:switch(u){case R:return u=za(31,m,d,I),u.elementType=R,u.lanes=U,u;case v:return Lp(m.children,I,U,d);case _:K=8,I|=24;break;case E:return u=za(12,m,d,I|2),u.elementType=E,u.lanes=U,u;case k:return u=za(13,m,d,I),u.elementType=k,u.lanes=U,u;case F:return u=za(19,m,d,I),u.elementType=F,u.lanes=U,u;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case A:K=10;break e;case w:K=9;break e;case N:K=11;break e;case C:K=14;break e;case M:K=16,b=null;break e}K=29,m=Error(i(130,u===null?"null":typeof u,"")),b=null}return d=za(K,m,d,I),d.elementType=u,d.type=b,d.lanes=U,d}function Lp(u,d,m,b){return u=za(7,u,b,d),u.lanes=m,u}function NR(u,d,m){return u=za(6,u,null,d),u.lanes=m,u}function iO(u){var d=za(18,null,null,0);return d.stateNode=u,d}function kR(u,d,m){return d=za(4,u.children!==null?u.children:[],u.key,d),d.lanes=m,d.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},d}var rO=new WeakMap;function Mo(u,d){if(typeof u=="object"&&u!==null){var m=rO.get(u);return m!==void 0?m:(d={value:u,source:d,stack:he(d)},rO.set(u,d),d)}return{value:u,source:d,stack:he(d)}}var A0=[],S0=0,HE=null,v_=0,Fo=[],Uo=0,ud=null,yc=1,vc="";function bu(u,d){A0[S0++]=v_,A0[S0++]=HE,HE=u,v_=d}function sO(u,d,m){Fo[Uo++]=yc,Fo[Uo++]=vc,Fo[Uo++]=ud,ud=u;var b=yc;u=vc;var I=32-Je(b)-1;b&=~(1<<I),m+=1;var U=32-Je(d)+I;if(30<U){var K=I-I%5;U=(b&(1<<K)-1).toString(32),b>>=K,I-=K,yc=1<<32-Je(d)+I|m<<I|b,vc=U+u}else yc=1<<U|m<<I|b,vc=u}function MR(u){u.return!==null&&(bu(u,1),sO(u,1,0))}function FR(u){for(;u===HE;)HE=A0[--S0],A0[S0]=null,v_=A0[--S0],A0[S0]=null;for(;u===ud;)ud=Fo[--Uo],Fo[Uo]=null,vc=Fo[--Uo],Fo[Uo]=null,yc=Fo[--Uo],Fo[Uo]=null}function aO(u,d){Fo[Uo++]=yc,Fo[Uo++]=vc,Fo[Uo++]=ud,yc=d.id,vc=d.overflow,ud=u}var ls=null,Ai=null,Sn=!1,hd=null,Po=!1,UR=Error(i(519));function dd(u){var d=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw __(Mo(d,u)),UR}function oO(u){var d=u.stateNode,m=u.type,b=u.memoizedProps;switch(d[de]=u,d[ye]=b,m){case"dialog":_n("cancel",d),_n("close",d);break;case"iframe":case"object":case"embed":_n("load",d);break;case"video":case"audio":for(m=0;m<W_.length;m++)_n(W_[m],d);break;case"source":_n("error",d);break;case"img":case"image":case"link":_n("error",d),_n("load",d);break;case"details":_n("toggle",d);break;case"input":_n("invalid",d),bE(d,b.value,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name,!0);break;case"select":_n("invalid",d);break;case"textarea":_n("invalid",d),id(d,b.value,b.defaultValue,b.children)}m=b.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||d.textContent===""+m||b.suppressHydrationWarning===!0||w6(d.textContent,m)?(b.popover!=null&&(_n("beforetoggle",d),_n("toggle",d)),b.onScroll!=null&&_n("scroll",d),b.onScrollEnd!=null&&_n("scrollend",d),b.onClick!=null&&(d.onclick=xl),d=!0):d=!1,d||dd(u,!0)}function lO(u){for(ls=u.return;ls;)switch(ls.tag){case 5:case 31:case 13:Po=!1;return;case 27:case 3:Po=!0;return;default:ls=ls.return}}function D0(u){if(u!==ls)return!1;if(!Sn)return lO(u),Sn=!0,!1;var d=u.tag,m;if((m=d!==3&&d!==27)&&((m=d===5)&&(m=u.type,m=!(m!=="form"&&m!=="button")||ZN(u.type,u.memoizedProps)),m=!m),m&&Ai&&dd(u),lO(u),d===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));Ai=M6(u)}else if(d===31){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));Ai=M6(u)}else d===27?(d=Ai,Sd(u.type)?(u=rk,rk=null,Ai=u):Ai=d):Ai=ls?Oo(u.stateNode.nextSibling):null;return!0}function Op(){Ai=ls=null,Sn=!1}function PR(){var u=hd;return u!==null&&(xa===null?xa=u:xa.push.apply(xa,u),hd=null),u}function __(u){hd===null?hd=[u]:hd.push(u)}var LR=j(null),Bp=null,Tu=null;function fd(u,d,m){Z(LR,d._currentValue),d._currentValue=m}function Eu(u){u._currentValue=LR.current,G(LR)}function OR(u,d,m){for(;u!==null;){var b=u.alternate;if((u.childLanes&d)!==d?(u.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),u===m)break;u=u.return}}function BR(u,d,m,b){var I=u.child;for(I!==null&&(I.return=u);I!==null;){var U=I.dependencies;if(U!==null){var K=I.child;U=U.firstContext;e:for(;U!==null;){var ce=U;U=I;for(var De=0;De<d.length;De++)if(ce.context===d[De]){U.lanes|=m,ce=U.alternate,ce!==null&&(ce.lanes|=m),OR(U.return,m,u),b||(K=null);break e}U=ce.next}}else if(I.tag===18){if(K=I.return,K===null)throw Error(i(341));K.lanes|=m,U=K.alternate,U!==null&&(U.lanes|=m),OR(K,m,u),K=null}else K=I.child;if(K!==null)K.return=I;else for(K=I;K!==null;){if(K===u){K=null;break}if(I=K.sibling,I!==null){I.return=K.return,K=I;break}K=K.return}I=K}}function C0(u,d,m,b){u=null;for(var I=d,U=!1;I!==null;){if(!U){if((I.flags&524288)!==0)U=!0;else if((I.flags&262144)!==0)break}if(I.tag===10){var K=I.alternate;if(K===null)throw Error(i(387));if(K=K.memoizedProps,K!==null){var ce=I.type;Ha(I.pendingProps.value,K.value)||(u!==null?u.push(ce):u=[ce])}}else if(I===Ie.current){if(K=I.alternate,K===null)throw Error(i(387));K.memoizedState.memoizedState!==I.memoizedState.memoizedState&&(u!==null?u.push($_):u=[$_])}I=I.return}u!==null&&BR(d,u,m,b),d.flags|=262144}function zE(u){for(u=u.firstContext;u!==null;){if(!Ha(u.context._currentValue,u.memoizedValue))return!0;u=u.next}return!1}function Vp(u){Bp=u,Tu=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function cs(u){return cO(Bp,u)}function GE(u,d){return Bp===null&&Vp(u),cO(u,d)}function cO(u,d){var m=d._currentValue;if(d={context:d,memoizedValue:m,next:null},Tu===null){if(u===null)throw Error(i(308));Tu=d,u.dependencies={lanes:0,firstContext:d},u.flags|=524288}else Tu=Tu.next=d;return m}var Vie=typeof AbortController<"u"?AbortController:function(){var u=[],d=this.signal={aborted:!1,addEventListener:function(m,b){u.push(b)}};this.abort=function(){d.aborted=!0,u.forEach(function(m){return m()})}},Wie=n.unstable_scheduleCallback,Hie=n.unstable_NormalPriority,or={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function VR(){return{controller:new Vie,data:new Map,refCount:0}}function x_(u){u.refCount--,u.refCount===0&&Wie(Hie,function(){u.controller.abort()})}var b_=null,WR=0,I0=0,R0=null;function zie(u,d){if(b_===null){var m=b_=[];WR=0,I0=GN(),R0={status:"pending",value:void 0,then:function(b){m.push(b)}}}return WR++,d.then(uO,uO),d}function uO(){if(--WR===0&&b_!==null){R0!==null&&(R0.status="fulfilled");var u=b_;b_=null,I0=0,R0=null;for(var d=0;d<u.length;d++)(0,u[d])()}}function Gie(u,d){var m=[],b={status:"pending",value:null,reason:null,then:function(I){m.push(I)}};return u.then(function(){b.status="fulfilled",b.value=d;for(var I=0;I<m.length;I++)(0,m[I])(d)},function(I){for(b.status="rejected",b.reason=I,I=0;I<m.length;I++)(0,m[I])(void 0)}),b}var hO=q.S;q.S=function(u,d){X8=Ee(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&zie(u,d),hO!==null&&hO(u,d)};var Wp=j(null);function HR(){var u=Wp.current;return u!==null?u:mi.pooledCache}function qE(u,d){d===null?Z(Wp,Wp.current):Z(Wp,d.pool)}function dO(){var u=HR();return u===null?null:{parent:or._currentValue,pool:u}}var N0=Error(i(460)),zR=Error(i(474)),$E=Error(i(542)),jE={then:function(){}};function fO(u){return u=u.status,u==="fulfilled"||u==="rejected"}function pO(u,d,m){switch(m=u[m],m===void 0?u.push(d):m!==d&&(d.then(xl,xl),d=m),d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,mO(u),u;default:if(typeof d.status=="string")d.then(xl,xl);else{if(u=mi,u!==null&&100<u.shellSuspendCounter)throw Error(i(482));u=d,u.status="pending",u.then(function(b){if(d.status==="pending"){var I=d;I.status="fulfilled",I.value=b}},function(b){if(d.status==="pending"){var I=d;I.status="rejected",I.reason=b}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw u=d.reason,mO(u),u}throw zp=d,N0}}function Hp(u){try{var d=u._init;return d(u._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(zp=m,N0):m}}var zp=null;function gO(){if(zp===null)throw Error(i(459));var u=zp;return zp=null,u}function mO(u){if(u===N0||u===$E)throw Error(i(483))}var k0=null,T_=0;function XE(u){var d=T_;return T_+=1,k0===null&&(k0=[]),pO(k0,u,d)}function E_(u,d){d=d.props.ref,u.ref=d!==void 0?d:null}function KE(u,d){throw d.$$typeof===p?Error(i(525)):(u=Object.prototype.toString.call(d),Error(i(31,u==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":u)))}function yO(u){function d(Ue,Ne){if(u){var We=Ue.deletions;We===null?(Ue.deletions=[Ne],Ue.flags|=16):We.push(Ne)}}function m(Ue,Ne){if(!u)return null;for(;Ne!==null;)d(Ue,Ne),Ne=Ne.sibling;return null}function b(Ue){for(var Ne=new Map;Ue!==null;)Ue.key!==null?Ne.set(Ue.key,Ue):Ne.set(Ue.index,Ue),Ue=Ue.sibling;return Ne}function I(Ue,Ne){return Ue=xu(Ue,Ne),Ue.index=0,Ue.sibling=null,Ue}function U(Ue,Ne,We){return Ue.index=We,u?(We=Ue.alternate,We!==null?(We=We.index,We<Ne?(Ue.flags|=67108866,Ne):We):(Ue.flags|=67108866,Ne)):(Ue.flags|=1048576,Ne)}function K(Ue){return u&&Ue.alternate===null&&(Ue.flags|=67108866),Ue}function ce(Ue,Ne,We,rt){return Ne===null||Ne.tag!==6?(Ne=NR(We,Ue.mode,rt),Ne.return=Ue,Ne):(Ne=I(Ne,We),Ne.return=Ue,Ne)}function De(Ue,Ne,We,rt){var Wt=We.type;return Wt===v?it(Ue,Ne,We.props.children,rt,We.key):Ne!==null&&(Ne.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===M&&Hp(Wt)===Ne.type)?(Ne=I(Ne,We.props),E_(Ne,We),Ne.return=Ue,Ne):(Ne=WE(We.type,We.key,We.props,null,Ue.mode,rt),E_(Ne,We),Ne.return=Ue,Ne)}function ze(Ue,Ne,We,rt){return Ne===null||Ne.tag!==4||Ne.stateNode.containerInfo!==We.containerInfo||Ne.stateNode.implementation!==We.implementation?(Ne=kR(We,Ue.mode,rt),Ne.return=Ue,Ne):(Ne=I(Ne,We.children||[]),Ne.return=Ue,Ne)}function it(Ue,Ne,We,rt,Wt){return Ne===null||Ne.tag!==7?(Ne=Lp(We,Ue.mode,rt,Wt),Ne.return=Ue,Ne):(Ne=I(Ne,We),Ne.return=Ue,Ne)}function st(Ue,Ne,We){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return Ne=NR(""+Ne,Ue.mode,We),Ne.return=Ue,Ne;if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case y:return We=WE(Ne.type,Ne.key,Ne.props,null,Ue.mode,We),E_(We,Ne),We.return=Ue,We;case x:return Ne=kR(Ne,Ue.mode,We),Ne.return=Ue,Ne;case M:return Ne=Hp(Ne),st(Ue,Ne,We)}if(re(Ne)||P(Ne))return Ne=Lp(Ne,Ue.mode,We,null),Ne.return=Ue,Ne;if(typeof Ne.then=="function")return st(Ue,XE(Ne),We);if(Ne.$$typeof===A)return st(Ue,GE(Ue,Ne),We);KE(Ue,Ne)}return null}function Ke(Ue,Ne,We,rt){var Wt=Ne!==null?Ne.key:null;if(typeof We=="string"&&We!==""||typeof We=="number"||typeof We=="bigint")return Wt!==null?null:ce(Ue,Ne,""+We,rt);if(typeof We=="object"&&We!==null){switch(We.$$typeof){case y:return We.key===Wt?De(Ue,Ne,We,rt):null;case x:return We.key===Wt?ze(Ue,Ne,We,rt):null;case M:return We=Hp(We),Ke(Ue,Ne,We,rt)}if(re(We)||P(We))return Wt!==null?null:it(Ue,Ne,We,rt,null);if(typeof We.then=="function")return Ke(Ue,Ne,XE(We),rt);if(We.$$typeof===A)return Ke(Ue,Ne,GE(Ue,We),rt);KE(Ue,We)}return null}function et(Ue,Ne,We,rt,Wt){if(typeof rt=="string"&&rt!==""||typeof rt=="number"||typeof rt=="bigint")return Ue=Ue.get(We)||null,ce(Ne,Ue,""+rt,Wt);if(typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case y:return Ue=Ue.get(rt.key===null?We:rt.key)||null,De(Ne,Ue,rt,Wt);case x:return Ue=Ue.get(rt.key===null?We:rt.key)||null,ze(Ne,Ue,rt,Wt);case M:return rt=Hp(rt),et(Ue,Ne,We,rt,Wt)}if(re(rt)||P(rt))return Ue=Ue.get(We)||null,it(Ne,Ue,rt,Wt,null);if(typeof rt.then=="function")return et(Ue,Ne,We,XE(rt),Wt);if(rt.$$typeof===A)return et(Ue,Ne,We,GE(Ne,rt),Wt);KE(Ne,rt)}return null}function kt(Ue,Ne,We,rt){for(var Wt=null,Nn=null,Bt=Ne,hn=Ne=0,bn=null;Bt!==null&&hn<We.length;hn++){Bt.index>hn?(bn=Bt,Bt=null):bn=Bt.sibling;var kn=Ke(Ue,Bt,We[hn],rt);if(kn===null){Bt===null&&(Bt=bn);break}u&&Bt&&kn.alternate===null&&d(Ue,Bt),Ne=U(kn,Ne,hn),Nn===null?Wt=kn:Nn.sibling=kn,Nn=kn,Bt=bn}if(hn===We.length)return m(Ue,Bt),Sn&&bu(Ue,hn),Wt;if(Bt===null){for(;hn<We.length;hn++)Bt=st(Ue,We[hn],rt),Bt!==null&&(Ne=U(Bt,Ne,hn),Nn===null?Wt=Bt:Nn.sibling=Bt,Nn=Bt);return Sn&&bu(Ue,hn),Wt}for(Bt=b(Bt);hn<We.length;hn++)bn=et(Bt,Ue,hn,We[hn],rt),bn!==null&&(u&&bn.alternate!==null&&Bt.delete(bn.key===null?hn:bn.key),Ne=U(bn,Ne,hn),Nn===null?Wt=bn:Nn.sibling=bn,Nn=bn);return u&&Bt.forEach(function(Nd){return d(Ue,Nd)}),Sn&&bu(Ue,hn),Wt}function qt(Ue,Ne,We,rt){if(We==null)throw Error(i(151));for(var Wt=null,Nn=null,Bt=Ne,hn=Ne=0,bn=null,kn=We.next();Bt!==null&&!kn.done;hn++,kn=We.next()){Bt.index>hn?(bn=Bt,Bt=null):bn=Bt.sibling;var Nd=Ke(Ue,Bt,kn.value,rt);if(Nd===null){Bt===null&&(Bt=bn);break}u&&Bt&&Nd.alternate===null&&d(Ue,Bt),Ne=U(Nd,Ne,hn),Nn===null?Wt=Nd:Nn.sibling=Nd,Nn=Nd,Bt=bn}if(kn.done)return m(Ue,Bt),Sn&&bu(Ue,hn),Wt;if(Bt===null){for(;!kn.done;hn++,kn=We.next())kn=st(Ue,kn.value,rt),kn!==null&&(Ne=U(kn,Ne,hn),Nn===null?Wt=kn:Nn.sibling=kn,Nn=kn);return Sn&&bu(Ue,hn),Wt}for(Bt=b(Bt);!kn.done;hn++,kn=We.next())kn=et(Bt,Ue,hn,kn.value,rt),kn!==null&&(u&&kn.alternate!==null&&Bt.delete(kn.key===null?hn:kn.key),Ne=U(kn,Ne,hn),Nn===null?Wt=kn:Nn.sibling=kn,Nn=kn);return u&&Bt.forEach(function(tse){return d(Ue,tse)}),Sn&&bu(Ue,hn),Wt}function oi(Ue,Ne,We,rt){if(typeof We=="object"&&We!==null&&We.type===v&&We.key===null&&(We=We.props.children),typeof We=="object"&&We!==null){switch(We.$$typeof){case y:e:{for(var Wt=We.key;Ne!==null;){if(Ne.key===Wt){if(Wt=We.type,Wt===v){if(Ne.tag===7){m(Ue,Ne.sibling),rt=I(Ne,We.props.children),rt.return=Ue,Ue=rt;break e}}else if(Ne.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===M&&Hp(Wt)===Ne.type){m(Ue,Ne.sibling),rt=I(Ne,We.props),E_(rt,We),rt.return=Ue,Ue=rt;break e}m(Ue,Ne);break}else d(Ue,Ne);Ne=Ne.sibling}We.type===v?(rt=Lp(We.props.children,Ue.mode,rt,We.key),rt.return=Ue,Ue=rt):(rt=WE(We.type,We.key,We.props,null,Ue.mode,rt),E_(rt,We),rt.return=Ue,Ue=rt)}return K(Ue);case x:e:{for(Wt=We.key;Ne!==null;){if(Ne.key===Wt)if(Ne.tag===4&&Ne.stateNode.containerInfo===We.containerInfo&&Ne.stateNode.implementation===We.implementation){m(Ue,Ne.sibling),rt=I(Ne,We.children||[]),rt.return=Ue,Ue=rt;break e}else{m(Ue,Ne);break}else d(Ue,Ne);Ne=Ne.sibling}rt=kR(We,Ue.mode,rt),rt.return=Ue,Ue=rt}return K(Ue);case M:return We=Hp(We),oi(Ue,Ne,We,rt)}if(re(We))return kt(Ue,Ne,We,rt);if(P(We)){if(Wt=P(We),typeof Wt!="function")throw Error(i(150));return We=Wt.call(We),qt(Ue,Ne,We,rt)}if(typeof We.then=="function")return oi(Ue,Ne,XE(We),rt);if(We.$$typeof===A)return oi(Ue,Ne,GE(Ue,We),rt);KE(Ue,We)}return typeof We=="string"&&We!==""||typeof We=="number"||typeof We=="bigint"?(We=""+We,Ne!==null&&Ne.tag===6?(m(Ue,Ne.sibling),rt=I(Ne,We),rt.return=Ue,Ue=rt):(m(Ue,Ne),rt=NR(We,Ue.mode,rt),rt.return=Ue,Ue=rt),K(Ue)):m(Ue,Ne)}return function(Ue,Ne,We,rt){try{T_=0;var Wt=oi(Ue,Ne,We,rt);return k0=null,Wt}catch(Bt){if(Bt===N0||Bt===$E)throw Bt;var Nn=za(29,Bt,null,Ue.mode);return Nn.lanes=rt,Nn.return=Ue,Nn}finally{}}}var Gp=yO(!0),vO=yO(!1),pd=!1;function GR(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qR(u,d){u=u.updateQueue,d.updateQueue===u&&(d.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function gd(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function md(u,d,m){var b=u.updateQueue;if(b===null)return null;if(b=b.shared,(Ln&2)!==0){var I=b.pending;return I===null?d.next=d:(d.next=I.next,I.next=d),b.pending=d,d=VE(u),tO(u,null,m),d}return BE(u,b,d,m),VE(u)}function w_(u,d,m){if(d=d.updateQueue,d!==null&&(d=d.shared,(m&4194048)!==0)){var b=d.lanes;b&=u.pendingLanes,m|=b,d.lanes=m,wr(u,m)}}function $R(u,d){var m=u.updateQueue,b=u.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var I=null,U=null;if(m=m.firstBaseUpdate,m!==null){do{var K={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};U===null?I=U=K:U=U.next=K,m=m.next}while(m!==null);U===null?I=U=d:U=U.next=d}else I=U=d;m={baseState:b.baseState,firstBaseUpdate:I,lastBaseUpdate:U,shared:b.shared,callbacks:b.callbacks},u.updateQueue=m;return}u=m.lastBaseUpdate,u===null?m.firstBaseUpdate=d:u.next=d,m.lastBaseUpdate=d}var jR=!1;function A_(){if(jR){var u=R0;if(u!==null)throw u}}function S_(u,d,m,b){jR=!1;var I=u.updateQueue;pd=!1;var U=I.firstBaseUpdate,K=I.lastBaseUpdate,ce=I.shared.pending;if(ce!==null){I.shared.pending=null;var De=ce,ze=De.next;De.next=null,K===null?U=ze:K.next=ze,K=De;var it=u.alternate;it!==null&&(it=it.updateQueue,ce=it.lastBaseUpdate,ce!==K&&(ce===null?it.firstBaseUpdate=ze:ce.next=ze,it.lastBaseUpdate=De))}if(U!==null){var st=I.baseState;K=0,it=ze=De=null,ce=U;do{var Ke=ce.lane&-536870913,et=Ke!==ce.lane;if(et?(xn&Ke)===Ke:(b&Ke)===Ke){Ke!==0&&Ke===I0&&(jR=!0),it!==null&&(it=it.next={lane:0,tag:ce.tag,payload:ce.payload,callback:null,next:null});e:{var kt=u,qt=ce;Ke=d;var oi=m;switch(qt.tag){case 1:if(kt=qt.payload,typeof kt=="function"){st=kt.call(oi,st,Ke);break e}st=kt;break e;case 3:kt.flags=kt.flags&-65537|128;case 0:if(kt=qt.payload,Ke=typeof kt=="function"?kt.call(oi,st,Ke):kt,Ke==null)break e;st=f({},st,Ke);break e;case 2:pd=!0}}Ke=ce.callback,Ke!==null&&(u.flags|=64,et&&(u.flags|=8192),et=I.callbacks,et===null?I.callbacks=[Ke]:et.push(Ke))}else et={lane:Ke,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null},it===null?(ze=it=et,De=st):it=it.next=et,K|=Ke;if(ce=ce.next,ce===null){if(ce=I.shared.pending,ce===null)break;et=ce,ce=et.next,et.next=null,I.lastBaseUpdate=et,I.shared.pending=null}}while(!0);it===null&&(De=st),I.baseState=De,I.firstBaseUpdate=ze,I.lastBaseUpdate=it,U===null&&(I.shared.lanes=0),bd|=K,u.lanes=K,u.memoizedState=st}}function _O(u,d){if(typeof u!="function")throw Error(i(191,u));u.call(d)}function xO(u,d){var m=u.callbacks;if(m!==null)for(u.callbacks=null,u=0;u<m.length;u++)_O(m[u],d)}var M0=j(null),YE=j(0);function bO(u,d){u=ku,Z(YE,u),Z(M0,d),ku=u|d.baseLanes}function XR(){Z(YE,ku),Z(M0,M0.current)}function KR(){ku=YE.current,G(M0),G(YE)}var Ga=j(null),Lo=null;function yd(u){var d=u.alternate;Z(er,er.current&1),Z(Ga,u),Lo===null&&(d===null||M0.current!==null||d.memoizedState!==null)&&(Lo=u)}function YR(u){Z(er,er.current),Z(Ga,u),Lo===null&&(Lo=u)}function TO(u){u.tag===22?(Z(er,er.current),Z(Ga,u),Lo===null&&(Lo=u)):vd()}function vd(){Z(er,er.current),Z(Ga,Ga.current)}function qa(u){G(Ga),Lo===u&&(Lo=null),G(er)}var er=j(0);function JE(u){for(var d=u;d!==null;){if(d.tag===13){var m=d.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||nk(m)||ik(m)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var wu=0,cn=null,si=null,lr=null,QE=!1,F0=!1,qp=!1,ZE=0,D_=0,U0=null,qie=0;function Hi(){throw Error(i(321))}function JR(u,d){if(d===null)return!1;for(var m=0;m<d.length&&m<u.length;m++)if(!Ha(u[m],d[m]))return!1;return!0}function QR(u,d,m,b,I,U){return wu=U,cn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,q.H=u===null||u.memoizedState===null?s8:fN,qp=!1,U=m(b,I),qp=!1,F0&&(U=wO(d,m,b,I)),EO(u),U}function EO(u){q.H=R_;var d=si!==null&&si.next!==null;if(wu=0,lr=si=cn=null,QE=!1,D_=0,U0=null,d)throw Error(i(300));u===null||cr||(u=u.dependencies,u!==null&&zE(u)&&(cr=!0))}function wO(u,d,m,b){cn=u;var I=0;do{if(F0&&(U0=null),D_=0,F0=!1,25<=I)throw Error(i(301));if(I+=1,lr=si=null,u.updateQueue!=null){var U=u.updateQueue;U.lastEffect=null,U.events=null,U.stores=null,U.memoCache!=null&&(U.memoCache.index=0)}q.H=a8,U=d(m,b)}while(F0);return U}function $ie(){var u=q.H,d=u.useState()[0];return d=typeof d.then=="function"?C_(d):d,u=u.useState()[0],(si!==null?si.memoizedState:null)!==u&&(cn.flags|=1024),d}function ZR(){var u=ZE!==0;return ZE=0,u}function eN(u,d,m){d.updateQueue=u.updateQueue,d.flags&=-2053,u.lanes&=~m}function tN(u){if(QE){for(u=u.memoizedState;u!==null;){var d=u.queue;d!==null&&(d.pending=null),u=u.next}QE=!1}wu=0,lr=si=cn=null,F0=!1,D_=ZE=0,U0=null}function Qs(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?cn.memoizedState=lr=u:lr=lr.next=u,lr}function tr(){if(si===null){var u=cn.alternate;u=u!==null?u.memoizedState:null}else u=si.next;var d=lr===null?cn.memoizedState:lr.next;if(d!==null)lr=d,si=u;else{if(u===null)throw cn.alternate===null?Error(i(467)):Error(i(310));si=u,u={memoizedState:si.memoizedState,baseState:si.baseState,baseQueue:si.baseQueue,queue:si.queue,next:null},lr===null?cn.memoizedState=lr=u:lr=lr.next=u}return lr}function ew(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function C_(u){var d=D_;return D_+=1,U0===null&&(U0=[]),u=pO(U0,u,d),d=cn,(lr===null?d.memoizedState:lr.next)===null&&(d=d.alternate,q.H=d===null||d.memoizedState===null?s8:fN),u}function tw(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return C_(u);if(u.$$typeof===A)return cs(u)}throw Error(i(438,String(u)))}function nN(u){var d=null,m=cn.updateQueue;if(m!==null&&(d=m.memoCache),d==null){var b=cn.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(d={data:b.data.map(function(I){return I.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),m===null&&(m=ew(),cn.updateQueue=m),m.memoCache=d,m=d.data[d.index],m===void 0)for(m=d.data[d.index]=Array(u),b=0;b<u;b++)m[b]=L;return d.index++,m}function Au(u,d){return typeof d=="function"?d(u):d}function nw(u){var d=tr();return iN(d,si,u)}function iN(u,d,m){var b=u.queue;if(b===null)throw Error(i(311));b.lastRenderedReducer=m;var I=u.baseQueue,U=b.pending;if(U!==null){if(I!==null){var K=I.next;I.next=U.next,U.next=K}d.baseQueue=I=U,b.pending=null}if(U=u.baseState,I===null)u.memoizedState=U;else{d=I.next;var ce=K=null,De=null,ze=d,it=!1;do{var st=ze.lane&-536870913;if(st!==ze.lane?(xn&st)===st:(wu&st)===st){var Ke=ze.revertLane;if(Ke===0)De!==null&&(De=De.next={lane:0,revertLane:0,gesture:null,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null}),st===I0&&(it=!0);else if((wu&Ke)===Ke){ze=ze.next,Ke===I0&&(it=!0);continue}else st={lane:0,revertLane:ze.revertLane,gesture:null,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null},De===null?(ce=De=st,K=U):De=De.next=st,cn.lanes|=Ke,bd|=Ke;st=ze.action,qp&&m(U,st),U=ze.hasEagerState?ze.eagerState:m(U,st)}else Ke={lane:st,revertLane:ze.revertLane,gesture:ze.gesture,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null},De===null?(ce=De=Ke,K=U):De=De.next=Ke,cn.lanes|=st,bd|=st;ze=ze.next}while(ze!==null&&ze!==d);if(De===null?K=U:De.next=ce,!Ha(U,u.memoizedState)&&(cr=!0,it&&(m=R0,m!==null)))throw m;u.memoizedState=U,u.baseState=K,u.baseQueue=De,b.lastRenderedState=U}return I===null&&(b.lanes=0),[u.memoizedState,b.dispatch]}function rN(u){var d=tr(),m=d.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=u;var b=m.dispatch,I=m.pending,U=d.memoizedState;if(I!==null){m.pending=null;var K=I=I.next;do U=u(U,K.action),K=K.next;while(K!==I);Ha(U,d.memoizedState)||(cr=!0),d.memoizedState=U,d.baseQueue===null&&(d.baseState=U),m.lastRenderedState=U}return[U,b]}function AO(u,d,m){var b=cn,I=tr(),U=Sn;if(U){if(m===void 0)throw Error(i(407));m=m()}else m=d();var K=!Ha((si||I).memoizedState,m);if(K&&(I.memoizedState=m,cr=!0),I=I.queue,oN(CO.bind(null,b,I,u),[u]),I.getSnapshot!==d||K||lr!==null&&lr.memoizedState.tag&1){if(b.flags|=2048,P0(9,{destroy:void 0},DO.bind(null,b,I,m,d),null),mi===null)throw Error(i(349));U||(wu&127)!==0||SO(b,d,m)}return m}function SO(u,d,m){u.flags|=16384,u={getSnapshot:d,value:m},d=cn.updateQueue,d===null?(d=ew(),cn.updateQueue=d,d.stores=[u]):(m=d.stores,m===null?d.stores=[u]:m.push(u))}function DO(u,d,m,b){d.value=m,d.getSnapshot=b,IO(d)&&RO(u)}function CO(u,d,m){return m(function(){IO(d)&&RO(u)})}function IO(u){var d=u.getSnapshot;u=u.value;try{var m=d();return!Ha(u,m)}catch{return!0}}function RO(u){var d=Pp(u,2);d!==null&&ba(d,u,2)}function sN(u){var d=Qs();if(typeof u=="function"){var m=u;if(u=m(),qp){Ye(!0);try{m()}finally{Ye(!1)}}}return d.memoizedState=d.baseState=u,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Au,lastRenderedState:u},d}function NO(u,d,m,b){return u.baseState=m,iN(u,si,typeof b=="function"?b:Au)}function jie(u,d,m,b,I){if(sw(u))throw Error(i(485));if(u=d.action,u!==null){var U={payload:I,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(K){U.listeners.push(K)}};q.T!==null?m(!0):U.isTransition=!1,b(U),m=d.pending,m===null?(U.next=d.pending=U,kO(d,U)):(U.next=m.next,d.pending=m.next=U)}}function kO(u,d){var m=d.action,b=d.payload,I=u.state;if(d.isTransition){var U=q.T,K={};q.T=K;try{var ce=m(I,b),De=q.S;De!==null&&De(K,ce),MO(u,d,ce)}catch(ze){aN(u,d,ze)}finally{U!==null&&K.types!==null&&(U.types=K.types),q.T=U}}else try{U=m(I,b),MO(u,d,U)}catch(ze){aN(u,d,ze)}}function MO(u,d,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(b){FO(u,d,b)},function(b){return aN(u,d,b)}):FO(u,d,m)}function FO(u,d,m){d.status="fulfilled",d.value=m,UO(d),u.state=m,d=u.pending,d!==null&&(m=d.next,m===d?u.pending=null:(m=m.next,d.next=m,kO(u,m)))}function aN(u,d,m){var b=u.pending;if(u.pending=null,b!==null){b=b.next;do d.status="rejected",d.reason=m,UO(d),d=d.next;while(d!==b)}u.action=null}function UO(u){u=u.listeners;for(var d=0;d<u.length;d++)(0,u[d])()}function PO(u,d){return d}function LO(u,d){if(Sn){var m=mi.formState;if(m!==null){e:{var b=cn;if(Sn){if(Ai){t:{for(var I=Ai,U=Po;I.nodeType!==8;){if(!U){I=null;break t}if(I=Oo(I.nextSibling),I===null){I=null;break t}}U=I.data,I=U==="F!"||U==="F"?I:null}if(I){Ai=Oo(I.nextSibling),b=I.data==="F!";break e}}dd(b)}b=!1}b&&(d=m[0])}}return m=Qs(),m.memoizedState=m.baseState=d,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:PO,lastRenderedState:d},m.queue=b,m=n8.bind(null,cn,b),b.dispatch=m,b=sN(!1),U=dN.bind(null,cn,!1,b.queue),b=Qs(),I={state:d,dispatch:null,action:u,pending:null},b.queue=I,m=jie.bind(null,cn,I,U,m),I.dispatch=m,b.memoizedState=u,[d,m,!1]}function OO(u){var d=tr();return BO(d,si,u)}function BO(u,d,m){if(d=iN(u,d,PO)[0],u=nw(Au)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var b=C_(d)}catch(K){throw K===N0?$E:K}else b=d;d=tr();var I=d.queue,U=I.dispatch;return m!==d.memoizedState&&(cn.flags|=2048,P0(9,{destroy:void 0},Xie.bind(null,I,m),null)),[b,U,u]}function Xie(u,d){u.action=d}function VO(u){var d=tr(),m=si;if(m!==null)return BO(d,m,u);tr(),d=d.memoizedState,m=tr();var b=m.queue.dispatch;return m.memoizedState=u,[d,b,!1]}function P0(u,d,m,b){return u={tag:u,create:m,deps:b,inst:d,next:null},d=cn.updateQueue,d===null&&(d=ew(),cn.updateQueue=d),m=d.lastEffect,m===null?d.lastEffect=u.next=u:(b=m.next,m.next=u,u.next=b,d.lastEffect=u),u}function WO(){return tr().memoizedState}function iw(u,d,m,b){var I=Qs();cn.flags|=u,I.memoizedState=P0(1|d,{destroy:void 0},m,b===void 0?null:b)}function rw(u,d,m,b){var I=tr();b=b===void 0?null:b;var U=I.memoizedState.inst;si!==null&&b!==null&&JR(b,si.memoizedState.deps)?I.memoizedState=P0(d,U,m,b):(cn.flags|=u,I.memoizedState=P0(1|d,U,m,b))}function HO(u,d){iw(8390656,8,u,d)}function oN(u,d){rw(2048,8,u,d)}function Kie(u){cn.flags|=4;var d=cn.updateQueue;if(d===null)d=ew(),cn.updateQueue=d,d.events=[u];else{var m=d.events;m===null?d.events=[u]:m.push(u)}}function zO(u){var d=tr().memoizedState;return Kie({ref:d,nextImpl:u}),function(){if((Ln&2)!==0)throw Error(i(440));return d.impl.apply(void 0,arguments)}}function GO(u,d){return rw(4,2,u,d)}function qO(u,d){return rw(4,4,u,d)}function $O(u,d){if(typeof d=="function"){u=u();var m=d(u);return function(){typeof m=="function"?m():d(null)}}if(d!=null)return u=u(),d.current=u,function(){d.current=null}}function jO(u,d,m){m=m!=null?m.concat([u]):null,rw(4,4,$O.bind(null,d,u),m)}function lN(){}function XO(u,d){var m=tr();d=d===void 0?null:d;var b=m.memoizedState;return d!==null&&JR(d,b[1])?b[0]:(m.memoizedState=[u,d],u)}function KO(u,d){var m=tr();d=d===void 0?null:d;var b=m.memoizedState;if(d!==null&&JR(d,b[1]))return b[0];if(b=u(),qp){Ye(!0);try{u()}finally{Ye(!1)}}return m.memoizedState=[b,d],b}function cN(u,d,m){return m===void 0||(wu&1073741824)!==0&&(xn&261930)===0?u.memoizedState=d:(u.memoizedState=m,u=Y8(),cn.lanes|=u,bd|=u,m)}function YO(u,d,m,b){return Ha(m,d)?m:M0.current!==null?(u=cN(u,m,b),Ha(u,d)||(cr=!0),u):(wu&42)===0||(wu&1073741824)!==0&&(xn&261930)===0?(cr=!0,u.memoizedState=m):(u=Y8(),cn.lanes|=u,bd|=u,d)}function JO(u,d,m,b,I){var U=X.p;X.p=U!==0&&8>U?U:8;var K=q.T,ce={};q.T=ce,dN(u,!1,d,m);try{var De=I(),ze=q.S;if(ze!==null&&ze(ce,De),De!==null&&typeof De=="object"&&typeof De.then=="function"){var it=Gie(De,b);I_(u,d,it,Xa(u))}else I_(u,d,b,Xa(u))}catch(st){I_(u,d,{then:function(){},status:"rejected",reason:st},Xa())}finally{X.p=U,K!==null&&ce.types!==null&&(K.types=ce.types),q.T=K}}function Yie(){}function uN(u,d,m,b){if(u.tag!==5)throw Error(i(476));var I=QO(u).queue;JO(u,I,d,oe,m===null?Yie:function(){return ZO(u),m(b)})}function QO(u){var d=u.memoizedState;if(d!==null)return d;d={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Au,lastRenderedState:oe},next:null};var m={};return d.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Au,lastRenderedState:m},next:null},u.memoizedState=d,u=u.alternate,u!==null&&(u.memoizedState=d),d}function ZO(u){var d=QO(u);d.next===null&&(d=u.alternate.memoizedState),I_(u,d.next.queue,{},Xa())}function hN(){return cs($_)}function e8(){return tr().memoizedState}function t8(){return tr().memoizedState}function Jie(u){for(var d=u.return;d!==null;){switch(d.tag){case 24:case 3:var m=Xa();u=gd(m);var b=md(d,u,m);b!==null&&(ba(b,d,m),w_(b,d,m)),d={cache:VR()},u.payload=d;return}d=d.return}}function Qie(u,d,m){var b=Xa();m={lane:b,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},sw(u)?i8(d,m):(m=IR(u,d,m,b),m!==null&&(ba(m,u,b),r8(m,d,b)))}function n8(u,d,m){var b=Xa();I_(u,d,m,b)}function I_(u,d,m,b){var I={lane:b,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(sw(u))i8(d,I);else{var U=u.alternate;if(u.lanes===0&&(U===null||U.lanes===0)&&(U=d.lastRenderedReducer,U!==null))try{var K=d.lastRenderedState,ce=U(K,m);if(I.hasEagerState=!0,I.eagerState=ce,Ha(ce,K))return BE(u,d,I,0),mi===null&&OE(),!1}catch{}finally{}if(m=IR(u,d,I,b),m!==null)return ba(m,u,b),r8(m,d,b),!0}return!1}function dN(u,d,m,b){if(b={lane:2,revertLane:GN(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},sw(u)){if(d)throw Error(i(479))}else d=IR(u,m,b,2),d!==null&&ba(d,u,2)}function sw(u){var d=u.alternate;return u===cn||d!==null&&d===cn}function i8(u,d){F0=QE=!0;var m=u.pending;m===null?d.next=d:(d.next=m.next,m.next=d),u.pending=d}function r8(u,d,m){if((m&4194048)!==0){var b=d.lanes;b&=u.pendingLanes,m|=b,d.lanes=m,wr(u,m)}}var R_={readContext:cs,use:tw,useCallback:Hi,useContext:Hi,useEffect:Hi,useImperativeHandle:Hi,useLayoutEffect:Hi,useInsertionEffect:Hi,useMemo:Hi,useReducer:Hi,useRef:Hi,useState:Hi,useDebugValue:Hi,useDeferredValue:Hi,useTransition:Hi,useSyncExternalStore:Hi,useId:Hi,useHostTransitionStatus:Hi,useFormState:Hi,useActionState:Hi,useOptimistic:Hi,useMemoCache:Hi,useCacheRefresh:Hi};R_.useEffectEvent=Hi;var s8={readContext:cs,use:tw,useCallback:function(u,d){return Qs().memoizedState=[u,d===void 0?null:d],u},useContext:cs,useEffect:HO,useImperativeHandle:function(u,d,m){m=m!=null?m.concat([u]):null,iw(4194308,4,$O.bind(null,d,u),m)},useLayoutEffect:function(u,d){return iw(4194308,4,u,d)},useInsertionEffect:function(u,d){iw(4,2,u,d)},useMemo:function(u,d){var m=Qs();d=d===void 0?null:d;var b=u();if(qp){Ye(!0);try{u()}finally{Ye(!1)}}return m.memoizedState=[b,d],b},useReducer:function(u,d,m){var b=Qs();if(m!==void 0){var I=m(d);if(qp){Ye(!0);try{m(d)}finally{Ye(!1)}}}else I=d;return b.memoizedState=b.baseState=I,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:I},b.queue=u,u=u.dispatch=Qie.bind(null,cn,u),[b.memoizedState,u]},useRef:function(u){var d=Qs();return u={current:u},d.memoizedState=u},useState:function(u){u=sN(u);var d=u.queue,m=n8.bind(null,cn,d);return d.dispatch=m,[u.memoizedState,m]},useDebugValue:lN,useDeferredValue:function(u,d){var m=Qs();return cN(m,u,d)},useTransition:function(){var u=sN(!1);return u=JO.bind(null,cn,u.queue,!0,!1),Qs().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,d,m){var b=cn,I=Qs();if(Sn){if(m===void 0)throw Error(i(407));m=m()}else{if(m=d(),mi===null)throw Error(i(349));(xn&127)!==0||SO(b,d,m)}I.memoizedState=m;var U={value:m,getSnapshot:d};return I.queue=U,HO(CO.bind(null,b,U,u),[u]),b.flags|=2048,P0(9,{destroy:void 0},DO.bind(null,b,U,m,d),null),m},useId:function(){var u=Qs(),d=mi.identifierPrefix;if(Sn){var m=vc,b=yc;m=(b&~(1<<32-Je(b)-1)).toString(32)+m,d="_"+d+"R_"+m,m=ZE++,0<m&&(d+="H"+m.toString(32)),d+="_"}else m=qie++,d="_"+d+"r_"+m.toString(32)+"_";return u.memoizedState=d},useHostTransitionStatus:hN,useFormState:LO,useActionState:LO,useOptimistic:function(u){var d=Qs();d.memoizedState=d.baseState=u;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=m,d=dN.bind(null,cn,!0,m),m.dispatch=d,[u,d]},useMemoCache:nN,useCacheRefresh:function(){return Qs().memoizedState=Jie.bind(null,cn)},useEffectEvent:function(u){var d=Qs(),m={impl:u};return d.memoizedState=m,function(){if((Ln&2)!==0)throw Error(i(440));return m.impl.apply(void 0,arguments)}}},fN={readContext:cs,use:tw,useCallback:XO,useContext:cs,useEffect:oN,useImperativeHandle:jO,useInsertionEffect:GO,useLayoutEffect:qO,useMemo:KO,useReducer:nw,useRef:WO,useState:function(){return nw(Au)},useDebugValue:lN,useDeferredValue:function(u,d){var m=tr();return YO(m,si.memoizedState,u,d)},useTransition:function(){var u=nw(Au)[0],d=tr().memoizedState;return[typeof u=="boolean"?u:C_(u),d]},useSyncExternalStore:AO,useId:e8,useHostTransitionStatus:hN,useFormState:OO,useActionState:OO,useOptimistic:function(u,d){var m=tr();return NO(m,si,u,d)},useMemoCache:nN,useCacheRefresh:t8};fN.useEffectEvent=zO;var a8={readContext:cs,use:tw,useCallback:XO,useContext:cs,useEffect:oN,useImperativeHandle:jO,useInsertionEffect:GO,useLayoutEffect:qO,useMemo:KO,useReducer:rN,useRef:WO,useState:function(){return rN(Au)},useDebugValue:lN,useDeferredValue:function(u,d){var m=tr();return si===null?cN(m,u,d):YO(m,si.memoizedState,u,d)},useTransition:function(){var u=rN(Au)[0],d=tr().memoizedState;return[typeof u=="boolean"?u:C_(u),d]},useSyncExternalStore:AO,useId:e8,useHostTransitionStatus:hN,useFormState:VO,useActionState:VO,useOptimistic:function(u,d){var m=tr();return si!==null?NO(m,si,u,d):(m.baseState=u,[u,m.queue.dispatch])},useMemoCache:nN,useCacheRefresh:t8};a8.useEffectEvent=zO;function pN(u,d,m,b){d=u.memoizedState,m=m(b,d),m=m==null?d:f({},d,m),u.memoizedState=m,u.lanes===0&&(u.updateQueue.baseState=m)}var gN={enqueueSetState:function(u,d,m){u=u._reactInternals;var b=Xa(),I=gd(b);I.payload=d,m!=null&&(I.callback=m),d=md(u,I,b),d!==null&&(ba(d,u,b),w_(d,u,b))},enqueueReplaceState:function(u,d,m){u=u._reactInternals;var b=Xa(),I=gd(b);I.tag=1,I.payload=d,m!=null&&(I.callback=m),d=md(u,I,b),d!==null&&(ba(d,u,b),w_(d,u,b))},enqueueForceUpdate:function(u,d){u=u._reactInternals;var m=Xa(),b=gd(m);b.tag=2,d!=null&&(b.callback=d),d=md(u,b,m),d!==null&&(ba(d,u,m),w_(d,u,m))}};function o8(u,d,m,b,I,U,K){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(b,U,K):d.prototype&&d.prototype.isPureReactComponent?!m_(m,b)||!m_(I,U):!0}function l8(u,d,m,b){u=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(m,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(m,b),d.state!==u&&gN.enqueueReplaceState(d,d.state,null)}function $p(u,d){var m=d;if("ref"in d){m={};for(var b in d)b!=="ref"&&(m[b]=d[b])}if(u=u.defaultProps){m===d&&(m=f({},m));for(var I in u)m[I]===void 0&&(m[I]=u[I])}return m}function c8(u){LE(u)}function u8(u){console.error(u)}function h8(u){LE(u)}function aw(u,d){try{var m=u.onUncaughtError;m(d.value,{componentStack:d.stack})}catch(b){setTimeout(function(){throw b})}}function d8(u,d,m){try{var b=u.onCaughtError;b(m.value,{componentStack:m.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(I){setTimeout(function(){throw I})}}function mN(u,d,m){return m=gd(m),m.tag=3,m.payload={element:null},m.callback=function(){aw(u,d)},m}function f8(u){return u=gd(u),u.tag=3,u}function p8(u,d,m,b){var I=m.type.getDerivedStateFromError;if(typeof I=="function"){var U=b.value;u.payload=function(){return I(U)},u.callback=function(){d8(d,m,b)}}var K=m.stateNode;K!==null&&typeof K.componentDidCatch=="function"&&(u.callback=function(){d8(d,m,b),typeof I!="function"&&(Td===null?Td=new Set([this]):Td.add(this));var ce=b.stack;this.componentDidCatch(b.value,{componentStack:ce!==null?ce:""})})}function Zie(u,d,m,b,I){if(m.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(d=m.alternate,d!==null&&C0(d,m,I,!0),m=Ga.current,m!==null){switch(m.tag){case 31:case 13:return Lo===null?vw():m.alternate===null&&zi===0&&(zi=3),m.flags&=-257,m.flags|=65536,m.lanes=I,b===jE?m.flags|=16384:(d=m.updateQueue,d===null?m.updateQueue=new Set([b]):d.add(b),WN(u,b,I)),!1;case 22:return m.flags|=65536,b===jE?m.flags|=16384:(d=m.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([b])},m.updateQueue=d):(m=d.retryQueue,m===null?d.retryQueue=new Set([b]):m.add(b)),WN(u,b,I)),!1}throw Error(i(435,m.tag))}return WN(u,b,I),vw(),!1}if(Sn)return d=Ga.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=I,b!==UR&&(u=Error(i(422),{cause:b}),__(Mo(u,m)))):(b!==UR&&(d=Error(i(423),{cause:b}),__(Mo(d,m))),u=u.current.alternate,u.flags|=65536,I&=-I,u.lanes|=I,b=Mo(b,m),I=mN(u.stateNode,b,I),$R(u,I),zi!==4&&(zi=2)),!1;var U=Error(i(520),{cause:b});if(U=Mo(U,m),O_===null?O_=[U]:O_.push(U),zi!==4&&(zi=2),d===null)return!0;b=Mo(b,m),m=d;do{switch(m.tag){case 3:return m.flags|=65536,u=I&-I,m.lanes|=u,u=mN(m.stateNode,b,u),$R(m,u),!1;case 1:if(d=m.type,U=m.stateNode,(m.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||U!==null&&typeof U.componentDidCatch=="function"&&(Td===null||!Td.has(U))))return m.flags|=65536,I&=-I,m.lanes|=I,I=f8(I),p8(I,u,m,b),$R(m,I),!1}m=m.return}while(m!==null);return!1}var yN=Error(i(461)),cr=!1;function us(u,d,m,b){d.child=u===null?vO(d,null,m,b):Gp(d,u.child,m,b)}function g8(u,d,m,b,I){m=m.render;var U=d.ref;if("ref"in b){var K={};for(var ce in b)ce!=="ref"&&(K[ce]=b[ce])}else K=b;return Vp(d),b=QR(u,d,m,K,U,I),ce=ZR(),u!==null&&!cr?(eN(u,d,I),Su(u,d,I)):(Sn&&ce&&MR(d),d.flags|=1,us(u,d,b,I),d.child)}function m8(u,d,m,b,I){if(u===null){var U=m.type;return typeof U=="function"&&!RR(U)&&U.defaultProps===void 0&&m.compare===null?(d.tag=15,d.type=U,y8(u,d,U,b,I)):(u=WE(m.type,null,b,d,d.mode,I),u.ref=d.ref,u.return=d,d.child=u)}if(U=u.child,!AN(u,I)){var K=U.memoizedProps;if(m=m.compare,m=m!==null?m:m_,m(K,b)&&u.ref===d.ref)return Su(u,d,I)}return d.flags|=1,u=xu(U,b),u.ref=d.ref,u.return=d,d.child=u}function y8(u,d,m,b,I){if(u!==null){var U=u.memoizedProps;if(m_(U,b)&&u.ref===d.ref)if(cr=!1,d.pendingProps=b=U,AN(u,I))(u.flags&131072)!==0&&(cr=!0);else return d.lanes=u.lanes,Su(u,d,I)}return vN(u,d,m,b,I)}function v8(u,d,m,b){var I=b.children,U=u!==null?u.memoizedState:null;if(u===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((d.flags&128)!==0){if(U=U!==null?U.baseLanes|m:m,u!==null){for(b=d.child=u.child,I=0;b!==null;)I=I|b.lanes|b.childLanes,b=b.sibling;b=I&~U}else b=0,d.child=null;return _8(u,d,U,m,b)}if((m&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},u!==null&&qE(d,U!==null?U.cachePool:null),U!==null?bO(d,U):XR(),TO(d);else return b=d.lanes=536870912,_8(u,d,U!==null?U.baseLanes|m:m,m,b)}else U!==null?(qE(d,U.cachePool),bO(d,U),vd(),d.memoizedState=null):(u!==null&&qE(d,null),XR(),vd());return us(u,d,I,m),d.child}function N_(u,d){return u!==null&&u.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function _8(u,d,m,b,I){var U=HR();return U=U===null?null:{parent:or._currentValue,pool:U},d.memoizedState={baseLanes:m,cachePool:U},u!==null&&qE(d,null),XR(),TO(d),u!==null&&C0(u,d,b,!0),d.childLanes=I,null}function ow(u,d){return d=cw({mode:d.mode,children:d.children},u.mode),d.ref=u.ref,u.child=d,d.return=u,d}function x8(u,d,m){return Gp(d,u.child,null,m),u=ow(d,d.pendingProps),u.flags|=2,qa(d),d.memoizedState=null,u}function ere(u,d,m){var b=d.pendingProps,I=(d.flags&128)!==0;if(d.flags&=-129,u===null){if(Sn){if(b.mode==="hidden")return u=ow(d,b),d.lanes=536870912,N_(null,u);if(YR(d),(u=Ai)?(u=k6(u,Po),u=u!==null&&u.data==="&"?u:null,u!==null&&(d.memoizedState={dehydrated:u,treeContext:ud!==null?{id:yc,overflow:vc}:null,retryLane:536870912,hydrationErrors:null},m=iO(u),m.return=d,d.child=m,ls=d,Ai=null)):u=null,u===null)throw dd(d);return d.lanes=536870912,null}return ow(d,b)}var U=u.memoizedState;if(U!==null){var K=U.dehydrated;if(YR(d),I)if(d.flags&256)d.flags&=-257,d=x8(u,d,m);else if(d.memoizedState!==null)d.child=u.child,d.flags|=128,d=null;else throw Error(i(558));else if(cr||C0(u,d,m,!1),I=(m&u.childLanes)!==0,cr||I){if(b=mi,b!==null&&(K=Ys(b,m),K!==0&&K!==U.retryLane))throw U.retryLane=K,Pp(u,K),ba(b,u,K),yN;vw(),d=x8(u,d,m)}else u=U.treeContext,Ai=Oo(K.nextSibling),ls=d,Sn=!0,hd=null,Po=!1,u!==null&&aO(d,u),d=ow(d,b),d.flags|=4096;return d}return u=xu(u.child,{mode:b.mode,children:b.children}),u.ref=d.ref,d.child=u,u.return=d,u}function lw(u,d){var m=d.ref;if(m===null)u!==null&&u.ref!==null&&(d.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(i(284));(u===null||u.ref!==m)&&(d.flags|=4194816)}}function vN(u,d,m,b,I){return Vp(d),m=QR(u,d,m,b,void 0,I),b=ZR(),u!==null&&!cr?(eN(u,d,I),Su(u,d,I)):(Sn&&b&&MR(d),d.flags|=1,us(u,d,m,I),d.child)}function b8(u,d,m,b,I,U){return Vp(d),d.updateQueue=null,m=wO(d,b,m,I),EO(u),b=ZR(),u!==null&&!cr?(eN(u,d,U),Su(u,d,U)):(Sn&&b&&MR(d),d.flags|=1,us(u,d,m,U),d.child)}function T8(u,d,m,b,I){if(Vp(d),d.stateNode===null){var U=w0,K=m.contextType;typeof K=="object"&&K!==null&&(U=cs(K)),U=new m(b,U),d.memoizedState=U.state!==null&&U.state!==void 0?U.state:null,U.updater=gN,d.stateNode=U,U._reactInternals=d,U=d.stateNode,U.props=b,U.state=d.memoizedState,U.refs={},GR(d),K=m.contextType,U.context=typeof K=="object"&&K!==null?cs(K):w0,U.state=d.memoizedState,K=m.getDerivedStateFromProps,typeof K=="function"&&(pN(d,m,K,b),U.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof U.getSnapshotBeforeUpdate=="function"||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(K=U.state,typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount(),K!==U.state&&gN.enqueueReplaceState(U,U.state,null),S_(d,b,U,I),A_(),U.state=d.memoizedState),typeof U.componentDidMount=="function"&&(d.flags|=4194308),b=!0}else if(u===null){U=d.stateNode;var ce=d.memoizedProps,De=$p(m,ce);U.props=De;var ze=U.context,it=m.contextType;K=w0,typeof it=="object"&&it!==null&&(K=cs(it));var st=m.getDerivedStateFromProps;it=typeof st=="function"||typeof U.getSnapshotBeforeUpdate=="function",ce=d.pendingProps!==ce,it||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(ce||ze!==K)&&l8(d,U,b,K),pd=!1;var Ke=d.memoizedState;U.state=Ke,S_(d,b,U,I),A_(),ze=d.memoizedState,ce||Ke!==ze||pd?(typeof st=="function"&&(pN(d,m,st,b),ze=d.memoizedState),(De=pd||o8(d,m,De,b,Ke,ze,K))?(it||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(d.flags|=4194308)):(typeof U.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=ze),U.props=b,U.state=ze,U.context=K,b=De):(typeof U.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{U=d.stateNode,qR(u,d),K=d.memoizedProps,it=$p(m,K),U.props=it,st=d.pendingProps,Ke=U.context,ze=m.contextType,De=w0,typeof ze=="object"&&ze!==null&&(De=cs(ze)),ce=m.getDerivedStateFromProps,(ze=typeof ce=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(K!==st||Ke!==De)&&l8(d,U,b,De),pd=!1,Ke=d.memoizedState,U.state=Ke,S_(d,b,U,I),A_();var et=d.memoizedState;K!==st||Ke!==et||pd||u!==null&&u.dependencies!==null&&zE(u.dependencies)?(typeof ce=="function"&&(pN(d,m,ce,b),et=d.memoizedState),(it=pd||o8(d,m,it,b,Ke,et,De)||u!==null&&u.dependencies!==null&&zE(u.dependencies))?(ze||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(b,et,De),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(b,et,De)),typeof U.componentDidUpdate=="function"&&(d.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof U.componentDidUpdate!="function"||K===u.memoizedProps&&Ke===u.memoizedState||(d.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||K===u.memoizedProps&&Ke===u.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=et),U.props=b,U.state=et,U.context=De,b=it):(typeof U.componentDidUpdate!="function"||K===u.memoizedProps&&Ke===u.memoizedState||(d.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||K===u.memoizedProps&&Ke===u.memoizedState||(d.flags|=1024),b=!1)}return U=b,lw(u,d),b=(d.flags&128)!==0,U||b?(U=d.stateNode,m=b&&typeof m.getDerivedStateFromError!="function"?null:U.render(),d.flags|=1,u!==null&&b?(d.child=Gp(d,u.child,null,I),d.child=Gp(d,null,m,I)):us(u,d,m,I),d.memoizedState=U.state,u=d.child):u=Su(u,d,I),u}function E8(u,d,m,b){return Op(),d.flags|=256,us(u,d,m,b),d.child}var _N={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xN(u){return{baseLanes:u,cachePool:dO()}}function bN(u,d,m){return u=u!==null?u.childLanes&~m:0,d&&(u|=ja),u}function w8(u,d,m){var b=d.pendingProps,I=!1,U=(d.flags&128)!==0,K;if((K=U)||(K=u!==null&&u.memoizedState===null?!1:(er.current&2)!==0),K&&(I=!0,d.flags&=-129),K=(d.flags&32)!==0,d.flags&=-33,u===null){if(Sn){if(I?yd(d):vd(),(u=Ai)?(u=k6(u,Po),u=u!==null&&u.data!=="&"?u:null,u!==null&&(d.memoizedState={dehydrated:u,treeContext:ud!==null?{id:yc,overflow:vc}:null,retryLane:536870912,hydrationErrors:null},m=iO(u),m.return=d,d.child=m,ls=d,Ai=null)):u=null,u===null)throw dd(d);return ik(u)?d.lanes=32:d.lanes=536870912,null}var ce=b.children;return b=b.fallback,I?(vd(),I=d.mode,ce=cw({mode:"hidden",children:ce},I),b=Lp(b,I,m,null),ce.return=d,b.return=d,ce.sibling=b,d.child=ce,b=d.child,b.memoizedState=xN(m),b.childLanes=bN(u,K,m),d.memoizedState=_N,N_(null,b)):(yd(d),TN(d,ce))}var De=u.memoizedState;if(De!==null&&(ce=De.dehydrated,ce!==null)){if(U)d.flags&256?(yd(d),d.flags&=-257,d=EN(u,d,m)):d.memoizedState!==null?(vd(),d.child=u.child,d.flags|=128,d=null):(vd(),ce=b.fallback,I=d.mode,b=cw({mode:"visible",children:b.children},I),ce=Lp(ce,I,m,null),ce.flags|=2,b.return=d,ce.return=d,b.sibling=ce,d.child=b,Gp(d,u.child,null,m),b=d.child,b.memoizedState=xN(m),b.childLanes=bN(u,K,m),d.memoizedState=_N,d=N_(null,b));else if(yd(d),ik(ce)){if(K=ce.nextSibling&&ce.nextSibling.dataset,K)var ze=K.dgst;K=ze,b=Error(i(419)),b.stack="",b.digest=K,__({value:b,source:null,stack:null}),d=EN(u,d,m)}else if(cr||C0(u,d,m,!1),K=(m&u.childLanes)!==0,cr||K){if(K=mi,K!==null&&(b=Ys(K,m),b!==0&&b!==De.retryLane))throw De.retryLane=b,Pp(u,b),ba(K,u,b),yN;nk(ce)||vw(),d=EN(u,d,m)}else nk(ce)?(d.flags|=192,d.child=u.child,d=null):(u=De.treeContext,Ai=Oo(ce.nextSibling),ls=d,Sn=!0,hd=null,Po=!1,u!==null&&aO(d,u),d=TN(d,b.children),d.flags|=4096);return d}return I?(vd(),ce=b.fallback,I=d.mode,De=u.child,ze=De.sibling,b=xu(De,{mode:"hidden",children:b.children}),b.subtreeFlags=De.subtreeFlags&65011712,ze!==null?ce=xu(ze,ce):(ce=Lp(ce,I,m,null),ce.flags|=2),ce.return=d,b.return=d,b.sibling=ce,d.child=b,N_(null,b),b=d.child,ce=u.child.memoizedState,ce===null?ce=xN(m):(I=ce.cachePool,I!==null?(De=or._currentValue,I=I.parent!==De?{parent:De,pool:De}:I):I=dO(),ce={baseLanes:ce.baseLanes|m,cachePool:I}),b.memoizedState=ce,b.childLanes=bN(u,K,m),d.memoizedState=_N,N_(u.child,b)):(yd(d),m=u.child,u=m.sibling,m=xu(m,{mode:"visible",children:b.children}),m.return=d,m.sibling=null,u!==null&&(K=d.deletions,K===null?(d.deletions=[u],d.flags|=16):K.push(u)),d.child=m,d.memoizedState=null,m)}function TN(u,d){return d=cw({mode:"visible",children:d},u.mode),d.return=u,u.child=d}function cw(u,d){return u=za(22,u,null,d),u.lanes=0,u}function EN(u,d,m){return Gp(d,u.child,null,m),u=TN(d,d.pendingProps.children),u.flags|=2,d.memoizedState=null,u}function A8(u,d,m){u.lanes|=d;var b=u.alternate;b!==null&&(b.lanes|=d),OR(u.return,d,m)}function wN(u,d,m,b,I,U){var K=u.memoizedState;K===null?u.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:I,treeForkCount:U}:(K.isBackwards=d,K.rendering=null,K.renderingStartTime=0,K.last=b,K.tail=m,K.tailMode=I,K.treeForkCount=U)}function S8(u,d,m){var b=d.pendingProps,I=b.revealOrder,U=b.tail;b=b.children;var K=er.current,ce=(K&2)!==0;if(ce?(K=K&1|2,d.flags|=128):K&=1,Z(er,K),us(u,d,b,m),b=Sn?v_:0,!ce&&u!==null&&(u.flags&128)!==0)e:for(u=d.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&A8(u,m,d);else if(u.tag===19)A8(u,m,d);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===d)break e;for(;u.sibling===null;){if(u.return===null||u.return===d)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}switch(I){case"forwards":for(m=d.child,I=null;m!==null;)u=m.alternate,u!==null&&JE(u)===null&&(I=m),m=m.sibling;m=I,m===null?(I=d.child,d.child=null):(I=m.sibling,m.sibling=null),wN(d,!1,I,m,U,b);break;case"backwards":case"unstable_legacy-backwards":for(m=null,I=d.child,d.child=null;I!==null;){if(u=I.alternate,u!==null&&JE(u)===null){d.child=I;break}u=I.sibling,I.sibling=m,m=I,I=u}wN(d,!0,m,null,U,b);break;case"together":wN(d,!1,null,null,void 0,b);break;default:d.memoizedState=null}return d.child}function Su(u,d,m){if(u!==null&&(d.dependencies=u.dependencies),bd|=d.lanes,(m&d.childLanes)===0)if(u!==null){if(C0(u,d,m,!1),(m&d.childLanes)===0)return null}else return null;if(u!==null&&d.child!==u.child)throw Error(i(153));if(d.child!==null){for(u=d.child,m=xu(u,u.pendingProps),d.child=m,m.return=d;u.sibling!==null;)u=u.sibling,m=m.sibling=xu(u,u.pendingProps),m.return=d;m.sibling=null}return d.child}function AN(u,d){return(u.lanes&d)!==0?!0:(u=u.dependencies,!!(u!==null&&zE(u)))}function tre(u,d,m){switch(d.tag){case 3:Pe(d,d.stateNode.containerInfo),fd(d,or,u.memoizedState.cache),Op();break;case 27:case 5:Ge(d);break;case 4:Pe(d,d.stateNode.containerInfo);break;case 10:fd(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,YR(d),null;break;case 13:var b=d.memoizedState;if(b!==null)return b.dehydrated!==null?(yd(d),d.flags|=128,null):(m&d.child.childLanes)!==0?w8(u,d,m):(yd(d),u=Su(u,d,m),u!==null?u.sibling:null);yd(d);break;case 19:var I=(u.flags&128)!==0;if(b=(m&d.childLanes)!==0,b||(C0(u,d,m,!1),b=(m&d.childLanes)!==0),I){if(b)return S8(u,d,m);d.flags|=128}if(I=d.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Z(er,er.current),b)break;return null;case 22:return d.lanes=0,v8(u,d,m,d.pendingProps);case 24:fd(d,or,u.memoizedState.cache)}return Su(u,d,m)}function D8(u,d,m){if(u!==null)if(u.memoizedProps!==d.pendingProps)cr=!0;else{if(!AN(u,m)&&(d.flags&128)===0)return cr=!1,tre(u,d,m);cr=(u.flags&131072)!==0}else cr=!1,Sn&&(d.flags&1048576)!==0&&sO(d,v_,d.index);switch(d.lanes=0,d.tag){case 16:e:{var b=d.pendingProps;if(u=Hp(d.elementType),d.type=u,typeof u=="function")RR(u)?(b=$p(u,b),d.tag=1,d=T8(null,d,u,b,m)):(d.tag=0,d=vN(null,d,u,b,m));else{if(u!=null){var I=u.$$typeof;if(I===N){d.tag=11,d=g8(null,d,u,b,m);break e}else if(I===C){d.tag=14,d=m8(null,d,u,b,m);break e}}throw d=B(u)||u,Error(i(306,d,""))}}return d;case 0:return vN(u,d,d.type,d.pendingProps,m);case 1:return b=d.type,I=$p(b,d.pendingProps),T8(u,d,b,I,m);case 3:e:{if(Pe(d,d.stateNode.containerInfo),u===null)throw Error(i(387));b=d.pendingProps;var U=d.memoizedState;I=U.element,qR(u,d),S_(d,b,null,m);var K=d.memoizedState;if(b=K.cache,fd(d,or,b),b!==U.cache&&BR(d,[or],m,!0),A_(),b=K.element,U.isDehydrated)if(U={element:b,isDehydrated:!1,cache:K.cache},d.updateQueue.baseState=U,d.memoizedState=U,d.flags&256){d=E8(u,d,b,m);break e}else if(b!==I){I=Mo(Error(i(424)),d),__(I),d=E8(u,d,b,m);break e}else{switch(u=d.stateNode.containerInfo,u.nodeType){case 9:u=u.body;break;default:u=u.nodeName==="HTML"?u.ownerDocument.body:u}for(Ai=Oo(u.firstChild),ls=d,Sn=!0,hd=null,Po=!0,m=vO(d,null,b,m),d.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(Op(),b===I){d=Su(u,d,m);break e}us(u,d,b,m)}d=d.child}return d;case 26:return lw(u,d),u===null?(m=O6(d.type,null,d.pendingProps,null))?d.memoizedState=m:Sn||(m=d.type,u=d.pendingProps,b=Aw(_e.current).createElement(m),b[de]=d,b[ye]=u,hs(b,m,u),Ft(b),d.stateNode=b):d.memoizedState=O6(d.type,u.memoizedProps,d.pendingProps,u.memoizedState),null;case 27:return Ge(d),u===null&&Sn&&(b=d.stateNode=U6(d.type,d.pendingProps,_e.current),ls=d,Po=!0,I=Ai,Sd(d.type)?(rk=I,Ai=Oo(b.firstChild)):Ai=I),us(u,d,d.pendingProps.children,m),lw(u,d),u===null&&(d.flags|=4194304),d.child;case 5:return u===null&&Sn&&((I=b=Ai)&&(b=Nre(b,d.type,d.pendingProps,Po),b!==null?(d.stateNode=b,ls=d,Ai=Oo(b.firstChild),Po=!1,I=!0):I=!1),I||dd(d)),Ge(d),I=d.type,U=d.pendingProps,K=u!==null?u.memoizedProps:null,b=U.children,ZN(I,U)?b=null:K!==null&&ZN(I,K)&&(d.flags|=32),d.memoizedState!==null&&(I=QR(u,d,$ie,null,null,m),$_._currentValue=I),lw(u,d),us(u,d,b,m),d.child;case 6:return u===null&&Sn&&((u=m=Ai)&&(m=kre(m,d.pendingProps,Po),m!==null?(d.stateNode=m,ls=d,Ai=null,u=!0):u=!1),u||dd(d)),null;case 13:return w8(u,d,m);case 4:return Pe(d,d.stateNode.containerInfo),b=d.pendingProps,u===null?d.child=Gp(d,null,b,m):us(u,d,b,m),d.child;case 11:return g8(u,d,d.type,d.pendingProps,m);case 7:return us(u,d,d.pendingProps,m),d.child;case 8:return us(u,d,d.pendingProps.children,m),d.child;case 12:return us(u,d,d.pendingProps.children,m),d.child;case 10:return b=d.pendingProps,fd(d,d.type,b.value),us(u,d,b.children,m),d.child;case 9:return I=d.type._context,b=d.pendingProps.children,Vp(d),I=cs(I),b=b(I),d.flags|=1,us(u,d,b,m),d.child;case 14:return m8(u,d,d.type,d.pendingProps,m);case 15:return y8(u,d,d.type,d.pendingProps,m);case 19:return S8(u,d,m);case 31:return ere(u,d,m);case 22:return v8(u,d,m,d.pendingProps);case 24:return Vp(d),b=cs(or),u===null?(I=HR(),I===null&&(I=mi,U=VR(),I.pooledCache=U,U.refCount++,U!==null&&(I.pooledCacheLanes|=m),I=U),d.memoizedState={parent:b,cache:I},GR(d),fd(d,or,I)):((u.lanes&m)!==0&&(qR(u,d),S_(d,null,null,m),A_()),I=u.memoizedState,U=d.memoizedState,I.parent!==b?(I={parent:b,cache:b},d.memoizedState=I,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=I),fd(d,or,b)):(b=U.cache,fd(d,or,b),b!==I.cache&&BR(d,[or],m,!0))),us(u,d,d.pendingProps.children,m),d.child;case 29:throw d.pendingProps}throw Error(i(156,d.tag))}function Du(u){u.flags|=4}function SN(u,d,m,b,I){if((d=(u.mode&32)!==0)&&(d=!1),d){if(u.flags|=16777216,(I&335544128)===I)if(u.stateNode.complete)u.flags|=8192;else if(e6())u.flags|=8192;else throw zp=jE,zR}else u.flags&=-16777217}function C8(u,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)u.flags&=-16777217;else if(u.flags|=16777216,!z6(d))if(e6())u.flags|=8192;else throw zp=jE,zR}function uw(u,d){d!==null&&(u.flags|=4),u.flags&16384&&(d=u.tag!==22?Ht():536870912,u.lanes|=d,V0|=d)}function k_(u,d){if(!Sn)switch(u.tailMode){case"hidden":d=u.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?u.tail=null:m.sibling=null;break;case"collapsed":m=u.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?d||u.tail===null?u.tail=null:u.tail.sibling=null:b.sibling=null}}function Si(u){var d=u.alternate!==null&&u.alternate.child===u.child,m=0,b=0;if(d)for(var I=u.child;I!==null;)m|=I.lanes|I.childLanes,b|=I.subtreeFlags&65011712,b|=I.flags&65011712,I.return=u,I=I.sibling;else for(I=u.child;I!==null;)m|=I.lanes|I.childLanes,b|=I.subtreeFlags,b|=I.flags,I.return=u,I=I.sibling;return u.subtreeFlags|=b,u.childLanes=m,d}function nre(u,d,m){var b=d.pendingProps;switch(FR(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Si(d),null;case 1:return Si(d),null;case 3:return m=d.stateNode,b=null,u!==null&&(b=u.memoizedState.cache),d.memoizedState.cache!==b&&(d.flags|=2048),Eu(or),Fe(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(u===null||u.child===null)&&(D0(d)?Du(d):u===null||u.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,PR())),Si(d),null;case 26:var I=d.type,U=d.memoizedState;return u===null?(Du(d),U!==null?(Si(d),C8(d,U)):(Si(d),SN(d,I,null,b,m))):U?U!==u.memoizedState?(Du(d),Si(d),C8(d,U)):(Si(d),d.flags&=-16777217):(u=u.memoizedProps,u!==b&&Du(d),Si(d),SN(d,I,u,b,m)),null;case 27:if(ct(d),m=_e.current,I=d.type,u!==null&&d.stateNode!=null)u.memoizedProps!==b&&Du(d);else{if(!b){if(d.stateNode===null)throw Error(i(166));return Si(d),null}u=te.current,D0(d)?oO(d):(u=U6(I,b,m),d.stateNode=u,Du(d))}return Si(d),null;case 5:if(ct(d),I=d.type,u!==null&&d.stateNode!=null)u.memoizedProps!==b&&Du(d);else{if(!b){if(d.stateNode===null)throw Error(i(166));return Si(d),null}if(U=te.current,D0(d))oO(d);else{var K=Aw(_e.current);switch(U){case 1:U=K.createElementNS("http://www.w3.org/2000/svg",I);break;case 2:U=K.createElementNS("http://www.w3.org/1998/Math/MathML",I);break;default:switch(I){case"svg":U=K.createElementNS("http://www.w3.org/2000/svg",I);break;case"math":U=K.createElementNS("http://www.w3.org/1998/Math/MathML",I);break;case"script":U=K.createElement("div"),U.innerHTML="<script><\/script>",U=U.removeChild(U.firstChild);break;case"select":U=typeof b.is=="string"?K.createElement("select",{is:b.is}):K.createElement("select"),b.multiple?U.multiple=!0:b.size&&(U.size=b.size);break;default:U=typeof b.is=="string"?K.createElement(I,{is:b.is}):K.createElement(I)}}U[de]=d,U[ye]=b;e:for(K=d.child;K!==null;){if(K.tag===5||K.tag===6)U.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===d)break e;for(;K.sibling===null;){if(K.return===null||K.return===d)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}d.stateNode=U;e:switch(hs(U,I,b),I){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&Du(d)}}return Si(d),SN(d,d.type,u===null?null:u.memoizedProps,d.pendingProps,m),null;case 6:if(u&&d.stateNode!=null)u.memoizedProps!==b&&Du(d);else{if(typeof b!="string"&&d.stateNode===null)throw Error(i(166));if(u=_e.current,D0(d)){if(u=d.stateNode,m=d.memoizedProps,b=null,I=ls,I!==null)switch(I.tag){case 27:case 5:b=I.memoizedProps}u[de]=d,u=!!(u.nodeValue===m||b!==null&&b.suppressHydrationWarning===!0||w6(u.nodeValue,m)),u||dd(d,!0)}else u=Aw(u).createTextNode(b),u[de]=d,d.stateNode=u}return Si(d),null;case 31:if(m=d.memoizedState,u===null||u.memoizedState!==null){if(b=D0(d),m!==null){if(u===null){if(!b)throw Error(i(318));if(u=d.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(557));u[de]=d}else Op(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Si(d),u=!1}else m=PR(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=m),u=!0;if(!u)return d.flags&256?(qa(d),d):(qa(d),null);if((d.flags&128)!==0)throw Error(i(558))}return Si(d),null;case 13:if(b=d.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(I=D0(d),b!==null&&b.dehydrated!==null){if(u===null){if(!I)throw Error(i(318));if(I=d.memoizedState,I=I!==null?I.dehydrated:null,!I)throw Error(i(317));I[de]=d}else Op(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Si(d),I=!1}else I=PR(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=I),I=!0;if(!I)return d.flags&256?(qa(d),d):(qa(d),null)}return qa(d),(d.flags&128)!==0?(d.lanes=m,d):(m=b!==null,u=u!==null&&u.memoizedState!==null,m&&(b=d.child,I=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(I=b.alternate.memoizedState.cachePool.pool),U=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(U=b.memoizedState.cachePool.pool),U!==I&&(b.flags|=2048)),m!==u&&m&&(d.child.flags|=8192),uw(d,d.updateQueue),Si(d),null);case 4:return Fe(),u===null&&XN(d.stateNode.containerInfo),Si(d),null;case 10:return Eu(d.type),Si(d),null;case 19:if(G(er),b=d.memoizedState,b===null)return Si(d),null;if(I=(d.flags&128)!==0,U=b.rendering,U===null)if(I)k_(b,!1);else{if(zi!==0||u!==null&&(u.flags&128)!==0)for(u=d.child;u!==null;){if(U=JE(u),U!==null){for(d.flags|=128,k_(b,!1),u=U.updateQueue,d.updateQueue=u,uw(d,u),d.subtreeFlags=0,u=m,m=d.child;m!==null;)nO(m,u),m=m.sibling;return Z(er,er.current&1|2),Sn&&bu(d,b.treeForkCount),d.child}u=u.sibling}b.tail!==null&&Ee()>gw&&(d.flags|=128,I=!0,k_(b,!1),d.lanes=4194304)}else{if(!I)if(u=JE(U),u!==null){if(d.flags|=128,I=!0,u=u.updateQueue,d.updateQueue=u,uw(d,u),k_(b,!0),b.tail===null&&b.tailMode==="hidden"&&!U.alternate&&!Sn)return Si(d),null}else 2*Ee()-b.renderingStartTime>gw&&m!==536870912&&(d.flags|=128,I=!0,k_(b,!1),d.lanes=4194304);b.isBackwards?(U.sibling=d.child,d.child=U):(u=b.last,u!==null?u.sibling=U:d.child=U,b.last=U)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=Ee(),u.sibling=null,m=er.current,Z(er,I?m&1|2:m&1),Sn&&bu(d,b.treeForkCount),u):(Si(d),null);case 22:case 23:return qa(d),KR(),b=d.memoizedState!==null,u!==null?u.memoizedState!==null!==b&&(d.flags|=8192):b&&(d.flags|=8192),b?(m&536870912)!==0&&(d.flags&128)===0&&(Si(d),d.subtreeFlags&6&&(d.flags|=8192)):Si(d),m=d.updateQueue,m!==null&&uw(d,m.retryQueue),m=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==m&&(d.flags|=2048),u!==null&&G(Wp),null;case 24:return m=null,u!==null&&(m=u.memoizedState.cache),d.memoizedState.cache!==m&&(d.flags|=2048),Eu(or),Si(d),null;case 25:return null;case 30:return null}throw Error(i(156,d.tag))}function ire(u,d){switch(FR(d),d.tag){case 1:return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 3:return Eu(or),Fe(),u=d.flags,(u&65536)!==0&&(u&128)===0?(d.flags=u&-65537|128,d):null;case 26:case 27:case 5:return ct(d),null;case 31:if(d.memoizedState!==null){if(qa(d),d.alternate===null)throw Error(i(340));Op()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 13:if(qa(d),u=d.memoizedState,u!==null&&u.dehydrated!==null){if(d.alternate===null)throw Error(i(340));Op()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 19:return G(er),null;case 4:return Fe(),null;case 10:return Eu(d.type),null;case 22:case 23:return qa(d),KR(),u!==null&&G(Wp),u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 24:return Eu(or),null;case 25:return null;default:return null}}function I8(u,d){switch(FR(d),d.tag){case 3:Eu(or),Fe();break;case 26:case 27:case 5:ct(d);break;case 4:Fe();break;case 31:d.memoizedState!==null&&qa(d);break;case 13:qa(d);break;case 19:G(er);break;case 10:Eu(d.type);break;case 22:case 23:qa(d),KR(),u!==null&&G(Wp);break;case 24:Eu(or)}}function M_(u,d){try{var m=d.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var I=b.next;m=I;do{if((m.tag&u)===u){b=void 0;var U=m.create,K=m.inst;b=U(),K.destroy=b}m=m.next}while(m!==I)}}catch(ce){Kn(d,d.return,ce)}}function _d(u,d,m){try{var b=d.updateQueue,I=b!==null?b.lastEffect:null;if(I!==null){var U=I.next;b=U;do{if((b.tag&u)===u){var K=b.inst,ce=K.destroy;if(ce!==void 0){K.destroy=void 0,I=d;var De=m,ze=ce;try{ze()}catch(it){Kn(I,De,it)}}}b=b.next}while(b!==U)}}catch(it){Kn(d,d.return,it)}}function R8(u){var d=u.updateQueue;if(d!==null){var m=u.stateNode;try{xO(d,m)}catch(b){Kn(u,u.return,b)}}}function N8(u,d,m){m.props=$p(u.type,u.memoizedProps),m.state=u.memoizedState;try{m.componentWillUnmount()}catch(b){Kn(u,d,b)}}function F_(u,d){try{var m=u.ref;if(m!==null){switch(u.tag){case 26:case 27:case 5:var b=u.stateNode;break;case 30:b=u.stateNode;break;default:b=u.stateNode}typeof m=="function"?u.refCleanup=m(b):m.current=b}}catch(I){Kn(u,d,I)}}function _c(u,d){var m=u.ref,b=u.refCleanup;if(m!==null)if(typeof b=="function")try{b()}catch(I){Kn(u,d,I)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(I){Kn(u,d,I)}else m.current=null}function k8(u){var d=u.type,m=u.memoizedProps,b=u.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":m.autoFocus&&b.focus();break e;case"img":m.src?b.src=m.src:m.srcSet&&(b.srcset=m.srcSet)}}catch(I){Kn(u,u.return,I)}}function DN(u,d,m){try{var b=u.stateNode;Are(b,u.type,m,d),b[ye]=d}catch(I){Kn(u,u.return,I)}}function M8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&Sd(u.type)||u.tag===4}function CN(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||M8(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&Sd(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function IN(u,d,m){var b=u.tag;if(b===5||b===6)u=u.stateNode,d?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(u,d):(d=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,d.appendChild(u),m=m._reactRootContainer,m!=null||d.onclick!==null||(d.onclick=xl));else if(b!==4&&(b===27&&Sd(u.type)&&(m=u.stateNode,d=null),u=u.child,u!==null))for(IN(u,d,m),u=u.sibling;u!==null;)IN(u,d,m),u=u.sibling}function hw(u,d,m){var b=u.tag;if(b===5||b===6)u=u.stateNode,d?m.insertBefore(u,d):m.appendChild(u);else if(b!==4&&(b===27&&Sd(u.type)&&(m=u.stateNode),u=u.child,u!==null))for(hw(u,d,m),u=u.sibling;u!==null;)hw(u,d,m),u=u.sibling}function F8(u){var d=u.stateNode,m=u.memoizedProps;try{for(var b=u.type,I=d.attributes;I.length;)d.removeAttributeNode(I[0]);hs(d,b,m),d[de]=u,d[ye]=m}catch(U){Kn(u,u.return,U)}}var Cu=!1,ur=!1,RN=!1,U8=typeof WeakSet=="function"?WeakSet:Set,Wr=null;function rre(u,d){if(u=u.containerInfo,JN=kw,u=j5(u),ER(u)){if("selectionStart"in u)var m={start:u.selectionStart,end:u.selectionEnd};else e:{m=(m=u.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var I=b.anchorOffset,U=b.focusNode;b=b.focusOffset;try{m.nodeType,U.nodeType}catch{m=null;break e}var K=0,ce=-1,De=-1,ze=0,it=0,st=u,Ke=null;t:for(;;){for(var et;st!==m||I!==0&&st.nodeType!==3||(ce=K+I),st!==U||b!==0&&st.nodeType!==3||(De=K+b),st.nodeType===3&&(K+=st.nodeValue.length),(et=st.firstChild)!==null;)Ke=st,st=et;for(;;){if(st===u)break t;if(Ke===m&&++ze===I&&(ce=K),Ke===U&&++it===b&&(De=K),(et=st.nextSibling)!==null)break;st=Ke,Ke=st.parentNode}st=et}m=ce===-1||De===-1?null:{start:ce,end:De}}else m=null}m=m||{start:0,end:0}}else m=null;for(QN={focusedElem:u,selectionRange:m},kw=!1,Wr=d;Wr!==null;)if(d=Wr,u=d.child,(d.subtreeFlags&1028)!==0&&u!==null)u.return=d,Wr=u;else for(;Wr!==null;){switch(d=Wr,U=d.alternate,u=d.flags,d.tag){case 0:if((u&4)!==0&&(u=d.updateQueue,u=u!==null?u.events:null,u!==null))for(m=0;m<u.length;m++)I=u[m],I.ref.impl=I.nextImpl;break;case 11:case 15:break;case 1:if((u&1024)!==0&&U!==null){u=void 0,m=d,I=U.memoizedProps,U=U.memoizedState,b=m.stateNode;try{var kt=$p(m.type,I);u=b.getSnapshotBeforeUpdate(kt,U),b.__reactInternalSnapshotBeforeUpdate=u}catch(qt){Kn(m,m.return,qt)}}break;case 3:if((u&1024)!==0){if(u=d.stateNode.containerInfo,m=u.nodeType,m===9)tk(u);else if(m===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":tk(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=d.sibling,u!==null){u.return=d.return,Wr=u;break}Wr=d.return}}function P8(u,d,m){var b=m.flags;switch(m.tag){case 0:case 11:case 15:Ru(u,m),b&4&&M_(5,m);break;case 1:if(Ru(u,m),b&4)if(u=m.stateNode,d===null)try{u.componentDidMount()}catch(K){Kn(m,m.return,K)}else{var I=$p(m.type,d.memoizedProps);d=d.memoizedState;try{u.componentDidUpdate(I,d,u.__reactInternalSnapshotBeforeUpdate)}catch(K){Kn(m,m.return,K)}}b&64&&R8(m),b&512&&F_(m,m.return);break;case 3:if(Ru(u,m),b&64&&(u=m.updateQueue,u!==null)){if(d=null,m.child!==null)switch(m.child.tag){case 27:case 5:d=m.child.stateNode;break;case 1:d=m.child.stateNode}try{xO(u,d)}catch(K){Kn(m,m.return,K)}}break;case 27:d===null&&b&4&&F8(m);case 26:case 5:Ru(u,m),d===null&&b&4&&k8(m),b&512&&F_(m,m.return);break;case 12:Ru(u,m);break;case 31:Ru(u,m),b&4&&B8(u,m);break;case 13:Ru(u,m),b&4&&V8(u,m),b&64&&(u=m.memoizedState,u!==null&&(u=u.dehydrated,u!==null&&(m=fre.bind(null,m),Mre(u,m))));break;case 22:if(b=m.memoizedState!==null||Cu,!b){d=d!==null&&d.memoizedState!==null||ur,I=Cu;var U=ur;Cu=b,(ur=d)&&!U?Nu(u,m,(m.subtreeFlags&8772)!==0):Ru(u,m),Cu=I,ur=U}break;case 30:break;default:Ru(u,m)}}function L8(u){var d=u.alternate;d!==null&&(u.alternate=null,L8(d)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(d=u.stateNode,d!==null&&ht(d)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}var Fi=null,ya=!1;function Iu(u,d,m){for(m=m.child;m!==null;)O8(u,d,m),m=m.sibling}function O8(u,d,m){if(xe&&typeof xe.onCommitFiberUnmount=="function")try{xe.onCommitFiberUnmount(ke,m)}catch{}switch(m.tag){case 26:ur||_c(m,d),Iu(u,d,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:ur||_c(m,d);var b=Fi,I=ya;Sd(m.type)&&(Fi=m.stateNode,ya=!1),Iu(u,d,m),z_(m.stateNode),Fi=b,ya=I;break;case 5:ur||_c(m,d);case 6:if(b=Fi,I=ya,Fi=null,Iu(u,d,m),Fi=b,ya=I,Fi!==null)if(ya)try{(Fi.nodeType===9?Fi.body:Fi.nodeName==="HTML"?Fi.ownerDocument.body:Fi).removeChild(m.stateNode)}catch(U){Kn(m,d,U)}else try{Fi.removeChild(m.stateNode)}catch(U){Kn(m,d,U)}break;case 18:Fi!==null&&(ya?(u=Fi,R6(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,m.stateNode),X0(u)):R6(Fi,m.stateNode));break;case 4:b=Fi,I=ya,Fi=m.stateNode.containerInfo,ya=!0,Iu(u,d,m),Fi=b,ya=I;break;case 0:case 11:case 14:case 15:_d(2,m,d),ur||_d(4,m,d),Iu(u,d,m);break;case 1:ur||(_c(m,d),b=m.stateNode,typeof b.componentWillUnmount=="function"&&N8(m,d,b)),Iu(u,d,m);break;case 21:Iu(u,d,m);break;case 22:ur=(b=ur)||m.memoizedState!==null,Iu(u,d,m),ur=b;break;default:Iu(u,d,m)}}function B8(u,d){if(d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null))){u=u.dehydrated;try{X0(u)}catch(m){Kn(d,d.return,m)}}}function V8(u,d){if(d.memoizedState===null&&(u=d.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{X0(u)}catch(m){Kn(d,d.return,m)}}function sre(u){switch(u.tag){case 31:case 13:case 19:var d=u.stateNode;return d===null&&(d=u.stateNode=new U8),d;case 22:return u=u.stateNode,d=u._retryCache,d===null&&(d=u._retryCache=new U8),d;default:throw Error(i(435,u.tag))}}function dw(u,d){var m=sre(u);d.forEach(function(b){if(!m.has(b)){m.add(b);var I=pre.bind(null,u,b);b.then(I,I)}})}function va(u,d){var m=d.deletions;if(m!==null)for(var b=0;b<m.length;b++){var I=m[b],U=u,K=d,ce=K;e:for(;ce!==null;){switch(ce.tag){case 27:if(Sd(ce.type)){Fi=ce.stateNode,ya=!1;break e}break;case 5:Fi=ce.stateNode,ya=!1;break e;case 3:case 4:Fi=ce.stateNode.containerInfo,ya=!0;break e}ce=ce.return}if(Fi===null)throw Error(i(160));O8(U,K,I),Fi=null,ya=!1,U=I.alternate,U!==null&&(U.return=null),I.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)W8(d,u),d=d.sibling}var Sl=null;function W8(u,d){var m=u.alternate,b=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:va(d,u),_a(u),b&4&&(_d(3,u,u.return),M_(3,u),_d(5,u,u.return));break;case 1:va(d,u),_a(u),b&512&&(ur||m===null||_c(m,m.return)),b&64&&Cu&&(u=u.updateQueue,u!==null&&(b=u.callbacks,b!==null&&(m=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=m===null?b:m.concat(b))));break;case 26:var I=Sl;if(va(d,u),_a(u),b&512&&(ur||m===null||_c(m,m.return)),b&4){var U=m!==null?m.memoizedState:null;if(b=u.memoizedState,m===null)if(b===null)if(u.stateNode===null){e:{b=u.type,m=u.memoizedProps,I=I.ownerDocument||I;t:switch(b){case"title":U=I.getElementsByTagName("title")[0],(!U||U[qe]||U[de]||U.namespaceURI==="http://www.w3.org/2000/svg"||U.hasAttribute("itemprop"))&&(U=I.createElement(b),I.head.insertBefore(U,I.querySelector("head > title"))),hs(U,b,m),U[de]=u,Ft(U),b=U;break e;case"link":var K=W6("link","href",I).get(b+(m.href||""));if(K){for(var ce=0;ce<K.length;ce++)if(U=K[ce],U.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&U.getAttribute("rel")===(m.rel==null?null:m.rel)&&U.getAttribute("title")===(m.title==null?null:m.title)&&U.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){K.splice(ce,1);break t}}U=I.createElement(b),hs(U,b,m),I.head.appendChild(U);break;case"meta":if(K=W6("meta","content",I).get(b+(m.content||""))){for(ce=0;ce<K.length;ce++)if(U=K[ce],U.getAttribute("content")===(m.content==null?null:""+m.content)&&U.getAttribute("name")===(m.name==null?null:m.name)&&U.getAttribute("property")===(m.property==null?null:m.property)&&U.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&U.getAttribute("charset")===(m.charSet==null?null:m.charSet)){K.splice(ce,1);break t}}U=I.createElement(b),hs(U,b,m),I.head.appendChild(U);break;default:throw Error(i(468,b))}U[de]=u,Ft(U),b=U}u.stateNode=b}else H6(I,u.type,u.stateNode);else u.stateNode=V6(I,b,u.memoizedProps);else U!==b?(U===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):U.count--,b===null?H6(I,u.type,u.stateNode):V6(I,b,u.memoizedProps)):b===null&&u.stateNode!==null&&DN(u,u.memoizedProps,m.memoizedProps)}break;case 27:va(d,u),_a(u),b&512&&(ur||m===null||_c(m,m.return)),m!==null&&b&4&&DN(u,u.memoizedProps,m.memoizedProps);break;case 5:if(va(d,u),_a(u),b&512&&(ur||m===null||_c(m,m.return)),u.flags&32){I=u.stateNode;try{ma(I,"")}catch(kt){Kn(u,u.return,kt)}}b&4&&u.stateNode!=null&&(I=u.memoizedProps,DN(u,I,m!==null?m.memoizedProps:I)),b&1024&&(RN=!0);break;case 6:if(va(d,u),_a(u),b&4){if(u.stateNode===null)throw Error(i(162));b=u.memoizedProps,m=u.stateNode;try{m.nodeValue=b}catch(kt){Kn(u,u.return,kt)}}break;case 3:if(Cw=null,I=Sl,Sl=Sw(d.containerInfo),va(d,u),Sl=I,_a(u),b&4&&m!==null&&m.memoizedState.isDehydrated)try{X0(d.containerInfo)}catch(kt){Kn(u,u.return,kt)}RN&&(RN=!1,H8(u));break;case 4:b=Sl,Sl=Sw(u.stateNode.containerInfo),va(d,u),_a(u),Sl=b;break;case 12:va(d,u),_a(u);break;case 31:va(d,u),_a(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,dw(u,b)));break;case 13:va(d,u),_a(u),u.child.flags&8192&&u.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(pw=Ee()),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,dw(u,b)));break;case 22:I=u.memoizedState!==null;var De=m!==null&&m.memoizedState!==null,ze=Cu,it=ur;if(Cu=ze||I,ur=it||De,va(d,u),ur=it,Cu=ze,_a(u),b&8192)e:for(d=u.stateNode,d._visibility=I?d._visibility&-2:d._visibility|1,I&&(m===null||De||Cu||ur||jp(u)),m=null,d=u;;){if(d.tag===5||d.tag===26){if(m===null){De=m=d;try{if(U=De.stateNode,I)K=U.style,typeof K.setProperty=="function"?K.setProperty("display","none","important"):K.display="none";else{ce=De.stateNode;var st=De.memoizedProps.style,Ke=st!=null&&st.hasOwnProperty("display")?st.display:null;ce.style.display=Ke==null||typeof Ke=="boolean"?"":(""+Ke).trim()}}catch(kt){Kn(De,De.return,kt)}}}else if(d.tag===6){if(m===null){De=d;try{De.stateNode.nodeValue=I?"":De.memoizedProps}catch(kt){Kn(De,De.return,kt)}}}else if(d.tag===18){if(m===null){De=d;try{var et=De.stateNode;I?N6(et,!0):N6(De.stateNode,!1)}catch(kt){Kn(De,De.return,kt)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===u)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break e;for(;d.sibling===null;){if(d.return===null||d.return===u)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}b&4&&(b=u.updateQueue,b!==null&&(m=b.retryQueue,m!==null&&(b.retryQueue=null,dw(u,m))));break;case 19:va(d,u),_a(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,dw(u,b)));break;case 30:break;case 21:break;default:va(d,u),_a(u)}}function _a(u){var d=u.flags;if(d&2){try{for(var m,b=u.return;b!==null;){if(M8(b)){m=b;break}b=b.return}if(m==null)throw Error(i(160));switch(m.tag){case 27:var I=m.stateNode,U=CN(u);hw(u,U,I);break;case 5:var K=m.stateNode;m.flags&32&&(ma(K,""),m.flags&=-33);var ce=CN(u);hw(u,ce,K);break;case 3:case 4:var De=m.stateNode.containerInfo,ze=CN(u);IN(u,ze,De);break;default:throw Error(i(161))}}catch(it){Kn(u,u.return,it)}u.flags&=-3}d&4096&&(u.flags&=-4097)}function H8(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var d=u;H8(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),u=u.sibling}}function Ru(u,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)P8(u,d.alternate,d),d=d.sibling}function jp(u){for(u=u.child;u!==null;){var d=u;switch(d.tag){case 0:case 11:case 14:case 15:_d(4,d,d.return),jp(d);break;case 1:_c(d,d.return);var m=d.stateNode;typeof m.componentWillUnmount=="function"&&N8(d,d.return,m),jp(d);break;case 27:z_(d.stateNode);case 26:case 5:_c(d,d.return),jp(d);break;case 22:d.memoizedState===null&&jp(d);break;case 30:jp(d);break;default:jp(d)}u=u.sibling}}function Nu(u,d,m){for(m=m&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var b=d.alternate,I=u,U=d,K=U.flags;switch(U.tag){case 0:case 11:case 15:Nu(I,U,m),M_(4,U);break;case 1:if(Nu(I,U,m),b=U,I=b.stateNode,typeof I.componentDidMount=="function")try{I.componentDidMount()}catch(ze){Kn(b,b.return,ze)}if(b=U,I=b.updateQueue,I!==null){var ce=b.stateNode;try{var De=I.shared.hiddenCallbacks;if(De!==null)for(I.shared.hiddenCallbacks=null,I=0;I<De.length;I++)_O(De[I],ce)}catch(ze){Kn(b,b.return,ze)}}m&&K&64&&R8(U),F_(U,U.return);break;case 27:F8(U);case 26:case 5:Nu(I,U,m),m&&b===null&&K&4&&k8(U),F_(U,U.return);break;case 12:Nu(I,U,m);break;case 31:Nu(I,U,m),m&&K&4&&B8(I,U);break;case 13:Nu(I,U,m),m&&K&4&&V8(I,U);break;case 22:U.memoizedState===null&&Nu(I,U,m),F_(U,U.return);break;case 30:break;default:Nu(I,U,m)}d=d.sibling}}function NN(u,d){var m=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),u=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(u=d.memoizedState.cachePool.pool),u!==m&&(u!=null&&u.refCount++,m!=null&&x_(m))}function kN(u,d){u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&x_(u))}function Dl(u,d,m,b){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)z8(u,d,m,b),d=d.sibling}function z8(u,d,m,b){var I=d.flags;switch(d.tag){case 0:case 11:case 15:Dl(u,d,m,b),I&2048&&M_(9,d);break;case 1:Dl(u,d,m,b);break;case 3:Dl(u,d,m,b),I&2048&&(u=null,d.alternate!==null&&(u=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==u&&(d.refCount++,u!=null&&x_(u)));break;case 12:if(I&2048){Dl(u,d,m,b),u=d.stateNode;try{var U=d.memoizedProps,K=U.id,ce=U.onPostCommit;typeof ce=="function"&&ce(K,d.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(De){Kn(d,d.return,De)}}else Dl(u,d,m,b);break;case 31:Dl(u,d,m,b);break;case 13:Dl(u,d,m,b);break;case 23:break;case 22:U=d.stateNode,K=d.alternate,d.memoizedState!==null?U._visibility&2?Dl(u,d,m,b):U_(u,d):U._visibility&2?Dl(u,d,m,b):(U._visibility|=2,L0(u,d,m,b,(d.subtreeFlags&10256)!==0||!1)),I&2048&&NN(K,d);break;case 24:Dl(u,d,m,b),I&2048&&kN(d.alternate,d);break;default:Dl(u,d,m,b)}}function L0(u,d,m,b,I){for(I=I&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var U=u,K=d,ce=m,De=b,ze=K.flags;switch(K.tag){case 0:case 11:case 15:L0(U,K,ce,De,I),M_(8,K);break;case 23:break;case 22:var it=K.stateNode;K.memoizedState!==null?it._visibility&2?L0(U,K,ce,De,I):U_(U,K):(it._visibility|=2,L0(U,K,ce,De,I)),I&&ze&2048&&NN(K.alternate,K);break;case 24:L0(U,K,ce,De,I),I&&ze&2048&&kN(K.alternate,K);break;default:L0(U,K,ce,De,I)}d=d.sibling}}function U_(u,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var m=u,b=d,I=b.flags;switch(b.tag){case 22:U_(m,b),I&2048&&NN(b.alternate,b);break;case 24:U_(m,b),I&2048&&kN(b.alternate,b);break;default:U_(m,b)}d=d.sibling}}var P_=8192;function O0(u,d,m){if(u.subtreeFlags&P_)for(u=u.child;u!==null;)G8(u,d,m),u=u.sibling}function G8(u,d,m){switch(u.tag){case 26:O0(u,d,m),u.flags&P_&&u.memoizedState!==null&&qre(m,Sl,u.memoizedState,u.memoizedProps);break;case 5:O0(u,d,m);break;case 3:case 4:var b=Sl;Sl=Sw(u.stateNode.containerInfo),O0(u,d,m),Sl=b;break;case 22:u.memoizedState===null&&(b=u.alternate,b!==null&&b.memoizedState!==null?(b=P_,P_=16777216,O0(u,d,m),P_=b):O0(u,d,m));break;default:O0(u,d,m)}}function q8(u){var d=u.alternate;if(d!==null&&(u=d.child,u!==null)){d.child=null;do d=u.sibling,u.sibling=null,u=d;while(u!==null)}}function L_(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var b=d[m];Wr=b,j8(b,u)}q8(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)$8(u),u=u.sibling}function $8(u){switch(u.tag){case 0:case 11:case 15:L_(u),u.flags&2048&&_d(9,u,u.return);break;case 3:L_(u);break;case 12:L_(u);break;case 22:var d=u.stateNode;u.memoizedState!==null&&d._visibility&2&&(u.return===null||u.return.tag!==13)?(d._visibility&=-3,fw(u)):L_(u);break;default:L_(u)}}function fw(u){var d=u.deletions;if((u.flags&16)!==0){if(d!==null)for(var m=0;m<d.length;m++){var b=d[m];Wr=b,j8(b,u)}q8(u)}for(u=u.child;u!==null;){switch(d=u,d.tag){case 0:case 11:case 15:_d(8,d,d.return),fw(d);break;case 22:m=d.stateNode,m._visibility&2&&(m._visibility&=-3,fw(d));break;default:fw(d)}u=u.sibling}}function j8(u,d){for(;Wr!==null;){var m=Wr;switch(m.tag){case 0:case 11:case 15:_d(8,m,d);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var b=m.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:x_(m.memoizedState.cache)}if(b=m.child,b!==null)b.return=m,Wr=b;else e:for(m=u;Wr!==null;){b=Wr;var I=b.sibling,U=b.return;if(L8(b),b===m){Wr=null;break e}if(I!==null){I.return=U,Wr=I;break e}Wr=U}}}var are={getCacheForType:function(u){var d=cs(or),m=d.data.get(u);return m===void 0&&(m=u(),d.data.set(u,m)),m},cacheSignal:function(){return cs(or).controller.signal}},ore=typeof WeakMap=="function"?WeakMap:Map,Ln=0,mi=null,vn=null,xn=0,Xn=0,$a=null,xd=!1,B0=!1,MN=!1,ku=0,zi=0,bd=0,Xp=0,FN=0,ja=0,V0=0,O_=null,xa=null,UN=!1,pw=0,X8=0,gw=1/0,mw=null,Td=null,Sr=0,Ed=null,W0=null,Mu=0,PN=0,LN=null,K8=null,B_=0,ON=null;function Xa(){return(Ln&2)!==0&&xn!==0?xn&-xn:q.T!==null?GN():se()}function Y8(){if(ja===0)if((xn&536870912)===0||Sn){var u=jt;jt<<=1,(jt&3932160)===0&&(jt=262144),ja=u}else ja=536870912;return u=Ga.current,u!==null&&(u.flags|=32),ja}function ba(u,d,m){(u===mi&&(Xn===2||Xn===9)||u.cancelPendingCommit!==null)&&(H0(u,0),wd(u,xn,ja,!1)),ki(u,m),((Ln&2)===0||u!==mi)&&(u===mi&&((Ln&2)===0&&(Xp|=m),zi===4&&wd(u,xn,ja,!1)),xc(u))}function J8(u,d,m){if((Ln&6)!==0)throw Error(i(327));var b=!m&&(d&127)===0&&(d&u.expiredLanes)===0||Oe(u,d),I=b?ure(u,d):VN(u,d,!0),U=b;do{if(I===0){B0&&!b&&wd(u,d,0,!1);break}else{if(m=u.current.alternate,U&&!lre(m)){I=VN(u,d,!1),U=!1;continue}if(I===2){if(U=d,u.errorRecoveryDisabledLanes&U)var K=0;else K=u.pendingLanes&-536870913,K=K!==0?K:K&536870912?536870912:0;if(K!==0){d=K;e:{var ce=u;I=O_;var De=ce.current.memoizedState.isDehydrated;if(De&&(H0(ce,K).flags|=256),K=VN(ce,K,!1),K!==2){if(MN&&!De){ce.errorRecoveryDisabledLanes|=U,Xp|=U,I=4;break e}U=xa,xa=I,U!==null&&(xa===null?xa=U:xa.push.apply(xa,U))}I=K}if(U=!1,I!==2)continue}}if(I===1){H0(u,0),wd(u,d,0,!0);break}e:{switch(b=u,U=I,U){case 0:case 1:throw Error(i(345));case 4:if((d&4194048)!==d)break;case 6:wd(b,d,ja,!xd);break e;case 2:xa=null;break;case 3:case 5:break;default:throw Error(i(329))}if((d&62914560)===d&&(I=pw+300-Ee(),10<I)){if(wd(b,d,ja,!xd),Ae(b,0,!0)!==0)break e;Mu=d,b.timeoutHandle=C6(Q8.bind(null,b,m,xa,mw,UN,d,ja,Xp,V0,xd,U,"Throttled",-0,0),I);break e}Q8(b,m,xa,mw,UN,d,ja,Xp,V0,xd,U,null,-0,0)}}break}while(!0);xc(u)}function Q8(u,d,m,b,I,U,K,ce,De,ze,it,st,Ke,et){if(u.timeoutHandle=-1,st=d.subtreeFlags,st&8192||(st&16785408)===16785408){st={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xl},G8(d,U,st);var kt=(U&62914560)===U?pw-Ee():(U&4194048)===U?X8-Ee():0;if(kt=$re(st,kt),kt!==null){Mu=U,u.cancelPendingCommit=kt(a6.bind(null,u,d,U,m,b,I,K,ce,De,it,st,null,Ke,et)),wd(u,U,K,!ze);return}}a6(u,d,U,m,b,I,K,ce,De)}function lre(u){for(var d=u;;){var m=d.tag;if((m===0||m===11||m===15)&&d.flags&16384&&(m=d.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var b=0;b<m.length;b++){var I=m[b],U=I.getSnapshot;I=I.value;try{if(!Ha(U(),I))return!1}catch{return!1}}if(m=d.child,d.subtreeFlags&16384&&m!==null)m.return=d,d=m;else{if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function wd(u,d,m,b){d&=~FN,d&=~Xp,u.suspendedLanes|=d,u.pingedLanes&=~d,b&&(u.warmLanes|=d),b=u.expirationTimes;for(var I=d;0<I;){var U=31-Je(I),K=1<<U;b[U]=-1,I&=~K}m!==0&&Br(u,m,d)}function yw(){return(Ln&6)===0?(V_(0),!1):!0}function BN(){if(vn!==null){if(Xn===0)var u=vn.return;else u=vn,Tu=Bp=null,tN(u),k0=null,T_=0,u=vn;for(;u!==null;)I8(u.alternate,u),u=u.return;vn=null}}function H0(u,d){var m=u.timeoutHandle;m!==-1&&(u.timeoutHandle=-1,Cre(m)),m=u.cancelPendingCommit,m!==null&&(u.cancelPendingCommit=null,m()),Mu=0,BN(),mi=u,vn=m=xu(u.current,null),xn=d,Xn=0,$a=null,xd=!1,B0=Oe(u,d),MN=!1,V0=ja=FN=Xp=bd=zi=0,xa=O_=null,UN=!1,(d&8)!==0&&(d|=d&32);var b=u.entangledLanes;if(b!==0)for(u=u.entanglements,b&=d;0<b;){var I=31-Je(b),U=1<<I;d|=u[I],b&=~U}return ku=d,OE(),m}function Z8(u,d){cn=null,q.H=R_,d===N0||d===$E?(d=gO(),Xn=3):d===zR?(d=gO(),Xn=4):Xn=d===yN?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,$a=d,vn===null&&(zi=1,aw(u,Mo(d,u.current)))}function e6(){var u=Ga.current;return u===null?!0:(xn&4194048)===xn?Lo===null:(xn&62914560)===xn||(xn&536870912)!==0?u===Lo:!1}function t6(){var u=q.H;return q.H=R_,u===null?R_:u}function n6(){var u=q.A;return q.A=are,u}function vw(){zi=4,xd||(xn&4194048)!==xn&&Ga.current!==null||(B0=!0),(bd&134217727)===0&&(Xp&134217727)===0||mi===null||wd(mi,xn,ja,!1)}function VN(u,d,m){var b=Ln;Ln|=2;var I=t6(),U=n6();(mi!==u||xn!==d)&&(mw=null,H0(u,d)),d=!1;var K=zi;e:do try{if(Xn!==0&&vn!==null){var ce=vn,De=$a;switch(Xn){case 8:BN(),K=6;break e;case 3:case 2:case 9:case 6:Ga.current===null&&(d=!0);var ze=Xn;if(Xn=0,$a=null,z0(u,ce,De,ze),m&&B0){K=0;break e}break;default:ze=Xn,Xn=0,$a=null,z0(u,ce,De,ze)}}cre(),K=zi;break}catch(it){Z8(u,it)}while(!0);return d&&u.shellSuspendCounter++,Tu=Bp=null,Ln=b,q.H=I,q.A=U,vn===null&&(mi=null,xn=0,OE()),K}function cre(){for(;vn!==null;)i6(vn)}function ure(u,d){var m=Ln;Ln|=2;var b=t6(),I=n6();mi!==u||xn!==d?(mw=null,gw=Ee()+500,H0(u,d)):B0=Oe(u,d);e:do try{if(Xn!==0&&vn!==null){d=vn;var U=$a;t:switch(Xn){case 1:Xn=0,$a=null,z0(u,d,U,1);break;case 2:case 9:if(fO(U)){Xn=0,$a=null,r6(d);break}d=function(){Xn!==2&&Xn!==9||mi!==u||(Xn=7),xc(u)},U.then(d,d);break e;case 3:Xn=7;break e;case 4:Xn=5;break e;case 7:fO(U)?(Xn=0,$a=null,r6(d)):(Xn=0,$a=null,z0(u,d,U,7));break;case 5:var K=null;switch(vn.tag){case 26:K=vn.memoizedState;case 5:case 27:var ce=vn;if(K?z6(K):ce.stateNode.complete){Xn=0,$a=null;var De=ce.sibling;if(De!==null)vn=De;else{var ze=ce.return;ze!==null?(vn=ze,_w(ze)):vn=null}break t}}Xn=0,$a=null,z0(u,d,U,5);break;case 6:Xn=0,$a=null,z0(u,d,U,6);break;case 8:BN(),zi=6;break e;default:throw Error(i(462))}}hre();break}catch(it){Z8(u,it)}while(!0);return Tu=Bp=null,q.H=b,q.A=I,Ln=m,vn!==null?0:(mi=null,xn=0,OE(),zi)}function hre(){for(;vn!==null&&!Ce();)i6(vn)}function i6(u){var d=D8(u.alternate,u,ku);u.memoizedProps=u.pendingProps,d===null?_w(u):vn=d}function r6(u){var d=u,m=d.alternate;switch(d.tag){case 15:case 0:d=b8(m,d,d.pendingProps,d.type,void 0,xn);break;case 11:d=b8(m,d,d.pendingProps,d.type.render,d.ref,xn);break;case 5:tN(d);default:I8(m,d),d=vn=nO(d,ku),d=D8(m,d,ku)}u.memoizedProps=u.pendingProps,d===null?_w(u):vn=d}function z0(u,d,m,b){Tu=Bp=null,tN(d),k0=null,T_=0;var I=d.return;try{if(Zie(u,I,d,m,xn)){zi=1,aw(u,Mo(m,u.current)),vn=null;return}}catch(U){if(I!==null)throw vn=I,U;zi=1,aw(u,Mo(m,u.current)),vn=null;return}d.flags&32768?(Sn||b===1?u=!0:B0||(xn&536870912)!==0?u=!1:(xd=u=!0,(b===2||b===9||b===3||b===6)&&(b=Ga.current,b!==null&&b.tag===13&&(b.flags|=16384))),s6(d,u)):_w(d)}function _w(u){var d=u;do{if((d.flags&32768)!==0){s6(d,xd);return}u=d.return;var m=nre(d.alternate,d,ku);if(m!==null){vn=m;return}if(d=d.sibling,d!==null){vn=d;return}vn=d=u}while(d!==null);zi===0&&(zi=5)}function s6(u,d){do{var m=ire(u.alternate,u);if(m!==null){m.flags&=32767,vn=m;return}if(m=u.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!d&&(u=u.sibling,u!==null)){vn=u;return}vn=u=m}while(u!==null);zi=6,vn=null}function a6(u,d,m,b,I,U,K,ce,De){u.cancelPendingCommit=null;do xw();while(Sr!==0);if((Ln&6)!==0)throw Error(i(327));if(d!==null){if(d===u.current)throw Error(i(177));if(U=d.lanes|d.childLanes,U|=CR,ss(u,m,U,K,ce,De),u===mi&&(vn=mi=null,xn=0),W0=d,Ed=u,Mu=m,PN=U,LN=I,K8=b,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(u.callbackNode=null,u.callbackPriority=0,gre(bt,function(){return h6(),null})):(u.callbackNode=null,u.callbackPriority=0),b=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||b){b=q.T,q.T=null,I=X.p,X.p=2,K=Ln,Ln|=4;try{rre(u,d,m)}finally{Ln=K,X.p=I,q.T=b}}Sr=1,o6(),l6(),c6()}}function o6(){if(Sr===1){Sr=0;var u=Ed,d=W0,m=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||m){m=q.T,q.T=null;var b=X.p;X.p=2;var I=Ln;Ln|=4;try{W8(d,u);var U=QN,K=j5(u.containerInfo),ce=U.focusedElem,De=U.selectionRange;if(K!==ce&&ce&&ce.ownerDocument&&$5(ce.ownerDocument.documentElement,ce)){if(De!==null&&ER(ce)){var ze=De.start,it=De.end;if(it===void 0&&(it=ze),"selectionStart"in ce)ce.selectionStart=ze,ce.selectionEnd=Math.min(it,ce.value.length);else{var st=ce.ownerDocument||document,Ke=st&&st.defaultView||window;if(Ke.getSelection){var et=Ke.getSelection(),kt=ce.textContent.length,qt=Math.min(De.start,kt),oi=De.end===void 0?qt:Math.min(De.end,kt);!et.extend&&qt>oi&&(K=oi,oi=qt,qt=K);var Ue=q5(ce,qt),Ne=q5(ce,oi);if(Ue&&Ne&&(et.rangeCount!==1||et.anchorNode!==Ue.node||et.anchorOffset!==Ue.offset||et.focusNode!==Ne.node||et.focusOffset!==Ne.offset)){var We=st.createRange();We.setStart(Ue.node,Ue.offset),et.removeAllRanges(),qt>oi?(et.addRange(We),et.extend(Ne.node,Ne.offset)):(We.setEnd(Ne.node,Ne.offset),et.addRange(We))}}}}for(st=[],et=ce;et=et.parentNode;)et.nodeType===1&&st.push({element:et,left:et.scrollLeft,top:et.scrollTop});for(typeof ce.focus=="function"&&ce.focus(),ce=0;ce<st.length;ce++){var rt=st[ce];rt.element.scrollLeft=rt.left,rt.element.scrollTop=rt.top}}kw=!!JN,QN=JN=null}finally{Ln=I,X.p=b,q.T=m}}u.current=d,Sr=2}}function l6(){if(Sr===2){Sr=0;var u=Ed,d=W0,m=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||m){m=q.T,q.T=null;var b=X.p;X.p=2;var I=Ln;Ln|=4;try{P8(u,d.alternate,d)}finally{Ln=I,X.p=b,q.T=m}}Sr=3}}function c6(){if(Sr===4||Sr===3){Sr=0,be();var u=Ed,d=W0,m=Mu,b=K8;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?Sr=5:(Sr=0,W0=Ed=null,u6(u,u.pendingLanes));var I=u.pendingLanes;if(I===0&&(Td=null),Ar(m),d=d.stateNode,xe&&typeof xe.onCommitFiberRoot=="function")try{xe.onCommitFiberRoot(ke,d,void 0,(d.current.flags&128)===128)}catch{}if(b!==null){d=q.T,I=X.p,X.p=2,q.T=null;try{for(var U=u.onRecoverableError,K=0;K<b.length;K++){var ce=b[K];U(ce.value,{componentStack:ce.stack})}}finally{q.T=d,X.p=I}}(Mu&3)!==0&&xw(),xc(u),I=u.pendingLanes,(m&261930)!==0&&(I&42)!==0?u===ON?B_++:(B_=0,ON=u):B_=0,V_(0)}}function u6(u,d){(u.pooledCacheLanes&=d)===0&&(d=u.pooledCache,d!=null&&(u.pooledCache=null,x_(d)))}function xw(){return o6(),l6(),c6(),h6()}function h6(){if(Sr!==5)return!1;var u=Ed,d=PN;PN=0;var m=Ar(Mu),b=q.T,I=X.p;try{X.p=32>m?32:m,q.T=null,m=LN,LN=null;var U=Ed,K=Mu;if(Sr=0,W0=Ed=null,Mu=0,(Ln&6)!==0)throw Error(i(331));var ce=Ln;if(Ln|=4,$8(U.current),z8(U,U.current,K,m),Ln=ce,V_(0,!1),xe&&typeof xe.onPostCommitFiberRoot=="function")try{xe.onPostCommitFiberRoot(ke,U)}catch{}return!0}finally{X.p=I,q.T=b,u6(u,d)}}function d6(u,d,m){d=Mo(m,d),d=mN(u.stateNode,d,2),u=md(u,d,2),u!==null&&(ki(u,2),xc(u))}function Kn(u,d,m){if(u.tag===3)d6(u,u,m);else for(;d!==null;){if(d.tag===3){d6(d,u,m);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Td===null||!Td.has(b))){u=Mo(m,u),m=f8(2),b=md(d,m,2),b!==null&&(p8(m,b,d,u),ki(b,2),xc(b));break}}d=d.return}}function WN(u,d,m){var b=u.pingCache;if(b===null){b=u.pingCache=new ore;var I=new Set;b.set(d,I)}else I=b.get(d),I===void 0&&(I=new Set,b.set(d,I));I.has(m)||(MN=!0,I.add(m),u=dre.bind(null,u,d,m),d.then(u,u))}function dre(u,d,m){var b=u.pingCache;b!==null&&b.delete(d),u.pingedLanes|=u.suspendedLanes&m,u.warmLanes&=~m,mi===u&&(xn&m)===m&&(zi===4||zi===3&&(xn&62914560)===xn&&300>Ee()-pw?(Ln&2)===0&&H0(u,0):FN|=m,V0===xn&&(V0=0)),xc(u)}function f6(u,d){d===0&&(d=Ht()),u=Pp(u,d),u!==null&&(ki(u,d),xc(u))}function fre(u){var d=u.memoizedState,m=0;d!==null&&(m=d.retryLane),f6(u,m)}function pre(u,d){var m=0;switch(u.tag){case 31:case 13:var b=u.stateNode,I=u.memoizedState;I!==null&&(m=I.retryLane);break;case 19:b=u.stateNode;break;case 22:b=u.stateNode._retryCache;break;default:throw Error(i(314))}b!==null&&b.delete(d),f6(u,m)}function gre(u,d){return Le(u,d)}var bw=null,G0=null,HN=!1,Tw=!1,zN=!1,Ad=0;function xc(u){u!==G0&&u.next===null&&(G0===null?bw=G0=u:G0=G0.next=u),Tw=!0,HN||(HN=!0,yre())}function V_(u,d){if(!zN&&Tw){zN=!0;do for(var m=!1,b=bw;b!==null;){if(u!==0){var I=b.pendingLanes;if(I===0)var U=0;else{var K=b.suspendedLanes,ce=b.pingedLanes;U=(1<<31-Je(42|u)+1)-1,U&=I&~(K&~ce),U=U&201326741?U&201326741|1:U?U|2:0}U!==0&&(m=!0,y6(b,U))}else U=xn,U=Ae(b,b===mi?U:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(U&3)===0||Oe(b,U)||(m=!0,y6(b,U));b=b.next}while(m);zN=!1}}function mre(){p6()}function p6(){Tw=HN=!1;var u=0;Ad!==0&&Dre()&&(u=Ad);for(var d=Ee(),m=null,b=bw;b!==null;){var I=b.next,U=g6(b,d);U===0?(b.next=null,m===null?bw=I:m.next=I,I===null&&(G0=m)):(m=b,(u!==0||(U&3)!==0)&&(Tw=!0)),b=I}Sr!==0&&Sr!==5||V_(u),Ad!==0&&(Ad=0)}function g6(u,d){for(var m=u.suspendedLanes,b=u.pingedLanes,I=u.expirationTimes,U=u.pendingLanes&-62914561;0<U;){var K=31-Je(U),ce=1<<K,De=I[K];De===-1?((ce&m)===0||(ce&b)!==0)&&(I[K]=ft(ce,d)):De<=d&&(u.expiredLanes|=ce),U&=~ce}if(d=mi,m=xn,m=Ae(u,u===d?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b=u.callbackNode,m===0||u===d&&(Xn===2||Xn===9)||u.cancelPendingCommit!==null)return b!==null&&b!==null&&$e(b),u.callbackNode=null,u.callbackPriority=0;if((m&3)===0||Oe(u,m)){if(d=m&-m,d===u.callbackPriority)return d;switch(b!==null&&$e(b),Ar(m)){case 2:case 8:m=dt;break;case 32:m=bt;break;case 268435456:m=Nt;break;default:m=bt}return b=m6.bind(null,u),m=Le(m,b),u.callbackPriority=d,u.callbackNode=m,d}return b!==null&&b!==null&&$e(b),u.callbackPriority=2,u.callbackNode=null,2}function m6(u,d){if(Sr!==0&&Sr!==5)return u.callbackNode=null,u.callbackPriority=0,null;var m=u.callbackNode;if(xw()&&u.callbackNode!==m)return null;var b=xn;return b=Ae(u,u===mi?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b===0?null:(J8(u,b,d),g6(u,Ee()),u.callbackNode!=null&&u.callbackNode===m?m6.bind(null,u):null)}function y6(u,d){if(xw())return null;J8(u,d,!0)}function yre(){Ire(function(){(Ln&6)!==0?Le(Xe,mre):p6()})}function GN(){if(Ad===0){var u=I0;u===0&&(u=Kt,Kt<<=1,(Kt&261888)===0&&(Kt=256)),Ad=u}return Ad}function v6(u){return u==null||typeof u=="symbol"||typeof u=="boolean"?null:typeof u=="function"?u:p0(""+u)}function _6(u,d){var m=d.ownerDocument.createElement("input");return m.name=d.name,m.value=d.value,u.id&&m.setAttribute("form",u.id),d.parentNode.insertBefore(m,d),u=new FormData(u),m.parentNode.removeChild(m),u}function vre(u,d,m,b,I){if(d==="submit"&&m&&m.stateNode===I){var U=v6((I[ye]||null).action),K=b.submitter;K&&(d=(d=K[ye]||null)?v6(d.formAction):K.getAttribute("formAction"),d!==null&&(U=d,K=null));var ce=new fc("action","action",null,b,I);u.push({event:ce,listeners:[{instance:null,listener:function(){if(b.defaultPrevented){if(Ad!==0){var De=K?_6(I,K):new FormData(I);uN(m,{pending:!0,data:De,method:I.method,action:U},null,De)}}else typeof U=="function"&&(ce.preventDefault(),De=K?_6(I,K):new FormData(I),uN(m,{pending:!0,data:De,method:I.method,action:U},U,De))},currentTarget:I}]})}}for(var qN=0;qN<DR.length;qN++){var $N=DR[qN],_re=$N.toLowerCase(),xre=$N[0].toUpperCase()+$N.slice(1);Al(_re,"on"+xre)}Al(Y5,"onAnimationEnd"),Al(J5,"onAnimationIteration"),Al(Q5,"onAnimationStart"),Al("dblclick","onDoubleClick"),Al("focusin","onFocus"),Al("focusout","onBlur"),Al(Pie,"onTransitionRun"),Al(Lie,"onTransitionStart"),Al(Oie,"onTransitionCancel"),Al(Z5,"onTransitionEnd"),Ns("onMouseEnter",["mouseout","mouseover"]),Ns("onMouseLeave",["mouseout","mouseover"]),Ns("onPointerEnter",["pointerout","pointerover"]),Ns("onPointerLeave",["pointerout","pointerover"]),gi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gi("onBeforeInput",["compositionend","keypress","textInput","paste"]),gi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var W_="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(" "),bre=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(W_));function x6(u,d){d=(d&4)!==0;for(var m=0;m<u.length;m++){var b=u[m],I=b.event;b=b.listeners;e:{var U=void 0;if(d)for(var K=b.length-1;0<=K;K--){var ce=b[K],De=ce.instance,ze=ce.currentTarget;if(ce=ce.listener,De!==U&&I.isPropagationStopped())break e;U=ce,I.currentTarget=ze;try{U(I)}catch(it){LE(it)}I.currentTarget=null,U=De}else for(K=0;K<b.length;K++){if(ce=b[K],De=ce.instance,ze=ce.currentTarget,ce=ce.listener,De!==U&&I.isPropagationStopped())break e;U=ce,I.currentTarget=ze;try{U(I)}catch(it){LE(it)}I.currentTarget=null,U=De}}}}function _n(u,d){var m=d[Ve];m===void 0&&(m=d[Ve]=new Set);var b=u+"__bubble";m.has(b)||(b6(d,u,2,!1),m.add(b))}function jN(u,d,m){var b=0;d&&(b|=4),b6(m,u,b,d)}var Ew="_reactListening"+Math.random().toString(36).slice(2);function XN(u){if(!u[Ew]){u[Ew]=!0,qn.forEach(function(m){m!=="selectionchange"&&(bre.has(m)||jN(m,!1,u),jN(m,!0,u))});var d=u.nodeType===9?u:u.ownerDocument;d===null||d[Ew]||(d[Ew]=!0,jN("selectionchange",!1,d))}}function b6(u,d,m,b){switch(Y6(d)){case 2:var I=Kre;break;case 8:I=Yre;break;default:I=ck}m=I.bind(null,d,m,u),I=void 0,!Cp||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(I=!0),b?I!==void 0?u.addEventListener(d,m,{capture:!0,passive:I}):u.addEventListener(d,m,!0):I!==void 0?u.addEventListener(d,m,{passive:I}):u.addEventListener(d,m,!1)}function KN(u,d,m,b,I){var U=b;if((d&1)===0&&(d&2)===0&&b!==null)e:for(;;){if(b===null)return;var K=b.tag;if(K===3||K===4){var ce=b.stateNode.containerInfo;if(ce===I)break;if(K===4)for(K=b.return;K!==null;){var De=K.tag;if((De===3||De===4)&&K.stateNode.containerInfo===I)return;K=K.return}for(;ce!==null;){if(K=yt(ce),K===null)return;if(De=K.tag,De===5||De===6||De===26||De===27){b=U=K;continue e}ce=ce.parentNode}}b=b.return}ad(function(){var ze=U,it=Io(m),st=[];e:{var Ke=eO.get(u);if(Ke!==void 0){var et=fc,kt=u;switch(u){case"keypress":if(Rp(m)===0)break e;case"keydown":case"keyup":et=FE;break;case"focusin":kt="focus",et=kp;break;case"focusout":kt="blur",et=kp;break;case"beforeblur":case"afterblur":et=kp;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":et=d_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":et=AE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":et=z;break;case Y5:case J5:case Q5:et=DE;break;case Z5:et=pe;break;case"scroll":case"scrollend":et=h_;break;case"wheel":et=Qe;break;case"copy":case"cut":case"paste":et=CE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":et=_u;break;case"toggle":case"beforetoggle":et=ln}var qt=(d&4)!==0,oi=!qt&&(u==="scroll"||u==="scrollend"),Ue=qt?Ke!==null?Ke+"Capture":null:Ke;qt=[];for(var Ne=ze,We;Ne!==null;){var rt=Ne;if(We=rt.stateNode,rt=rt.tag,rt!==5&&rt!==26&&rt!==27||We===null||Ue===null||(rt=bl(Ne,Ue),rt!=null&&qt.push(H_(Ne,rt,We))),oi)break;Ne=Ne.return}0<qt.length&&(Ke=new et(Ke,kt,null,m,it),st.push({event:Ke,listeners:qt}))}}if((d&7)===0){e:{if(Ke=u==="mouseover"||u==="pointerover",et=u==="mouseout"||u==="pointerout",Ke&&m!==l_&&(kt=m.relatedTarget||m.fromElement)&&(yt(kt)||kt[ve]))break e;if((et||Ke)&&(Ke=it.window===it?it:(Ke=it.ownerDocument)?Ke.defaultView||Ke.parentWindow:window,et?(kt=m.relatedTarget||m.toElement,et=ze,kt=kt?yt(kt):null,kt!==null&&(oi=s(kt),qt=kt.tag,kt!==oi||qt!==5&&qt!==27&&qt!==6)&&(kt=null)):(et=null,kt=ze),et!==kt)){if(qt=d_,rt="onMouseLeave",Ue="onMouseEnter",Ne="mouse",(u==="pointerout"||u==="pointerover")&&(qt=_u,rt="onPointerLeave",Ue="onPointerEnter",Ne="pointer"),oi=et==null?Ke:ut(et),We=kt==null?Ke:ut(kt),Ke=new qt(rt,Ne+"leave",et,m,it),Ke.target=oi,Ke.relatedTarget=We,rt=null,yt(it)===ze&&(qt=new qt(Ue,Ne+"enter",kt,m,it),qt.target=We,qt.relatedTarget=oi,rt=qt),oi=rt,et&&kt)t:{for(qt=Tre,Ue=et,Ne=kt,We=0,rt=Ue;rt;rt=qt(rt))We++;rt=0;for(var Wt=Ne;Wt;Wt=qt(Wt))rt++;for(;0<We-rt;)Ue=qt(Ue),We--;for(;0<rt-We;)Ne=qt(Ne),rt--;for(;We--;){if(Ue===Ne||Ne!==null&&Ue===Ne.alternate){qt=Ue;break t}Ue=qt(Ue),Ne=qt(Ne)}qt=null}else qt=null;et!==null&&T6(st,Ke,et,qt,!1),kt!==null&&oi!==null&&T6(st,oi,kt,qt,!0)}}e:{if(Ke=ze?ut(ze):window,et=Ke.nodeName&&Ke.nodeName.toLowerCase(),et==="select"||et==="input"&&Ke.type==="file")var Nn=B5;else if(L5(Ke))if(V5)Nn=Mie;else{Nn=Nie;var Bt=Rie}else et=Ke.nodeName,!et||et.toLowerCase()!=="input"||Ke.type!=="checkbox"&&Ke.type!=="radio"?ze&&f0(ze.elementType)&&(Nn=B5):Nn=kie;if(Nn&&(Nn=Nn(u,ze))){O5(st,Nn,m,it);break e}Bt&&Bt(u,Ke,ze),u==="focusout"&&ze&&Ke.type==="number"&&ze.memoizedProps.value!=null&&s_(Ke,"number",Ke.value)}switch(Bt=ze?ut(ze):window,u){case"focusin":(L5(Bt)||Bt.contentEditable==="true")&&(b0=Bt,wR=ze,y_=null);break;case"focusout":y_=wR=b0=null;break;case"mousedown":AR=!0;break;case"contextmenu":case"mouseup":case"dragend":AR=!1,X5(st,m,it);break;case"selectionchange":if(Uie)break;case"keydown":case"keyup":X5(st,m,it)}var hn;if(Pn)e:{switch(u){case"compositionstart":var bn="onCompositionStart";break e;case"compositionend":bn="onCompositionEnd";break e;case"compositionupdate":bn="onCompositionUpdate";break e}bn=void 0}else x0?Mp(u,m)&&(bn="onCompositionEnd"):u==="keydown"&&m.keyCode===229&&(bn="onCompositionStart");bn&&(mc&&m.locale!=="ko"&&(x0||bn!=="onCompositionStart"?bn==="onCompositionEnd"&&x0&&(hn=u_()):(dc=it,c_="value"in dc?dc.value:dc.textContent,x0=!0)),Bt=ww(ze,bn),0<Bt.length&&(bn=new gc(bn,u,null,m,it),st.push({event:bn,listeners:Bt}),hn?bn.data=hn:(hn=_0(m),hn!==null&&(bn.data=hn)))),(hn=No?Sie(u,m):Die(u,m))&&(bn=ww(ze,"onBeforeInput"),0<bn.length&&(Bt=new gc("onBeforeInput","beforeinput",null,m,it),st.push({event:Bt,listeners:bn}),Bt.data=hn)),vre(st,u,ze,m,it)}x6(st,d)})}function H_(u,d,m){return{instance:u,listener:d,currentTarget:m}}function ww(u,d){for(var m=d+"Capture",b=[];u!==null;){var I=u,U=I.stateNode;if(I=I.tag,I!==5&&I!==26&&I!==27||U===null||(I=bl(u,m),I!=null&&b.unshift(H_(u,I,U)),I=bl(u,d),I!=null&&b.push(H_(u,I,U))),u.tag===3)return b;u=u.return}return[]}function Tre(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5&&u.tag!==27);return u||null}function T6(u,d,m,b,I){for(var U=d._reactName,K=[];m!==null&&m!==b;){var ce=m,De=ce.alternate,ze=ce.stateNode;if(ce=ce.tag,De!==null&&De===b)break;ce!==5&&ce!==26&&ce!==27||ze===null||(De=ze,I?(ze=bl(m,U),ze!=null&&K.unshift(H_(m,ze,De))):I||(ze=bl(m,U),ze!=null&&K.push(H_(m,ze,De)))),m=m.return}K.length!==0&&u.push({event:d,listeners:K})}var Ere=/\r\n?/g,wre=/\u0000|\uFFFD/g;function E6(u){return(typeof u=="string"?u:""+u).replace(Ere,`
`).replace(wre,"")}function w6(u,d){return d=E6(d),E6(u)===d}function ai(u,d,m,b,I,U){switch(m){case"children":typeof b=="string"?d==="body"||d==="textarea"&&b===""||ma(u,b):(typeof b=="number"||typeof b=="bigint")&&d!=="body"&&ma(u,""+b);break;case"className":Wa(u,"class",b);break;case"tabIndex":Wa(u,"tabindex",b);break;case"dir":case"role":case"viewBox":case"width":case"height":Wa(u,m,b);break;case"style":o_(u,b,U);break;case"data":if(d!=="object"){Wa(u,"data",b);break}case"src":case"href":if(b===""&&(d!=="a"||m!=="href")){u.removeAttribute(m);break}if(b==null||typeof b=="function"||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(m);break}b=p0(""+b),u.setAttribute(m,b);break;case"action":case"formAction":if(typeof b=="function"){u.setAttribute(m,"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 U=="function"&&(m==="formAction"?(d!=="input"&&ai(u,d,"name",I.name,I,null),ai(u,d,"formEncType",I.formEncType,I,null),ai(u,d,"formMethod",I.formMethod,I,null),ai(u,d,"formTarget",I.formTarget,I,null)):(ai(u,d,"encType",I.encType,I,null),ai(u,d,"method",I.method,I,null),ai(u,d,"target",I.target,I,null)));if(b==null||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(m);break}b=p0(""+b),u.setAttribute(m,b);break;case"onClick":b!=null&&(u.onclick=xl);break;case"onScroll":b!=null&&_n("scroll",u);break;case"onScrollEnd":b!=null&&_n("scrollend",u);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(i(61));if(m=b.__html,m!=null){if(I.children!=null)throw Error(i(60));u.innerHTML=m}}break;case"multiple":u.multiple=b&&typeof b!="function"&&typeof b!="symbol";break;case"muted":u.muted=b&&typeof b!="function"&&typeof b!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(b==null||typeof b=="function"||typeof b=="boolean"||typeof b=="symbol"){u.removeAttribute("xlink:href");break}m=p0(""+b),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(m,""+b):u.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":b&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(m,""):u.removeAttribute(m);break;case"capture":case"download":b===!0?u.setAttribute(m,""):b!==!1&&b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(m,b):u.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":b!=null&&typeof b!="function"&&typeof b!="symbol"&&!isNaN(b)&&1<=b?u.setAttribute(m,b):u.removeAttribute(m);break;case"rowSpan":case"start":b==null||typeof b=="function"||typeof b=="symbol"||isNaN(b)?u.removeAttribute(m):u.setAttribute(m,b);break;case"popover":_n("beforetoggle",u),_n("toggle",u),ks(u,"popover",b);break;case"xlinkActuate":ar(u,"http://www.w3.org/1999/xlink","xlink:actuate",b);break;case"xlinkArcrole":ar(u,"http://www.w3.org/1999/xlink","xlink:arcrole",b);break;case"xlinkRole":ar(u,"http://www.w3.org/1999/xlink","xlink:role",b);break;case"xlinkShow":ar(u,"http://www.w3.org/1999/xlink","xlink:show",b);break;case"xlinkTitle":ar(u,"http://www.w3.org/1999/xlink","xlink:title",b);break;case"xlinkType":ar(u,"http://www.w3.org/1999/xlink","xlink:type",b);break;case"xmlBase":ar(u,"http://www.w3.org/XML/1998/namespace","xml:base",b);break;case"xmlLang":ar(u,"http://www.w3.org/XML/1998/namespace","xml:lang",b);break;case"xmlSpace":ar(u,"http://www.w3.org/XML/1998/namespace","xml:space",b);break;case"is":ks(u,"is",b);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=wE.get(m)||m,ks(u,m,b))}}function YN(u,d,m,b,I,U){switch(m){case"style":o_(u,b,U);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(i(61));if(m=b.__html,m!=null){if(I.children!=null)throw Error(i(60));u.innerHTML=m}}break;case"children":typeof b=="string"?ma(u,b):(typeof b=="number"||typeof b=="bigint")&&ma(u,""+b);break;case"onScroll":b!=null&&_n("scroll",u);break;case"onScrollEnd":b!=null&&_n("scrollend",u);break;case"onClick":b!=null&&(u.onclick=xl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$n.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(I=m.endsWith("Capture"),d=m.slice(2,I?m.length-7:void 0),U=u[ye]||null,U=U!=null?U[m]:null,typeof U=="function"&&u.removeEventListener(d,U,I),typeof b=="function")){typeof U!="function"&&U!==null&&(m in u?u[m]=null:u.hasAttribute(m)&&u.removeAttribute(m)),u.addEventListener(d,b,I);break e}m in u?u[m]=b:b===!0?u.setAttribute(m,""):ks(u,m,b)}}}function hs(u,d,m){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_n("error",u),_n("load",u);var b=!1,I=!1,U;for(U in m)if(m.hasOwnProperty(U)){var K=m[U];if(K!=null)switch(U){case"src":b=!0;break;case"srcSet":I=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,d));default:ai(u,d,U,K,m,null)}}I&&ai(u,d,"srcSet",m.srcSet,m,null),b&&ai(u,d,"src",m.src,m,null);return;case"input":_n("invalid",u);var ce=U=K=I=null,De=null,ze=null;for(b in m)if(m.hasOwnProperty(b)){var it=m[b];if(it!=null)switch(b){case"name":I=it;break;case"type":K=it;break;case"checked":De=it;break;case"defaultChecked":ze=it;break;case"value":U=it;break;case"defaultValue":ce=it;break;case"children":case"dangerouslySetInnerHTML":if(it!=null)throw Error(i(137,d));break;default:ai(u,d,b,it,m,null)}}bE(u,U,ce,De,ze,K,I,!1);return;case"select":_n("invalid",u),b=K=U=null;for(I in m)if(m.hasOwnProperty(I)&&(ce=m[I],ce!=null))switch(I){case"value":U=ce;break;case"defaultValue":K=ce;break;case"multiple":b=ce;default:ai(u,d,I,ce,m,null)}d=U,m=K,u.multiple=!!b,d!=null?nd(u,!!b,d,!1):m!=null&&nd(u,!!b,m,!0);return;case"textarea":_n("invalid",u),U=I=b=null;for(K in m)if(m.hasOwnProperty(K)&&(ce=m[K],ce!=null))switch(K){case"value":b=ce;break;case"defaultValue":I=ce;break;case"children":U=ce;break;case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(91));break;default:ai(u,d,K,ce,m,null)}id(u,b,I,U);return;case"option":for(De in m)if(m.hasOwnProperty(De)&&(b=m[De],b!=null))switch(De){case"selected":u.selected=b&&typeof b!="function"&&typeof b!="symbol";break;default:ai(u,d,De,b,m,null)}return;case"dialog":_n("beforetoggle",u),_n("toggle",u),_n("cancel",u),_n("close",u);break;case"iframe":case"object":_n("load",u);break;case"video":case"audio":for(b=0;b<W_.length;b++)_n(W_[b],u);break;case"image":_n("error",u),_n("load",u);break;case"details":_n("toggle",u);break;case"embed":case"source":case"link":_n("error",u),_n("load",u);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ze in m)if(m.hasOwnProperty(ze)&&(b=m[ze],b!=null))switch(ze){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,d));default:ai(u,d,ze,b,m,null)}return;default:if(f0(d)){for(it in m)m.hasOwnProperty(it)&&(b=m[it],b!==void 0&&YN(u,d,it,b,m,void 0));return}}for(ce in m)m.hasOwnProperty(ce)&&(b=m[ce],b!=null&&ai(u,d,ce,b,m,null))}function Are(u,d,m,b){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var I=null,U=null,K=null,ce=null,De=null,ze=null,it=null;for(et in m){var st=m[et];if(m.hasOwnProperty(et)&&st!=null)switch(et){case"checked":break;case"value":break;case"defaultValue":De=st;default:b.hasOwnProperty(et)||ai(u,d,et,null,b,st)}}for(var Ke in b){var et=b[Ke];if(st=m[Ke],b.hasOwnProperty(Ke)&&(et!=null||st!=null))switch(Ke){case"type":U=et;break;case"name":I=et;break;case"checked":ze=et;break;case"defaultChecked":it=et;break;case"value":K=et;break;case"defaultValue":ce=et;break;case"children":case"dangerouslySetInnerHTML":if(et!=null)throw Error(i(137,d));break;default:et!==st&&ai(u,d,Ke,et,b,st)}}d0(u,K,ce,De,ze,it,U,I);return;case"select":et=K=ce=Ke=null;for(U in m)if(De=m[U],m.hasOwnProperty(U)&&De!=null)switch(U){case"value":break;case"multiple":et=De;default:b.hasOwnProperty(U)||ai(u,d,U,null,b,De)}for(I in b)if(U=b[I],De=m[I],b.hasOwnProperty(I)&&(U!=null||De!=null))switch(I){case"value":Ke=U;break;case"defaultValue":ce=U;break;case"multiple":K=U;default:U!==De&&ai(u,d,I,U,b,De)}d=ce,m=K,b=et,Ke!=null?nd(u,!!m,Ke,!1):!!b!=!!m&&(d!=null?nd(u,!!m,d,!0):nd(u,!!m,m?[]:"",!1));return;case"textarea":et=Ke=null;for(ce in m)if(I=m[ce],m.hasOwnProperty(ce)&&I!=null&&!b.hasOwnProperty(ce))switch(ce){case"value":break;case"children":break;default:ai(u,d,ce,null,b,I)}for(K in b)if(I=b[K],U=m[K],b.hasOwnProperty(K)&&(I!=null||U!=null))switch(K){case"value":Ke=I;break;case"defaultValue":et=I;break;case"children":break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(91));break;default:I!==U&&ai(u,d,K,I,b,U)}TE(u,Ke,et);return;case"option":for(var kt in m)if(Ke=m[kt],m.hasOwnProperty(kt)&&Ke!=null&&!b.hasOwnProperty(kt))switch(kt){case"selected":u.selected=!1;break;default:ai(u,d,kt,null,b,Ke)}for(De in b)if(Ke=b[De],et=m[De],b.hasOwnProperty(De)&&Ke!==et&&(Ke!=null||et!=null))switch(De){case"selected":u.selected=Ke&&typeof Ke!="function"&&typeof Ke!="symbol";break;default:ai(u,d,De,Ke,b,et)}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 qt in m)Ke=m[qt],m.hasOwnProperty(qt)&&Ke!=null&&!b.hasOwnProperty(qt)&&ai(u,d,qt,null,b,Ke);for(ze in b)if(Ke=b[ze],et=m[ze],b.hasOwnProperty(ze)&&Ke!==et&&(Ke!=null||et!=null))switch(ze){case"children":case"dangerouslySetInnerHTML":if(Ke!=null)throw Error(i(137,d));break;default:ai(u,d,ze,Ke,b,et)}return;default:if(f0(d)){for(var oi in m)Ke=m[oi],m.hasOwnProperty(oi)&&Ke!==void 0&&!b.hasOwnProperty(oi)&&YN(u,d,oi,void 0,b,Ke);for(it in b)Ke=b[it],et=m[it],!b.hasOwnProperty(it)||Ke===et||Ke===void 0&&et===void 0||YN(u,d,it,Ke,b,et);return}}for(var Ue in m)Ke=m[Ue],m.hasOwnProperty(Ue)&&Ke!=null&&!b.hasOwnProperty(Ue)&&ai(u,d,Ue,null,b,Ke);for(st in b)Ke=b[st],et=m[st],!b.hasOwnProperty(st)||Ke===et||Ke==null&&et==null||ai(u,d,st,Ke,b,et)}function A6(u){switch(u){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sre(){if(typeof performance.getEntriesByType=="function"){for(var u=0,d=0,m=performance.getEntriesByType("resource"),b=0;b<m.length;b++){var I=m[b],U=I.transferSize,K=I.initiatorType,ce=I.duration;if(U&&ce&&A6(K)){for(K=0,ce=I.responseEnd,b+=1;b<m.length;b++){var De=m[b],ze=De.startTime;if(ze>ce)break;var it=De.transferSize,st=De.initiatorType;it&&A6(st)&&(De=De.responseEnd,K+=it*(De<ce?1:(ce-ze)/(De-ze)))}if(--b,d+=8*(U+K)/(I.duration/1e3),u++,10<u)break}}if(0<u)return d/u/1e6}return navigator.connection&&(u=navigator.connection.downlink,typeof u=="number")?u:5}var JN=null,QN=null;function Aw(u){return u.nodeType===9?u:u.ownerDocument}function S6(u){switch(u){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function D6(u,d){if(u===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return u===1&&d==="foreignObject"?0:u}function ZN(u,d){return u==="textarea"||u==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var ek=null;function Dre(){var u=window.event;return u&&u.type==="popstate"?u===ek?!1:(ek=u,!0):(ek=null,!1)}var C6=typeof setTimeout=="function"?setTimeout:void 0,Cre=typeof clearTimeout=="function"?clearTimeout:void 0,I6=typeof Promise=="function"?Promise:void 0,Ire=typeof queueMicrotask=="function"?queueMicrotask:typeof I6<"u"?function(u){return I6.resolve(null).then(u).catch(Rre)}:C6;function Rre(u){setTimeout(function(){throw u})}function Sd(u){return u==="head"}function R6(u,d){var m=d,b=0;do{var I=m.nextSibling;if(u.removeChild(m),I&&I.nodeType===8)if(m=I.data,m==="/$"||m==="/&"){if(b===0){u.removeChild(I),X0(d);return}b--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")b++;else if(m==="html")z_(u.ownerDocument.documentElement);else if(m==="head"){m=u.ownerDocument.head,z_(m);for(var U=m.firstChild;U;){var K=U.nextSibling,ce=U.nodeName;U[qe]||ce==="SCRIPT"||ce==="STYLE"||ce==="LINK"&&U.rel.toLowerCase()==="stylesheet"||m.removeChild(U),U=K}}else m==="body"&&z_(u.ownerDocument.body);m=I}while(m);X0(d)}function N6(u,d){var m=u;u=0;do{var b=m.nextSibling;if(m.nodeType===1?d?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(d?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),b&&b.nodeType===8)if(m=b.data,m==="/$"){if(u===0)break;u--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||u++;m=b}while(m)}function tk(u){var d=u.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var m=d;switch(d=d.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":tk(m),ht(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}u.removeChild(m)}}function Nre(u,d,m,b){for(;u.nodeType===1;){var I=m;if(u.nodeName.toLowerCase()!==d.toLowerCase()){if(!b&&(u.nodeName!=="INPUT"||u.type!=="hidden"))break}else if(b){if(!u[qe])switch(d){case"meta":if(!u.hasAttribute("itemprop"))break;return u;case"link":if(U=u.getAttribute("rel"),U==="stylesheet"&&u.hasAttribute("data-precedence"))break;if(U!==I.rel||u.getAttribute("href")!==(I.href==null||I.href===""?null:I.href)||u.getAttribute("crossorigin")!==(I.crossOrigin==null?null:I.crossOrigin)||u.getAttribute("title")!==(I.title==null?null:I.title))break;return u;case"style":if(u.hasAttribute("data-precedence"))break;return u;case"script":if(U=u.getAttribute("src"),(U!==(I.src==null?null:I.src)||u.getAttribute("type")!==(I.type==null?null:I.type)||u.getAttribute("crossorigin")!==(I.crossOrigin==null?null:I.crossOrigin))&&U&&u.hasAttribute("async")&&!u.hasAttribute("itemprop"))break;return u;default:return u}}else if(d==="input"&&u.type==="hidden"){var U=I.name==null?null:""+I.name;if(I.type==="hidden"&&u.getAttribute("name")===U)return u}else return u;if(u=Oo(u.nextSibling),u===null)break}return null}function kre(u,d,m){if(d==="")return null;for(;u.nodeType!==3;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!m||(u=Oo(u.nextSibling),u===null))return null;return u}function k6(u,d){for(;u.nodeType!==8;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!d||(u=Oo(u.nextSibling),u===null))return null;return u}function nk(u){return u.data==="$?"||u.data==="$~"}function ik(u){return u.data==="$!"||u.data==="$?"&&u.ownerDocument.readyState!=="loading"}function Mre(u,d){var m=u.ownerDocument;if(u.data==="$~")u._reactRetry=d;else if(u.data!=="$?"||m.readyState!=="loading")d();else{var b=function(){d(),m.removeEventListener("DOMContentLoaded",b)};m.addEventListener("DOMContentLoaded",b),u._reactRetry=b}}function Oo(u){for(;u!=null;u=u.nextSibling){var d=u.nodeType;if(d===1||d===3)break;if(d===8){if(d=u.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return u}var rk=null;function M6(u){u=u.nextSibling;for(var d=0;u;){if(u.nodeType===8){var m=u.data;if(m==="/$"||m==="/&"){if(d===0)return Oo(u.nextSibling);d--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||d++}u=u.nextSibling}return null}function F6(u){u=u.previousSibling;for(var d=0;u;){if(u.nodeType===8){var m=u.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(d===0)return u;d--}else m!=="/$"&&m!=="/&"||d++}u=u.previousSibling}return null}function U6(u,d,m){switch(d=Aw(m),u){case"html":if(u=d.documentElement,!u)throw Error(i(452));return u;case"head":if(u=d.head,!u)throw Error(i(453));return u;case"body":if(u=d.body,!u)throw Error(i(454));return u;default:throw Error(i(451))}}function z_(u){for(var d=u.attributes;d.length;)u.removeAttributeNode(d[0]);ht(u)}var Bo=new Map,P6=new Set;function Sw(u){return typeof u.getRootNode=="function"?u.getRootNode():u.nodeType===9?u:u.ownerDocument}var Fu=X.d;X.d={f:Fre,r:Ure,D:Pre,C:Lre,L:Ore,m:Bre,X:Wre,S:Vre,M:Hre};function Fre(){var u=Fu.f(),d=yw();return u||d}function Ure(u){var d=Et(u);d!==null&&d.tag===5&&d.type==="form"?ZO(d):Fu.r(u)}var q0=typeof document>"u"?null:document;function L6(u,d,m){var b=q0;if(b&&typeof d=="string"&&d){var I=ga(d);I='link[rel="'+u+'"][href="'+I+'"]',typeof m=="string"&&(I+='[crossorigin="'+m+'"]'),P6.has(I)||(P6.add(I),u={rel:u,crossOrigin:m,href:d},b.querySelector(I)===null&&(d=b.createElement("link"),hs(d,"link",u),Ft(d),b.head.appendChild(d)))}}function Pre(u){Fu.D(u),L6("dns-prefetch",u,null)}function Lre(u,d){Fu.C(u,d),L6("preconnect",u,d)}function Ore(u,d,m){Fu.L(u,d,m);var b=q0;if(b&&u&&d){var I='link[rel="preload"][as="'+ga(d)+'"]';d==="image"&&m&&m.imageSrcSet?(I+='[imagesrcset="'+ga(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(I+='[imagesizes="'+ga(m.imageSizes)+'"]')):I+='[href="'+ga(u)+'"]';var U=I;switch(d){case"style":U=$0(u);break;case"script":U=j0(u)}Bo.has(U)||(u=f({rel:"preload",href:d==="image"&&m&&m.imageSrcSet?void 0:u,as:d},m),Bo.set(U,u),b.querySelector(I)!==null||d==="style"&&b.querySelector(G_(U))||d==="script"&&b.querySelector(q_(U))||(d=b.createElement("link"),hs(d,"link",u),Ft(d),b.head.appendChild(d)))}}function Bre(u,d){Fu.m(u,d);var m=q0;if(m&&u){var b=d&&typeof d.as=="string"?d.as:"script",I='link[rel="modulepreload"][as="'+ga(b)+'"][href="'+ga(u)+'"]',U=I;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":U=j0(u)}if(!Bo.has(U)&&(u=f({rel:"modulepreload",href:u},d),Bo.set(U,u),m.querySelector(I)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(q_(U)))return}b=m.createElement("link"),hs(b,"link",u),Ft(b),m.head.appendChild(b)}}}function Vre(u,d,m){Fu.S(u,d,m);var b=q0;if(b&&u){var I=Tt(b).hoistableStyles,U=$0(u);d=d||"default";var K=I.get(U);if(!K){var ce={loading:0,preload:null};if(K=b.querySelector(G_(U)))ce.loading=5;else{u=f({rel:"stylesheet",href:u,"data-precedence":d},m),(m=Bo.get(U))&&sk(u,m);var De=K=b.createElement("link");Ft(De),hs(De,"link",u),De._p=new Promise(function(ze,it){De.onload=ze,De.onerror=it}),De.addEventListener("load",function(){ce.loading|=1}),De.addEventListener("error",function(){ce.loading|=2}),ce.loading|=4,Dw(K,d,b)}K={type:"stylesheet",instance:K,count:1,state:ce},I.set(U,K)}}}function Wre(u,d){Fu.X(u,d);var m=q0;if(m&&u){var b=Tt(m).hoistableScripts,I=j0(u),U=b.get(I);U||(U=m.querySelector(q_(I)),U||(u=f({src:u,async:!0},d),(d=Bo.get(I))&&ak(u,d),U=m.createElement("script"),Ft(U),hs(U,"link",u),m.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},b.set(I,U))}}function Hre(u,d){Fu.M(u,d);var m=q0;if(m&&u){var b=Tt(m).hoistableScripts,I=j0(u),U=b.get(I);U||(U=m.querySelector(q_(I)),U||(u=f({src:u,async:!0,type:"module"},d),(d=Bo.get(I))&&ak(u,d),U=m.createElement("script"),Ft(U),hs(U,"link",u),m.head.appendChild(U)),U={type:"script",instance:U,count:1,state:null},b.set(I,U))}}function O6(u,d,m,b){var I=(I=_e.current)?Sw(I):null;if(!I)throw Error(i(446));switch(u){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(d=$0(m.href),m=Tt(I).hoistableStyles,b=m.get(d),b||(b={type:"style",instance:null,count:0,state:null},m.set(d,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){u=$0(m.href);var U=Tt(I).hoistableStyles,K=U.get(u);if(K||(I=I.ownerDocument||I,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},U.set(u,K),(U=I.querySelector(G_(u)))&&!U._p&&(K.instance=U,K.state.loading=5),Bo.has(u)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},Bo.set(u,m),U||zre(I,u,m,K.state))),d&&b===null)throw Error(i(528,""));return K}if(d&&b!==null)throw Error(i(529,""));return null;case"script":return d=m.async,m=m.src,typeof m=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=j0(m),m=Tt(I).hoistableScripts,b=m.get(d),b||(b={type:"script",instance:null,count:0,state:null},m.set(d,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,u))}}function $0(u){return'href="'+ga(u)+'"'}function G_(u){return'link[rel="stylesheet"]['+u+"]"}function B6(u){return f({},u,{"data-precedence":u.precedence,precedence:null})}function zre(u,d,m,b){u.querySelector('link[rel="preload"][as="style"]['+d+"]")?b.loading=1:(d=u.createElement("link"),b.preload=d,d.addEventListener("load",function(){return b.loading|=1}),d.addEventListener("error",function(){return b.loading|=2}),hs(d,"link",m),Ft(d),u.head.appendChild(d))}function j0(u){return'[src="'+ga(u)+'"]'}function q_(u){return"script[async]"+u}function V6(u,d,m){if(d.count++,d.instance===null)switch(d.type){case"style":var b=u.querySelector('style[data-href~="'+ga(m.href)+'"]');if(b)return d.instance=b,Ft(b),b;var I=f({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return b=(u.ownerDocument||u).createElement("style"),Ft(b),hs(b,"style",I),Dw(b,m.precedence,u),d.instance=b;case"stylesheet":I=$0(m.href);var U=u.querySelector(G_(I));if(U)return d.state.loading|=4,d.instance=U,Ft(U),U;b=B6(m),(I=Bo.get(I))&&sk(b,I),U=(u.ownerDocument||u).createElement("link"),Ft(U);var K=U;return K._p=new Promise(function(ce,De){K.onload=ce,K.onerror=De}),hs(U,"link",b),d.state.loading|=4,Dw(U,m.precedence,u),d.instance=U;case"script":return U=j0(m.src),(I=u.querySelector(q_(U)))?(d.instance=I,Ft(I),I):(b=m,(I=Bo.get(U))&&(b=f({},m),ak(b,I)),u=u.ownerDocument||u,I=u.createElement("script"),Ft(I),hs(I,"link",b),u.head.appendChild(I),d.instance=I);case"void":return null;default:throw Error(i(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(b=d.instance,d.state.loading|=4,Dw(b,m.precedence,u));return d.instance}function Dw(u,d,m){for(var b=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),I=b.length?b[b.length-1]:null,U=I,K=0;K<b.length;K++){var ce=b[K];if(ce.dataset.precedence===d)U=ce;else if(U!==I)break}U?U.parentNode.insertBefore(u,U.nextSibling):(d=m.nodeType===9?m.head:m,d.insertBefore(u,d.firstChild))}function sk(u,d){u.crossOrigin==null&&(u.crossOrigin=d.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=d.referrerPolicy),u.title==null&&(u.title=d.title)}function ak(u,d){u.crossOrigin==null&&(u.crossOrigin=d.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=d.referrerPolicy),u.integrity==null&&(u.integrity=d.integrity)}var Cw=null;function W6(u,d,m){if(Cw===null){var b=new Map,I=Cw=new Map;I.set(m,b)}else I=Cw,b=I.get(m),b||(b=new Map,I.set(m,b));if(b.has(u))return b;for(b.set(u,null),m=m.getElementsByTagName(u),I=0;I<m.length;I++){var U=m[I];if(!(U[qe]||U[de]||u==="link"&&U.getAttribute("rel")==="stylesheet")&&U.namespaceURI!=="http://www.w3.org/2000/svg"){var K=U.getAttribute(d)||"";K=u+K;var ce=b.get(K);ce?ce.push(U):b.set(K,[U])}}return b}function H6(u,d,m){u=u.ownerDocument||u,u.head.insertBefore(m,d==="title"?u.querySelector("head > title"):null)}function Gre(u,d,m){if(m===1||d.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return u=d.disabled,typeof d.precedence=="string"&&u==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function z6(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function qre(u,d,m,b){if(m.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var I=$0(b.href),U=d.querySelector(G_(I));if(U){d=U._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(u.count++,u=Iw.bind(u),d.then(u,u)),m.state.loading|=4,m.instance=U,Ft(U);return}U=d.ownerDocument||d,b=B6(b),(I=Bo.get(I))&&sk(b,I),U=U.createElement("link"),Ft(U);var K=U;K._p=new Promise(function(ce,De){K.onload=ce,K.onerror=De}),hs(U,"link",b),m.instance=U}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(m,d),(d=m.state.preload)&&(m.state.loading&3)===0&&(u.count++,m=Iw.bind(u),d.addEventListener("load",m),d.addEventListener("error",m))}}var ok=0;function $re(u,d){return u.stylesheets&&u.count===0&&Nw(u,u.stylesheets),0<u.count||0<u.imgCount?function(m){var b=setTimeout(function(){if(u.stylesheets&&Nw(u,u.stylesheets),u.unsuspend){var U=u.unsuspend;u.unsuspend=null,U()}},6e4+d);0<u.imgBytes&&ok===0&&(ok=62500*Sre());var I=setTimeout(function(){if(u.waitingForImages=!1,u.count===0&&(u.stylesheets&&Nw(u,u.stylesheets),u.unsuspend)){var U=u.unsuspend;u.unsuspend=null,U()}},(u.imgBytes>ok?50:800)+d);return u.unsuspend=m,function(){u.unsuspend=null,clearTimeout(b),clearTimeout(I)}}:null}function Iw(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nw(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var Rw=null;function Nw(u,d){u.stylesheets=null,u.unsuspend!==null&&(u.count++,Rw=new Map,d.forEach(jre,u),Rw=null,Iw.call(u))}function jre(u,d){if(!(d.state.loading&4)){var m=Rw.get(u);if(m)var b=m.get(null);else{m=new Map,Rw.set(u,m);for(var I=u.querySelectorAll("link[data-precedence],style[data-precedence]"),U=0;U<I.length;U++){var K=I[U];(K.nodeName==="LINK"||K.getAttribute("media")!=="not all")&&(m.set(K.dataset.precedence,K),b=K)}b&&m.set(null,b)}I=d.instance,K=I.getAttribute("data-precedence"),U=m.get(K)||b,U===b&&m.set(null,I),m.set(K,I),this.count++,b=Iw.bind(this),I.addEventListener("load",b),I.addEventListener("error",b),U?U.parentNode.insertBefore(I,U.nextSibling):(u=u.nodeType===9?u.head:u,u.insertBefore(I,u.firstChild)),d.state.loading|=4}}var $_={$$typeof:A,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function Xre(u,d,m,b,I,U,K,ce,De){this.tag=1,this.containerInfo=u,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mn(0),this.hiddenUpdates=mn(null),this.identifierPrefix=b,this.onUncaughtError=I,this.onCaughtError=U,this.onRecoverableError=K,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=De,this.incompleteTransitions=new Map}function G6(u,d,m,b,I,U,K,ce,De,ze,it,st){return u=new Xre(u,d,m,K,De,ze,it,st,ce),d=1,U===!0&&(d|=24),U=za(3,null,null,d),u.current=U,U.stateNode=u,d=VR(),d.refCount++,u.pooledCache=d,d.refCount++,U.memoizedState={element:b,isDehydrated:m,cache:d},GR(U),u}function q6(u){return u?(u=w0,u):w0}function $6(u,d,m,b,I,U){I=q6(I),b.context===null?b.context=I:b.pendingContext=I,b=gd(d),b.payload={element:m},U=U===void 0?null:U,U!==null&&(b.callback=U),m=md(u,b,d),m!==null&&(ba(m,u,d),w_(m,u,d))}function j6(u,d){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var m=u.retryLane;u.retryLane=m!==0&&m<d?m:d}}function lk(u,d){j6(u,d),(u=u.alternate)&&j6(u,d)}function X6(u){if(u.tag===13||u.tag===31){var d=Pp(u,67108864);d!==null&&ba(d,u,67108864),lk(u,67108864)}}function K6(u){if(u.tag===13||u.tag===31){var d=Xa();d=as(d);var m=Pp(u,d);m!==null&&ba(m,u,d),lk(u,d)}}var kw=!0;function Kre(u,d,m,b){var I=q.T;q.T=null;var U=X.p;try{X.p=2,ck(u,d,m,b)}finally{X.p=U,q.T=I}}function Yre(u,d,m,b){var I=q.T;q.T=null;var U=X.p;try{X.p=8,ck(u,d,m,b)}finally{X.p=U,q.T=I}}function ck(u,d,m,b){if(kw){var I=uk(b);if(I===null)KN(u,d,b,Mw,m),J6(u,b);else if(Qre(I,u,d,m,b))b.stopPropagation();else if(J6(u,b),d&4&&-1<Jre.indexOf(u)){for(;I!==null;){var U=Et(I);if(U!==null)switch(U.tag){case 3:if(U=U.stateNode,U.current.memoizedState.isDehydrated){var K=le(U.pendingLanes);if(K!==0){var ce=U;for(ce.pendingLanes|=2,ce.entangledLanes|=2;K;){var De=1<<31-Je(K);ce.entanglements[1]|=De,K&=~De}xc(U),(Ln&6)===0&&(gw=Ee()+500,V_(0))}}break;case 31:case 13:ce=Pp(U,2),ce!==null&&ba(ce,U,2),yw(),lk(U,2)}if(U=uk(b),U===null&&KN(u,d,b,Mw,m),U===I)break;I=U}I!==null&&b.stopPropagation()}else KN(u,d,b,null,m)}}function uk(u){return u=Io(u),hk(u)}var Mw=null;function hk(u){if(Mw=null,u=yt(u),u!==null){var d=s(u);if(d===null)u=null;else{var m=d.tag;if(m===13){if(u=a(d),u!==null)return u;u=null}else if(m===31){if(u=o(d),u!==null)return u;u=null}else if(m===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;u=null}else d!==u&&(u=null)}}return Mw=u,null}function Y6(u){switch(u){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Me()){case Xe:return 2;case dt:return 8;case bt:case zt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var dk=!1,Dd=null,Cd=null,Id=null,j_=new Map,X_=new Map,Rd=[],Jre="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function J6(u,d){switch(u){case"focusin":case"focusout":Dd=null;break;case"dragenter":case"dragleave":Cd=null;break;case"mouseover":case"mouseout":Id=null;break;case"pointerover":case"pointerout":j_.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":X_.delete(d.pointerId)}}function K_(u,d,m,b,I,U){return u===null||u.nativeEvent!==U?(u={blockedOn:d,domEventName:m,eventSystemFlags:b,nativeEvent:U,targetContainers:[I]},d!==null&&(d=Et(d),d!==null&&X6(d)),u):(u.eventSystemFlags|=b,d=u.targetContainers,I!==null&&d.indexOf(I)===-1&&d.push(I),u)}function Qre(u,d,m,b,I){switch(d){case"focusin":return Dd=K_(Dd,u,d,m,b,I),!0;case"dragenter":return Cd=K_(Cd,u,d,m,b,I),!0;case"mouseover":return Id=K_(Id,u,d,m,b,I),!0;case"pointerover":var U=I.pointerId;return j_.set(U,K_(j_.get(U)||null,u,d,m,b,I)),!0;case"gotpointercapture":return U=I.pointerId,X_.set(U,K_(X_.get(U)||null,u,d,m,b,I)),!0}return!1}function Q6(u){var d=yt(u.target);if(d!==null){var m=s(d);if(m!==null){if(d=m.tag,d===13){if(d=a(m),d!==null){u.blockedOn=d,me(u.priority,function(){K6(m)});return}}else if(d===31){if(d=o(m),d!==null){u.blockedOn=d,me(u.priority,function(){K6(m)});return}}else if(d===3&&m.stateNode.current.memoizedState.isDehydrated){u.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}u.blockedOn=null}function Fw(u){if(u.blockedOn!==null)return!1;for(var d=u.targetContainers;0<d.length;){var m=uk(u.nativeEvent);if(m===null){m=u.nativeEvent;var b=new m.constructor(m.type,m);l_=b,m.target.dispatchEvent(b),l_=null}else return d=Et(m),d!==null&&X6(d),u.blockedOn=m,!1;d.shift()}return!0}function Z6(u,d,m){Fw(u)&&m.delete(d)}function Zre(){dk=!1,Dd!==null&&Fw(Dd)&&(Dd=null),Cd!==null&&Fw(Cd)&&(Cd=null),Id!==null&&Fw(Id)&&(Id=null),j_.forEach(Z6),X_.forEach(Z6)}function Uw(u,d){u.blockedOn===d&&(u.blockedOn=null,dk||(dk=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Zre)))}var Pw=null;function eB(u){Pw!==u&&(Pw=u,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Pw===u&&(Pw=null);for(var d=0;d<u.length;d+=3){var m=u[d],b=u[d+1],I=u[d+2];if(typeof b!="function"){if(hk(b||m)===null)continue;break}var U=Et(m);U!==null&&(u.splice(d,3),d-=3,uN(U,{pending:!0,data:I,method:m.method,action:b},b,I))}}))}function X0(u){function d(De){return Uw(De,u)}Dd!==null&&Uw(Dd,u),Cd!==null&&Uw(Cd,u),Id!==null&&Uw(Id,u),j_.forEach(d),X_.forEach(d);for(var m=0;m<Rd.length;m++){var b=Rd[m];b.blockedOn===u&&(b.blockedOn=null)}for(;0<Rd.length&&(m=Rd[0],m.blockedOn===null);)Q6(m),m.blockedOn===null&&Rd.shift();if(m=(u.ownerDocument||u).$$reactFormReplay,m!=null)for(b=0;b<m.length;b+=3){var I=m[b],U=m[b+1],K=I[ye]||null;if(typeof U=="function")K||eB(m);else if(K){var ce=null;if(U&&U.hasAttribute("formAction")){if(I=U,K=U[ye]||null)ce=K.formAction;else if(hk(I)!==null)continue}else ce=K.action;typeof ce=="function"?m[b+1]=ce:(m.splice(b,3),b-=3),eB(m)}}}function tB(){function u(U){U.canIntercept&&U.info==="react-transition"&&U.intercept({handler:function(){return new Promise(function(K){return I=K})},focusReset:"manual",scroll:"manual"})}function d(){I!==null&&(I(),I=null),b||setTimeout(m,20)}function m(){if(!b&&!navigation.transition){var U=navigation.currentEntry;U&&U.url!=null&&navigation.navigate(U.url,{state:U.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var b=!1,I=null;return navigation.addEventListener("navigate",u),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(m,100),function(){b=!0,navigation.removeEventListener("navigate",u),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),I!==null&&(I(),I=null)}}}function fk(u){this._internalRoot=u}Lw.prototype.render=fk.prototype.render=function(u){var d=this._internalRoot;if(d===null)throw Error(i(409));var m=d.current,b=Xa();$6(m,b,u,d,null,null)},Lw.prototype.unmount=fk.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var d=u.containerInfo;$6(u.current,2,null,u,null,null),yw(),d[ve]=null}};function Lw(u){this._internalRoot=u}Lw.prototype.unstable_scheduleHydration=function(u){if(u){var d=se();u={blockedOn:null,target:u,priority:d};for(var m=0;m<Rd.length&&d!==0&&d<Rd[m].priority;m++);Rd.splice(m,0,u),m===0&&Q6(u)}};var nB=e.version;if(nB!=="19.2.4")throw Error(i(527,nB,"19.2.4"));X.findDOMNode=function(u){var d=u._reactInternals;if(d===void 0)throw typeof u.render=="function"?Error(i(188)):(u=Object.keys(u).join(","),Error(i(268,u)));return u=c(d),u=u!==null?h(u):null,u=u===null?null:u.stateNode,u};var ese={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ow=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ow.isDisabled&&Ow.supportsFiber)try{ke=Ow.inject(ese),xe=Ow}catch{}}return J_.createRoot=function(u,d){if(!r(u))throw Error(i(299));var m=!1,b="",I=c8,U=u8,K=h8;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(I=d.onUncaughtError),d.onCaughtError!==void 0&&(U=d.onCaughtError),d.onRecoverableError!==void 0&&(K=d.onRecoverableError)),d=G6(u,1,!1,null,null,m,b,null,I,U,K,tB),u[ve]=d.current,XN(u),new fk(d)},J_.hydrateRoot=function(u,d,m){if(!r(u))throw Error(i(299));var b=!1,I="",U=c8,K=u8,ce=h8,De=null;return m!=null&&(m.unstable_strictMode===!0&&(b=!0),m.identifierPrefix!==void 0&&(I=m.identifierPrefix),m.onUncaughtError!==void 0&&(U=m.onUncaughtError),m.onCaughtError!==void 0&&(K=m.onCaughtError),m.onRecoverableError!==void 0&&(ce=m.onRecoverableError),m.formState!==void 0&&(De=m.formState)),d=G6(u,1,!0,d,m??null,b,I,De,U,K,ce,tB),d.context=q6(null),m=d.current,b=Xa(),b=as(b),I=gd(b),I.callback=null,md(m,I,b),m=b,d.current.lanes=m,ki(d,m),xc(d),u[ve]=d.current,XN(u),new Lw(d)},J_.version="19.2.4",J_}var fB;function pse(){if(fB)return yk.exports;fB=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),yk.exports=fse(),yk.exports}var gse=pse();/**
 * react-router v7.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var pB="popstate";function gB(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function mse(n={}){function e(r,s){let{pathname:a="/",search:o="",hash:l=""}=U1(r.location.hash.substring(1));return!a.startsWith("/")&&!a.startsWith(".")&&(a="/"+a),CM("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function t(r,s){let a=r.document.querySelector("base"),o="";if(a&&a.getAttribute("href")){let l=r.location.href,c=l.indexOf("#");o=c===-1?l:l.slice(0,c)}return o+"#"+(typeof s=="string"?s:fb(s))}function i(r,s){fl(r.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(s)})`)}return vse(e,t,i,n)}function Ur(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function fl(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function yse(){return Math.random().toString(36).substring(2,10)}function mB(n,e){return{usr:n.state,key:n.key,idx:e,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function CM(n,e,t=null,i,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?U1(e):e,state:t,key:e&&e.key||i||yse(),unstable_mask:r}}function fb({pathname:n="/",search:e="",hash:t=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(n+=t.charAt(0)==="#"?t:"#"+t),n}function U1(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substring(t),n=n.substring(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substring(i),n=n.substring(0,i)),n&&(e.pathname=n)}return e}function vse(n,e,t,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,a=r.history,o="POP",l=null,c=h();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function h(){return(a.state||{idx:null}).idx}function f(){o="POP";let _=h(),E=_==null?null:_-c;c=_,l&&l({action:o,location:v.location,delta:E})}function p(_,E){o="PUSH";let w=gB(_)?_:CM(v.location,_,E);t&&t(w,_),c=h()+1;let A=mB(w,c),N=v.createHref(w.unstable_mask||w);try{a.pushState(A,"",N)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(N)}s&&l&&l({action:o,location:v.location,delta:1})}function y(_,E){o="REPLACE";let w=gB(_)?_:CM(v.location,_,E);t&&t(w,_),c=h();let A=mB(w,c),N=v.createHref(w.unstable_mask||w);a.replaceState(A,"",N),s&&l&&l({action:o,location:v.location,delta:0})}function x(_){return _se(_)}let v={get action(){return o},get location(){return n(r,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(pB,f),l=_,()=>{r.removeEventListener(pB,f),l=null}},createHref(_){return e(r,_)},createURL:x,encodeLocation(_){let E=x(_);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:p,replace:y,go(_){return a.go(_)}};return v}function _se(n,e=!1){let t="http://localhost";typeof window<"u"&&(t=window.location.origin!=="null"?window.location.origin:window.location.href),Ur(t,"No window.location.(origin|href) available to create URL");let i=typeof n=="string"?n:fb(n);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=t+i),new URL(i,t)}function Gq(n,e,t="/"){return xse(n,e,t,!1)}function xse(n,e,t,i){let r=typeof e=="string"?U1(e):e,s=Ph(r.pathname||"/",t);if(s==null)return null;let a=qq(n);bse(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let c=kse(s);o=Rse(a[l],c,i)}return o}function qq(n,e=[],t=[],i="",r=!1){let s=(a,o,l=r,c)=>{let h={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(i)&&l)return;Ur(h.relativePath.startsWith(i),`Absolute route path "${h.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(i.length)}let f=iu([i,h.relativePath]),p=t.concat(h);a.children&&a.children.length>0&&(Ur(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),qq(a.children,e,p,f,l)),!(a.path==null&&!a.index)&&e.push({path:f,score:Cse(f,a.index),routesMeta:p})};return n.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of $q(a.path))s(a,o,!0,c)}),e}function $q(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let a=$q(i.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),r&&o.push(...a),o.map(l=>n.startsWith("/")&&l===""?"/":l)}function bse(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Ise(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}var Tse=/^:[\w-]+$/,Ese=3,wse=2,Ase=1,Sse=10,Dse=-2,yB=n=>n==="*";function Cse(n,e){let t=n.split("/"),i=t.length;return t.some(yB)&&(i+=Dse),e&&(i+=wse),t.filter(r=>!yB(r)).reduce((r,s)=>r+(Tse.test(s)?Ese:s===""?Ase:Sse),i)}function Ise(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function Rse(n,e,t=!1){let{routesMeta:i}=n,r={},s="/",a=[];for(let o=0;o<i.length;++o){let l=i[o],c=o===i.length-1,h=s==="/"?e:e.slice(s.length)||"/",f=lD({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},h),p=l.route;if(!f&&c&&t&&!i[i.length-1].route.index&&(f=lD({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!f)return null;Object.assign(r,f.params),a.push({params:r,pathname:iu([s,f.pathname]),pathnameBase:Pse(iu([s,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(s=iu([s,f.pathnameBase]))}return a}function lD(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=Nse(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let s=r[0],a=s.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:i.reduce((c,{paramName:h,isOptional:f},p)=>{if(h==="*"){let x=o[p]||"";a=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const y=o[p];return f&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:n}}function Nse(n,e=!1,t=!0){fl(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l,c,h)=>{if(i.push({paramName:o,isOptional:l!=null}),l){let f=h.charAt(c+a.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function kse(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return fl(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function Ph(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}var Mse=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Fse(n,e="/"){let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?U1(n):n,s;return t?(t=t.replace(/\/\/+/g,"/"),t.startsWith("/")?s=vB(t.substring(1),"/"):s=vB(t,e)):s=e,{pathname:s,search:Lse(i),hash:Ose(r)}}function vB(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function bk(n,e,t,i){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Use(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function jq(n){let e=Use(n);return e.map((t,i)=>i===e.length-1?t.pathname:t.pathnameBase)}function DP(n,e,t,i=!1){let r;typeof n=="string"?r=U1(n):(r={...n},Ur(!r.pathname||!r.pathname.includes("?"),bk("?","pathname","search",r)),Ur(!r.pathname||!r.pathname.includes("#"),bk("#","pathname","hash",r)),Ur(!r.search||!r.search.includes("#"),bk("#","search","hash",r)));let s=n===""||r.pathname==="",a=s?"/":r.pathname,o;if(a==null)o=t;else{let f=e.length-1;if(!i&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;r.pathname=p.join("/")}o=f>=0?e[f]:"/"}let l=Fse(r,o),c=a&&a!=="/"&&a.endsWith("/"),h=(s||a===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||h)&&(l.pathname+="/"),l}var iu=n=>n.join("/").replace(/\/\/+/g,"/"),Pse=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Lse=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Ose=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Bse=class{constructor(n,e,t,i=!1){this.status=n,this.statusText=e||"",this.internal=i,t instanceof Error?(this.data=t.toString(),this.error=t):this.data=t}};function Vse(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Wse(n){return n.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Kq(n,e){let t=n;if(typeof t!="string"||!Mse.test(t))return{absoluteURL:void 0,isExternal:!1,to:t};let i=t,r=!1;if(Xq)try{let s=new URL(window.location.href),a=t.startsWith("//")?new URL(s.protocol+t):new URL(t),o=Ph(a.pathname,e);a.origin===s.origin&&o!=null?t=o+a.search+a.hash:r=!0}catch{fl(!1,`<Link to="${t}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:t}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Yq=["POST","PUT","PATCH","DELETE"];new Set(Yq);var Hse=["GET",...Yq];new Set(Hse);var P1=Se.createContext(null);P1.displayName="DataRouter";var $C=Se.createContext(null);$C.displayName="DataRouterState";var zse=Se.createContext(!1),Jq=Se.createContext({isTransitioning:!1});Jq.displayName="ViewTransition";var Gse=Se.createContext(new Map);Gse.displayName="Fetchers";var qse=Se.createContext(null);qse.displayName="Await";var ml=Se.createContext(null);ml.displayName="Navigation";var jC=Se.createContext(null);jC.displayName="Location";var Kh=Se.createContext({outlet:null,matches:[],isDataRoute:!1});Kh.displayName="Route";var CP=Se.createContext(null);CP.displayName="RouteError";var Qq="REACT_ROUTER_ERROR",$se="REDIRECT",jse="ROUTE_ERROR_RESPONSE";function Xse(n){if(n.startsWith(`${Qq}:${$se}:{`))try{let e=JSON.parse(n.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Kse(n){if(n.startsWith(`${Qq}:${jse}:{`))try{let e=JSON.parse(n.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Bse(e.status,e.statusText,e.data)}catch{}}function Yse(n,{relative:e}={}){Ur(WT(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:i}=Se.useContext(ml),{hash:r,pathname:s,search:a}=HT(n,{relative:e}),o=s;return t!=="/"&&(o=s==="/"?t:iu([t,s])),i.createHref({pathname:o,search:a,hash:r})}function WT(){return Se.useContext(jC)!=null}function mu(){return Ur(WT(),"useLocation() may be used only in the context of a <Router> component."),Se.useContext(jC).location}var Zq="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function e$(n){Se.useContext(ml).static||Se.useLayoutEffect(n)}function XC(){let{isDataRoute:n}=Se.useContext(Kh);return n?cae():Jse()}function Jse(){Ur(WT(),"useNavigate() may be used only in the context of a <Router> component.");let n=Se.useContext(P1),{basename:e,navigator:t}=Se.useContext(ml),{matches:i}=Se.useContext(Kh),{pathname:r}=mu(),s=JSON.stringify(jq(i)),a=Se.useRef(!1);return e$(()=>{a.current=!0}),Se.useCallback((l,c={})=>{if(fl(a.current,Zq),!a.current)return;if(typeof l=="number"){t.go(l);return}let h=DP(l,JSON.parse(s),r,c.relative==="path");n==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:iu([e,h.pathname])),(c.replace?t.replace:t.push)(h,c.state,c)},[e,t,s,r,n])}Se.createContext(null);function HT(n,{relative:e}={}){let{matches:t}=Se.useContext(Kh),{pathname:i}=mu(),r=JSON.stringify(jq(t));return Se.useMemo(()=>DP(n,JSON.parse(r),i,e==="path"),[n,r,i,e])}function Qse(n,e,t){Ur(WT(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=Se.useContext(ml),{matches:r}=Se.useContext(Kh),s=r[r.length-1],a=s?s.params:{},o=s?s.pathname:"/",l=s?s.pathnameBase:"/",c=s&&s.route;{let _=c&&c.path||"";n$(o,!c||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let h=mu(),f;f=h;let p=f.pathname||"/",y=p;if(l!=="/"){let _=l.replace(/^\//,"").split("/");y="/"+p.replace(/^\//,"").split("/").slice(_.length).join("/")}let x=Gq(n,{pathname:y});return fl(c||x!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),fl(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),iae(x&&x.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:iu([l,i.encodeLocation?i.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:iu([l,i.encodeLocation?i.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),r,t)}function Zse(){let n=lae(),e=Vse(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},a=null;return console.error("Error handled by React Router default ErrorBoundary:",n),a=Se.createElement(Se.Fragment,null,Se.createElement("p",null,"💿 Hey developer 👋"),Se.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Se.createElement("code",{style:s},"ErrorBoundary")," or"," ",Se.createElement("code",{style:s},"errorElement")," prop on your route.")),Se.createElement(Se.Fragment,null,Se.createElement("h2",null,"Unexpected Application Error!"),Se.createElement("h3",{style:{fontStyle:"italic"}},e),t?Se.createElement("pre",{style:r},t):null,a)}var eae=Se.createElement(Zse,null),t$=class extends Se.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){this.props.onError?this.props.onError(n,e):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const t=Kse(n.digest);t&&(n=t)}let e=n!==void 0?Se.createElement(Kh.Provider,{value:this.props.routeContext},Se.createElement(CP.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?Se.createElement(tae,{error:n},e):e}};t$.contextType=zse;var Tk=new WeakMap;function tae({children:n,error:e}){let{basename:t}=Se.useContext(ml);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=Xse(e.digest);if(i){let r=Tk.get(e);if(r)throw r;let s=Kq(i.location,t);if(Xq&&!Tk.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw Tk.set(e,a),a}return Se.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return n}function nae({routeContext:n,match:e,children:t}){let i=Se.useContext(P1);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),Se.createElement(Kh.Provider,{value:n},t)}function iae(n,e=[],t){let i=t==null?void 0:t.state;if(n==null){if(!i)return null;if(i.errors)n=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let r=n,s=i==null?void 0:i.errors;if(s!=null){let h=r.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);Ur(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,h+1))}let a=!1,o=-1;if(t&&i){a=i.renderFallback;for(let h=0;h<r.length;h++){let f=r[h];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(o=h),f.route.id){let{loaderData:p,errors:y}=i,x=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||x){t.isStatic&&(a=!0),o>=0?r=r.slice(0,o+1):r=[r[0]];break}}}}let l=t==null?void 0:t.onError,c=i&&l?(h,f)=>{var p,y;l(h,{location:i.location,params:((y=(p=i.matches)==null?void 0:p[0])==null?void 0:y.params)??{},unstable_pattern:Wse(i.matches),errorInfo:f})}:void 0;return r.reduceRight((h,f,p)=>{let y,x=!1,v=null,_=null;i&&(y=s&&f.route.id?s[f.route.id]:void 0,v=f.route.errorElement||eae,a&&(o<0&&p===0?(n$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,_=null):o===p&&(x=!0,_=f.route.hydrateFallbackElement||null)));let E=e.concat(r.slice(0,p+1)),w=()=>{let A;return y?A=v:x?A=_:f.route.Component?A=Se.createElement(f.route.Component,null):f.route.element?A=f.route.element:A=h,Se.createElement(nae,{match:f,routeContext:{outlet:h,matches:E,isDataRoute:i!=null},children:A})};return i&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?Se.createElement(t$,{location:i.location,revalidation:i.revalidation,component:v,error:y,children:w(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:c}):w()},null)}function IP(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function rae(n){let e=Se.useContext(P1);return Ur(e,IP(n)),e}function sae(n){let e=Se.useContext($C);return Ur(e,IP(n)),e}function aae(n){let e=Se.useContext(Kh);return Ur(e,IP(n)),e}function RP(n){let e=aae(n),t=e.matches[e.matches.length-1];return Ur(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function oae(){return RP("useRouteId")}function lae(){var i;let n=Se.useContext(CP),e=sae("useRouteError"),t=RP("useRouteError");return n!==void 0?n:(i=e.errors)==null?void 0:i[t]}function cae(){let{router:n}=rae("useNavigate"),e=RP("useNavigate"),t=Se.useRef(!1);return e$(()=>{t.current=!0}),Se.useCallback(async(r,s={})=>{fl(t.current,Zq),t.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:e,...s}))},[n,e])}var _B={};function n$(n,e,t){!e&&!_B[n]&&(_B[n]=!0,fl(!1,t))}Se.memo(uae);function uae({routes:n,future:e,state:t,isStatic:i,onError:r}){return Qse(n,void 0,{state:t,isStatic:i,onError:r})}function hae({basename:n="/",children:e=null,location:t,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:a}){Ur(!WT(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=n.replace(/^\/*/,"/"),l=Se.useMemo(()=>({basename:o,navigator:r,static:s,unstable_useTransitions:a,future:{}}),[o,r,s,a]);typeof t=="string"&&(t=U1(t));let{pathname:c="/",search:h="",hash:f="",state:p=null,key:y="default",unstable_mask:x}=t,v=Se.useMemo(()=>{let _=Ph(c,o);return _==null?null:{location:{pathname:_,search:h,hash:f,state:p,key:y,unstable_mask:x},navigationType:i}},[o,c,h,f,p,y,i,x]);return fl(v!=null,`<Router basename="${o}"> is not able to match the URL "${c}${h}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:Se.createElement(ml.Provider,{value:l},Se.createElement(jC.Provider,{children:e,value:v}))}var MA="get",FA="application/x-www-form-urlencoded";function KC(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function dae(n){return KC(n)&&n.tagName.toLowerCase()==="button"}function fae(n){return KC(n)&&n.tagName.toLowerCase()==="form"}function pae(n){return KC(n)&&n.tagName.toLowerCase()==="input"}function gae(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function mae(n,e){return n.button===0&&(!e||e==="_self")&&!gae(n)}function IM(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let i=n[t];return e.concat(Array.isArray(i)?i.map(r=>[t,r]):[[t,i]])},[]))}function yae(n,e){let t=IM(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(s=>{t.append(r,s)})}),t}var Bw=null;function vae(){if(Bw===null)try{new FormData(document.createElement("form"),0),Bw=!1}catch{Bw=!0}return Bw}var _ae=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ek(n){return n!=null&&!_ae.has(n)?(fl(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${FA}"`),null):n}function xae(n,e){let t,i,r,s,a;if(fae(n)){let o=n.getAttribute("action");i=o?Ph(o,e):null,t=n.getAttribute("method")||MA,r=Ek(n.getAttribute("enctype"))||FA,s=new FormData(n)}else if(dae(n)||pae(n)&&(n.type==="submit"||n.type==="image")){let o=n.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=n.getAttribute("formaction")||o.getAttribute("action");if(i=l?Ph(l,e):null,t=n.getAttribute("formmethod")||o.getAttribute("method")||MA,r=Ek(n.getAttribute("formenctype"))||Ek(o.getAttribute("enctype"))||FA,s=new FormData(o,n),!vae()){let{name:c,type:h,value:f}=n;if(h==="image"){let p=c?`${c}.`:"";s.append(`${p}x`,"0"),s.append(`${p}y`,"0")}else c&&s.append(c,f)}}else{if(KC(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=MA,i=null,r=FA,a=n}return s&&r==="text/plain"&&(a=s,s=void 0),{action:i,method:t.toLowerCase(),encType:r,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function NP(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function bae(n,e,t,i){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return t?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&Ph(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function Tae(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Eae(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function wae(n,e,t){let i=await Promise.all(n.map(async r=>{let s=e.routes[r.route.id];if(s){let a=await Tae(s,t);return a.links?a.links():[]}return[]}));return Cae(i.flat(1).filter(Eae).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function xB(n,e,t,i,r,s){let a=(l,c)=>t[c]?l.route.id!==t[c].route.id:!0,o=(l,c)=>{var h;return t[c].pathname!==l.pathname||((h=t[c].route.path)==null?void 0:h.endsWith("*"))&&t[c].params["*"]!==l.params["*"]};return s==="assets"?e.filter((l,c)=>a(l,c)||o(l,c)):s==="data"?e.filter((l,c)=>{var f;let h=i.routes[l.route.id];if(!h||!h.hasLoader)return!1;if(a(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let p=l.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((f=t[0])==null?void 0:f.params)||{},nextUrl:new URL(n,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Aae(n,e,{includeHydrateFallback:t}={}){return Sae(n.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Sae(n){return[...new Set(n)]}function Dae(n){let e={},t=Object.keys(n).sort();for(let i of t)e[i]=n[i];return e}function Cae(n,e){let t=new Set;return new Set(e),n.reduce((i,r)=>{let s=JSON.stringify(Dae(r));return t.has(s)||(t.add(s),i.push({key:s,link:r})),i},[])}function i$(){let n=Se.useContext(P1);return NP(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Iae(){let n=Se.useContext($C);return NP(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var kP=Se.createContext(void 0);kP.displayName="FrameworkContext";function r$(){let n=Se.useContext(kP);return NP(n,"You must render this element inside a <HydratedRouter> element"),n}function Rae(n,e){let t=Se.useContext(kP),[i,r]=Se.useState(!1),[s,a]=Se.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:h,onTouchStart:f}=e,p=Se.useRef(null);Se.useEffect(()=>{if(n==="render"&&a(!0),n==="viewport"){let v=E=>{E.forEach(w=>{a(w.isIntersecting)})},_=new IntersectionObserver(v,{threshold:.5});return p.current&&_.observe(p.current),()=>{_.disconnect()}}},[n]),Se.useEffect(()=>{if(i){let v=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(v)}}},[i]);let y=()=>{r(!0)},x=()=>{r(!1),a(!1)};return t?n!=="intent"?[s,p,{}]:[s,p,{onFocus:Q_(o,y),onBlur:Q_(l,x),onMouseEnter:Q_(c,y),onMouseLeave:Q_(h,x),onTouchStart:Q_(f,y)}]:[!1,p,{}]}function Q_(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function Nae({page:n,...e}){let{router:t}=i$(),i=Se.useMemo(()=>Gq(t.routes,n,t.basename),[t.routes,n,t.basename]);return i?Se.createElement(Mae,{page:n,matches:i,...e}):null}function kae(n){let{manifest:e,routeModules:t}=r$(),[i,r]=Se.useState([]);return Se.useEffect(()=>{let s=!1;return wae(n,e,t).then(a=>{s||r(a)}),()=>{s=!0}},[n,e,t]),i}function Mae({page:n,matches:e,...t}){let i=mu(),{future:r,manifest:s,routeModules:a}=r$(),{basename:o}=i$(),{loaderData:l,matches:c}=Iae(),h=Se.useMemo(()=>xB(n,e,c,s,i,"data"),[n,e,c,s,i]),f=Se.useMemo(()=>xB(n,e,c,s,i,"assets"),[n,e,c,s,i]),p=Se.useMemo(()=>{if(n===i.pathname+i.search+i.hash)return[];let v=new Set,_=!1;if(e.forEach(w=>{var N;let A=s.routes[w.route.id];!A||!A.hasLoader||(!h.some(k=>k.route.id===w.route.id)&&w.route.id in l&&((N=a[w.route.id])!=null&&N.shouldRevalidate)||A.hasClientLoader?_=!0:v.add(w.route.id))}),v.size===0)return[];let E=bae(n,o,r.unstable_trailingSlashAwareDataRequests,"data");return _&&v.size>0&&E.searchParams.set("_routes",e.filter(w=>v.has(w.route.id)).map(w=>w.route.id).join(",")),[E.pathname+E.search]},[o,r.unstable_trailingSlashAwareDataRequests,l,i,s,h,e,n,a]),y=Se.useMemo(()=>Aae(f,s),[f,s]),x=kae(f);return Se.createElement(Se.Fragment,null,p.map(v=>Se.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...t})),y.map(v=>Se.createElement("link",{key:v,rel:"modulepreload",href:v,...t})),x.map(({key:v,link:_})=>Se.createElement("link",{key:v,nonce:t.nonce,..._,crossOrigin:_.crossOrigin??t.crossOrigin})))}function Fae(...n){return e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var Uae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Uae&&(window.__reactRouterVersion="7.13.1")}catch{}function Pae({basename:n,children:e,unstable_useTransitions:t,window:i}){let r=Se.useRef();r.current==null&&(r.current=mse({window:i,v5Compat:!0}));let s=r.current,[a,o]=Se.useState({action:s.action,location:s.location}),l=Se.useCallback(c=>{t===!1?o(c):Se.startTransition(()=>o(c))},[t]);return Se.useLayoutEffect(()=>s.listen(l),[s,l]),Se.createElement(hae,{basename:n,children:e,location:a.location,navigationType:a.action,navigator:s,unstable_useTransitions:t})}var s$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,a$=Se.forwardRef(function({onClick:e,discover:t="render",prefetch:i="none",relative:r,reloadDocument:s,replace:a,unstable_mask:o,state:l,target:c,to:h,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},v){let{basename:_,navigator:E,unstable_useTransitions:w}=Se.useContext(ml),A=typeof h=="string"&&s$.test(h),N=Kq(h,_);h=N.to;let k=Yse(h,{relative:r}),F=mu(),C=null;if(o){let re=DP(o,[],F.unstable_mask?F.unstable_mask.pathname:"/",!0);_!=="/"&&(re.pathname=re.pathname==="/"?_:iu([_,re.pathname])),C=E.createHref(re)}let[M,R,L]=Rae(i,x),H=Vae(h,{replace:a,unstable_mask:o,state:l,target:c,preventScrollReset:f,relative:r,viewTransition:p,unstable_defaultShouldRevalidate:y,unstable_useTransitions:w});function P(re){e&&e(re),re.defaultPrevented||H(re)}let O=!(N.isExternal||s),B=Se.createElement("a",{...x,...L,href:(O?C:void 0)||N.absoluteURL||k,onClick:O?P:e,ref:Fae(v,R),target:c,"data-discover":!A&&t==="render"?"true":void 0});return M&&!A?Se.createElement(Se.Fragment,null,B,Se.createElement(Nae,{page:k})):B});a$.displayName="Link";var Lae=Se.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:i="",end:r=!1,style:s,to:a,viewTransition:o,children:l,...c},h){let f=HT(a,{relative:c.relative}),p=mu(),y=Se.useContext($C),{navigator:x,basename:v}=Se.useContext(ml),_=y!=null&&qae(f)&&o===!0,E=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,w=p.pathname,A=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;t||(w=w.toLowerCase(),A=A?A.toLowerCase():null,E=E.toLowerCase()),A&&v&&(A=Ph(A,v)||A);const N=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let k=w===E||!r&&w.startsWith(E)&&w.charAt(N)==="/",F=A!=null&&(A===E||!r&&A.startsWith(E)&&A.charAt(E.length)==="/"),C={isActive:k,isPending:F,isTransitioning:_},M=k?e:void 0,R;typeof i=="function"?R=i(C):R=[i,k?"active":null,F?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let L=typeof s=="function"?s(C):s;return Se.createElement(a$,{...c,"aria-current":M,className:R,ref:h,style:L,to:a,viewTransition:o},typeof l=="function"?l(C):l)});Lae.displayName="NavLink";var Oae=Se.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:i,replace:r,state:s,method:a=MA,action:o,onSubmit:l,relative:c,preventScrollReset:h,viewTransition:f,unstable_defaultShouldRevalidate:p,...y},x)=>{let{unstable_useTransitions:v}=Se.useContext(ml),_=zae(),E=Gae(o,{relative:c}),w=a.toLowerCase()==="get"?"get":"post",A=typeof o=="string"&&s$.test(o),N=k=>{if(l&&l(k),k.defaultPrevented)return;k.preventDefault();let F=k.nativeEvent.submitter,C=(F==null?void 0:F.getAttribute("formmethod"))||a,M=()=>_(F||k.currentTarget,{fetcherKey:e,method:C,navigate:t,replace:r,state:s,relative:c,preventScrollReset:h,viewTransition:f,unstable_defaultShouldRevalidate:p});v&&t!==!1?Se.startTransition(()=>M()):M()};return Se.createElement("form",{ref:x,method:w,action:E,onSubmit:i?l:N,...y,"data-discover":!A&&n==="render"?"true":void 0})});Oae.displayName="Form";function Bae(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function o$(n){let e=Se.useContext(P1);return Ur(e,Bae(n)),e}function Vae(n,{target:e,replace:t,unstable_mask:i,state:r,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let h=XC(),f=mu(),p=HT(n,{relative:a});return Se.useCallback(y=>{if(mae(y,e)){y.preventDefault();let x=t!==void 0?t:fb(f)===fb(p),v=()=>h(n,{replace:x,unstable_mask:i,state:r,preventScrollReset:s,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:l});c?Se.startTransition(()=>v()):v()}},[f,h,p,t,i,r,e,n,s,a,o,l,c])}function l$(n){fl(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=Se.useRef(IM(n)),t=Se.useRef(!1),i=mu(),r=Se.useMemo(()=>yae(i.search,t.current?null:e.current),[i.search]),s=XC(),a=Se.useCallback((o,l)=>{const c=IM(typeof o=="function"?o(new URLSearchParams(r)):o);t.current=!0,s("?"+c,l)},[s,r]);return[r,a]}var Wae=0,Hae=()=>`__${String(++Wae)}__`;function zae(){let{router:n}=o$("useSubmit"),{basename:e}=Se.useContext(ml),t=oae(),i=n.fetch,r=n.navigate;return Se.useCallback(async(s,a={})=>{let{action:o,method:l,encType:c,formData:h,body:f}=xae(s,e);if(a.navigate===!1){let p=a.fetcherKey||Hae();await i(p,t,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:f,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync})}else await r(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:h,body:f,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[i,r,e,t])}function Gae(n,{relative:e}={}){let{basename:t}=Se.useContext(ml),i=Se.useContext(Kh);Ur(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...HT(n||".",{relative:e})},a=mu();if(n==null){s.search=a.search;let o=new URLSearchParams(s.search),l=o.getAll("index");if(l.some(h=>h==="")){o.delete("index"),l.filter(f=>f).forEach(f=>o.append("index",f));let h=o.toString();s.search=h?`?${h}`:""}}return(!n||n===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(s.pathname=s.pathname==="/"?t:iu([t,s.pathname])),fb(s)}function qae(n,{relative:e}={}){let t=Se.useContext(Jq);Ur(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=o$("useViewTransitionState"),r=HT(n,{relative:e});if(!t.isTransitioning)return!1;let s=Ph(t.currentLocation.pathname,i)||t.currentLocation.pathname,a=Ph(t.nextLocation.pathname,i)||t.nextLocation.pathname;return lD(r.pathname,a)!=null||lD(r.pathname,s)!=null}const $ae="modulepreload",jae=function(n,e){return new URL(n,e).href},bB={},Xae=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let a=function(h){return Promise.all(h.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(t.map(h=>{if(h=jae(h,i),h in bB)return;bB[h]=!0;const f=h.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(!!i)for(let v=o.length-1;v>=0;v--){const _=o[v];if(_.href===h&&(!f||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${p}`))return;const x=document.createElement("link");if(x.rel=f?"stylesheet":$ae,f||(x.as="script"),x.crossOrigin="",x.href=h,c&&x.setAttribute("nonce",c),document.head.appendChild(x),f)return new Promise((v,_)=>{x.addEventListener("load",v),x.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return r.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};var Z_={exports:{}},wk={},Ak,TB;function Kae(){if(TB)return Ak;TB=1;function n(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ak=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},n.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],a=s.message,o=(e[a]||0)+1;e[a]=o,o>=i&&(t=s,i=o)}return t},Ak}var EB;function Yae(){return EB||(EB=1,(function(n){var e=Kae();n.operation=function(t){var i=n.timeouts(t);return new e(i,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},n.timeouts=function(t){if(t instanceof Array)return[].concat(t);var i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)i[r]=t[r];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],a=0;a<i.retries;a++)s.push(this.createTimeout(a,i));return t&&t.forever&&!s.length&&s.push(this.createTimeout(a,i)),s.sort(function(o,l){return o-l}),s},n.createTimeout=function(t,i){var r=i.randomize?Math.random()+1:1,s=Math.round(r*Math.max(i.minTimeout,1)*Math.pow(i.factor,t));return s=Math.min(s,i.maxTimeout),s},n.wrap=function(t,i,r){if(i instanceof Array&&(r=i,i=null),!r){r=[];for(var s in t)typeof t[s]=="function"&&r.push(s)}for(var a=0;a<r.length;a++){var o=r[a],l=t[o];t[o]=(function(h){var f=n.operation(i),p=Array.prototype.slice.call(arguments,1),y=p.pop();p.push(function(x){f.retry(x)||(x&&(arguments[0]=f.mainError()),y.apply(this,arguments))}),f.attempt(function(){h.apply(t,p)})}).bind(t,l),t[o].options=i}}})(wk)),wk}var Sk,wB;function Jae(){return wB||(wB=1,Sk=Yae()),Sk}var AB;function Qae(){if(AB)return Z_.exports;AB=1;const n=Jae(),e=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class t extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const i=(a,o,l)=>{const c=l.retries-(o-1);return a.attemptNumber=o,a.retriesLeft=c,a},r=a=>e.includes(a),s=(a,o)=>new Promise((l,c)=>{o={onFailedAttempt:()=>{},retries:10,...o};const h=n.operation(o);h.attempt(async f=>{try{l(await a(f))}catch(p){if(!(p instanceof Error)){c(new TypeError(`Non-error was thrown: "${p}". You should only throw errors.`));return}if(p instanceof t)h.stop(),c(p.originalError);else if(p instanceof TypeError&&!r(p.message))h.stop(),c(p);else{i(p,f,o);try{await o.onFailedAttempt(p)}catch(y){c(y);return}h.retry(p)||c(h.mainError())}}})});return Z_.exports=s,Z_.exports.default=s,Z_.exports.AbortError=t,Z_.exports}var c$=Qae();const Zae=AP(c$);var eoe={};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let toe,noe;function ioe(){return{geminiUrl:toe,vertexUrl:noe}}function roe(n,e,t,i){var r,s;if(!(n!=null&&n.baseUrl)){const a=ioe();return e?(r=a.vertexUrl)!==null&&r!==void 0?r:t:(s=a.geminiUrl)!==null&&s!==void 0?s:i}return n.baseUrl}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Yh{}function At(n,e){const t=/\{([^}]+)\}/g;return n.replace(t,(i,r)=>{if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];return s!=null?String(s):""}else throw new Error(`Key '${r}' not found in valueMap.`)})}function S(n,e,t){for(let s=0;s<e.length-1;s++){const a=e[s];if(a.endsWith("[]")){const o=a.slice(0,-2);if(!(o in n))if(Array.isArray(t))n[o]=Array.from({length:t.length},()=>({}));else throw new Error(`Value must be a list given an array path ${a}`);if(Array.isArray(n[o])){const l=n[o];if(Array.isArray(t))for(let c=0;c<l.length;c++){const h=l[c];S(h,e.slice(s+1),t[c])}else for(const c of l)S(c,e.slice(s+1),t)}return}else if(a.endsWith("[0]")){const o=a.slice(0,-3);o in n||(n[o]=[{}]);const l=n[o];S(l[0],e.slice(s+1),t);return}(!n[a]||typeof n[a]!="object")&&(n[a]={}),n=n[a]}const i=e[e.length-1],r=n[i];if(r!==void 0){if(!t||typeof t=="object"&&Object.keys(t).length===0||t===r)return;if(typeof r=="object"&&typeof t=="object"&&r!==null&&t!==null)Object.assign(r,t);else throw new Error(`Cannot set value for an existing key. Key: ${i}`)}else i==="_self"&&typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.assign(n,t):n[i]=t}function T(n,e,t=void 0){try{if(e.length===1&&e[0]==="_self")return n;for(let i=0;i<e.length;i++){if(typeof n!="object"||n===null)return t;const r=e[i];if(r.endsWith("[]")){const s=r.slice(0,-2);if(s in n){const a=n[s];return Array.isArray(a)?a.map(o=>T(o,e.slice(i+1),t)):t}else return t}else n=n[r]}return n}catch(i){if(i instanceof TypeError)return t;throw i}}function soe(n,e){for(const[t,i]of Object.entries(e)){const r=t.split("."),s=i.split("."),a=new Set;let o=-1;for(let l=0;l<r.length;l++)if(r[l]==="*"){o=l;break}if(o!==-1&&s.length>o)for(let l=o;l<s.length;l++){const c=s[l];c!=="*"&&!c.endsWith("[]")&&!c.endsWith("[0]")&&a.add(c)}RM(n,r,s,0,a)}}function RM(n,e,t,i,r){if(i>=e.length||typeof n!="object"||n===null)return;const s=e[i];if(s.endsWith("[]")){const a=s.slice(0,-2),o=n;if(a in o&&Array.isArray(o[a]))for(const l of o[a])RM(l,e,t,i+1,r)}else if(s==="*"){if(typeof n=="object"&&n!==null&&!Array.isArray(n)){const a=n,o=Object.keys(a).filter(c=>!c.startsWith("_")&&!r.has(c)),l={};for(const c of o)l[c]=a[c];for(const[c,h]of Object.entries(l)){const f=[];for(const p of t.slice(i))p==="*"?f.push(c):f.push(p);S(a,f,h)}for(const c of o)delete a[c]}}else{const a=n;s in a&&RM(a[s],e,t,i+1,r)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function MP(n){if(typeof n!="string")throw new Error("fromImageBytes must be a string");return n}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function aoe(n){const e={},t=T(n,["operationName"]);t!=null&&S(e,["operationName"],t);const i=T(n,["resourceName"]);return i!=null&&S(e,["_url","resourceName"],i),e}function ooe(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["response","generateVideoResponse"]);return a!=null&&S(e,["response"],coe(a)),e}function loe(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["response"]);return a!=null&&S(e,["response"],uoe(a)),e}function coe(n){const e={},t=T(n,["generatedSamples"]);if(t!=null){let s=t;Array.isArray(s)&&(s=s.map(a=>hoe(a))),S(e,["generatedVideos"],s)}const i=T(n,["raiMediaFilteredCount"]);i!=null&&S(e,["raiMediaFilteredCount"],i);const r=T(n,["raiMediaFilteredReasons"]);return r!=null&&S(e,["raiMediaFilteredReasons"],r),e}function uoe(n){const e={},t=T(n,["videos"]);if(t!=null){let s=t;Array.isArray(s)&&(s=s.map(a=>doe(a))),S(e,["generatedVideos"],s)}const i=T(n,["raiMediaFilteredCount"]);i!=null&&S(e,["raiMediaFilteredCount"],i);const r=T(n,["raiMediaFilteredReasons"]);return r!=null&&S(e,["raiMediaFilteredReasons"],r),e}function hoe(n){const e={},t=T(n,["video"]);return t!=null&&S(e,["video"],voe(t)),e}function doe(n){const e={},t=T(n,["_self"]);return t!=null&&S(e,["video"],_oe(t)),e}function foe(n){const e={},t=T(n,["operationName"]);return t!=null&&S(e,["_url","operationName"],t),e}function poe(n){const e={},t=T(n,["operationName"]);return t!=null&&S(e,["_url","operationName"],t),e}function goe(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["response"]);return a!=null&&S(e,["response"],moe(a)),e}function moe(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["parent"]);i!=null&&S(e,["parent"],i);const r=T(n,["documentName"]);return r!=null&&S(e,["documentName"],r),e}function u$(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["response"]);return a!=null&&S(e,["response"],yoe(a)),e}function yoe(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["parent"]);i!=null&&S(e,["parent"],i);const r=T(n,["documentName"]);return r!=null&&S(e,["documentName"],r),e}function voe(n){const e={},t=T(n,["uri"]);t!=null&&S(e,["uri"],t);const i=T(n,["encodedVideo"]);i!=null&&S(e,["videoBytes"],MP(i));const r=T(n,["encoding"]);return r!=null&&S(e,["mimeType"],r),e}function _oe(n){const e={},t=T(n,["gcsUri"]);t!=null&&S(e,["uri"],t);const i=T(n,["bytesBase64Encoded"]);i!=null&&S(e,["videoBytes"],MP(i));const r=T(n,["mimeType"]);return r!=null&&S(e,["mimeType"],r),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var SB;(function(n){n.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",n.PYTHON="PYTHON"})(SB||(SB={}));var DB;(function(n){n.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",n.OUTCOME_OK="OUTCOME_OK",n.OUTCOME_FAILED="OUTCOME_FAILED",n.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(DB||(DB={}));var CB;(function(n){n.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",n.SILENT="SILENT",n.WHEN_IDLE="WHEN_IDLE",n.INTERRUPT="INTERRUPT"})(CB||(CB={}));var Wf;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.STRING="STRING",n.NUMBER="NUMBER",n.INTEGER="INTEGER",n.BOOLEAN="BOOLEAN",n.ARRAY="ARRAY",n.OBJECT="OBJECT",n.NULL="NULL"})(Wf||(Wf={}));var IB;(function(n){n.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",n.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",n.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",n.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(IB||(IB={}));var RB;(function(n){n.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",n.NO_AUTH="NO_AUTH",n.API_KEY_AUTH="API_KEY_AUTH",n.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",n.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",n.OAUTH="OAUTH",n.OIDC_AUTH="OIDC_AUTH"})(RB||(RB={}));var NB;(function(n){n.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",n.HTTP_IN_QUERY="HTTP_IN_QUERY",n.HTTP_IN_HEADER="HTTP_IN_HEADER",n.HTTP_IN_PATH="HTTP_IN_PATH",n.HTTP_IN_BODY="HTTP_IN_BODY",n.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(NB||(NB={}));var kB;(function(n){n.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",n.SIMPLE_SEARCH="SIMPLE_SEARCH",n.ELASTIC_SEARCH="ELASTIC_SEARCH"})(kB||(kB={}));var MB;(function(n){n.UNSPECIFIED="UNSPECIFIED",n.BLOCKING="BLOCKING",n.NON_BLOCKING="NON_BLOCKING"})(MB||(MB={}));var FB;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(FB||(FB={}));var UB;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.AUTO="AUTO",n.ANY="ANY",n.NONE="NONE",n.VALIDATED="VALIDATED"})(UB||(UB={}));var PB;(function(n){n.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH",n.MINIMAL="MINIMAL"})(PB||(PB={}));var LB;(function(n){n.DONT_ALLOW="DONT_ALLOW",n.ALLOW_ADULT="ALLOW_ADULT",n.ALLOW_ALL="ALLOW_ALL"})(LB||(LB={}));var OB;(function(n){n.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",n.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",n.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",n.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",n.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",n.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",n.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",n.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",n.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(OB||(OB={}));var BB;(function(n){n.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",n.SEVERITY="SEVERITY",n.PROBABILITY="PROBABILITY"})(BB||(BB={}));var VB;(function(n){n.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE",n.OFF="OFF"})(VB||(VB={}));var WB;(function(n){n.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",n.STOP="STOP",n.MAX_TOKENS="MAX_TOKENS",n.SAFETY="SAFETY",n.RECITATION="RECITATION",n.LANGUAGE="LANGUAGE",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.SPII="SPII",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.IMAGE_SAFETY="IMAGE_SAFETY",n.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",n.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",n.NO_IMAGE="NO_IMAGE",n.IMAGE_RECITATION="IMAGE_RECITATION",n.IMAGE_OTHER="IMAGE_OTHER"})(WB||(WB={}));var HB;(function(n){n.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",n.NEGLIGIBLE="NEGLIGIBLE",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH"})(HB||(HB={}));var zB;(function(n){n.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",n.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",n.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",n.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",n.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(zB||(zB={}));var GB;(function(n){n.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",n.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",n.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",n.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",n.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(GB||(GB={}));var qB;(function(n){n.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",n.SAFETY="SAFETY",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.IMAGE_SAFETY="IMAGE_SAFETY",n.MODEL_ARMOR="MODEL_ARMOR",n.JAILBREAK="JAILBREAK"})(qB||(qB={}));var $B;(function(n){n.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",n.ON_DEMAND="ON_DEMAND",n.ON_DEMAND_PRIORITY="ON_DEMAND_PRIORITY",n.ON_DEMAND_FLEX="ON_DEMAND_FLEX",n.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})($B||($B={}));var cD;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.AUDIO="AUDIO"})(cD||(cD={}));var jB;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(jB||(jB={}));var XB;(function(n){n.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",n.TUNING_MODE_FULL="TUNING_MODE_FULL",n.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(XB||(XB={}));var KB;(function(n){n.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",n.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",n.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",n.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",n.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",n.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",n.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(KB||(KB={}));var NM;(function(n){n.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",n.JOB_STATE_QUEUED="JOB_STATE_QUEUED",n.JOB_STATE_PENDING="JOB_STATE_PENDING",n.JOB_STATE_RUNNING="JOB_STATE_RUNNING",n.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",n.JOB_STATE_FAILED="JOB_STATE_FAILED",n.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",n.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",n.JOB_STATE_PAUSED="JOB_STATE_PAUSED",n.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",n.JOB_STATE_UPDATING="JOB_STATE_UPDATING",n.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(NM||(NM={}));var YB;(function(n){n.TUNING_JOB_STATE_UNSPECIFIED="TUNING_JOB_STATE_UNSPECIFIED",n.TUNING_JOB_STATE_WAITING_FOR_QUOTA="TUNING_JOB_STATE_WAITING_FOR_QUOTA",n.TUNING_JOB_STATE_PROCESSING_DATASET="TUNING_JOB_STATE_PROCESSING_DATASET",n.TUNING_JOB_STATE_WAITING_FOR_CAPACITY="TUNING_JOB_STATE_WAITING_FOR_CAPACITY",n.TUNING_JOB_STATE_TUNING="TUNING_JOB_STATE_TUNING",n.TUNING_JOB_STATE_POST_PROCESSING="TUNING_JOB_STATE_POST_PROCESSING"})(YB||(YB={}));var JB;(function(n){n.AGGREGATION_METRIC_UNSPECIFIED="AGGREGATION_METRIC_UNSPECIFIED",n.AVERAGE="AVERAGE",n.MODE="MODE",n.STANDARD_DEVIATION="STANDARD_DEVIATION",n.VARIANCE="VARIANCE",n.MINIMUM="MINIMUM",n.MAXIMUM="MAXIMUM",n.MEDIAN="MEDIAN",n.PERCENTILE_P90="PERCENTILE_P90",n.PERCENTILE_P95="PERCENTILE_P95",n.PERCENTILE_P99="PERCENTILE_P99"})(JB||(JB={}));var QB;(function(n){n.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",n.BASELINE="BASELINE",n.CANDIDATE="CANDIDATE",n.TIE="TIE"})(QB||(QB={}));var ZB;(function(n){n.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",n.TUNING_TASK_I2V="TUNING_TASK_I2V",n.TUNING_TASK_T2V="TUNING_TASK_T2V",n.TUNING_TASK_R2V="TUNING_TASK_R2V"})(ZB||(ZB={}));var e9;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",n.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(e9||(e9={}));var t9;(function(n){n.TOOL_TYPE_UNSPECIFIED="TOOL_TYPE_UNSPECIFIED",n.GOOGLE_SEARCH_WEB="GOOGLE_SEARCH_WEB",n.GOOGLE_SEARCH_IMAGE="GOOGLE_SEARCH_IMAGE",n.URL_CONTEXT="URL_CONTEXT",n.GOOGLE_MAPS="GOOGLE_MAPS",n.FILE_SEARCH="FILE_SEARCH"})(t9||(t9={}));var kM;(function(n){n.COLLECTION="COLLECTION"})(kM||(kM={}));var n9;(function(n){n.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",n.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",n.BALANCED="BALANCED",n.PRIORITIZE_COST="PRIORITIZE_COST"})(n9||(n9={}));var i9;(function(n){n.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",n.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(i9||(i9={}));var r9;(function(n){n.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",n.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",n.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(r9||(r9={}));var uD;(function(n){n.PREDICT="PREDICT",n.EMBED_CONTENT="EMBED_CONTENT"})(uD||(uD={}));var s9;(function(n){n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE"})(s9||(s9={}));var a9;(function(n){n.auto="auto",n.en="en",n.ja="ja",n.ko="ko",n.hi="hi",n.zh="zh",n.pt="pt",n.es="es"})(a9||(a9={}));var o9;(function(n){n.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",n.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",n.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",n.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",n.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(o9||(o9={}));var l9;(function(n){n.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",n.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",n.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",n.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(l9||(l9={}));var c9;(function(n){n.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",n.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",n.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",n.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(c9||(c9={}));var u9;(function(n){n.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",n.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",n.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",n.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",n.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",n.EDIT_MODE_STYLE="EDIT_MODE_STYLE",n.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",n.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(u9||(u9={}));var h9;(function(n){n.FOREGROUND="FOREGROUND",n.BACKGROUND="BACKGROUND",n.PROMPT="PROMPT",n.SEMANTIC="SEMANTIC",n.INTERACTIVE="INTERACTIVE"})(h9||(h9={}));var d9;(function(n){n.ASSET="ASSET",n.STYLE="STYLE"})(d9||(d9={}));var f9;(function(n){n.INSERT="INSERT",n.REMOVE="REMOVE",n.REMOVE_STATIC="REMOVE_STATIC",n.OUTPAINT="OUTPAINT"})(f9||(f9={}));var p9;(function(n){n.OPTIMIZED="OPTIMIZED",n.LOSSLESS="LOSSLESS"})(p9||(p9={}));var g9;(function(n){n.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",n.PREFERENCE_TUNING="PREFERENCE_TUNING",n.DISTILLATION="DISTILLATION"})(g9||(g9={}));var m9;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.STATE_PENDING="STATE_PENDING",n.STATE_ACTIVE="STATE_ACTIVE",n.STATE_FAILED="STATE_FAILED"})(m9||(m9={}));var y9;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.PROCESSING="PROCESSING",n.ACTIVE="ACTIVE",n.FAILED="FAILED"})(y9||(y9={}));var v9;(function(n){n.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",n.UPLOADED="UPLOADED",n.GENERATED="GENERATED",n.REGISTERED="REGISTERED"})(v9||(v9={}));var _9;(function(n){n.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.RESPONSE_REJECTED="RESPONSE_REJECTED",n.NEED_MORE_INPUT="NEED_MORE_INPUT"})(_9||(_9={}));var x9;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.VIDEO="VIDEO",n.AUDIO="AUDIO",n.DOCUMENT="DOCUMENT"})(x9||(x9={}));var b9;(function(n){n.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",n.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",n.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(b9||(b9={}));var T9;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.ACTIVITY_START="ACTIVITY_START",n.ACTIVITY_END="ACTIVITY_END"})(T9||(T9={}));var E9;(function(n){n.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",n.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",n.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(E9||(E9={}));var w9;(function(n){n.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",n.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",n.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(w9||(w9={}));var A9;(function(n){n.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",n.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",n.NO_INTERRUPTION="NO_INTERRUPTION"})(A9||(A9={}));var S9;(function(n){n.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",n.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",n.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(S9||(S9={}));var D9;(function(n){n.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",n.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",n.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",n.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",n.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",n.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",n.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",n.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",n.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",n.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",n.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",n.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",n.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(D9||(D9={}));var C9;(function(n){n.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",n.QUALITY="QUALITY",n.DIVERSITY="DIVERSITY",n.VOCALIZATION="VOCALIZATION"})(C9||(C9={}));var yy;(function(n){n.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",n.PLAY="PLAY",n.PAUSE="PAUSE",n.STOP="STOP",n.RESET_CONTEXT="RESET_CONTEXT"})(yy||(yy={}));class MM{constructor(e){const t={};for(const i of e.headers.entries())t[i[0]]=i[1];this.headers=t,this.responseInternal=e}json(){return this.responseInternal.json()}}class ex{get text(){var e,t,i,r,s,a,o,l;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let c="",h=!1;const f=[];for(const p of(l=(o=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||o===void 0?void 0:o.parts)!==null&&l!==void 0?l:[]){for(const[y,x]of Object.entries(p))y!=="text"&&y!=="thought"&&y!=="thoughtSignature"&&(x!==null||x!==void 0)&&f.push(y);if(typeof p.text=="string"){if(typeof p.thought=="boolean"&&p.thought)continue;h=!0,c+=p.text}}return f.length>0&&console.warn(`there are non-text parts ${f} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),h?c:void 0}get data(){var e,t,i,r,s,a,o,l;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let c="";const h=[];for(const f of(l=(o=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||o===void 0?void 0:o.parts)!==null&&l!==void 0?l:[]){for(const[p,y]of Object.entries(f))p!=="inlineData"&&(y!==null||y!==void 0)&&h.push(p);f.inlineData&&typeof f.inlineData.data=="string"&&(c+=atob(f.inlineData.data))}return h.length>0&&console.warn(`there are non-data parts ${h} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),c.length>0?btoa(c):void 0}get functionCalls(){var e,t,i,r,s,a,o,l;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const c=(l=(o=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||o===void 0?void 0:o.parts)===null||l===void 0?void 0:l.filter(h=>h.functionCall).map(h=>h.functionCall).filter(h=>h!==void 0);if((c==null?void 0:c.length)!==0)return c}get executableCode(){var e,t,i,r,s,a,o,l,c;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const h=(l=(o=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||o===void 0?void 0:o.parts)===null||l===void 0?void 0:l.filter(f=>f.executableCode).map(f=>f.executableCode).filter(f=>f!==void 0);if((h==null?void 0:h.length)!==0)return(c=h==null?void 0:h[0])===null||c===void 0?void 0:c.code}get codeExecutionResult(){var e,t,i,r,s,a,o,l,c;if(((r=(i=(t=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||t===void 0?void 0:t.content)===null||i===void 0?void 0:i.parts)===null||r===void 0?void 0:r.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const h=(l=(o=(a=(s=this.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content)===null||o===void 0?void 0:o.parts)===null||l===void 0?void 0:l.filter(f=>f.codeExecutionResult).map(f=>f.codeExecutionResult).filter(f=>f!==void 0);if((h==null?void 0:h.length)!==0)return(c=h==null?void 0:h[0])===null||c===void 0?void 0:c.output}}class I9{}class R9{}class xoe{}class boe{}class Toe{}class Eoe{}class N9{}class k9{}class M9{}class woe{}class hD{_fromAPIResponse({apiResponse:e,_isVertexAI:t}){const i=new hD;let r;const s=e;return t?r=loe(s):r=ooe(s),Object.assign(i,r),i}}class F9{}class U9{}class P9{}class L9{}class Aoe{}class Soe{}class Doe{}class FP{_fromAPIResponse({apiResponse:e,_isVertexAI:t}){const i=new FP,s=goe(e);return Object.assign(i,s),i}}class Coe{}class Ioe{}class Roe{}class Noe{}class O9{}class koe{get text(){var e,t,i;let r="",s=!1;const a=[];for(const o of(i=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&i!==void 0?i:[]){for(const[l,c]of Object.entries(o))l!=="text"&&l!=="thought"&&c!==null&&a.push(l);if(typeof o.text=="string"){if(typeof o.thought=="boolean"&&o.thought)continue;s=!0,r+=o.text}}return a.length>0&&console.warn(`there are non-text parts ${a} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),s?r:void 0}get data(){var e,t,i;let r="";const s=[];for(const a of(i=(t=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||t===void 0?void 0:t.parts)!==null&&i!==void 0?i:[]){for(const[o,l]of Object.entries(a))o!=="inlineData"&&l!==null&&s.push(o);a.inlineData&&typeof a.inlineData.data=="string"&&(r+=atob(a.inlineData.data))}return s.length>0&&console.warn(`there are non-data parts ${s} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),r.length>0?btoa(r):void 0}}class Moe{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class UP{_fromAPIResponse({apiResponse:e,_isVertexAI:t}){const i=new UP,s=u$(e);return Object.assign(i,s),i}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Un(n,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(e.includes("..")||e.includes("?")||e.includes("&"))throw new Error("invalid model parameter");if(n.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const t=e.split("/",2);return`publishers/${t[0]}/models/${t[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function h$(n,e){const t=Un(n,e);return t?t.startsWith("publishers/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/${t}`:t.startsWith("models/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/publishers/google/${t}`:t:""}function d$(n){return Array.isArray(n)?n.map(e=>dD(e)):[dD(n)]}function dD(n){if(typeof n=="object"&&n!==null)return n;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof n}`)}function f$(n){const e=dD(n);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function p$(n){const e=dD(n);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function B9(n){if(n==null)throw new Error("PartUnion is required");if(typeof n=="object")return n;if(typeof n=="string")return{text:n};throw new Error(`Unsupported part type: ${typeof n}`)}function g$(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("PartListUnion is required");return Array.isArray(n)?n.map(e=>B9(e)):[B9(n)]}function FM(n){return n!=null&&typeof n=="object"&&"parts"in n&&Array.isArray(n.parts)}function V9(n){return n!=null&&typeof n=="object"&&"functionCall"in n}function W9(n){return n!=null&&typeof n=="object"&&"functionResponse"in n}function es(n){if(n==null)throw new Error("ContentUnion is required");return FM(n)?n:{role:"user",parts:g$(n)}}function PP(n,e){if(!e)return[];if(n.isVertexAI()&&Array.isArray(e))return e.flatMap(t=>{const i=es(t);return i.parts&&i.parts.length>0&&i.parts[0].text!==void 0?[i.parts[0].text]:[]});if(n.isVertexAI()){const t=es(e);return t.parts&&t.parts.length>0&&t.parts[0].text!==void 0?[t.parts[0].text]:[]}return Array.isArray(e)?e.map(t=>es(t)):[es(e)]}function Eo(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("contents are required");if(!Array.isArray(n)){if(V9(n)||W9(n))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[es(n)]}const e=[],t=[],i=FM(n[0]);for(const r of n){const s=FM(r);if(s!=i)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(s)e.push(r);else{if(V9(r)||W9(r))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");t.push(r)}}return i||e.push({role:"user",parts:g$(t)}),e}function Foe(n,e){n.includes("null")&&(e.nullable=!0);const t=n.filter(i=>i!=="null");if(t.length===1)e.type=Object.values(Wf).includes(t[0].toUpperCase())?t[0].toUpperCase():Wf.TYPE_UNSPECIFIED;else{e.anyOf=[];for(const i of t)e.anyOf.push({type:Object.values(Wf).includes(i.toUpperCase())?i.toUpperCase():Wf.TYPE_UNSPECIFIED})}}function Ny(n){const e={},t=["items"],i=["anyOf"],r=["properties"];if(n.type&&n.anyOf)throw new Error("type and anyOf cannot be both populated.");const s=n.anyOf;s!=null&&s.length==2&&(s[0].type==="null"?(e.nullable=!0,n=s[1]):s[1].type==="null"&&(e.nullable=!0,n=s[0])),n.type instanceof Array&&Foe(n.type,e);for(const[a,o]of Object.entries(n))if(o!=null)if(a=="type"){if(o==="null")throw new Error("type: null can not be the only possible type for the field.");if(o instanceof Array)continue;e.type=Object.values(Wf).includes(o.toUpperCase())?o.toUpperCase():Wf.TYPE_UNSPECIFIED}else if(t.includes(a))e[a]=Ny(o);else if(i.includes(a)){const l=[];for(const c of o){if(c.type=="null"){e.nullable=!0;continue}l.push(Ny(c))}e[a]=l}else if(r.includes(a)){const l={};for(const[c,h]of Object.entries(o))l[c]=Ny(h);e[a]=l}else{if(a==="additionalProperties")continue;e[a]=o}return e}function LP(n){return Ny(n)}function OP(n){if(typeof n=="object")return n;if(typeof n=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:n}}};throw new Error(`Unsupported speechConfig type: ${typeof n}`)}function BP(n){if("multiSpeakerVoiceConfig"in n)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return n}function L1(n){if(n.functionDeclarations)for(const e of n.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=Ny(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=Ny(e.response));return n}function O1(n){if(n==null)throw new Error("tools is required");if(!Array.isArray(n))throw new Error("tools is required and must be an array of Tools");const e=[];for(const t of n)e.push(t);return e}function Uoe(n,e,t,i=1){const r=!e.startsWith(`${t}/`)&&e.split("/").length===i;return n.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${n.getProject()}/${e}`:e.startsWith(`${t}/`)?`projects/${n.getProject()}/locations/${n.getLocation()}/${e}`:r?`projects/${n.getProject()}/locations/${n.getLocation()}/${t}/${e}`:e:r?`${t}/${e}`:e}function Jh(n,e){if(typeof e!="string")throw new Error("name must be a string");return Uoe(n,e,"cachedContents")}function m$(n){switch(n){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return n}}function mp(n){return MP(n)}function Poe(n){return n!=null&&typeof n=="object"&&"name"in n}function Loe(n){return n!=null&&typeof n=="object"&&"video"in n}function Ooe(n){return n!=null&&typeof n=="object"&&"uri"in n}function y$(n){var e;let t;if(Poe(n)&&(t=n.name),!(Ooe(n)&&(t=n.uri,t===void 0))&&!(Loe(n)&&(t=(e=n.video)===null||e===void 0?void 0:e.uri,t===void 0))){if(typeof n=="string"&&(t=n),t===void 0)throw new Error("Could not extract file name from the provided input.");if(t.startsWith("https://")){const r=t.split("files/")[1].match(/[a-z0-9]+/);if(r===null)throw new Error(`Could not extract file name from URI ${t}`);t=r[0]}else t.startsWith("files/")&&(t=t.split("files/")[1]);return t}}function v$(n,e){let t;return n.isVertexAI()?t=e?"publishers/google/models":"models":t=e?"models":"tunedModels",t}function _$(n){for(const e of["models","tunedModels","publisherModels"])if(Boe(n,e))return n[e];return[]}function Boe(n,e){return n!==null&&typeof n=="object"&&e in n}function Voe(n,e={}){const t=n,i={name:t.name,description:t.description,parametersJsonSchema:t.inputSchema};return t.outputSchema&&(i.responseJsonSchema=t.outputSchema),e.behavior&&(i.behavior=e.behavior),{functionDeclarations:[i]}}function Woe(n,e={}){const t=[],i=new Set;for(const r of n){const s=r.name;if(i.has(s))throw new Error(`Duplicate function name ${s} found in MCP tools. Please ensure function names are unique.`);i.add(s);const a=Voe(r,e);a.functionDeclarations&&t.push(...a.functionDeclarations)}return{functionDeclarations:t}}function x$(n,e){let t;if(typeof e=="string")if(n.isVertexAI())if(e.startsWith("gs://"))t={format:"jsonl",gcsUri:[e]};else if(e.startsWith("bq://"))t={format:"bigquery",bigqueryUri:e};else throw new Error(`Unsupported string source for Vertex AI: ${e}`);else if(e.startsWith("files/"))t={fileName:e};else throw new Error(`Unsupported string source for Gemini API: ${e}`);else if(Array.isArray(e)){if(n.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");t={inlinedRequests:e}}else t=e;const i=[t.gcsUri,t.bigqueryUri].filter(Boolean).length,r=[t.inlinedRequests,t.fileName].filter(Boolean).length;if(n.isVertexAI()){if(r>0||i!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(i>0||r!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return t}function Hoe(n){if(typeof n!="string")return n;const e=n;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function b$(n){if(typeof n!="object"||n===null)return{};const e=n,t=e.inlinedResponses;if(typeof t!="object"||t===null)return n;const r=t.inlinedResponses;if(!Array.isArray(r)||r.length===0)return n;let s=!1;for(const a of r){if(typeof a!="object"||a===null)continue;const l=a.response;if(typeof l!="object"||l===null)continue;if(l.embedding!==void 0){s=!0;break}}return s&&(e.inlinedEmbedContentResponses=e.inlinedResponses,delete e.inlinedResponses),n}function B1(n,e){const t=e;if(!n.isVertexAI()){if(/batches\/[^/]+$/.test(t))return t.split("/").pop();throw new Error(`Invalid batch job name: ${t}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(t))return t.split("/").pop();if(/^\d+$/.test(t))return t;throw new Error(`Invalid batch job name: ${t}.`)}function T$(n){const e=n;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":e}function zoe(n){return n.includes("gemini")&&n!=="gemini-embedding-001"||n.includes("maas")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Goe(n){const e={},t=T(n,["apiKey"]);if(t!=null&&S(e,["apiKey"],t),T(n,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(T(n,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(T(n,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(T(n,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(T(n,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(T(n,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function qoe(n){const e={},t=T(n,["responsesFile"]);t!=null&&S(e,["fileName"],t);const i=T(n,["inlinedResponses","inlinedResponses"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>Ale(a))),S(e,["inlinedResponses"],s)}const r=T(n,["inlinedEmbedContentResponses","inlinedResponses"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["inlinedEmbedContentResponses"],s)}return e}function $oe(n){const e={},t=T(n,["predictionsFormat"]);t!=null&&S(e,["format"],t);const i=T(n,["gcsDestination","outputUriPrefix"]);i!=null&&S(e,["gcsUri"],i);const r=T(n,["bigqueryDestination","outputUri"]);return r!=null&&S(e,["bigqueryUri"],r),e}function joe(n){const e={},t=T(n,["format"]);t!=null&&S(e,["predictionsFormat"],t);const i=T(n,["gcsUri"]);i!=null&&S(e,["gcsDestination","outputUriPrefix"],i);const r=T(n,["bigqueryUri"]);if(r!=null&&S(e,["bigqueryDestination","outputUri"],r),T(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(T(n,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(T(n,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return e}function UA(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata","displayName"]);i!=null&&S(e,["displayName"],i);const r=T(n,["metadata","state"]);r!=null&&S(e,["state"],T$(r));const s=T(n,["metadata","createTime"]);s!=null&&S(e,["createTime"],s);const a=T(n,["metadata","endTime"]);a!=null&&S(e,["endTime"],a);const o=T(n,["metadata","updateTime"]);o!=null&&S(e,["updateTime"],o);const l=T(n,["metadata","model"]);l!=null&&S(e,["model"],l);const c=T(n,["metadata","output"]);return c!=null&&S(e,["dest"],qoe(b$(c))),e}function UM(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["displayName"]);i!=null&&S(e,["displayName"],i);const r=T(n,["state"]);r!=null&&S(e,["state"],T$(r));const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["createTime"]);a!=null&&S(e,["createTime"],a);const o=T(n,["startTime"]);o!=null&&S(e,["startTime"],o);const l=T(n,["endTime"]);l!=null&&S(e,["endTime"],l);const c=T(n,["updateTime"]);c!=null&&S(e,["updateTime"],c);const h=T(n,["model"]);h!=null&&S(e,["model"],h);const f=T(n,["inputConfig"]);f!=null&&S(e,["src"],Xoe(f));const p=T(n,["outputConfig"]);p!=null&&S(e,["dest"],$oe(b$(p)));const y=T(n,["completionStats"]);return y!=null&&S(e,["completionStats"],y),e}function Xoe(n){const e={},t=T(n,["instancesFormat"]);t!=null&&S(e,["format"],t);const i=T(n,["gcsSource","uris"]);i!=null&&S(e,["gcsUri"],i);const r=T(n,["bigquerySource","inputUri"]);return r!=null&&S(e,["bigqueryUri"],r),e}function Koe(n,e){const t={};if(T(e,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(T(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(T(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const i=T(e,["fileName"]);i!=null&&S(t,["fileName"],i);const r=T(e,["inlinedRequests"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>wle(n,a))),S(t,["requests","requests"],s)}return t}function Yoe(n){const e={},t=T(n,["format"]);t!=null&&S(e,["instancesFormat"],t);const i=T(n,["gcsUri"]);i!=null&&S(e,["gcsSource","uris"],i);const r=T(n,["bigqueryUri"]);if(r!=null&&S(e,["bigquerySource","inputUri"],r),T(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(T(n,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return e}function Joe(n){const e={},t=T(n,["data"]);if(t!=null&&S(e,["data"],t),T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function Qoe(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function Zoe(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function ele(n){const e={},t=T(n,["content"]);t!=null&&S(e,["content"],t);const i=T(n,["citationMetadata"]);i!=null&&S(e,["citationMetadata"],tle(i));const r=T(n,["tokenCount"]);r!=null&&S(e,["tokenCount"],r);const s=T(n,["finishReason"]);s!=null&&S(e,["finishReason"],s);const a=T(n,["groundingMetadata"]);a!=null&&S(e,["groundingMetadata"],a);const o=T(n,["avgLogprobs"]);o!=null&&S(e,["avgLogprobs"],o);const l=T(n,["index"]);l!=null&&S(e,["index"],l);const c=T(n,["logprobsResult"]);c!=null&&S(e,["logprobsResult"],c);const h=T(n,["safetyRatings"]);if(h!=null){let p=h;Array.isArray(p)&&(p=p.map(y=>y)),S(e,["safetyRatings"],p)}const f=T(n,["urlContextMetadata"]);return f!=null&&S(e,["urlContextMetadata"],f),e}function tle(n){const e={},t=T(n,["citationSources"]);if(t!=null){let i=t;Array.isArray(i)&&(i=i.map(r=>r)),S(e,["citations"],i)}return e}function E$(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>kle(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function nle(n,e){const t={},i=T(n,["displayName"]);if(e!==void 0&&i!=null&&S(e,["batch","displayName"],i),T(n,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return t}function ile(n,e){const t={},i=T(n,["displayName"]);e!==void 0&&i!=null&&S(e,["displayName"],i);const r=T(n,["dest"]);return e!==void 0&&r!=null&&S(e,["outputConfig"],joe(Hoe(r))),t}function H9(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["_url","model"],Un(n,i));const r=T(e,["src"]);r!=null&&S(t,["batch","inputConfig"],Koe(n,x$(n,r)));const s=T(e,["config"]);return s!=null&&nle(s,t),t}function rle(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["model"],Un(n,i));const r=T(e,["src"]);r!=null&&S(t,["inputConfig"],Yoe(x$(n,r)));const s=T(e,["config"]);return s!=null&&ile(s,t),t}function sle(n,e){const t={},i=T(n,["displayName"]);return e!==void 0&&i!=null&&S(e,["batch","displayName"],i),t}function ale(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["_url","model"],Un(n,i));const r=T(e,["src"]);r!=null&&S(t,["batch","inputConfig"],fle(n,r));const s=T(e,["config"]);return s!=null&&sle(s,t),t}function ole(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function lle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function cle(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["name"]);i!=null&&S(e,["name"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);return s!=null&&S(e,["error"],s),e}function ule(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["name"]);i!=null&&S(e,["name"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);return s!=null&&S(e,["error"],s),e}function hle(n,e){const t={},i=T(e,["contents"]);if(i!=null){let s=PP(n,i);Array.isArray(s)&&(s=s.map(a=>a)),S(t,["requests[]","request","content"],s)}const r=T(e,["config"]);return r!=null&&(S(t,["_self"],dle(r,t)),soe(t,{"requests[].*":"requests[].request.*"})),t}function dle(n,e){const t={},i=T(n,["taskType"]);e!==void 0&&i!=null&&S(e,["requests[]","taskType"],i);const r=T(n,["title"]);e!==void 0&&r!=null&&S(e,["requests[]","title"],r);const s=T(n,["outputDimensionality"]);if(e!==void 0&&s!=null&&S(e,["requests[]","outputDimensionality"],s),T(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(T(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return t}function fle(n,e){const t={},i=T(e,["fileName"]);i!=null&&S(t,["file_name"],i);const r=T(e,["inlinedRequests"]);return r!=null&&S(t,["requests"],hle(n,r)),t}function ple(n){const e={};if(T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const t=T(n,["fileUri"]);t!=null&&S(e,["fileUri"],t);const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function gle(n){const e={},t=T(n,["id"]);t!=null&&S(e,["id"],t);const i=T(n,["args"]);i!=null&&S(e,["args"],i);const r=T(n,["name"]);if(r!=null&&S(e,["name"],r),T(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(T(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function mle(n){const e={},t=T(n,["allowedFunctionNames"]);t!=null&&S(e,["allowedFunctionNames"],t);const i=T(n,["mode"]);if(i!=null&&S(e,["mode"],i),T(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function yle(n,e,t){const i={},r=T(e,["systemInstruction"]);t!==void 0&&r!=null&&S(t,["systemInstruction"],E$(es(r)));const s=T(e,["temperature"]);s!=null&&S(i,["temperature"],s);const a=T(e,["topP"]);a!=null&&S(i,["topP"],a);const o=T(e,["topK"]);o!=null&&S(i,["topK"],o);const l=T(e,["candidateCount"]);l!=null&&S(i,["candidateCount"],l);const c=T(e,["maxOutputTokens"]);c!=null&&S(i,["maxOutputTokens"],c);const h=T(e,["stopSequences"]);h!=null&&S(i,["stopSequences"],h);const f=T(e,["responseLogprobs"]);f!=null&&S(i,["responseLogprobs"],f);const p=T(e,["logprobs"]);p!=null&&S(i,["logprobs"],p);const y=T(e,["presencePenalty"]);y!=null&&S(i,["presencePenalty"],y);const x=T(e,["frequencyPenalty"]);x!=null&&S(i,["frequencyPenalty"],x);const v=T(e,["seed"]);v!=null&&S(i,["seed"],v);const _=T(e,["responseMimeType"]);_!=null&&S(i,["responseMimeType"],_);const E=T(e,["responseSchema"]);E!=null&&S(i,["responseSchema"],LP(E));const w=T(e,["responseJsonSchema"]);if(w!=null&&S(i,["responseJsonSchema"],w),T(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(T(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const A=T(e,["safetySettings"]);if(t!==void 0&&A!=null){let O=A;Array.isArray(O)&&(O=O.map(B=>Mle(B))),S(t,["safetySettings"],O)}const N=T(e,["tools"]);if(t!==void 0&&N!=null){let O=O1(N);Array.isArray(O)&&(O=O.map(B=>Ule(L1(B)))),S(t,["tools"],O)}const k=T(e,["toolConfig"]);if(t!==void 0&&k!=null&&S(t,["toolConfig"],Fle(k)),T(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const F=T(e,["cachedContent"]);t!==void 0&&F!=null&&S(t,["cachedContent"],Jh(n,F));const C=T(e,["responseModalities"]);C!=null&&S(i,["responseModalities"],C);const M=T(e,["mediaResolution"]);M!=null&&S(i,["mediaResolution"],M);const R=T(e,["speechConfig"]);if(R!=null&&S(i,["speechConfig"],OP(R)),T(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const L=T(e,["thinkingConfig"]);L!=null&&S(i,["thinkingConfig"],L);const H=T(e,["imageConfig"]);H!=null&&S(i,["imageConfig"],Ele(H));const P=T(e,["enableEnhancedCivicAnswers"]);if(P!=null&&S(i,["enableEnhancedCivicAnswers"],P),T(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return i}function vle(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["candidates"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(c=>ele(c))),S(e,["candidates"],l)}const r=T(n,["modelVersion"]);r!=null&&S(e,["modelVersion"],r);const s=T(n,["promptFeedback"]);s!=null&&S(e,["promptFeedback"],s);const a=T(n,["responseId"]);a!=null&&S(e,["responseId"],a);const o=T(n,["usageMetadata"]);return o!=null&&S(e,["usageMetadata"],o),e}function _le(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function xle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],B1(n,i)),t}function ble(n){const e={},t=T(n,["authConfig"]);t!=null&&S(e,["authConfig"],Goe(t));const i=T(n,["enableWidget"]);return i!=null&&S(e,["enableWidget"],i),e}function Tle(n){const e={},t=T(n,["searchTypes"]);if(t!=null&&S(e,["searchTypes"],t),T(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(T(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const i=T(n,["timeRangeFilter"]);return i!=null&&S(e,["timeRangeFilter"],i),e}function Ele(n){const e={},t=T(n,["aspectRatio"]);t!=null&&S(e,["aspectRatio"],t);const i=T(n,["imageSize"]);if(i!=null&&S(e,["imageSize"],i),T(n,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(T(n,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(T(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(T(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(T(n,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return e}function wle(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["request","model"],Un(n,i));const r=T(e,["contents"]);if(r!=null){let o=Eo(r);Array.isArray(o)&&(o=o.map(l=>E$(l))),S(t,["request","contents"],o)}const s=T(e,["metadata"]);s!=null&&S(t,["metadata"],s);const a=T(e,["config"]);return a!=null&&S(t,["request","generationConfig"],yle(n,a,T(t,["request"],{}))),t}function Ale(n){const e={},t=T(n,["response"]);t!=null&&S(e,["response"],vle(t));const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["error"]);return r!=null&&S(e,["error"],r),e}function Sle(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);if(e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),T(n,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return t}function Dle(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);e!==void 0&&r!=null&&S(e,["_query","pageToken"],r);const s=T(n,["filter"]);return e!==void 0&&s!=null&&S(e,["_query","filter"],s),t}function Cle(n){const e={},t=T(n,["config"]);return t!=null&&Sle(t,e),e}function Ile(n){const e={},t=T(n,["config"]);return t!=null&&Dle(t,e),e}function Rle(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["operations"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>UA(a))),S(e,["batchJobs"],s)}return e}function Nle(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["batchPredictionJobs"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>UM(a))),S(e,["batchJobs"],s)}return e}function kle(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],ple(s));const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],gle(a));const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],Joe(l));const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);p!=null&&S(e,["videoMetadata"],p);const y=T(n,["toolCall"]);y!=null&&S(e,["toolCall"],y);const x=T(n,["toolResponse"]);return x!=null&&S(e,["toolResponse"],x),e}function Mle(n){const e={},t=T(n,["category"]);if(t!=null&&S(e,["category"],t),T(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const i=T(n,["threshold"]);return i!=null&&S(e,["threshold"],i),e}function Fle(n){const e={},t=T(n,["retrievalConfig"]);t!=null&&S(e,["retrievalConfig"],t);const i=T(n,["functionCallingConfig"]);i!=null&&S(e,["functionCallingConfig"],mle(i));const r=T(n,["includeServerSideToolInvocations"]);return r!=null&&S(e,["includeServerSideToolInvocations"],r),e}function Ule(n){const e={};if(T(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const t=T(n,["computerUse"]);t!=null&&S(e,["computerUse"],t);const i=T(n,["fileSearch"]);i!=null&&S(e,["fileSearch"],i);const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],Tle(r));const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],ble(s));const a=T(n,["codeExecution"]);if(a!=null&&S(e,["codeExecution"],a),T(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const o=T(n,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["functionDeclarations"],f)}const l=T(n,["googleSearchRetrieval"]);if(l!=null&&S(e,["googleSearchRetrieval"],l),T(n,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const c=T(n,["urlContext"]);c!=null&&S(e,["urlContext"],c);const h=T(n,["mcpServers"]);if(h!=null){let f=h;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["mcpServers"],f)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var Lh;(function(n){n.PAGED_ITEM_BATCH_JOBS="batchJobs",n.PAGED_ITEM_MODELS="models",n.PAGED_ITEM_TUNING_JOBS="tuningJobs",n.PAGED_ITEM_FILES="files",n.PAGED_ITEM_CACHED_CONTENTS="cachedContents",n.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",n.PAGED_ITEM_DOCUMENTS="documents"})(Lh||(Lh={}));class Km{constructor(e,t,i,r){this.pageInternal=[],this.paramsInternal={},this.requestInternal=t,this.init(e,i,r)}init(e,t,i){var r,s;this.nameInternal=e,this.pageInternal=t[this.nameInternal]||[],this.sdkHttpResponseInternal=t==null?void 0:t.sdkHttpResponse,this.idxInternal=0;let a={config:{}};!i||Object.keys(i).length===0?a={config:{}}:typeof i=="object"?a=Object.assign({},i):a=i,a.config&&(a.config.pageToken=t.nextPageToken),this.paramsInternal=a,this.pageInternalSize=(s=(r=a.config)===null||r===void 0?void 0:r.pageSize)!==null&&s!==void 0?s:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Ple extends Yh{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Km(Lh.PAGED_ITEM_BATCH_JOBS,i=>this.listInternal(i),await this.listInternal(t),t),this.create=async t=>(this.apiClient.isVertexAI()&&(t.config=this.formatDestination(t.src,t.config)),this.createInternal(t)),this.createEmbeddings=async t=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(t)}}createInlinedGenerateContentRequest(e){const t=H9(this.apiClient,e),i=t._url,r=At("{model}:batchGenerateContent",i),o=t.batch.inputConfig.requests,l=o.requests,c=[];for(const h of l){const f=Object.assign({},h);if(f.systemInstruction){const p=f.systemInstruction;delete f.systemInstruction;const y=f.request;y.systemInstruction=p,f.request=y}c.push(f)}return o.requests=c,delete t.config,delete t._url,delete t._query,{path:r,body:t}}getGcsUri(e){if(typeof e=="string")return e.startsWith("gs://")?e:void 0;if(!Array.isArray(e)&&e.gcsUri&&e.gcsUri.length>0)return e.gcsUri[0]}getBigqueryUri(e){if(typeof e=="string")return e.startsWith("bq://")?e:void 0;if(!Array.isArray(e))return e.bigqueryUri}formatDestination(e,t){const i=t?Object.assign({},t):{},r=Date.now().toString();if(i.displayName||(i.displayName=`genaiBatchJob_${r}`),i.dest===void 0){const s=this.getGcsUri(e),a=this.getBigqueryUri(e);if(s)s.endsWith(".jsonl")?i.dest=`${s.slice(0,-6)}/dest`:i.dest=`${s}_dest_${r}`;else if(a)i.dest=`${a}_dest_${r}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return i}async createInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=rle(this.apiClient,e);return o=At("batchPredictionJobs",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>UM(h))}else{const c=H9(this.apiClient,e);return o=At("{model}:batchGenerateContent",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>UA(h))}}async createEmbeddingsInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=ale(this.apiClient,e);return s=At("{model}:asyncBatchEmbedContent",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>UA(l))}}async get(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=xle(this.apiClient,e);return o=At("batchPredictionJobs/{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>UM(h))}else{const c=_le(this.apiClient,e);return o=At("batches/{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>UA(h))}}async cancel(e){var t,i,r,s;let a="",o={};if(this.apiClient.isVertexAI()){const l=Zoe(this.apiClient,e);a=At("batchPredictionJobs/{name}:cancel",l._url),o=l._query,delete l._url,delete l._query,await this.apiClient.request({path:a,queryParams:o,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}else{const l=Qoe(this.apiClient,e);a=At("batches/{name}:cancel",l._url),o=l._query,delete l._url,delete l._query,await this.apiClient.request({path:a,queryParams:o,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal})}}async listInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Ile(e);return o=At("batchPredictionJobs",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Nle(h),p=new O9;return Object.assign(p,f),p})}else{const c=Cle(e);return o=At("batches",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Rle(h),p=new O9;return Object.assign(p,f),p})}}async delete(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=lle(this.apiClient,e);return o=At("batchPredictionJobs/{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>ule(h))}else{const c=ole(this.apiClient,e);return o=At("batches/{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>cle(h))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Lle(n){const e={},t=T(n,["apiKey"]);if(t!=null&&S(e,["apiKey"],t),T(n,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(T(n,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(T(n,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(T(n,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(T(n,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(T(n,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function Ole(n){const e={},t=T(n,["data"]);if(t!=null&&S(e,["data"],t),T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function z9(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>oce(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function G9(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>lce(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function Ble(n,e){const t={},i=T(n,["ttl"]);e!==void 0&&i!=null&&S(e,["ttl"],i);const r=T(n,["expireTime"]);e!==void 0&&r!=null&&S(e,["expireTime"],r);const s=T(n,["displayName"]);e!==void 0&&s!=null&&S(e,["displayName"],s);const a=T(n,["contents"]);if(e!==void 0&&a!=null){let h=Eo(a);Array.isArray(h)&&(h=h.map(f=>z9(f))),S(e,["contents"],h)}const o=T(n,["systemInstruction"]);e!==void 0&&o!=null&&S(e,["systemInstruction"],z9(es(o)));const l=T(n,["tools"]);if(e!==void 0&&l!=null){let h=l;Array.isArray(h)&&(h=h.map(f=>hce(f))),S(e,["tools"],h)}const c=T(n,["toolConfig"]);if(e!==void 0&&c!=null&&S(e,["toolConfig"],cce(c)),T(n,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return t}function Vle(n,e){const t={},i=T(n,["ttl"]);e!==void 0&&i!=null&&S(e,["ttl"],i);const r=T(n,["expireTime"]);e!==void 0&&r!=null&&S(e,["expireTime"],r);const s=T(n,["displayName"]);e!==void 0&&s!=null&&S(e,["displayName"],s);const a=T(n,["contents"]);if(e!==void 0&&a!=null){let f=Eo(a);Array.isArray(f)&&(f=f.map(p=>G9(p))),S(e,["contents"],f)}const o=T(n,["systemInstruction"]);e!==void 0&&o!=null&&S(e,["systemInstruction"],G9(es(o)));const l=T(n,["tools"]);if(e!==void 0&&l!=null){let f=l;Array.isArray(f)&&(f=f.map(p=>dce(p))),S(e,["tools"],f)}const c=T(n,["toolConfig"]);e!==void 0&&c!=null&&S(e,["toolConfig"],uce(c));const h=T(n,["kmsKeyName"]);return e!==void 0&&h!=null&&S(e,["encryption_spec","kmsKeyName"],h),t}function Wle(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["model"],h$(n,i));const r=T(e,["config"]);return r!=null&&Ble(r,t),t}function Hle(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["model"],h$(n,i));const r=T(e,["config"]);return r!=null&&Vle(r,t),t}function zle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],Jh(n,i)),t}function Gle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],Jh(n,i)),t}function qle(n){const e={},t=T(n,["sdkHttpResponse"]);return t!=null&&S(e,["sdkHttpResponse"],t),e}function $le(n){const e={},t=T(n,["sdkHttpResponse"]);return t!=null&&S(e,["sdkHttpResponse"],t),e}function jle(n){const e={};if(T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const t=T(n,["fileUri"]);t!=null&&S(e,["fileUri"],t);const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function Xle(n){const e={},t=T(n,["id"]);t!=null&&S(e,["id"],t);const i=T(n,["args"]);i!=null&&S(e,["args"],i);const r=T(n,["name"]);if(r!=null&&S(e,["name"],r),T(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(T(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function Kle(n){const e={},t=T(n,["allowedFunctionNames"]);t!=null&&S(e,["allowedFunctionNames"],t);const i=T(n,["mode"]);if(i!=null&&S(e,["mode"],i),T(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return e}function Yle(n){const e={},t=T(n,["description"]);t!=null&&S(e,["description"],t);const i=T(n,["name"]);i!=null&&S(e,["name"],i);const r=T(n,["parameters"]);r!=null&&S(e,["parameters"],r);const s=T(n,["parametersJsonSchema"]);s!=null&&S(e,["parametersJsonSchema"],s);const a=T(n,["response"]);a!=null&&S(e,["response"],a);const o=T(n,["responseJsonSchema"]);if(o!=null&&S(e,["responseJsonSchema"],o),T(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return e}function Jle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],Jh(n,i)),t}function Qle(n,e){const t={},i=T(e,["name"]);return i!=null&&S(t,["_url","name"],Jh(n,i)),t}function Zle(n){const e={},t=T(n,["authConfig"]);t!=null&&S(e,["authConfig"],Lle(t));const i=T(n,["enableWidget"]);return i!=null&&S(e,["enableWidget"],i),e}function ece(n){const e={},t=T(n,["searchTypes"]);if(t!=null&&S(e,["searchTypes"],t),T(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(T(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const i=T(n,["timeRangeFilter"]);return i!=null&&S(e,["timeRangeFilter"],i),e}function tce(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);return e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),t}function nce(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);return e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),t}function ice(n){const e={},t=T(n,["config"]);return t!=null&&tce(t,e),e}function rce(n){const e={},t=T(n,["config"]);return t!=null&&nce(t,e),e}function sce(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["cachedContents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["cachedContents"],s)}return e}function ace(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["cachedContents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["cachedContents"],s)}return e}function oce(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],jle(s));const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],Xle(a));const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],Ole(l));const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);p!=null&&S(e,["videoMetadata"],p);const y=T(n,["toolCall"]);y!=null&&S(e,["toolCall"],y);const x=T(n,["toolResponse"]);return x!=null&&S(e,["toolResponse"],x),e}function lce(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],s);const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],a);const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],l);const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);if(p!=null&&S(e,["videoMetadata"],p),T(n,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Vertex AI.");if(T(n,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Vertex AI.");return e}function cce(n){const e={},t=T(n,["retrievalConfig"]);t!=null&&S(e,["retrievalConfig"],t);const i=T(n,["functionCallingConfig"]);i!=null&&S(e,["functionCallingConfig"],Kle(i));const r=T(n,["includeServerSideToolInvocations"]);return r!=null&&S(e,["includeServerSideToolInvocations"],r),e}function uce(n){const e={},t=T(n,["retrievalConfig"]);t!=null&&S(e,["retrievalConfig"],t);const i=T(n,["functionCallingConfig"]);if(i!=null&&S(e,["functionCallingConfig"],i),T(n,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is not supported in Vertex AI.");return e}function hce(n){const e={};if(T(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const t=T(n,["computerUse"]);t!=null&&S(e,["computerUse"],t);const i=T(n,["fileSearch"]);i!=null&&S(e,["fileSearch"],i);const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],ece(r));const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],Zle(s));const a=T(n,["codeExecution"]);if(a!=null&&S(e,["codeExecution"],a),T(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const o=T(n,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["functionDeclarations"],f)}const l=T(n,["googleSearchRetrieval"]);if(l!=null&&S(e,["googleSearchRetrieval"],l),T(n,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const c=T(n,["urlContext"]);c!=null&&S(e,["urlContext"],c);const h=T(n,["mcpServers"]);if(h!=null){let f=h;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["mcpServers"],f)}return e}function dce(n){const e={},t=T(n,["retrieval"]);t!=null&&S(e,["retrieval"],t);const i=T(n,["computerUse"]);if(i!=null&&S(e,["computerUse"],i),T(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],r);const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],s);const a=T(n,["codeExecution"]);a!=null&&S(e,["codeExecution"],a);const o=T(n,["enterpriseWebSearch"]);o!=null&&S(e,["enterpriseWebSearch"],o);const l=T(n,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(y=>Yle(y))),S(e,["functionDeclarations"],p)}const c=T(n,["googleSearchRetrieval"]);c!=null&&S(e,["googleSearchRetrieval"],c);const h=T(n,["parallelAiSearch"]);h!=null&&S(e,["parallelAiSearch"],h);const f=T(n,["urlContext"]);if(f!=null&&S(e,["urlContext"],f),T(n,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return e}function fce(n,e){const t={},i=T(n,["ttl"]);e!==void 0&&i!=null&&S(e,["ttl"],i);const r=T(n,["expireTime"]);return e!==void 0&&r!=null&&S(e,["expireTime"],r),t}function pce(n,e){const t={},i=T(n,["ttl"]);e!==void 0&&i!=null&&S(e,["ttl"],i);const r=T(n,["expireTime"]);return e!==void 0&&r!=null&&S(e,["expireTime"],r),t}function gce(n,e){const t={},i=T(e,["name"]);i!=null&&S(t,["_url","name"],Jh(n,i));const r=T(e,["config"]);return r!=null&&fce(r,t),t}function mce(n,e){const t={},i=T(e,["name"]);i!=null&&S(t,["_url","name"],Jh(n,i));const r=T(e,["config"]);return r!=null&&pce(r,t),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class yce extends Yh{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Km(Lh.PAGED_ITEM_CACHED_CONTENTS,i=>this.listInternal(i),await this.listInternal(t),t)}async create(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Hle(this.apiClient,e);return o=At("cachedContents",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>h)}else{const c=Wle(this.apiClient,e);return o=At("cachedContents",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>h)}}async get(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Qle(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>h)}else{const c=Jle(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>h)}}async delete(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Gle(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=$le(h),p=new P9;return Object.assign(p,f),p})}else{const c=zle(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=qle(h),p=new P9;return Object.assign(p,f),p})}}async update(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=mce(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>h)}else{const c=gce(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>h)}}async listInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=rce(e);return o=At("cachedContents",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=ace(h),p=new L9;return Object.assign(p,f),p})}else{const c=ice(e);return o=At("cachedContents",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=sce(h),p=new L9;return Object.assign(p,f),p})}}}function fD(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t}function q9(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function en(n){return this instanceof en?(this.v=n,this):new en(n)}function ec(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),r[Symbol.asyncIterator]=function(){return this},r;function a(y){return function(x){return Promise.resolve(x).then(y,f)}}function o(y,x){i[y]&&(r[y]=function(v){return new Promise(function(_,E){s.push([y,v,_,E])>1||l(y,v)})},x&&(r[y]=x(r[y])))}function l(y,x){try{c(i[y](x))}catch(v){p(s[0][3],v)}}function c(y){y.value instanceof en?Promise.resolve(y.value.v).then(h,f):p(s[0][2],y)}function h(y){l("next",y)}function f(y){l("throw",y)}function p(y,x){y(x),s.shift(),s.length&&l(s[0][0],s[0][1])}}function tc(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof q9=="function"?q9(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=n[s]&&function(a){return new Promise(function(o,l){a=n[s](a),r(o,l,a.done,a.value)})}}function r(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function vce(n){var e;if(n.candidates==null||n.candidates.length===0)return!1;const t=(e=n.candidates[0])===null||e===void 0?void 0:e.content;return t===void 0?!1:w$(t)}function w$(n){if(n.parts===void 0||n.parts.length===0)return!1;for(const e of n.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function _ce(n){if(n.length!==0){for(const e of n)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function $9(n){if(n===void 0||n.length===0)return[];const e=[],t=n.length;let i=0;for(;i<t;)if(n[i].role==="user")e.push(n[i]),i++;else{const r=[];let s=!0;for(;i<t&&n[i].role==="model";)r.push(n[i]),s&&!w$(n[i])&&(s=!1),i++;s?e.push(...r):e.pop()}return e}class xce{constructor(e,t){this.modelsModule=e,this.apiClient=t}create(e){return new bce(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}}class bce{constructor(e,t,i,r={},s=[]){this.apiClient=e,this.modelsModule=t,this.model=i,this.config=r,this.history=s,this.sendPromise=Promise.resolve(),_ce(s)}async sendMessage(e){var t;await this.sendPromise;const i=es(e.message),r=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(i),config:(t=e.config)!==null&&t!==void 0?t:this.config});return this.sendPromise=(async()=>{var s,a,o;const l=await r,c=(a=(s=l.candidates)===null||s===void 0?void 0:s[0])===null||a===void 0?void 0:a.content,h=l.automaticFunctionCallingHistory,f=this.getHistory(!0).length;let p=[];h!=null&&(p=(o=h.slice(f))!==null&&o!==void 0?o:[]);const y=c?[c]:[];this.recordHistory(i,y,p)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),r}async sendMessageStream(e){var t;await this.sendPromise;const i=es(e.message),r=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(i),config:(t=e.config)!==null&&t!==void 0?t:this.config});this.sendPromise=r.then(()=>{}).catch(()=>{});const s=await r;return this.processStreamResponse(s,i)}getHistory(e=!1){const t=e?$9(this.history):this.history;return structuredClone(t)}processStreamResponse(e,t){return ec(this,arguments,function*(){var r,s,a,o,l,c;const h=[];try{for(var f=!0,p=tc(e),y;y=yield en(p.next()),r=y.done,!r;f=!0){o=y.value,f=!1;const x=o;if(vce(x)){const v=(c=(l=x.candidates)===null||l===void 0?void 0:l[0])===null||c===void 0?void 0:c.content;v!==void 0&&h.push(v)}yield yield en(x)}}catch(x){s={error:x}}finally{try{!f&&!r&&(a=p.return)&&(yield en(a.call(p)))}finally{if(s)throw s.error}}this.recordHistory(t,h)})}recordHistory(e,t,i){let r=[];t.length>0&&t.every(s=>s.role!==void 0)?r=t:r.push({role:"model",parts:[]}),i&&i.length>0?this.history.push(...$9(i)):this.history.push(e),this.history.push(...r)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class YC extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,YC.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Tce(n){const e={},t=T(n,["file"]);return t!=null&&S(e,["file"],t),e}function Ece(n){const e={},t=T(n,["sdkHttpResponse"]);return t!=null&&S(e,["sdkHttpResponse"],t),e}function wce(n){const e={},t=T(n,["name"]);return t!=null&&S(e,["_url","file"],y$(t)),e}function Ace(n){const e={},t=T(n,["sdkHttpResponse"]);return t!=null&&S(e,["sdkHttpResponse"],t),e}function Sce(n){const e={},t=T(n,["name"]);return t!=null&&S(e,["_url","file"],y$(t)),e}function Dce(n){const e={},t=T(n,["uris"]);return t!=null&&S(e,["uris"],t),e}function Cce(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);return e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),t}function Ice(n){const e={},t=T(n,["config"]);return t!=null&&Cce(t,e),e}function Rce(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["files"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["files"],s)}return e}function Nce(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["files"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),S(e,["files"],r)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class kce extends Yh{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Km(Lh.PAGED_ITEM_FILES,i=>this.listInternal(i),await this.listInternal(t),t)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(t=>t)}async download(e){await this.apiClient.downloadFile(e)}async registerFiles(e){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(e){return this.registerFilesInternal(e)}async listInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Ice(e);return s=At("files",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>{const c=Rce(l),h=new Coe;return Object.assign(h,c),h})}}async createInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Tce(e);return s=At("upload/v1beta/files",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=Ece(l),h=new Ioe;return Object.assign(h,c),h})}}async get(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Sce(e);return s=At("files/{file}",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=wce(e);return s=At("files/{file}",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>{const c=Ace(l),h=new Roe;return Object.assign(h,c),h})}}async registerFilesInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Dce(e);return s=At("files:register",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=Nce(l),h=new Noe;return Object.assign(h,c),h})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function j9(n){const e={};if(T(n,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return e}function Mce(n){const e={},t=T(n,["apiKey"]);if(t!=null&&S(e,["apiKey"],t),T(n,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(T(n,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(T(n,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(T(n,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(T(n,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(T(n,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function PA(n){const e={},t=T(n,["data"]);if(t!=null&&S(e,["data"],t),T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function Fce(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>Jce(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function Uce(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>Qce(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function Pce(n){const e={};if(T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const t=T(n,["fileUri"]);t!=null&&S(e,["fileUri"],t);const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function Lce(n){const e={},t=T(n,["id"]);t!=null&&S(e,["id"],t);const i=T(n,["args"]);i!=null&&S(e,["args"],i);const r=T(n,["name"]);if(r!=null&&S(e,["name"],r),T(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(T(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function Oce(n){const e={},t=T(n,["description"]);t!=null&&S(e,["description"],t);const i=T(n,["name"]);i!=null&&S(e,["name"],i);const r=T(n,["parameters"]);r!=null&&S(e,["parameters"],r);const s=T(n,["parametersJsonSchema"]);s!=null&&S(e,["parametersJsonSchema"],s);const a=T(n,["response"]);a!=null&&S(e,["response"],a);const o=T(n,["responseJsonSchema"]);if(o!=null&&S(e,["responseJsonSchema"],o),T(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return e}function Bce(n){const e={},t=T(n,["modelSelectionConfig"]);t!=null&&S(e,["modelConfig"],t);const i=T(n,["responseJsonSchema"]);i!=null&&S(e,["responseJsonSchema"],i);const r=T(n,["audioTimestamp"]);r!=null&&S(e,["audioTimestamp"],r);const s=T(n,["candidateCount"]);s!=null&&S(e,["candidateCount"],s);const a=T(n,["enableAffectiveDialog"]);a!=null&&S(e,["enableAffectiveDialog"],a);const o=T(n,["frequencyPenalty"]);o!=null&&S(e,["frequencyPenalty"],o);const l=T(n,["logprobs"]);l!=null&&S(e,["logprobs"],l);const c=T(n,["maxOutputTokens"]);c!=null&&S(e,["maxOutputTokens"],c);const h=T(n,["mediaResolution"]);h!=null&&S(e,["mediaResolution"],h);const f=T(n,["presencePenalty"]);f!=null&&S(e,["presencePenalty"],f);const p=T(n,["responseLogprobs"]);p!=null&&S(e,["responseLogprobs"],p);const y=T(n,["responseMimeType"]);y!=null&&S(e,["responseMimeType"],y);const x=T(n,["responseModalities"]);x!=null&&S(e,["responseModalities"],x);const v=T(n,["responseSchema"]);v!=null&&S(e,["responseSchema"],v);const _=T(n,["routingConfig"]);_!=null&&S(e,["routingConfig"],_);const E=T(n,["seed"]);E!=null&&S(e,["seed"],E);const w=T(n,["speechConfig"]);w!=null&&S(e,["speechConfig"],w);const A=T(n,["stopSequences"]);A!=null&&S(e,["stopSequences"],A);const N=T(n,["temperature"]);N!=null&&S(e,["temperature"],N);const k=T(n,["thinkingConfig"]);k!=null&&S(e,["thinkingConfig"],k);const F=T(n,["topK"]);F!=null&&S(e,["topK"],F);const C=T(n,["topP"]);if(C!=null&&S(e,["topP"],C),T(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return e}function Vce(n){const e={},t=T(n,["authConfig"]);t!=null&&S(e,["authConfig"],Mce(t));const i=T(n,["enableWidget"]);return i!=null&&S(e,["enableWidget"],i),e}function Wce(n){const e={},t=T(n,["searchTypes"]);if(t!=null&&S(e,["searchTypes"],t),T(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(T(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const i=T(n,["timeRangeFilter"]);return i!=null&&S(e,["timeRangeFilter"],i),e}function Hce(n,e){const t={},i=T(n,["generationConfig"]);e!==void 0&&i!=null&&S(e,["setup","generationConfig"],i);const r=T(n,["responseModalities"]);e!==void 0&&r!=null&&S(e,["setup","generationConfig","responseModalities"],r);const s=T(n,["temperature"]);e!==void 0&&s!=null&&S(e,["setup","generationConfig","temperature"],s);const a=T(n,["topP"]);e!==void 0&&a!=null&&S(e,["setup","generationConfig","topP"],a);const o=T(n,["topK"]);e!==void 0&&o!=null&&S(e,["setup","generationConfig","topK"],o);const l=T(n,["maxOutputTokens"]);e!==void 0&&l!=null&&S(e,["setup","generationConfig","maxOutputTokens"],l);const c=T(n,["mediaResolution"]);e!==void 0&&c!=null&&S(e,["setup","generationConfig","mediaResolution"],c);const h=T(n,["seed"]);e!==void 0&&h!=null&&S(e,["setup","generationConfig","seed"],h);const f=T(n,["speechConfig"]);e!==void 0&&f!=null&&S(e,["setup","generationConfig","speechConfig"],BP(f));const p=T(n,["thinkingConfig"]);e!==void 0&&p!=null&&S(e,["setup","generationConfig","thinkingConfig"],p);const y=T(n,["enableAffectiveDialog"]);e!==void 0&&y!=null&&S(e,["setup","generationConfig","enableAffectiveDialog"],y);const x=T(n,["systemInstruction"]);e!==void 0&&x!=null&&S(e,["setup","systemInstruction"],Fce(es(x)));const v=T(n,["tools"]);if(e!==void 0&&v!=null){let F=O1(v);Array.isArray(F)&&(F=F.map(C=>eue(L1(C)))),S(e,["setup","tools"],F)}const _=T(n,["sessionResumption"]);e!==void 0&&_!=null&&S(e,["setup","sessionResumption"],Zce(_));const E=T(n,["inputAudioTranscription"]);e!==void 0&&E!=null&&S(e,["setup","inputAudioTranscription"],j9(E));const w=T(n,["outputAudioTranscription"]);e!==void 0&&w!=null&&S(e,["setup","outputAudioTranscription"],j9(w));const A=T(n,["realtimeInputConfig"]);e!==void 0&&A!=null&&S(e,["setup","realtimeInputConfig"],A);const N=T(n,["contextWindowCompression"]);e!==void 0&&N!=null&&S(e,["setup","contextWindowCompression"],N);const k=T(n,["proactivity"]);if(e!==void 0&&k!=null&&S(e,["setup","proactivity"],k),T(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return t}function zce(n,e){const t={},i=T(n,["generationConfig"]);e!==void 0&&i!=null&&S(e,["setup","generationConfig"],Bce(i));const r=T(n,["responseModalities"]);e!==void 0&&r!=null&&S(e,["setup","generationConfig","responseModalities"],r);const s=T(n,["temperature"]);e!==void 0&&s!=null&&S(e,["setup","generationConfig","temperature"],s);const a=T(n,["topP"]);e!==void 0&&a!=null&&S(e,["setup","generationConfig","topP"],a);const o=T(n,["topK"]);e!==void 0&&o!=null&&S(e,["setup","generationConfig","topK"],o);const l=T(n,["maxOutputTokens"]);e!==void 0&&l!=null&&S(e,["setup","generationConfig","maxOutputTokens"],l);const c=T(n,["mediaResolution"]);e!==void 0&&c!=null&&S(e,["setup","generationConfig","mediaResolution"],c);const h=T(n,["seed"]);e!==void 0&&h!=null&&S(e,["setup","generationConfig","seed"],h);const f=T(n,["speechConfig"]);e!==void 0&&f!=null&&S(e,["setup","generationConfig","speechConfig"],BP(f));const p=T(n,["thinkingConfig"]);e!==void 0&&p!=null&&S(e,["setup","generationConfig","thinkingConfig"],p);const y=T(n,["enableAffectiveDialog"]);e!==void 0&&y!=null&&S(e,["setup","generationConfig","enableAffectiveDialog"],y);const x=T(n,["systemInstruction"]);e!==void 0&&x!=null&&S(e,["setup","systemInstruction"],Uce(es(x)));const v=T(n,["tools"]);if(e!==void 0&&v!=null){let C=O1(v);Array.isArray(C)&&(C=C.map(M=>tue(L1(M)))),S(e,["setup","tools"],C)}const _=T(n,["sessionResumption"]);e!==void 0&&_!=null&&S(e,["setup","sessionResumption"],_);const E=T(n,["inputAudioTranscription"]);e!==void 0&&E!=null&&S(e,["setup","inputAudioTranscription"],E);const w=T(n,["outputAudioTranscription"]);e!==void 0&&w!=null&&S(e,["setup","outputAudioTranscription"],w);const A=T(n,["realtimeInputConfig"]);e!==void 0&&A!=null&&S(e,["setup","realtimeInputConfig"],A);const N=T(n,["contextWindowCompression"]);e!==void 0&&N!=null&&S(e,["setup","contextWindowCompression"],N);const k=T(n,["proactivity"]);e!==void 0&&k!=null&&S(e,["setup","proactivity"],k);const F=T(n,["explicitVadSignal"]);return e!==void 0&&F!=null&&S(e,["setup","explicitVadSignal"],F),t}function Gce(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["setup","model"],Un(n,i));const r=T(e,["config"]);return r!=null&&S(t,["config"],Hce(r,t)),t}function qce(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["setup","model"],Un(n,i));const r=T(e,["config"]);return r!=null&&S(t,["config"],zce(r,t)),t}function $ce(n){const e={},t=T(n,["musicGenerationConfig"]);return t!=null&&S(e,["musicGenerationConfig"],t),e}function jce(n){const e={},t=T(n,["weightedPrompts"]);if(t!=null){let i=t;Array.isArray(i)&&(i=i.map(r=>r)),S(e,["weightedPrompts"],i)}return e}function Xce(n){const e={},t=T(n,["media"]);if(t!=null){let c=d$(t);Array.isArray(c)&&(c=c.map(h=>PA(h))),S(e,["mediaChunks"],c)}const i=T(n,["audio"]);i!=null&&S(e,["audio"],PA(p$(i)));const r=T(n,["audioStreamEnd"]);r!=null&&S(e,["audioStreamEnd"],r);const s=T(n,["video"]);s!=null&&S(e,["video"],PA(f$(s)));const a=T(n,["text"]);a!=null&&S(e,["text"],a);const o=T(n,["activityStart"]);o!=null&&S(e,["activityStart"],o);const l=T(n,["activityEnd"]);return l!=null&&S(e,["activityEnd"],l),e}function Kce(n){const e={},t=T(n,["media"]);if(t!=null){let c=d$(t);Array.isArray(c)&&(c=c.map(h=>h)),S(e,["mediaChunks"],c)}const i=T(n,["audio"]);i!=null&&S(e,["audio"],p$(i));const r=T(n,["audioStreamEnd"]);r!=null&&S(e,["audioStreamEnd"],r);const s=T(n,["video"]);s!=null&&S(e,["video"],f$(s));const a=T(n,["text"]);a!=null&&S(e,["text"],a);const o=T(n,["activityStart"]);o!=null&&S(e,["activityStart"],o);const l=T(n,["activityEnd"]);return l!=null&&S(e,["activityEnd"],l),e}function Yce(n){const e={},t=T(n,["setupComplete"]);t!=null&&S(e,["setupComplete"],t);const i=T(n,["serverContent"]);i!=null&&S(e,["serverContent"],i);const r=T(n,["toolCall"]);r!=null&&S(e,["toolCall"],r);const s=T(n,["toolCallCancellation"]);s!=null&&S(e,["toolCallCancellation"],s);const a=T(n,["usageMetadata"]);a!=null&&S(e,["usageMetadata"],nue(a));const o=T(n,["goAway"]);o!=null&&S(e,["goAway"],o);const l=T(n,["sessionResumptionUpdate"]);l!=null&&S(e,["sessionResumptionUpdate"],l);const c=T(n,["voiceActivityDetectionSignal"]);c!=null&&S(e,["voiceActivityDetectionSignal"],c);const h=T(n,["voiceActivity"]);return h!=null&&S(e,["voiceActivity"],iue(h)),e}function Jce(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],Pce(s));const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],Lce(a));const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],PA(l));const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);p!=null&&S(e,["videoMetadata"],p);const y=T(n,["toolCall"]);y!=null&&S(e,["toolCall"],y);const x=T(n,["toolResponse"]);return x!=null&&S(e,["toolResponse"],x),e}function Qce(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],s);const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],a);const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],l);const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);if(p!=null&&S(e,["videoMetadata"],p),T(n,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Vertex AI.");if(T(n,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Vertex AI.");return e}function Zce(n){const e={},t=T(n,["handle"]);if(t!=null&&S(e,["handle"],t),T(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function eue(n){const e={};if(T(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const t=T(n,["computerUse"]);t!=null&&S(e,["computerUse"],t);const i=T(n,["fileSearch"]);i!=null&&S(e,["fileSearch"],i);const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],Wce(r));const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],Vce(s));const a=T(n,["codeExecution"]);if(a!=null&&S(e,["codeExecution"],a),T(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const o=T(n,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["functionDeclarations"],f)}const l=T(n,["googleSearchRetrieval"]);if(l!=null&&S(e,["googleSearchRetrieval"],l),T(n,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const c=T(n,["urlContext"]);c!=null&&S(e,["urlContext"],c);const h=T(n,["mcpServers"]);if(h!=null){let f=h;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["mcpServers"],f)}return e}function tue(n){const e={},t=T(n,["retrieval"]);t!=null&&S(e,["retrieval"],t);const i=T(n,["computerUse"]);if(i!=null&&S(e,["computerUse"],i),T(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],r);const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],s);const a=T(n,["codeExecution"]);a!=null&&S(e,["codeExecution"],a);const o=T(n,["enterpriseWebSearch"]);o!=null&&S(e,["enterpriseWebSearch"],o);const l=T(n,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(y=>Oce(y))),S(e,["functionDeclarations"],p)}const c=T(n,["googleSearchRetrieval"]);c!=null&&S(e,["googleSearchRetrieval"],c);const h=T(n,["parallelAiSearch"]);h!=null&&S(e,["parallelAiSearch"],h);const f=T(n,["urlContext"]);if(f!=null&&S(e,["urlContext"],f),T(n,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return e}function nue(n){const e={},t=T(n,["promptTokenCount"]);t!=null&&S(e,["promptTokenCount"],t);const i=T(n,["cachedContentTokenCount"]);i!=null&&S(e,["cachedContentTokenCount"],i);const r=T(n,["candidatesTokenCount"]);r!=null&&S(e,["responseTokenCount"],r);const s=T(n,["toolUsePromptTokenCount"]);s!=null&&S(e,["toolUsePromptTokenCount"],s);const a=T(n,["thoughtsTokenCount"]);a!=null&&S(e,["thoughtsTokenCount"],a);const o=T(n,["totalTokenCount"]);o!=null&&S(e,["totalTokenCount"],o);const l=T(n,["promptTokensDetails"]);if(l!=null){let y=l;Array.isArray(y)&&(y=y.map(x=>x)),S(e,["promptTokensDetails"],y)}const c=T(n,["cacheTokensDetails"]);if(c!=null){let y=c;Array.isArray(y)&&(y=y.map(x=>x)),S(e,["cacheTokensDetails"],y)}const h=T(n,["candidatesTokensDetails"]);if(h!=null){let y=h;Array.isArray(y)&&(y=y.map(x=>x)),S(e,["responseTokensDetails"],y)}const f=T(n,["toolUsePromptTokensDetails"]);if(f!=null){let y=f;Array.isArray(y)&&(y=y.map(x=>x)),S(e,["toolUsePromptTokensDetails"],y)}const p=T(n,["trafficType"]);return p!=null&&S(e,["trafficType"],p),e}function iue(n){const e={},t=T(n,["type"]);return t!=null&&S(e,["voiceActivityType"],t),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rue(n,e){const t={},i=T(n,["apiKey"]);if(i!=null&&S(t,["apiKey"],i),T(n,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(T(n,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(T(n,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(T(n,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(T(n,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(T(n,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return t}function sue(n,e){const t={},i=T(n,["data"]);if(i!=null&&S(t,["data"],i),T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=T(n,["mimeType"]);return r!=null&&S(t,["mimeType"],r),t}function aue(n,e){const t={},i=T(n,["content"]);i!=null&&S(t,["content"],i);const r=T(n,["citationMetadata"]);r!=null&&S(t,["citationMetadata"],oue(r));const s=T(n,["tokenCount"]);s!=null&&S(t,["tokenCount"],s);const a=T(n,["finishReason"]);a!=null&&S(t,["finishReason"],a);const o=T(n,["groundingMetadata"]);o!=null&&S(t,["groundingMetadata"],o);const l=T(n,["avgLogprobs"]);l!=null&&S(t,["avgLogprobs"],l);const c=T(n,["index"]);c!=null&&S(t,["index"],c);const h=T(n,["logprobsResult"]);h!=null&&S(t,["logprobsResult"],h);const f=T(n,["safetyRatings"]);if(f!=null){let y=f;Array.isArray(y)&&(y=y.map(x=>x)),S(t,["safetyRatings"],y)}const p=T(n,["urlContextMetadata"]);return p!=null&&S(t,["urlContextMetadata"],p),t}function oue(n,e){const t={},i=T(n,["citationSources"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),S(t,["citations"],r)}return t}function lue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let a=Eo(s);Array.isArray(a)&&(a=a.map(o=>V1(o))),S(i,["contents"],a)}return i}function cue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["tokensInfo"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(t,["tokensInfo"],s)}return t}function uue(n,e){const t={},i=T(n,["values"]);i!=null&&S(t,["values"],i);const r=T(n,["statistics"]);return r!=null&&S(t,["statistics"],hue(r)),t}function hue(n,e){const t={},i=T(n,["truncated"]);i!=null&&S(t,["truncated"],i);const r=T(n,["token_count"]);return r!=null&&S(t,["tokenCount"],r),t}function zT(n,e){const t={},i=T(n,["parts"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>xhe(a))),S(t,["parts"],s)}const r=T(n,["role"]);return r!=null&&S(t,["role"],r),t}function V1(n,e){const t={},i=T(n,["parts"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>bhe(a))),S(t,["parts"],s)}const r=T(n,["role"]);return r!=null&&S(t,["role"],r),t}function due(n,e){const t={},i=T(n,["controlType"]);i!=null&&S(t,["controlType"],i);const r=T(n,["enableControlImageComputation"]);return r!=null&&S(t,["computeControl"],r),t}function fue(n,e){const t={};if(T(n,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(T(n,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(T(n,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return t}function pue(n,e,t){const i={},r=T(n,["systemInstruction"]);e!==void 0&&r!=null&&S(e,["systemInstruction"],V1(es(r)));const s=T(n,["tools"]);if(e!==void 0&&s!=null){let o=s;Array.isArray(o)&&(o=o.map(l=>C$(l))),S(e,["tools"],o)}const a=T(n,["generationConfig"]);return e!==void 0&&a!=null&&S(e,["generationConfig"],she(a)),i}function gue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let o=Eo(s);Array.isArray(o)&&(o=o.map(l=>zT(l))),S(i,["contents"],o)}const a=T(e,["config"]);return a!=null&&fue(a),i}function mue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let o=Eo(s);Array.isArray(o)&&(o=o.map(l=>V1(l))),S(i,["contents"],o)}const a=T(e,["config"]);return a!=null&&pue(a,i),i}function yue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["totalTokens"]);r!=null&&S(t,["totalTokens"],r);const s=T(n,["cachedContentTokenCount"]);return s!=null&&S(t,["cachedContentTokenCount"],s),t}function vue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["totalTokens"]);return r!=null&&S(t,["totalTokens"],r),t}function _ue(n,e,t){const i={},r=T(e,["model"]);return r!=null&&S(i,["_url","name"],Un(n,r)),i}function xue(n,e,t){const i={},r=T(e,["model"]);return r!=null&&S(i,["_url","name"],Un(n,r)),i}function bue(n,e){const t={},i=T(n,["sdkHttpResponse"]);return i!=null&&S(t,["sdkHttpResponse"],i),t}function Tue(n,e){const t={},i=T(n,["sdkHttpResponse"]);return i!=null&&S(t,["sdkHttpResponse"],i),t}function Eue(n,e,t){const i={},r=T(n,["outputGcsUri"]);e!==void 0&&r!=null&&S(e,["parameters","storageUri"],r);const s=T(n,["negativePrompt"]);e!==void 0&&s!=null&&S(e,["parameters","negativePrompt"],s);const a=T(n,["numberOfImages"]);e!==void 0&&a!=null&&S(e,["parameters","sampleCount"],a);const o=T(n,["aspectRatio"]);e!==void 0&&o!=null&&S(e,["parameters","aspectRatio"],o);const l=T(n,["guidanceScale"]);e!==void 0&&l!=null&&S(e,["parameters","guidanceScale"],l);const c=T(n,["seed"]);e!==void 0&&c!=null&&S(e,["parameters","seed"],c);const h=T(n,["safetyFilterLevel"]);e!==void 0&&h!=null&&S(e,["parameters","safetySetting"],h);const f=T(n,["personGeneration"]);e!==void 0&&f!=null&&S(e,["parameters","personGeneration"],f);const p=T(n,["includeSafetyAttributes"]);e!==void 0&&p!=null&&S(e,["parameters","includeSafetyAttributes"],p);const y=T(n,["includeRaiReason"]);e!==void 0&&y!=null&&S(e,["parameters","includeRaiReason"],y);const x=T(n,["language"]);e!==void 0&&x!=null&&S(e,["parameters","language"],x);const v=T(n,["outputMimeType"]);e!==void 0&&v!=null&&S(e,["parameters","outputOptions","mimeType"],v);const _=T(n,["outputCompressionQuality"]);e!==void 0&&_!=null&&S(e,["parameters","outputOptions","compressionQuality"],_);const E=T(n,["addWatermark"]);e!==void 0&&E!=null&&S(e,["parameters","addWatermark"],E);const w=T(n,["labels"]);e!==void 0&&w!=null&&S(e,["labels"],w);const A=T(n,["editMode"]);e!==void 0&&A!=null&&S(e,["parameters","editMode"],A);const N=T(n,["baseSteps"]);return e!==void 0&&N!=null&&S(e,["parameters","editConfig","baseSteps"],N),i}function wue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["prompt"]);s!=null&&S(i,["instances[0]","prompt"],s);const a=T(e,["referenceImages"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(c=>Dhe(c))),S(i,["instances[0]","referenceImages"],l)}const o=T(e,["config"]);return o!=null&&Eue(o,i),i}function Aue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>JC(a))),S(t,["generatedImages"],s)}return t}function Sue(n,e,t){const i={},r=T(n,["taskType"]);e!==void 0&&r!=null&&S(e,["requests[]","taskType"],r);const s=T(n,["title"]);e!==void 0&&s!=null&&S(e,["requests[]","title"],s);const a=T(n,["outputDimensionality"]);if(e!==void 0&&a!=null&&S(e,["requests[]","outputDimensionality"],a),T(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(T(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return i}function Due(n,e,t){const i={};let r=T(t,["embeddingApiType"]);if(r===void 0&&(r="PREDICT"),r==="PREDICT"){const c=T(n,["taskType"]);e!==void 0&&c!=null&&S(e,["instances[]","task_type"],c)}else if(r==="EMBED_CONTENT"){const c=T(n,["taskType"]);e!==void 0&&c!=null&&S(e,["taskType"],c)}let s=T(t,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){const c=T(n,["title"]);e!==void 0&&c!=null&&S(e,["instances[]","title"],c)}else if(s==="EMBED_CONTENT"){const c=T(n,["title"]);e!==void 0&&c!=null&&S(e,["title"],c)}let a=T(t,["embeddingApiType"]);if(a===void 0&&(a="PREDICT"),a==="PREDICT"){const c=T(n,["outputDimensionality"]);e!==void 0&&c!=null&&S(e,["parameters","outputDimensionality"],c)}else if(a==="EMBED_CONTENT"){const c=T(n,["outputDimensionality"]);e!==void 0&&c!=null&&S(e,["outputDimensionality"],c)}let o=T(t,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="PREDICT"){const c=T(n,["mimeType"]);e!==void 0&&c!=null&&S(e,["instances[]","mimeType"],c)}let l=T(t,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="PREDICT"){const c=T(n,["autoTruncate"]);e!==void 0&&c!=null&&S(e,["parameters","autoTruncate"],c)}else if(l==="EMBED_CONTENT"){const c=T(n,["autoTruncate"]);e!==void 0&&c!=null&&S(e,["autoTruncate"],c)}return i}function Cue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let c=PP(n,s);Array.isArray(c)&&(c=c.map(h=>h)),S(i,["requests[]","content"],c)}const a=T(e,["content"]);a!=null&&zT(es(a));const o=T(e,["config"]);o!=null&&Sue(o,i);const l=T(e,["model"]);return l!==void 0&&S(i,["requests[]","model"],Un(n,l)),i}function Iue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));let s=T(t,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){const l=T(e,["contents"]);if(l!=null){let c=PP(n,l);Array.isArray(c)&&(c=c.map(h=>h)),S(i,["instances[]","content"],c)}}let a=T(t,["embeddingApiType"]);if(a===void 0&&(a="PREDICT"),a==="EMBED_CONTENT"){const l=T(e,["content"]);l!=null&&S(i,["content"],V1(es(l)))}const o=T(e,["config"]);return o!=null&&Due(o,i,t),i}function Rue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["embeddings"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(o=>o)),S(t,["embeddings"],a)}const s=T(n,["metadata"]);return s!=null&&S(t,["metadata"],s),t}function Nue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["predictions[]","embeddings"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(o=>uue(o))),S(t,["embeddings"],a)}const s=T(n,["metadata"]);if(s!=null&&S(t,["metadata"],s),e&&T(e,["embeddingApiType"])==="EMBED_CONTENT"){const a=T(n,["embedding"]),o=T(n,["usageMetadata"]),l=T(n,["truncated"]);if(a){const c={};o&&o.promptTokenCount&&(c.tokenCount=o.promptTokenCount),l&&(c.truncated=l),a.statistics=c,S(t,["embeddings"],[a])}}return t}function kue(n,e){const t={},i=T(n,["endpoint"]);i!=null&&S(t,["name"],i);const r=T(n,["deployedModelId"]);return r!=null&&S(t,["deployedModelId"],r),t}function Mue(n,e){const t={};if(T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=T(n,["fileUri"]);i!=null&&S(t,["fileUri"],i);const r=T(n,["mimeType"]);return r!=null&&S(t,["mimeType"],r),t}function Fue(n,e){const t={},i=T(n,["id"]);i!=null&&S(t,["id"],i);const r=T(n,["args"]);r!=null&&S(t,["args"],r);const s=T(n,["name"]);if(s!=null&&S(t,["name"],s),T(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(T(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function Uue(n,e){const t={},i=T(n,["allowedFunctionNames"]);i!=null&&S(t,["allowedFunctionNames"],i);const r=T(n,["mode"]);if(r!=null&&S(t,["mode"],r),T(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function Pue(n,e){const t={},i=T(n,["description"]);i!=null&&S(t,["description"],i);const r=T(n,["name"]);r!=null&&S(t,["name"],r);const s=T(n,["parameters"]);s!=null&&S(t,["parameters"],s);const a=T(n,["parametersJsonSchema"]);a!=null&&S(t,["parametersJsonSchema"],a);const o=T(n,["response"]);o!=null&&S(t,["response"],o);const l=T(n,["responseJsonSchema"]);if(l!=null&&S(t,["responseJsonSchema"],l),T(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function Lue(n,e,t,i){const r={},s=T(e,["systemInstruction"]);t!==void 0&&s!=null&&S(t,["systemInstruction"],zT(es(s)));const a=T(e,["temperature"]);a!=null&&S(r,["temperature"],a);const o=T(e,["topP"]);o!=null&&S(r,["topP"],o);const l=T(e,["topK"]);l!=null&&S(r,["topK"],l);const c=T(e,["candidateCount"]);c!=null&&S(r,["candidateCount"],c);const h=T(e,["maxOutputTokens"]);h!=null&&S(r,["maxOutputTokens"],h);const f=T(e,["stopSequences"]);f!=null&&S(r,["stopSequences"],f);const p=T(e,["responseLogprobs"]);p!=null&&S(r,["responseLogprobs"],p);const y=T(e,["logprobs"]);y!=null&&S(r,["logprobs"],y);const x=T(e,["presencePenalty"]);x!=null&&S(r,["presencePenalty"],x);const v=T(e,["frequencyPenalty"]);v!=null&&S(r,["frequencyPenalty"],v);const _=T(e,["seed"]);_!=null&&S(r,["seed"],_);const E=T(e,["responseMimeType"]);E!=null&&S(r,["responseMimeType"],E);const w=T(e,["responseSchema"]);w!=null&&S(r,["responseSchema"],LP(w));const A=T(e,["responseJsonSchema"]);if(A!=null&&S(r,["responseJsonSchema"],A),T(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(T(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const N=T(e,["safetySettings"]);if(t!==void 0&&N!=null){let B=N;Array.isArray(B)&&(B=B.map(re=>Che(re))),S(t,["safetySettings"],B)}const k=T(e,["tools"]);if(t!==void 0&&k!=null){let B=O1(k);Array.isArray(B)&&(B=B.map(re=>Phe(L1(re)))),S(t,["tools"],B)}const F=T(e,["toolConfig"]);if(t!==void 0&&F!=null&&S(t,["toolConfig"],Fhe(F)),T(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const C=T(e,["cachedContent"]);t!==void 0&&C!=null&&S(t,["cachedContent"],Jh(n,C));const M=T(e,["responseModalities"]);M!=null&&S(r,["responseModalities"],M);const R=T(e,["mediaResolution"]);R!=null&&S(r,["mediaResolution"],R);const L=T(e,["speechConfig"]);if(L!=null&&S(r,["speechConfig"],OP(L)),T(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const H=T(e,["thinkingConfig"]);H!=null&&S(r,["thinkingConfig"],H);const P=T(e,["imageConfig"]);P!=null&&S(r,["imageConfig"],uhe(P));const O=T(e,["enableEnhancedCivicAnswers"]);if(O!=null&&S(r,["enableEnhancedCivicAnswers"],O),T(e,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return r}function Oue(n,e,t,i){const r={},s=T(e,["systemInstruction"]);t!==void 0&&s!=null&&S(t,["systemInstruction"],V1(es(s)));const a=T(e,["temperature"]);a!=null&&S(r,["temperature"],a);const o=T(e,["topP"]);o!=null&&S(r,["topP"],o);const l=T(e,["topK"]);l!=null&&S(r,["topK"],l);const c=T(e,["candidateCount"]);c!=null&&S(r,["candidateCount"],c);const h=T(e,["maxOutputTokens"]);h!=null&&S(r,["maxOutputTokens"],h);const f=T(e,["stopSequences"]);f!=null&&S(r,["stopSequences"],f);const p=T(e,["responseLogprobs"]);p!=null&&S(r,["responseLogprobs"],p);const y=T(e,["logprobs"]);y!=null&&S(r,["logprobs"],y);const x=T(e,["presencePenalty"]);x!=null&&S(r,["presencePenalty"],x);const v=T(e,["frequencyPenalty"]);v!=null&&S(r,["frequencyPenalty"],v);const _=T(e,["seed"]);_!=null&&S(r,["seed"],_);const E=T(e,["responseMimeType"]);E!=null&&S(r,["responseMimeType"],E);const w=T(e,["responseSchema"]);w!=null&&S(r,["responseSchema"],LP(w));const A=T(e,["responseJsonSchema"]);A!=null&&S(r,["responseJsonSchema"],A);const N=T(e,["routingConfig"]);N!=null&&S(r,["routingConfig"],N);const k=T(e,["modelSelectionConfig"]);k!=null&&S(r,["modelConfig"],k);const F=T(e,["safetySettings"]);if(t!==void 0&&F!=null){let oe=F;Array.isArray(oe)&&(oe=oe.map(ue=>ue)),S(t,["safetySettings"],oe)}const C=T(e,["tools"]);if(t!==void 0&&C!=null){let oe=O1(C);Array.isArray(oe)&&(oe=oe.map(ue=>C$(L1(ue)))),S(t,["tools"],oe)}const M=T(e,["toolConfig"]);t!==void 0&&M!=null&&S(t,["toolConfig"],Uhe(M));const R=T(e,["labels"]);t!==void 0&&R!=null&&S(t,["labels"],R);const L=T(e,["cachedContent"]);t!==void 0&&L!=null&&S(t,["cachedContent"],Jh(n,L));const H=T(e,["responseModalities"]);H!=null&&S(r,["responseModalities"],H);const P=T(e,["mediaResolution"]);P!=null&&S(r,["mediaResolution"],P);const O=T(e,["speechConfig"]);O!=null&&S(r,["speechConfig"],OP(O));const B=T(e,["audioTimestamp"]);B!=null&&S(r,["audioTimestamp"],B);const re=T(e,["thinkingConfig"]);re!=null&&S(r,["thinkingConfig"],re);const q=T(e,["imageConfig"]);if(q!=null&&S(r,["imageConfig"],hhe(q)),T(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const X=T(e,["modelArmorConfig"]);return t!==void 0&&X!=null&&S(t,["modelArmorConfig"],X),r}function X9(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let o=Eo(s);Array.isArray(o)&&(o=o.map(l=>zT(l))),S(i,["contents"],o)}const a=T(e,["config"]);return a!=null&&S(i,["generationConfig"],Lue(n,a,i)),i}function K9(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["contents"]);if(s!=null){let o=Eo(s);Array.isArray(o)&&(o=o.map(l=>V1(l))),S(i,["contents"],o)}const a=T(e,["config"]);return a!=null&&S(i,["generationConfig"],Oue(n,a,i)),i}function Y9(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["candidates"]);if(r!=null){let c=r;Array.isArray(c)&&(c=c.map(h=>aue(h))),S(t,["candidates"],c)}const s=T(n,["modelVersion"]);s!=null&&S(t,["modelVersion"],s);const a=T(n,["promptFeedback"]);a!=null&&S(t,["promptFeedback"],a);const o=T(n,["responseId"]);o!=null&&S(t,["responseId"],o);const l=T(n,["usageMetadata"]);return l!=null&&S(t,["usageMetadata"],l),t}function J9(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["candidates"]);if(r!=null){let h=r;Array.isArray(h)&&(h=h.map(f=>f)),S(t,["candidates"],h)}const s=T(n,["createTime"]);s!=null&&S(t,["createTime"],s);const a=T(n,["modelVersion"]);a!=null&&S(t,["modelVersion"],a);const o=T(n,["promptFeedback"]);o!=null&&S(t,["promptFeedback"],o);const l=T(n,["responseId"]);l!=null&&S(t,["responseId"],l);const c=T(n,["usageMetadata"]);return c!=null&&S(t,["usageMetadata"],c),t}function Bue(n,e,t){const i={};if(T(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(T(n,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const r=T(n,["numberOfImages"]);e!==void 0&&r!=null&&S(e,["parameters","sampleCount"],r);const s=T(n,["aspectRatio"]);e!==void 0&&s!=null&&S(e,["parameters","aspectRatio"],s);const a=T(n,["guidanceScale"]);if(e!==void 0&&a!=null&&S(e,["parameters","guidanceScale"],a),T(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const o=T(n,["safetyFilterLevel"]);e!==void 0&&o!=null&&S(e,["parameters","safetySetting"],o);const l=T(n,["personGeneration"]);e!==void 0&&l!=null&&S(e,["parameters","personGeneration"],l);const c=T(n,["includeSafetyAttributes"]);e!==void 0&&c!=null&&S(e,["parameters","includeSafetyAttributes"],c);const h=T(n,["includeRaiReason"]);e!==void 0&&h!=null&&S(e,["parameters","includeRaiReason"],h);const f=T(n,["language"]);e!==void 0&&f!=null&&S(e,["parameters","language"],f);const p=T(n,["outputMimeType"]);e!==void 0&&p!=null&&S(e,["parameters","outputOptions","mimeType"],p);const y=T(n,["outputCompressionQuality"]);if(e!==void 0&&y!=null&&S(e,["parameters","outputOptions","compressionQuality"],y),T(n,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(T(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const x=T(n,["imageSize"]);if(e!==void 0&&x!=null&&S(e,["parameters","sampleImageSize"],x),T(n,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return i}function Vue(n,e,t){const i={},r=T(n,["outputGcsUri"]);e!==void 0&&r!=null&&S(e,["parameters","storageUri"],r);const s=T(n,["negativePrompt"]);e!==void 0&&s!=null&&S(e,["parameters","negativePrompt"],s);const a=T(n,["numberOfImages"]);e!==void 0&&a!=null&&S(e,["parameters","sampleCount"],a);const o=T(n,["aspectRatio"]);e!==void 0&&o!=null&&S(e,["parameters","aspectRatio"],o);const l=T(n,["guidanceScale"]);e!==void 0&&l!=null&&S(e,["parameters","guidanceScale"],l);const c=T(n,["seed"]);e!==void 0&&c!=null&&S(e,["parameters","seed"],c);const h=T(n,["safetyFilterLevel"]);e!==void 0&&h!=null&&S(e,["parameters","safetySetting"],h);const f=T(n,["personGeneration"]);e!==void 0&&f!=null&&S(e,["parameters","personGeneration"],f);const p=T(n,["includeSafetyAttributes"]);e!==void 0&&p!=null&&S(e,["parameters","includeSafetyAttributes"],p);const y=T(n,["includeRaiReason"]);e!==void 0&&y!=null&&S(e,["parameters","includeRaiReason"],y);const x=T(n,["language"]);e!==void 0&&x!=null&&S(e,["parameters","language"],x);const v=T(n,["outputMimeType"]);e!==void 0&&v!=null&&S(e,["parameters","outputOptions","mimeType"],v);const _=T(n,["outputCompressionQuality"]);e!==void 0&&_!=null&&S(e,["parameters","outputOptions","compressionQuality"],_);const E=T(n,["addWatermark"]);e!==void 0&&E!=null&&S(e,["parameters","addWatermark"],E);const w=T(n,["labels"]);e!==void 0&&w!=null&&S(e,["labels"],w);const A=T(n,["imageSize"]);e!==void 0&&A!=null&&S(e,["parameters","sampleImageSize"],A);const N=T(n,["enhancePrompt"]);return e!==void 0&&N!=null&&S(e,["parameters","enhancePrompt"],N),i}function Wue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["prompt"]);s!=null&&S(i,["instances[0]","prompt"],s);const a=T(e,["config"]);return a!=null&&Bue(a,i),i}function Hue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["prompt"]);s!=null&&S(i,["instances[0]","prompt"],s);const a=T(e,["config"]);return a!=null&&Vue(a,i),i}function zue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["predictions"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(o=>the(o))),S(t,["generatedImages"],a)}const s=T(n,["positivePromptSafetyAttributes"]);return s!=null&&S(t,["positivePromptSafetyAttributes"],S$(s)),t}function Gue(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["predictions"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(o=>JC(o))),S(t,["generatedImages"],a)}const s=T(n,["positivePromptSafetyAttributes"]);return s!=null&&S(t,["positivePromptSafetyAttributes"],D$(s)),t}function que(n,e,t){const i={},r=T(n,["numberOfVideos"]);if(e!==void 0&&r!=null&&S(e,["parameters","sampleCount"],r),T(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(T(n,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const s=T(n,["durationSeconds"]);if(e!==void 0&&s!=null&&S(e,["parameters","durationSeconds"],s),T(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const a=T(n,["aspectRatio"]);e!==void 0&&a!=null&&S(e,["parameters","aspectRatio"],a);const o=T(n,["resolution"]);e!==void 0&&o!=null&&S(e,["parameters","resolution"],o);const l=T(n,["personGeneration"]);if(e!==void 0&&l!=null&&S(e,["parameters","personGeneration"],l),T(n,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const c=T(n,["negativePrompt"]);e!==void 0&&c!=null&&S(e,["parameters","negativePrompt"],c);const h=T(n,["enhancePrompt"]);if(e!==void 0&&h!=null&&S(e,["parameters","enhancePrompt"],h),T(n,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const f=T(n,["lastFrame"]);e!==void 0&&f!=null&&S(e,["instances[0]","lastFrame"],QC(f));const p=T(n,["referenceImages"]);if(e!==void 0&&p!=null){let y=p;Array.isArray(y)&&(y=y.map(x=>Khe(x))),S(e,["instances[0]","referenceImages"],y)}if(T(n,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(T(n,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return i}function $ue(n,e,t){const i={},r=T(n,["numberOfVideos"]);e!==void 0&&r!=null&&S(e,["parameters","sampleCount"],r);const s=T(n,["outputGcsUri"]);e!==void 0&&s!=null&&S(e,["parameters","storageUri"],s);const a=T(n,["fps"]);e!==void 0&&a!=null&&S(e,["parameters","fps"],a);const o=T(n,["durationSeconds"]);e!==void 0&&o!=null&&S(e,["parameters","durationSeconds"],o);const l=T(n,["seed"]);e!==void 0&&l!=null&&S(e,["parameters","seed"],l);const c=T(n,["aspectRatio"]);e!==void 0&&c!=null&&S(e,["parameters","aspectRatio"],c);const h=T(n,["resolution"]);e!==void 0&&h!=null&&S(e,["parameters","resolution"],h);const f=T(n,["personGeneration"]);e!==void 0&&f!=null&&S(e,["parameters","personGeneration"],f);const p=T(n,["pubsubTopic"]);e!==void 0&&p!=null&&S(e,["parameters","pubsubTopic"],p);const y=T(n,["negativePrompt"]);e!==void 0&&y!=null&&S(e,["parameters","negativePrompt"],y);const x=T(n,["enhancePrompt"]);e!==void 0&&x!=null&&S(e,["parameters","enhancePrompt"],x);const v=T(n,["generateAudio"]);e!==void 0&&v!=null&&S(e,["parameters","generateAudio"],v);const _=T(n,["lastFrame"]);e!==void 0&&_!=null&&S(e,["instances[0]","lastFrame"],cc(_));const E=T(n,["referenceImages"]);if(e!==void 0&&E!=null){let N=E;Array.isArray(N)&&(N=N.map(k=>Yhe(k))),S(e,["instances[0]","referenceImages"],N)}const w=T(n,["mask"]);e!==void 0&&w!=null&&S(e,["instances[0]","mask"],Xhe(w));const A=T(n,["compressionQuality"]);return e!==void 0&&A!=null&&S(e,["parameters","compressionQuality"],A),i}function jue(n,e){const t={},i=T(n,["name"]);i!=null&&S(t,["name"],i);const r=T(n,["metadata"]);r!=null&&S(t,["metadata"],r);const s=T(n,["done"]);s!=null&&S(t,["done"],s);const a=T(n,["error"]);a!=null&&S(t,["error"],a);const o=T(n,["response","generateVideoResponse"]);return o!=null&&S(t,["response"],Jue(o)),t}function Xue(n,e){const t={},i=T(n,["name"]);i!=null&&S(t,["name"],i);const r=T(n,["metadata"]);r!=null&&S(t,["metadata"],r);const s=T(n,["done"]);s!=null&&S(t,["done"],s);const a=T(n,["error"]);a!=null&&S(t,["error"],a);const o=T(n,["response"]);return o!=null&&S(t,["response"],Que(o)),t}function Kue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["prompt"]);s!=null&&S(i,["instances[0]","prompt"],s);const a=T(e,["image"]);a!=null&&S(i,["instances[0]","image"],QC(a));const o=T(e,["video"]);o!=null&&S(i,["instances[0]","video"],I$(o));const l=T(e,["source"]);l!=null&&Zue(l,i);const c=T(e,["config"]);return c!=null&&que(c,i),i}function Yue(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["prompt"]);s!=null&&S(i,["instances[0]","prompt"],s);const a=T(e,["image"]);a!=null&&S(i,["instances[0]","image"],cc(a));const o=T(e,["video"]);o!=null&&S(i,["instances[0]","video"],R$(o));const l=T(e,["source"]);l!=null&&ehe(l,i);const c=T(e,["config"]);return c!=null&&$ue(c,i),i}function Jue(n,e){const t={},i=T(n,["generatedSamples"]);if(i!=null){let a=i;Array.isArray(a)&&(a=a.map(o=>ihe(o))),S(t,["generatedVideos"],a)}const r=T(n,["raiMediaFilteredCount"]);r!=null&&S(t,["raiMediaFilteredCount"],r);const s=T(n,["raiMediaFilteredReasons"]);return s!=null&&S(t,["raiMediaFilteredReasons"],s),t}function Que(n,e){const t={},i=T(n,["videos"]);if(i!=null){let a=i;Array.isArray(a)&&(a=a.map(o=>rhe(o))),S(t,["generatedVideos"],a)}const r=T(n,["raiMediaFilteredCount"]);r!=null&&S(t,["raiMediaFilteredCount"],r);const s=T(n,["raiMediaFilteredReasons"]);return s!=null&&S(t,["raiMediaFilteredReasons"],s),t}function Zue(n,e,t){const i={},r=T(n,["prompt"]);e!==void 0&&r!=null&&S(e,["instances[0]","prompt"],r);const s=T(n,["image"]);e!==void 0&&s!=null&&S(e,["instances[0]","image"],QC(s));const a=T(n,["video"]);return e!==void 0&&a!=null&&S(e,["instances[0]","video"],I$(a)),i}function ehe(n,e,t){const i={},r=T(n,["prompt"]);e!==void 0&&r!=null&&S(e,["instances[0]","prompt"],r);const s=T(n,["image"]);e!==void 0&&s!=null&&S(e,["instances[0]","image"],cc(s));const a=T(n,["video"]);return e!==void 0&&a!=null&&S(e,["instances[0]","video"],R$(a)),i}function the(n,e){const t={},i=T(n,["_self"]);i!=null&&S(t,["image"],dhe(i));const r=T(n,["raiFilteredReason"]);r!=null&&S(t,["raiFilteredReason"],r);const s=T(n,["_self"]);return s!=null&&S(t,["safetyAttributes"],S$(s)),t}function JC(n,e){const t={},i=T(n,["_self"]);i!=null&&S(t,["image"],A$(i));const r=T(n,["raiFilteredReason"]);r!=null&&S(t,["raiFilteredReason"],r);const s=T(n,["_self"]);s!=null&&S(t,["safetyAttributes"],D$(s));const a=T(n,["prompt"]);return a!=null&&S(t,["enhancedPrompt"],a),t}function nhe(n,e){const t={},i=T(n,["_self"]);i!=null&&S(t,["mask"],A$(i));const r=T(n,["labels"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(t,["labels"],s)}return t}function ihe(n,e){const t={},i=T(n,["video"]);return i!=null&&S(t,["video"],$he(i)),t}function rhe(n,e){const t={},i=T(n,["_self"]);return i!=null&&S(t,["video"],jhe(i)),t}function she(n,e){const t={},i=T(n,["modelSelectionConfig"]);i!=null&&S(t,["modelConfig"],i);const r=T(n,["responseJsonSchema"]);r!=null&&S(t,["responseJsonSchema"],r);const s=T(n,["audioTimestamp"]);s!=null&&S(t,["audioTimestamp"],s);const a=T(n,["candidateCount"]);a!=null&&S(t,["candidateCount"],a);const o=T(n,["enableAffectiveDialog"]);o!=null&&S(t,["enableAffectiveDialog"],o);const l=T(n,["frequencyPenalty"]);l!=null&&S(t,["frequencyPenalty"],l);const c=T(n,["logprobs"]);c!=null&&S(t,["logprobs"],c);const h=T(n,["maxOutputTokens"]);h!=null&&S(t,["maxOutputTokens"],h);const f=T(n,["mediaResolution"]);f!=null&&S(t,["mediaResolution"],f);const p=T(n,["presencePenalty"]);p!=null&&S(t,["presencePenalty"],p);const y=T(n,["responseLogprobs"]);y!=null&&S(t,["responseLogprobs"],y);const x=T(n,["responseMimeType"]);x!=null&&S(t,["responseMimeType"],x);const v=T(n,["responseModalities"]);v!=null&&S(t,["responseModalities"],v);const _=T(n,["responseSchema"]);_!=null&&S(t,["responseSchema"],_);const E=T(n,["routingConfig"]);E!=null&&S(t,["routingConfig"],E);const w=T(n,["seed"]);w!=null&&S(t,["seed"],w);const A=T(n,["speechConfig"]);A!=null&&S(t,["speechConfig"],A);const N=T(n,["stopSequences"]);N!=null&&S(t,["stopSequences"],N);const k=T(n,["temperature"]);k!=null&&S(t,["temperature"],k);const F=T(n,["thinkingConfig"]);F!=null&&S(t,["thinkingConfig"],F);const C=T(n,["topK"]);C!=null&&S(t,["topK"],C);const M=T(n,["topP"]);if(M!=null&&S(t,["topP"],M),T(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function ahe(n,e,t){const i={},r=T(e,["model"]);return r!=null&&S(i,["_url","name"],Un(n,r)),i}function ohe(n,e,t){const i={},r=T(e,["model"]);return r!=null&&S(i,["_url","name"],Un(n,r)),i}function lhe(n,e){const t={},i=T(n,["authConfig"]);i!=null&&S(t,["authConfig"],rue(i));const r=T(n,["enableWidget"]);return r!=null&&S(t,["enableWidget"],r),t}function che(n,e){const t={},i=T(n,["searchTypes"]);if(i!=null&&S(t,["searchTypes"],i),T(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(T(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const r=T(n,["timeRangeFilter"]);return r!=null&&S(t,["timeRangeFilter"],r),t}function uhe(n,e){const t={},i=T(n,["aspectRatio"]);i!=null&&S(t,["aspectRatio"],i);const r=T(n,["imageSize"]);if(r!=null&&S(t,["imageSize"],r),T(n,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(T(n,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(T(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(T(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(T(n,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return t}function hhe(n,e){const t={},i=T(n,["aspectRatio"]);i!=null&&S(t,["aspectRatio"],i);const r=T(n,["imageSize"]);r!=null&&S(t,["imageSize"],r);const s=T(n,["personGeneration"]);s!=null&&S(t,["personGeneration"],s);const a=T(n,["prominentPeople"]);a!=null&&S(t,["prominentPeople"],a);const o=T(n,["outputMimeType"]);o!=null&&S(t,["imageOutputOptions","mimeType"],o);const l=T(n,["outputCompressionQuality"]);l!=null&&S(t,["imageOutputOptions","compressionQuality"],l);const c=T(n,["imageOutputOptions"]);return c!=null&&S(t,["imageOutputOptions"],c),t}function dhe(n,e){const t={},i=T(n,["bytesBase64Encoded"]);i!=null&&S(t,["imageBytes"],mp(i));const r=T(n,["mimeType"]);return r!=null&&S(t,["mimeType"],r),t}function A$(n,e){const t={},i=T(n,["gcsUri"]);i!=null&&S(t,["gcsUri"],i);const r=T(n,["bytesBase64Encoded"]);r!=null&&S(t,["imageBytes"],mp(r));const s=T(n,["mimeType"]);return s!=null&&S(t,["mimeType"],s),t}function QC(n,e){const t={};if(T(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const i=T(n,["imageBytes"]);i!=null&&S(t,["bytesBase64Encoded"],mp(i));const r=T(n,["mimeType"]);return r!=null&&S(t,["mimeType"],r),t}function cc(n,e){const t={},i=T(n,["gcsUri"]);i!=null&&S(t,["gcsUri"],i);const r=T(n,["imageBytes"]);r!=null&&S(t,["bytesBase64Encoded"],mp(r));const s=T(n,["mimeType"]);return s!=null&&S(t,["mimeType"],s),t}function fhe(n,e,t,i){const r={},s=T(e,["pageSize"]);t!==void 0&&s!=null&&S(t,["_query","pageSize"],s);const a=T(e,["pageToken"]);t!==void 0&&a!=null&&S(t,["_query","pageToken"],a);const o=T(e,["filter"]);t!==void 0&&o!=null&&S(t,["_query","filter"],o);const l=T(e,["queryBase"]);return t!==void 0&&l!=null&&S(t,["_url","models_url"],v$(n,l)),r}function phe(n,e,t,i){const r={},s=T(e,["pageSize"]);t!==void 0&&s!=null&&S(t,["_query","pageSize"],s);const a=T(e,["pageToken"]);t!==void 0&&a!=null&&S(t,["_query","pageToken"],a);const o=T(e,["filter"]);t!==void 0&&o!=null&&S(t,["_query","filter"],o);const l=T(e,["queryBase"]);return t!==void 0&&l!=null&&S(t,["_url","models_url"],v$(n,l)),r}function ghe(n,e,t){const i={},r=T(e,["config"]);return r!=null&&fhe(n,r,i),i}function mhe(n,e,t){const i={},r=T(e,["config"]);return r!=null&&phe(n,r,i),i}function yhe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["nextPageToken"]);r!=null&&S(t,["nextPageToken"],r);const s=T(n,["_self"]);if(s!=null){let a=_$(s);Array.isArray(a)&&(a=a.map(o=>PM(o))),S(t,["models"],a)}return t}function vhe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["nextPageToken"]);r!=null&&S(t,["nextPageToken"],r);const s=T(n,["_self"]);if(s!=null){let a=_$(s);Array.isArray(a)&&(a=a.map(o=>LM(o))),S(t,["models"],a)}return t}function _he(n,e){const t={},i=T(n,["maskMode"]);i!=null&&S(t,["maskMode"],i);const r=T(n,["segmentationClasses"]);r!=null&&S(t,["maskClasses"],r);const s=T(n,["maskDilation"]);return s!=null&&S(t,["dilation"],s),t}function PM(n,e){const t={},i=T(n,["name"]);i!=null&&S(t,["name"],i);const r=T(n,["displayName"]);r!=null&&S(t,["displayName"],r);const s=T(n,["description"]);s!=null&&S(t,["description"],s);const a=T(n,["version"]);a!=null&&S(t,["version"],a);const o=T(n,["_self"]);o!=null&&S(t,["tunedModelInfo"],Lhe(o));const l=T(n,["inputTokenLimit"]);l!=null&&S(t,["inputTokenLimit"],l);const c=T(n,["outputTokenLimit"]);c!=null&&S(t,["outputTokenLimit"],c);const h=T(n,["supportedGenerationMethods"]);h!=null&&S(t,["supportedActions"],h);const f=T(n,["temperature"]);f!=null&&S(t,["temperature"],f);const p=T(n,["maxTemperature"]);p!=null&&S(t,["maxTemperature"],p);const y=T(n,["topP"]);y!=null&&S(t,["topP"],y);const x=T(n,["topK"]);x!=null&&S(t,["topK"],x);const v=T(n,["thinking"]);return v!=null&&S(t,["thinking"],v),t}function LM(n,e){const t={},i=T(n,["name"]);i!=null&&S(t,["name"],i);const r=T(n,["displayName"]);r!=null&&S(t,["displayName"],r);const s=T(n,["description"]);s!=null&&S(t,["description"],s);const a=T(n,["versionId"]);a!=null&&S(t,["version"],a);const o=T(n,["deployedModels"]);if(o!=null){let p=o;Array.isArray(p)&&(p=p.map(y=>kue(y))),S(t,["endpoints"],p)}const l=T(n,["labels"]);l!=null&&S(t,["labels"],l);const c=T(n,["_self"]);c!=null&&S(t,["tunedModelInfo"],Ohe(c));const h=T(n,["defaultCheckpointId"]);h!=null&&S(t,["defaultCheckpointId"],h);const f=T(n,["checkpoints"]);if(f!=null){let p=f;Array.isArray(p)&&(p=p.map(y=>y)),S(t,["checkpoints"],p)}return t}function xhe(n,e){const t={},i=T(n,["mediaResolution"]);i!=null&&S(t,["mediaResolution"],i);const r=T(n,["codeExecutionResult"]);r!=null&&S(t,["codeExecutionResult"],r);const s=T(n,["executableCode"]);s!=null&&S(t,["executableCode"],s);const a=T(n,["fileData"]);a!=null&&S(t,["fileData"],Mue(a));const o=T(n,["functionCall"]);o!=null&&S(t,["functionCall"],Fue(o));const l=T(n,["functionResponse"]);l!=null&&S(t,["functionResponse"],l);const c=T(n,["inlineData"]);c!=null&&S(t,["inlineData"],sue(c));const h=T(n,["text"]);h!=null&&S(t,["text"],h);const f=T(n,["thought"]);f!=null&&S(t,["thought"],f);const p=T(n,["thoughtSignature"]);p!=null&&S(t,["thoughtSignature"],p);const y=T(n,["videoMetadata"]);y!=null&&S(t,["videoMetadata"],y);const x=T(n,["toolCall"]);x!=null&&S(t,["toolCall"],x);const v=T(n,["toolResponse"]);return v!=null&&S(t,["toolResponse"],v),t}function bhe(n,e){const t={},i=T(n,["mediaResolution"]);i!=null&&S(t,["mediaResolution"],i);const r=T(n,["codeExecutionResult"]);r!=null&&S(t,["codeExecutionResult"],r);const s=T(n,["executableCode"]);s!=null&&S(t,["executableCode"],s);const a=T(n,["fileData"]);a!=null&&S(t,["fileData"],a);const o=T(n,["functionCall"]);o!=null&&S(t,["functionCall"],o);const l=T(n,["functionResponse"]);l!=null&&S(t,["functionResponse"],l);const c=T(n,["inlineData"]);c!=null&&S(t,["inlineData"],c);const h=T(n,["text"]);h!=null&&S(t,["text"],h);const f=T(n,["thought"]);f!=null&&S(t,["thought"],f);const p=T(n,["thoughtSignature"]);p!=null&&S(t,["thoughtSignature"],p);const y=T(n,["videoMetadata"]);if(y!=null&&S(t,["videoMetadata"],y),T(n,["toolCall"])!==void 0)throw new Error("toolCall parameter is not supported in Vertex AI.");if(T(n,["toolResponse"])!==void 0)throw new Error("toolResponse parameter is not supported in Vertex AI.");return t}function The(n,e){const t={},i=T(n,["productImage"]);return i!=null&&S(t,["image"],cc(i)),t}function Ehe(n,e,t){const i={},r=T(n,["numberOfImages"]);e!==void 0&&r!=null&&S(e,["parameters","sampleCount"],r);const s=T(n,["baseSteps"]);e!==void 0&&s!=null&&S(e,["parameters","baseSteps"],s);const a=T(n,["outputGcsUri"]);e!==void 0&&a!=null&&S(e,["parameters","storageUri"],a);const o=T(n,["seed"]);e!==void 0&&o!=null&&S(e,["parameters","seed"],o);const l=T(n,["safetyFilterLevel"]);e!==void 0&&l!=null&&S(e,["parameters","safetySetting"],l);const c=T(n,["personGeneration"]);e!==void 0&&c!=null&&S(e,["parameters","personGeneration"],c);const h=T(n,["addWatermark"]);e!==void 0&&h!=null&&S(e,["parameters","addWatermark"],h);const f=T(n,["outputMimeType"]);e!==void 0&&f!=null&&S(e,["parameters","outputOptions","mimeType"],f);const p=T(n,["outputCompressionQuality"]);e!==void 0&&p!=null&&S(e,["parameters","outputOptions","compressionQuality"],p);const y=T(n,["enhancePrompt"]);e!==void 0&&y!=null&&S(e,["parameters","enhancePrompt"],y);const x=T(n,["labels"]);return e!==void 0&&x!=null&&S(e,["labels"],x),i}function whe(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["source"]);s!=null&&She(s,i);const a=T(e,["config"]);return a!=null&&Ehe(a,i),i}function Ahe(n,e){const t={},i=T(n,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>JC(s))),S(t,["generatedImages"],r)}return t}function She(n,e,t){const i={},r=T(n,["prompt"]);e!==void 0&&r!=null&&S(e,["instances[0]","prompt"],r);const s=T(n,["personImage"]);e!==void 0&&s!=null&&S(e,["instances[0]","personImage","image"],cc(s));const a=T(n,["productImages"]);if(e!==void 0&&a!=null){let o=a;Array.isArray(o)&&(o=o.map(l=>The(l))),S(e,["instances[0]","productImages"],o)}return i}function Dhe(n,e){const t={},i=T(n,["referenceImage"]);i!=null&&S(t,["referenceImage"],cc(i));const r=T(n,["referenceId"]);r!=null&&S(t,["referenceId"],r);const s=T(n,["referenceType"]);s!=null&&S(t,["referenceType"],s);const a=T(n,["maskImageConfig"]);a!=null&&S(t,["maskImageConfig"],_he(a));const o=T(n,["controlImageConfig"]);o!=null&&S(t,["controlImageConfig"],due(o));const l=T(n,["styleImageConfig"]);l!=null&&S(t,["styleImageConfig"],l);const c=T(n,["subjectImageConfig"]);return c!=null&&S(t,["subjectImageConfig"],c),t}function S$(n,e){const t={},i=T(n,["safetyAttributes","categories"]);i!=null&&S(t,["categories"],i);const r=T(n,["safetyAttributes","scores"]);r!=null&&S(t,["scores"],r);const s=T(n,["contentType"]);return s!=null&&S(t,["contentType"],s),t}function D$(n,e){const t={},i=T(n,["safetyAttributes","categories"]);i!=null&&S(t,["categories"],i);const r=T(n,["safetyAttributes","scores"]);r!=null&&S(t,["scores"],r);const s=T(n,["contentType"]);return s!=null&&S(t,["contentType"],s),t}function Che(n,e){const t={},i=T(n,["category"]);if(i!=null&&S(t,["category"],i),T(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const r=T(n,["threshold"]);return r!=null&&S(t,["threshold"],r),t}function Ihe(n,e){const t={},i=T(n,["image"]);return i!=null&&S(t,["image"],cc(i)),t}function Rhe(n,e,t){const i={},r=T(n,["mode"]);e!==void 0&&r!=null&&S(e,["parameters","mode"],r);const s=T(n,["maxPredictions"]);e!==void 0&&s!=null&&S(e,["parameters","maxPredictions"],s);const a=T(n,["confidenceThreshold"]);e!==void 0&&a!=null&&S(e,["parameters","confidenceThreshold"],a);const o=T(n,["maskDilation"]);e!==void 0&&o!=null&&S(e,["parameters","maskDilation"],o);const l=T(n,["binaryColorThreshold"]);e!==void 0&&l!=null&&S(e,["parameters","binaryColorThreshold"],l);const c=T(n,["labels"]);return e!==void 0&&c!=null&&S(e,["labels"],c),i}function Nhe(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["source"]);s!=null&&Mhe(s,i);const a=T(e,["config"]);return a!=null&&Rhe(a,i),i}function khe(n,e){const t={},i=T(n,["predictions"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>nhe(s))),S(t,["generatedMasks"],r)}return t}function Mhe(n,e,t){const i={},r=T(n,["prompt"]);e!==void 0&&r!=null&&S(e,["instances[0]","prompt"],r);const s=T(n,["image"]);e!==void 0&&s!=null&&S(e,["instances[0]","image"],cc(s));const a=T(n,["scribbleImage"]);return e!==void 0&&a!=null&&S(e,["instances[0]","scribble"],Ihe(a)),i}function Fhe(n,e){const t={},i=T(n,["retrievalConfig"]);i!=null&&S(t,["retrievalConfig"],i);const r=T(n,["functionCallingConfig"]);r!=null&&S(t,["functionCallingConfig"],Uue(r));const s=T(n,["includeServerSideToolInvocations"]);return s!=null&&S(t,["includeServerSideToolInvocations"],s),t}function Uhe(n,e){const t={},i=T(n,["retrievalConfig"]);i!=null&&S(t,["retrievalConfig"],i);const r=T(n,["functionCallingConfig"]);if(r!=null&&S(t,["functionCallingConfig"],r),T(n,["includeServerSideToolInvocations"])!==void 0)throw new Error("includeServerSideToolInvocations parameter is not supported in Vertex AI.");return t}function Phe(n,e){const t={};if(T(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const i=T(n,["computerUse"]);i!=null&&S(t,["computerUse"],i);const r=T(n,["fileSearch"]);r!=null&&S(t,["fileSearch"],r);const s=T(n,["googleSearch"]);s!=null&&S(t,["googleSearch"],che(s));const a=T(n,["googleMaps"]);a!=null&&S(t,["googleMaps"],lhe(a));const o=T(n,["codeExecution"]);if(o!=null&&S(t,["codeExecution"],o),T(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const l=T(n,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(y=>y)),S(t,["functionDeclarations"],p)}const c=T(n,["googleSearchRetrieval"]);if(c!=null&&S(t,["googleSearchRetrieval"],c),T(n,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const h=T(n,["urlContext"]);h!=null&&S(t,["urlContext"],h);const f=T(n,["mcpServers"]);if(f!=null){let p=f;Array.isArray(p)&&(p=p.map(y=>y)),S(t,["mcpServers"],p)}return t}function C$(n,e){const t={},i=T(n,["retrieval"]);i!=null&&S(t,["retrieval"],i);const r=T(n,["computerUse"]);if(r!=null&&S(t,["computerUse"],r),T(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=T(n,["googleSearch"]);s!=null&&S(t,["googleSearch"],s);const a=T(n,["googleMaps"]);a!=null&&S(t,["googleMaps"],a);const o=T(n,["codeExecution"]);o!=null&&S(t,["codeExecution"],o);const l=T(n,["enterpriseWebSearch"]);l!=null&&S(t,["enterpriseWebSearch"],l);const c=T(n,["functionDeclarations"]);if(c!=null){let y=c;Array.isArray(y)&&(y=y.map(x=>Pue(x))),S(t,["functionDeclarations"],y)}const h=T(n,["googleSearchRetrieval"]);h!=null&&S(t,["googleSearchRetrieval"],h);const f=T(n,["parallelAiSearch"]);f!=null&&S(t,["parallelAiSearch"],f);const p=T(n,["urlContext"]);if(p!=null&&S(t,["urlContext"],p),T(n,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return t}function Lhe(n,e){const t={},i=T(n,["baseModel"]);i!=null&&S(t,["baseModel"],i);const r=T(n,["createTime"]);r!=null&&S(t,["createTime"],r);const s=T(n,["updateTime"]);return s!=null&&S(t,["updateTime"],s),t}function Ohe(n,e){const t={},i=T(n,["labels","google-vertex-llm-tuning-base-model-id"]);i!=null&&S(t,["baseModel"],i);const r=T(n,["createTime"]);r!=null&&S(t,["createTime"],r);const s=T(n,["updateTime"]);return s!=null&&S(t,["updateTime"],s),t}function Bhe(n,e,t){const i={},r=T(n,["displayName"]);e!==void 0&&r!=null&&S(e,["displayName"],r);const s=T(n,["description"]);e!==void 0&&s!=null&&S(e,["description"],s);const a=T(n,["defaultCheckpointId"]);return e!==void 0&&a!=null&&S(e,["defaultCheckpointId"],a),i}function Vhe(n,e,t){const i={},r=T(n,["displayName"]);e!==void 0&&r!=null&&S(e,["displayName"],r);const s=T(n,["description"]);e!==void 0&&s!=null&&S(e,["description"],s);const a=T(n,["defaultCheckpointId"]);return e!==void 0&&a!=null&&S(e,["defaultCheckpointId"],a),i}function Whe(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","name"],Un(n,r));const s=T(e,["config"]);return s!=null&&Bhe(s,i),i}function Hhe(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["config"]);return s!=null&&Vhe(s,i),i}function zhe(n,e,t){const i={},r=T(n,["outputGcsUri"]);e!==void 0&&r!=null&&S(e,["parameters","storageUri"],r);const s=T(n,["safetyFilterLevel"]);e!==void 0&&s!=null&&S(e,["parameters","safetySetting"],s);const a=T(n,["personGeneration"]);e!==void 0&&a!=null&&S(e,["parameters","personGeneration"],a);const o=T(n,["includeRaiReason"]);e!==void 0&&o!=null&&S(e,["parameters","includeRaiReason"],o);const l=T(n,["outputMimeType"]);e!==void 0&&l!=null&&S(e,["parameters","outputOptions","mimeType"],l);const c=T(n,["outputCompressionQuality"]);e!==void 0&&c!=null&&S(e,["parameters","outputOptions","compressionQuality"],c);const h=T(n,["enhanceInputImage"]);e!==void 0&&h!=null&&S(e,["parameters","upscaleConfig","enhanceInputImage"],h);const f=T(n,["imagePreservationFactor"]);e!==void 0&&f!=null&&S(e,["parameters","upscaleConfig","imagePreservationFactor"],f);const p=T(n,["labels"]);e!==void 0&&p!=null&&S(e,["labels"],p);const y=T(n,["numberOfImages"]);e!==void 0&&y!=null&&S(e,["parameters","sampleCount"],y);const x=T(n,["mode"]);return e!==void 0&&x!=null&&S(e,["parameters","mode"],x),i}function Ghe(n,e,t){const i={},r=T(e,["model"]);r!=null&&S(i,["_url","model"],Un(n,r));const s=T(e,["image"]);s!=null&&S(i,["instances[0]","image"],cc(s));const a=T(e,["upscaleFactor"]);a!=null&&S(i,["parameters","upscaleConfig","upscaleFactor"],a);const o=T(e,["config"]);return o!=null&&zhe(o,i),i}function qhe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["predictions"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>JC(a))),S(t,["generatedImages"],s)}return t}function $he(n,e){const t={},i=T(n,["uri"]);i!=null&&S(t,["uri"],i);const r=T(n,["encodedVideo"]);r!=null&&S(t,["videoBytes"],mp(r));const s=T(n,["encoding"]);return s!=null&&S(t,["mimeType"],s),t}function jhe(n,e){const t={},i=T(n,["gcsUri"]);i!=null&&S(t,["uri"],i);const r=T(n,["bytesBase64Encoded"]);r!=null&&S(t,["videoBytes"],mp(r));const s=T(n,["mimeType"]);return s!=null&&S(t,["mimeType"],s),t}function Xhe(n,e){const t={},i=T(n,["image"]);i!=null&&S(t,["_self"],cc(i));const r=T(n,["maskMode"]);return r!=null&&S(t,["maskMode"],r),t}function Khe(n,e){const t={},i=T(n,["image"]);i!=null&&S(t,["image"],QC(i));const r=T(n,["referenceType"]);return r!=null&&S(t,["referenceType"],r),t}function Yhe(n,e){const t={},i=T(n,["image"]);i!=null&&S(t,["image"],cc(i));const r=T(n,["referenceType"]);return r!=null&&S(t,["referenceType"],r),t}function I$(n,e){const t={},i=T(n,["uri"]);i!=null&&S(t,["uri"],i);const r=T(n,["videoBytes"]);r!=null&&S(t,["encodedVideo"],mp(r));const s=T(n,["mimeType"]);return s!=null&&S(t,["encoding"],s),t}function R$(n,e){const t={},i=T(n,["uri"]);i!=null&&S(t,["gcsUri"],i);const r=T(n,["videoBytes"]);r!=null&&S(t,["bytesBase64Encoded"],mp(r));const s=T(n,["mimeType"]);return s!=null&&S(t,["mimeType"],s),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Jhe(n,e){const t={},i=T(n,["displayName"]);return e!==void 0&&i!=null&&S(e,["displayName"],i),t}function Qhe(n){const e={},t=T(n,["config"]);return t!=null&&Jhe(t,e),e}function Zhe(n,e){const t={},i=T(n,["force"]);return e!==void 0&&i!=null&&S(e,["_query","force"],i),t}function ede(n){const e={},t=T(n,["name"]);t!=null&&S(e,["_url","name"],t);const i=T(n,["config"]);return i!=null&&Zhe(i,e),e}function tde(n){const e={},t=T(n,["name"]);return t!=null&&S(e,["_url","name"],t),e}function nde(n,e){const t={},i=T(n,["customMetadata"]);if(e!==void 0&&i!=null){let s=i;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["customMetadata"],s)}const r=T(n,["chunkingConfig"]);return e!==void 0&&r!=null&&S(e,["chunkingConfig"],r),t}function ide(n){const e={},t=T(n,["name"]);t!=null&&S(e,["name"],t);const i=T(n,["metadata"]);i!=null&&S(e,["metadata"],i);const r=T(n,["done"]);r!=null&&S(e,["done"],r);const s=T(n,["error"]);s!=null&&S(e,["error"],s);const a=T(n,["response"]);return a!=null&&S(e,["response"],sde(a)),e}function rde(n){const e={},t=T(n,["fileSearchStoreName"]);t!=null&&S(e,["_url","file_search_store_name"],t);const i=T(n,["fileName"]);i!=null&&S(e,["fileName"],i);const r=T(n,["config"]);return r!=null&&nde(r,e),e}function sde(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["parent"]);i!=null&&S(e,["parent"],i);const r=T(n,["documentName"]);return r!=null&&S(e,["documentName"],r),e}function ade(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);return e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),t}function ode(n){const e={},t=T(n,["config"]);return t!=null&&ade(t,e),e}function lde(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["fileSearchStores"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["fileSearchStores"],s)}return e}function N$(n,e){const t={},i=T(n,["mimeType"]);e!==void 0&&i!=null&&S(e,["mimeType"],i);const r=T(n,["displayName"]);e!==void 0&&r!=null&&S(e,["displayName"],r);const s=T(n,["customMetadata"]);if(e!==void 0&&s!=null){let o=s;Array.isArray(o)&&(o=o.map(l=>l)),S(e,["customMetadata"],o)}const a=T(n,["chunkingConfig"]);return e!==void 0&&a!=null&&S(e,["chunkingConfig"],a),t}function cde(n){const e={},t=T(n,["fileSearchStoreName"]);t!=null&&S(e,["_url","file_search_store_name"],t);const i=T(n,["config"]);return i!=null&&N$(i,e),e}function ude(n){const e={},t=T(n,["sdkHttpResponse"]);return t!=null&&S(e,["sdkHttpResponse"],t),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const hde="Content-Type",dde="X-Server-Timeout",fde="User-Agent",OM="x-goog-api-client",pde="1.46.0",gde=`google-genai-sdk/${pde}`,mde="v1beta1",yde="v1beta",vde=5,_de=[408,429,500,502,503,504];class xde{constructor(e){var t,i,r;this.clientOptions=Object.assign({},e),this.customBaseUrl=(t=e.httpOptions)===null||t===void 0?void 0:t.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));const s={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");const o=e.project&&e.location||!!e.apiKey;this.customBaseUrl&&!o?(s.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?s.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&(s.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),s.apiVersion=(i=this.clientOptions.apiVersion)!==null&&i!==void 0?i:mde}else this.clientOptions.apiKey||console.warn("API key should be set when using the Gemini API."),s.apiVersion=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:yde,s.baseUrl="https://generativelanguage.googleapis.com/";s.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=s,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(s,e.httpOptions))}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){const e=new Headers;return await this.clientOptions.auth.addAuthHeaders(e),e}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const i=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&i.push(e.apiVersion),i.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),t=new URL(e);return t.protocol=t.protocol=="http:"?"ws":"wss",t.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,t,i){const r=[this.getRequestUrlInternal(t)];return i&&r.push(this.getBaseResourcePath()),e!==""&&r.push(e),new URL(`${r.join("/")}`)}shouldPrependVertexProjectPath(e,t){return!(t.baseUrl&&t.baseUrlResourceScope===kM.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,i);if(e.queryParams)for(const[a,o]of Object.entries(e.queryParams))r.searchParams.append(a,String(o));let s={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else s.body=e.body;return s=await this.includeExtraHttpOptionsToRequestInit(s,t,r.toString(),e.abortSignal),this.unaryApiCall(r,s,e.httpMethod)}patchHttpOptions(e,t){const i=JSON.parse(JSON.stringify(e));for(const[r,s]of Object.entries(t))typeof s=="object"?i[r]=Object.assign(Object.assign({},i[r]),s):s!==void 0&&(i[r]=s);return i}async requestStream(e){let t=this.clientOptions.httpOptions;e.httpOptions&&(t=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const i=this.shouldPrependVertexProjectPath(e,t),r=this.constructUrl(e.path,t,i);(!r.searchParams.has("alt")||r.searchParams.get("alt")!=="sse")&&r.searchParams.set("alt","sse");let s={};return s.body=e.body,s=await this.includeExtraHttpOptionsToRequestInit(s,t,r.toString(),e.abortSignal),this.streamApiCall(r,s,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,t,i,r){if(t&&t.timeout||r){const s=new AbortController,a=s.signal;if(t.timeout&&(t==null?void 0:t.timeout)>0){const o=setTimeout(()=>s.abort(),t.timeout);o&&typeof o.unref=="function"&&o.unref()}r&&r.addEventListener("abort",()=>{s.abort()}),e.signal=a}return t&&t.extraBody!==null&&bde(e,t.extraBody),e.headers=await this.getHeadersInternal(t,i),e}async unaryApiCall(e,t,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:i})).then(async r=>(await Q9(r),new MM(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}async streamApiCall(e,t,i){return this.apiCall(e.toString(),Object.assign(Object.assign({},t),{method:i})).then(async r=>(await Q9(r),this.processStreamResponse(r))).catch(r=>{throw r instanceof Error?r:new Error(JSON.stringify(r))})}processStreamResponse(e){return ec(this,arguments,function*(){var i;const r=(i=e==null?void 0:e.body)===null||i===void 0?void 0:i.getReader(),s=new TextDecoder("utf-8");if(!r)throw new Error("Response body is empty");try{let a="";const o="data:",l=[`

`,"\r\r",`\r
\r
`];for(;;){const{done:c,value:h}=yield en(r.read());if(c){if(a.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const f=s.decode(h,{stream:!0});try{const x=JSON.parse(f);if("error"in x){const v=JSON.parse(JSON.stringify(x.error)),_=v.status,E=v.code,w=`got status: ${_}. ${JSON.stringify(x)}`;if(E>=400&&E<600)throw new YC({message:w,status:E})}}catch(x){if(x.name==="ApiError")throw x}a+=f;let p=-1,y=0;for(;;){p=-1,y=0;for(const _ of l){const E=a.indexOf(_);E!==-1&&(p===-1||E<p)&&(p=E,y=_.length)}if(p===-1)break;const x=a.substring(0,p);a=a.substring(p+y);const v=x.trim();if(v.startsWith(o)){const _=v.substring(o.length).trim();try{const E=new Response(_,{headers:e==null?void 0:e.headers,status:e==null?void 0:e.status,statusText:e==null?void 0:e.statusText});yield yield en(new MM(E))}catch(E){throw new Error(`exception parsing stream chunk ${_}. ${E}`)}}}}}finally{r.releaseLock()}})}async apiCall(e,t){var i;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(e,t);const r=this.clientOptions.httpOptions.retryOptions;return Zae(async()=>{const a=await fetch(e,t);if(a.ok)return a;throw _de.includes(a.status)?new Error(`Retryable HTTP Error: ${a.statusText}`):new c$.AbortError(`Non-retryable exception ${a.statusText} sending request`)},{retries:((i=r.attempts)!==null&&i!==void 0?i:vde)-1})}getDefaultHeaders(){const e={},t=gde+" "+this.clientOptions.userAgentExtra;return e[fde]=t,e[OM]=t,e[hde]="application/json",e}async getHeadersInternal(e,t){const i=new Headers;if(e&&e.headers){for(const[r,s]of Object.entries(e.headers))i.append(r,s);e.timeout&&e.timeout>0&&i.append(dde,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(i,t),i}getFileName(e){var t;let i="";return typeof e=="string"&&(i=e.replace(/[/\\]+$/,""),i=(t=i.split(/[/\\]/).pop())!==null&&t!==void 0?t:""),i}async uploadFile(e,t){var i;const r={};t!=null&&(r.mimeType=t.mimeType,r.name=t.name,r.displayName=t.displayName),r.name&&!r.name.startsWith("files/")&&(r.name=`files/${r.name}`);const s=this.clientOptions.uploader,a=await s.stat(e);r.sizeBytes=String(a.size);const o=(i=t==null?void 0:t.mimeType)!==null&&i!==void 0?i:a.type;if(o===void 0||o==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");r.mimeType=o;const l={file:r},c=this.getFileName(e),h=At("upload/v1beta/files",l._url),f=await this.fetchUploadUrl(h,r.sizeBytes,r.mimeType,c,l,t==null?void 0:t.httpOptions);return s.upload(e,f,this)}async uploadFileToFileSearchStore(e,t,i){var r;const s=this.clientOptions.uploader,a=await s.stat(t),o=String(a.size),l=(r=i==null?void 0:i.mimeType)!==null&&r!==void 0?r:a.type;if(l===void 0||l==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const c=`upload/v1beta/${e}:uploadToFileSearchStore`,h=this.getFileName(t),f={};i!=null&&N$(i,f);const p=await this.fetchUploadUrl(c,o,l,h,f,i==null?void 0:i.httpOptions);return s.uploadToFileSearchStore(t,p,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,t,i,r,s,a){var o;let l={};a?l=a:l={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${t}`,"X-Goog-Upload-Header-Content-Type":`${i}`},r?{"X-Goog-Upload-File-Name":r}:{})};const c=await this.request({path:e,body:JSON.stringify(s),httpMethod:"POST",httpOptions:l});if(!c||!(c!=null&&c.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const h=(o=c==null?void 0:c.headers)===null||o===void 0?void 0:o["x-goog-upload-url"];if(h===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return h}}async function Q9(n){var e;if(n===void 0)throw new Error("response is undefined");if(!n.ok){const t=n.status;let i;!((e=n.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?i=await n.json():i={error:{message:await n.text(),code:n.status,status:n.statusText}};const r=JSON.stringify(i);throw t>=400&&t<600?new YC({message:r,status:t}):new Error(r)}}function bde(n,e){if(!e||Object.keys(e).length===0)return;if(n.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let t={};if(typeof n.body=="string"&&n.body.length>0)try{const s=JSON.parse(n.body);if(typeof s=="object"&&s!==null&&!Array.isArray(s))t=s;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function i(s,a){const o=Object.assign({},s);for(const l in a)if(Object.prototype.hasOwnProperty.call(a,l)){const c=a[l],h=o[l];c&&typeof c=="object"&&!Array.isArray(c)&&h&&typeof h=="object"&&!Array.isArray(h)?o[l]=i(h,c):(h&&c&&typeof h!=typeof c&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${l}". Original type: ${typeof h}, New type: ${typeof c}. Overwriting.`),o[l]=c)}return o}const r=i(t,e);n.body=JSON.stringify(r)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Tde="mcp_used/unknown";let Ede=!1;function k$(n){for(const e of n)if(wde(e)||typeof e=="object"&&"inputSchema"in e)return!0;return Ede}function M$(n){var e;const t=(e=n[OM])!==null&&e!==void 0?e:"";n[OM]=(t+` ${Tde}`).trimStart()}function wde(n){return n!==null&&typeof n=="object"&&n instanceof VP}function Ade(n){return ec(this,arguments,function*(t,i=100){let r,s=0;for(;s<i;){const a=yield en(t.listTools({cursor:r}));for(const o of a.tools)yield yield en(o),s++;if(!a.nextCursor)break;r=a.nextCursor}})}class VP{constructor(e=[],t){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=t}static create(e,t){return new VP(e,t)}async initialize(){var e,t,i,r;if(this.mcpTools.length>0)return;const s={},a=[];for(const h of this.mcpClients)try{for(var o=!0,l=(t=void 0,tc(Ade(h))),c;c=await l.next(),e=c.done,!e;o=!0){r=c.value,o=!1;const f=r;a.push(f);const p=f.name;if(s[p])throw new Error(`Duplicate function name ${p} found in MCP tools. Please ensure function names are unique.`);s[p]=h}}catch(f){t={error:f}}finally{try{!o&&!e&&(i=l.return)&&await i.call(l)}finally{if(t)throw t.error}}this.mcpTools=a,this.functionNameToMcpClient=s}async tool(){return await this.initialize(),Woe(this.mcpTools,this.config)}async callTool(e){await this.initialize();const t=[];for(const i of e)if(i.name in this.functionNameToMcpClient){const r=this.functionNameToMcpClient[i.name];let s;this.config.timeout&&(s={timeout:this.config.timeout});const a=await r.callTool({name:i.name,arguments:i.args},void 0,s);t.push({functionResponse:{name:i.name,response:a.isError?{error:a}:a}})}return t}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function Sde(n,e,t){const i=new Moe;let r;t.data instanceof Blob?r=JSON.parse(await t.data.text()):r=JSON.parse(t.data),Object.assign(i,r),e(i)}class Dde{constructor(e,t,i){this.apiClient=e,this.auth=t,this.webSocketFactory=i}async connect(e){var t,i;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const r=this.apiClient.getWebsocketBaseUrl(),s=this.apiClient.getApiVersion(),a=Rde(this.apiClient.getDefaultHeaders()),o=this.apiClient.getApiKey(),l=`${r}/ws/google.ai.generativelanguage.${s}.GenerativeService.BidiGenerateMusic?key=${o}`;let c=()=>{};const h=new Promise(A=>{c=A}),f=e.callbacks,p=function(){c({})},y=this.apiClient,x={onopen:p,onmessage:A=>{Sde(y,f.onmessage,A)},onerror:(t=f==null?void 0:f.onerror)!==null&&t!==void 0?t:function(A){},onclose:(i=f==null?void 0:f.onclose)!==null&&i!==void 0?i:function(A){}},v=this.webSocketFactory.create(l,Ide(a),x);v.connect(),await h;const w={setup:{model:Un(this.apiClient,e.model)}};return v.send(JSON.stringify(w)),new Cde(v,this.apiClient)}}class Cde{constructor(e,t){this.conn=e,this.apiClient=t}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const t=jce(e);this.conn.send(JSON.stringify({clientContent:t}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});const t=$ce(e);this.conn.send(JSON.stringify(t))}sendPlaybackControl(e){const t={playbackControl:e};this.conn.send(JSON.stringify(t))}play(){this.sendPlaybackControl(yy.PLAY)}pause(){this.sendPlaybackControl(yy.PAUSE)}stop(){this.sendPlaybackControl(yy.STOP)}resetContext(){this.sendPlaybackControl(yy.RESET_CONTEXT)}close(){this.conn.close()}}function Ide(n){const e={};return n.forEach((t,i)=>{e[i]=t}),e}function Rde(n){const e=new Headers;for(const[t,i]of Object.entries(n))e.append(t,i);return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Nde="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function kde(n,e,t){const i=new koe;let r;t.data instanceof Blob?r=await t.data.text():t.data instanceof ArrayBuffer?r=new TextDecoder().decode(t.data):r=t.data;const s=JSON.parse(r);if(n.isVertexAI()){const a=Yce(s);Object.assign(i,a)}else Object.assign(i,s);e(i)}class Mde{constructor(e,t,i){this.apiClient=e,this.auth=t,this.webSocketFactory=i,this.music=new Dde(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var t,i,r,s,a,o;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const l=this.apiClient.getWebsocketBaseUrl(),c=this.apiClient.getApiVersion();let h;const f=this.apiClient.getHeaders();e.config&&e.config.tools&&k$(e.config.tools)&&M$(f);const p=Lde(f);if(this.apiClient.isVertexAI()){const R=this.apiClient.getProject(),L=this.apiClient.getLocation(),H=this.apiClient.getApiKey(),P=!!R&&!!L||!!H;this.apiClient.getCustomBaseUrl()&&!P?h=l:(h=`${l}/ws/google.cloud.aiplatform.${c}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(p,h))}else{const R=this.apiClient.getApiKey();let L="BidiGenerateContent",H="key";R!=null&&R.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),c!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),L="BidiGenerateContentConstrained",H="access_token"),h=`${l}/ws/google.ai.generativelanguage.${c}.GenerativeService.${L}?${H}=${R}`}let y=()=>{};const x=new Promise(R=>{y=R}),v=e.callbacks,_=function(){var R;(R=v==null?void 0:v.onopen)===null||R===void 0||R.call(v),y({})},E=this.apiClient,w={onopen:_,onmessage:R=>{kde(E,v.onmessage,R)},onerror:(t=v==null?void 0:v.onerror)!==null&&t!==void 0?t:function(R){},onclose:(i=v==null?void 0:v.onclose)!==null&&i!==void 0?i:function(R){}},A=this.webSocketFactory.create(h,Pde(p),w);A.connect(),await x;let N=Un(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&N.startsWith("publishers/")){const R=this.apiClient.getProject(),L=this.apiClient.getLocation();R&&L&&(N=`projects/${R}/locations/${L}/`+N)}let k={};this.apiClient.isVertexAI()&&((r=e.config)===null||r===void 0?void 0:r.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[cD.AUDIO]}:e.config.responseModalities=[cD.AUDIO]),!((s=e.config)===null||s===void 0)&&s.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const F=(o=(a=e.config)===null||a===void 0?void 0:a.tools)!==null&&o!==void 0?o:[],C=[];for(const R of F)if(this.isCallableTool(R)){const L=R;C.push(await L.tool())}else C.push(R);C.length>0&&(e.config.tools=C);const M={model:N,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?k=qce(this.apiClient,M):k=Gce(this.apiClient,M),delete k.config,A.send(JSON.stringify(k)),new Ude(A,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}}const Fde={turnComplete:!0};class Ude{constructor(e,t){this.conn=e,this.apiClient=t}tLiveClientContent(e,t){if(t.turns!==null&&t.turns!==void 0){let i=[];try{i=Eo(t.turns),e.isVertexAI()||(i=i.map(r=>zT(r)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof t.turns}'`)}return{clientContent:{turns:i,turnComplete:t.turnComplete}}}return{clientContent:{turnComplete:t.turnComplete}}}tLiveClienttToolResponse(e,t){let i=[];if(t.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(t.functionResponses)?i=t.functionResponses:i=[t.functionResponses],i.length===0)throw new Error("functionResponses is required.");for(const s of i){if(typeof s!="object"||s===null||!("name"in s)||!("response"in s))throw new Error(`Could not parse function response, type '${typeof s}'.`);if(!e.isVertexAI()&&!("id"in s))throw new Error(Nde)}return{toolResponse:{functionResponses:i}}}sendClientContent(e){e=Object.assign(Object.assign({},Fde),e);const t=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(t))}sendRealtimeInput(e){let t={};this.apiClient.isVertexAI()?t={realtimeInput:Kce(e)}:t={realtimeInput:Xce(e)},this.conn.send(JSON.stringify(t))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const t=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(t))}close(){this.conn.close()}}function Pde(n){const e={};return n.forEach((t,i)=>{e[i]=t}),e}function Lde(n){const e=new Headers;for(const[t,i]of Object.entries(n))e.append(t,i);return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Z9=10;function e7(n){var e,t,i;if(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let r=!1;for(const a of(t=n==null?void 0:n.tools)!==null&&t!==void 0?t:[])if(ky(a)){r=!0;break}if(!r)return!0;const s=(i=n==null?void 0:n.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls;return s&&(s<0||!Number.isInteger(s))||s==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",s),!0):!1}function ky(n){return"callTool"in n&&typeof n.callTool=="function"}function Ode(n){var e,t,i;return(i=(t=(e=n.config)===null||e===void 0?void 0:e.tools)===null||t===void 0?void 0:t.some(r=>ky(r)))!==null&&i!==void 0?i:!1}function t7(n){var e;const t=[];return!((e=n==null?void 0:n.config)===null||e===void 0)&&e.tools&&n.config.tools.forEach((i,r)=>{if(ky(i))return;const s=i;s.functionDeclarations&&s.functionDeclarations.length>0&&t.push(r)}),t}function n7(n){var e;return!(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Bde extends Yh{constructor(e){super(),this.apiClient=e,this.embedContent=async t=>{if(!this.apiClient.isVertexAI())return await this.embedContentInternal(t);if(t.model.includes("gemini")&&t.model!=="gemini-embedding-001"||t.model.includes("maas")){const r=Eo(t.contents);if(r.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");const s=Object.assign(Object.assign({},t),{content:r[0],embeddingApiType:uD.EMBED_CONTENT});return await this.embedContentInternal(s)}else{const r=Object.assign(Object.assign({},t),{embeddingApiType:uD.PREDICT});return await this.embedContentInternal(r)}},this.generateContent=async t=>{var i,r,s,a,o;const l=await this.processParamsMaybeAddMcpUsage(t);if(this.maybeMoveToResponseJsonSchem(t),!Ode(t)||e7(t.config))return await this.generateContentInternal(l);const c=t7(t);if(c.length>0){const v=c.map(_=>`tools[${_}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${v}.`)}let h,f;const p=Eo(l.contents),y=(s=(r=(i=l.config)===null||i===void 0?void 0:i.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&s!==void 0?s:Z9;let x=0;for(;x<y&&(h=await this.generateContentInternal(l),!(!h.functionCalls||h.functionCalls.length===0));){const v=h.candidates[0].content,_=[];for(const E of(o=(a=t.config)===null||a===void 0?void 0:a.tools)!==null&&o!==void 0?o:[])if(ky(E)){const A=await E.callTool(h.functionCalls);_.push(...A)}x++,f={role:"user",parts:_},l.contents=Eo(l.contents),l.contents.push(v),l.contents.push(f),n7(l.config)&&(p.push(v),p.push(f))}return n7(l.config)&&(h.automaticFunctionCallingHistory=p),h},this.generateContentStream=async t=>{var i,r,s,a,o;if(this.maybeMoveToResponseJsonSchem(t),e7(t.config)){const f=await this.processParamsMaybeAddMcpUsage(t);return await this.generateContentStreamInternal(f)}const l=t7(t);if(l.length>0){const f=l.map(p=>`tools[${p}]`).join(", ");throw new Error(`Incompatible tools found at ${f}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const c=(s=(r=(i=t==null?void 0:t.config)===null||i===void 0?void 0:i.toolConfig)===null||r===void 0?void 0:r.functionCallingConfig)===null||s===void 0?void 0:s.streamFunctionCallArguments,h=(o=(a=t==null?void 0:t.config)===null||a===void 0?void 0:a.automaticFunctionCalling)===null||o===void 0?void 0:o.disable;if(c&&!h)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(t)},this.generateImages=async t=>await this.generateImagesInternal(t).then(i=>{var r;let s;const a=[];if(i!=null&&i.generatedImages)for(const l of i.generatedImages)l&&(l!=null&&l.safetyAttributes)&&((r=l==null?void 0:l.safetyAttributes)===null||r===void 0?void 0:r.contentType)==="Positive Prompt"?s=l==null?void 0:l.safetyAttributes:a.push(l);let o;return s?o={generatedImages:a,positivePromptSafetyAttributes:s,sdkHttpResponse:i.sdkHttpResponse}:o={generatedImages:a,sdkHttpResponse:i.sdkHttpResponse},o}),this.list=async t=>{var i;const a={config:Object.assign(Object.assign({},{queryBase:!0}),t==null?void 0:t.config)};if(this.apiClient.isVertexAI()&&!a.config.queryBase){if(!((i=a.config)===null||i===void 0)&&i.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");a.config.filter="labels.tune-type:*"}return new Km(Lh.PAGED_ITEM_MODELS,o=>this.listInternal(o),await this.listInternal(a),a)},this.editImage=async t=>{const i={model:t.model,prompt:t.prompt,referenceImages:[],config:t.config};return t.referenceImages&&t.referenceImages&&(i.referenceImages=t.referenceImages.map(r=>r.toReferenceImageAPI())),await this.editImageInternal(i)},this.upscaleImage=async t=>{let i={numberOfImages:1,mode:"upscale"};t.config&&(i=Object.assign(Object.assign({},i),t.config));const r={model:t.model,image:t.image,upscaleFactor:t.upscaleFactor,config:i};return await this.upscaleImageInternal(r)},this.generateVideos=async t=>{var i,r,s,a,o,l;if((t.prompt||t.image||t.video)&&t.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((i=t.video)===null||i===void 0)&&i.uri&&(!((r=t.video)===null||r===void 0)&&r.videoBytes)?t.video={uri:t.video.uri,mimeType:t.video.mimeType}:!((a=(s=t.source)===null||s===void 0?void 0:s.video)===null||a===void 0)&&a.uri&&(!((l=(o=t.source)===null||o===void 0?void 0:o.video)===null||l===void 0)&&l.videoBytes)&&(t.source.video={uri:t.source.video.uri,mimeType:t.source.video.mimeType})),await this.generateVideosInternal(t)}}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var t,i,r;const s=(t=e.config)===null||t===void 0?void 0:t.tools;if(!s)return e;const a=await Promise.all(s.map(async l=>ky(l)?await l.tool():l)),o={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:a})};if(o.config.tools=a,e.config&&e.config.tools&&k$(e.config.tools)){const l=(r=(i=e.config.httpOptions)===null||i===void 0?void 0:i.headers)!==null&&r!==void 0?r:{};let c=Object.assign({},l);Object.keys(c).length===0&&(c=this.apiClient.getDefaultHeaders()),M$(c),o.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:c})}return o}async initAfcToolsMap(e){var t,i,r;const s=new Map;for(const a of(i=(t=e.config)===null||t===void 0?void 0:t.tools)!==null&&i!==void 0?i:[])if(ky(a)){const o=a,l=await o.tool();for(const c of(r=l.functionDeclarations)!==null&&r!==void 0?r:[]){if(!c.name)throw new Error("Function declaration name is required.");if(s.has(c.name))throw new Error(`Duplicate tool declaration name: ${c.name}`);s.set(c.name,o)}}return s}async processAfcStream(e){var t,i,r;const s=(r=(i=(t=e.config)===null||t===void 0?void 0:t.automaticFunctionCalling)===null||i===void 0?void 0:i.maximumRemoteCalls)!==null&&r!==void 0?r:Z9;let a=!1,o=0;const l=await this.initAfcToolsMap(e);return(function(c,h,f){return ec(this,arguments,function*(){for(var p,y,x,v,_,E;o<s;){a&&(o++,a=!1);const k=yield en(c.processParamsMaybeAddMcpUsage(f)),F=yield en(c.generateContentStreamInternal(k)),C=[],M=[];try{for(var w=!0,A=(y=void 0,tc(F)),N;N=yield en(A.next()),p=N.done,!p;w=!0){v=N.value,w=!1;const R=v;if(yield yield en(R),R.candidates&&(!((_=R.candidates[0])===null||_===void 0)&&_.content)){M.push(R.candidates[0].content);for(const L of(E=R.candidates[0].content.parts)!==null&&E!==void 0?E:[])if(o<s&&L.functionCall){if(!L.functionCall.name)throw new Error("Function call name was not returned by the model.");if(h.has(L.functionCall.name)){const H=yield en(h.get(L.functionCall.name).callTool([L.functionCall]));C.push(...H)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${h.keys()}, mising tool: ${L.functionCall.name}`)}}}}catch(R){y={error:R}}finally{try{!w&&!p&&(x=A.return)&&(yield en(x.call(A)))}finally{if(y)throw y.error}}if(C.length>0){a=!0;const R=new ex;R.candidates=[{content:{role:"user",parts:C}}],yield yield en(R);const L=[];L.push(...M),L.push({role:"user",parts:C});const H=Eo(f.contents).concat(L);f.contents=H}else break}})})(this,l,e)}async generateContentInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=K9(this.apiClient,e);return o=At("{model}:generateContent",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=J9(h),p=new ex;return Object.assign(p,f),p})}else{const c=X9(this.apiClient,e);return o=At("{model}:generateContent",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Y9(h),p=new ex;return Object.assign(p,f),p})}}async generateContentStreamInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=K9(this.apiClient,e);return o=At("{model}:streamGenerateContent?alt=sse",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.requestStream({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}),a.then(function(f){return ec(this,arguments,function*(){var p,y,x,v;try{for(var _=!0,E=tc(f),w;w=yield en(E.next()),p=w.done,!p;_=!0){v=w.value,_=!1;const A=v,N=J9(yield en(A.json()),e);N.sdkHttpResponse={headers:A.headers};const k=new ex;Object.assign(k,N),yield yield en(k)}}catch(A){y={error:A}}finally{try{!_&&!p&&(x=E.return)&&(yield en(x.call(E)))}finally{if(y)throw y.error}}})})}else{const c=X9(this.apiClient,e);return o=At("{model}:streamGenerateContent?alt=sse",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.requestStream({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}),a.then(function(f){return ec(this,arguments,function*(){var p,y,x,v;try{for(var _=!0,E=tc(f),w;w=yield en(E.next()),p=w.done,!p;_=!0){v=w.value,_=!1;const A=v,N=Y9(yield en(A.json()),e);N.sdkHttpResponse={headers:A.headers};const k=new ex;Object.assign(k,N),yield yield en(k)}}catch(A){y={error:A}}finally{try{!_&&!p&&(x=E.return)&&(yield en(x.call(E)))}finally{if(y)throw y.error}}})})}}async embedContentInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Iue(this.apiClient,e,e),h=zoe(e.model)?"{model}:embedContent":"{model}:predict";return o=At(h,c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const y=p;return y.sdkHttpResponse={headers:f.headers},y})),a.then(f=>{const p=Nue(f,e),y=new I9;return Object.assign(y,p),y})}else{const c=Cue(this.apiClient,e);return o=At("{model}:batchEmbedContents",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Rue(h),p=new I9;return Object.assign(p,f),p})}}async generateImagesInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Hue(this.apiClient,e);return o=At("{model}:predict",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Gue(h),p=new R9;return Object.assign(p,f),p})}else{const c=Wue(this.apiClient,e);return o=At("{model}:predict",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=zue(h),p=new R9;return Object.assign(p,f),p})}}async editImageInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=wue(this.apiClient,e);return s=At("{model}:predict",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>{const c=Aue(l),h=new xoe;return Object.assign(h,c),h})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=Ghe(this.apiClient,e);return s=At("{model}:predict",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>{const c=qhe(l),h=new boe;return Object.assign(h,c),h})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=whe(this.apiClient,e);return s=At("{model}:predict",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=Ahe(l),h=new Toe;return Object.assign(h,c),h})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=Nhe(this.apiClient,e);return s=At("{model}:predict",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=khe(l),h=new Eoe;return Object.assign(h,c),h})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=ohe(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>LM(h))}else{const c=ahe(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>PM(h))}}async listInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=mhe(this.apiClient,e);return o=At("{models_url}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=vhe(h),p=new N9;return Object.assign(p,f),p})}else{const c=ghe(this.apiClient,e);return o=At("{models_url}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=yhe(h),p=new N9;return Object.assign(p,f),p})}}async update(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Hhe(this.apiClient,e);return o=At("{model}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>LM(h))}else{const c=Whe(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"PATCH",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>PM(h))}}async delete(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=xue(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=Tue(h),p=new k9;return Object.assign(p,f),p})}else{const c=_ue(this.apiClient,e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"DELETE",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=bue(h),p=new k9;return Object.assign(p,f),p})}}async countTokens(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=mue(this.apiClient,e);return o=At("{model}:countTokens",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=vue(h),p=new M9;return Object.assign(p,f),p})}else{const c=gue(this.apiClient,e);return o=At("{model}:countTokens",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=yue(h),p=new M9;return Object.assign(p,f),p})}}async computeTokens(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=lue(this.apiClient,e);return s=At("{model}:computeTokens",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>{const c=cue(l),h=new woe;return Object.assign(h,c),h})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Yue(this.apiClient,e);return o=At("{model}:predictLongRunning",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a.then(h=>{const f=Xue(h),p=new hD;return Object.assign(p,f),p})}else{const c=Kue(this.apiClient,e);return o=At("{model}:predictLongRunning",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a.then(h=>{const f=jue(h),p=new hD;return Object.assign(p,f),p})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Vde extends Yh{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const t=e.operation,i=e.config;if(t.name===void 0||t.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=t.name.split("/operations/")[0];let s;i&&"httpOptions"in i&&(s=i.httpOptions);const a=await this.fetchPredictVideosOperationInternal({operationName:t.name,resourceName:r,config:{httpOptions:s}});return t._fromAPIResponse({apiResponse:a,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:t.name,config:i});return t._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async get(e){const t=e.operation,i=e.config;if(t.name===void 0||t.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const r=t.name.split("/operations/")[0];let s;i&&"httpOptions"in i&&(s=i.httpOptions);const a=await this.fetchPredictVideosOperationInternal({operationName:t.name,resourceName:r,config:{httpOptions:s}});return t._fromAPIResponse({apiResponse:a,_isVertexAI:!0})}else{const r=await this.getVideosOperationInternal({operationName:t.name,config:i});return t._fromAPIResponse({apiResponse:r,_isVertexAI:!1})}}async getVideosOperationInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=poe(e);return o=At("{operationName}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json()),a}else{const c=foe(e);return o=At("{operationName}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json()),a}}async fetchPredictVideosOperationInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=aoe(e);return s=At("{resourceName}:fetchPredictOperation",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r}else throw new Error("This method is only supported by the Vertex AI.")}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function i7(n){const e={};if(T(n,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return e}function Wde(n){const e={},t=T(n,["apiKey"]);if(t!=null&&S(e,["apiKey"],t),T(n,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(T(n,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(T(n,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(T(n,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(T(n,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(T(n,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return e}function Hde(n){const e={},t=T(n,["data"]);if(t!=null&&S(e,["data"],t),T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function zde(n){const e={},t=T(n,["parts"]);if(t!=null){let r=t;Array.isArray(r)&&(r=r.map(s=>Qde(s))),S(e,["parts"],r)}const i=T(n,["role"]);return i!=null&&S(e,["role"],i),e}function Gde(n,e,t){const i={},r=T(e,["expireTime"]);t!==void 0&&r!=null&&S(t,["expireTime"],r);const s=T(e,["newSessionExpireTime"]);t!==void 0&&s!=null&&S(t,["newSessionExpireTime"],s);const a=T(e,["uses"]);t!==void 0&&a!=null&&S(t,["uses"],a);const o=T(e,["liveConnectConstraints"]);t!==void 0&&o!=null&&S(t,["bidiGenerateContentSetup"],Jde(n,o));const l=T(e,["lockAdditionalFields"]);return t!==void 0&&l!=null&&S(t,["fieldMask"],l),i}function qde(n,e){const t={},i=T(e,["config"]);return i!=null&&S(t,["config"],Gde(n,i,t)),t}function $de(n){const e={};if(T(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const t=T(n,["fileUri"]);t!=null&&S(e,["fileUri"],t);const i=T(n,["mimeType"]);return i!=null&&S(e,["mimeType"],i),e}function jde(n){const e={},t=T(n,["id"]);t!=null&&S(e,["id"],t);const i=T(n,["args"]);i!=null&&S(e,["args"],i);const r=T(n,["name"]);if(r!=null&&S(e,["name"],r),T(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(T(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return e}function Xde(n){const e={},t=T(n,["authConfig"]);t!=null&&S(e,["authConfig"],Wde(t));const i=T(n,["enableWidget"]);return i!=null&&S(e,["enableWidget"],i),e}function Kde(n){const e={},t=T(n,["searchTypes"]);if(t!=null&&S(e,["searchTypes"],t),T(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(T(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const i=T(n,["timeRangeFilter"]);return i!=null&&S(e,["timeRangeFilter"],i),e}function Yde(n,e){const t={},i=T(n,["generationConfig"]);e!==void 0&&i!=null&&S(e,["setup","generationConfig"],i);const r=T(n,["responseModalities"]);e!==void 0&&r!=null&&S(e,["setup","generationConfig","responseModalities"],r);const s=T(n,["temperature"]);e!==void 0&&s!=null&&S(e,["setup","generationConfig","temperature"],s);const a=T(n,["topP"]);e!==void 0&&a!=null&&S(e,["setup","generationConfig","topP"],a);const o=T(n,["topK"]);e!==void 0&&o!=null&&S(e,["setup","generationConfig","topK"],o);const l=T(n,["maxOutputTokens"]);e!==void 0&&l!=null&&S(e,["setup","generationConfig","maxOutputTokens"],l);const c=T(n,["mediaResolution"]);e!==void 0&&c!=null&&S(e,["setup","generationConfig","mediaResolution"],c);const h=T(n,["seed"]);e!==void 0&&h!=null&&S(e,["setup","generationConfig","seed"],h);const f=T(n,["speechConfig"]);e!==void 0&&f!=null&&S(e,["setup","generationConfig","speechConfig"],BP(f));const p=T(n,["thinkingConfig"]);e!==void 0&&p!=null&&S(e,["setup","generationConfig","thinkingConfig"],p);const y=T(n,["enableAffectiveDialog"]);e!==void 0&&y!=null&&S(e,["setup","generationConfig","enableAffectiveDialog"],y);const x=T(n,["systemInstruction"]);e!==void 0&&x!=null&&S(e,["setup","systemInstruction"],zde(es(x)));const v=T(n,["tools"]);if(e!==void 0&&v!=null){let F=O1(v);Array.isArray(F)&&(F=F.map(C=>efe(L1(C)))),S(e,["setup","tools"],F)}const _=T(n,["sessionResumption"]);e!==void 0&&_!=null&&S(e,["setup","sessionResumption"],Zde(_));const E=T(n,["inputAudioTranscription"]);e!==void 0&&E!=null&&S(e,["setup","inputAudioTranscription"],i7(E));const w=T(n,["outputAudioTranscription"]);e!==void 0&&w!=null&&S(e,["setup","outputAudioTranscription"],i7(w));const A=T(n,["realtimeInputConfig"]);e!==void 0&&A!=null&&S(e,["setup","realtimeInputConfig"],A);const N=T(n,["contextWindowCompression"]);e!==void 0&&N!=null&&S(e,["setup","contextWindowCompression"],N);const k=T(n,["proactivity"]);if(e!==void 0&&k!=null&&S(e,["setup","proactivity"],k),T(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return t}function Jde(n,e){const t={},i=T(e,["model"]);i!=null&&S(t,["setup","model"],Un(n,i));const r=T(e,["config"]);return r!=null&&S(t,["config"],Yde(r,t)),t}function Qde(n){const e={},t=T(n,["mediaResolution"]);t!=null&&S(e,["mediaResolution"],t);const i=T(n,["codeExecutionResult"]);i!=null&&S(e,["codeExecutionResult"],i);const r=T(n,["executableCode"]);r!=null&&S(e,["executableCode"],r);const s=T(n,["fileData"]);s!=null&&S(e,["fileData"],$de(s));const a=T(n,["functionCall"]);a!=null&&S(e,["functionCall"],jde(a));const o=T(n,["functionResponse"]);o!=null&&S(e,["functionResponse"],o);const l=T(n,["inlineData"]);l!=null&&S(e,["inlineData"],Hde(l));const c=T(n,["text"]);c!=null&&S(e,["text"],c);const h=T(n,["thought"]);h!=null&&S(e,["thought"],h);const f=T(n,["thoughtSignature"]);f!=null&&S(e,["thoughtSignature"],f);const p=T(n,["videoMetadata"]);p!=null&&S(e,["videoMetadata"],p);const y=T(n,["toolCall"]);y!=null&&S(e,["toolCall"],y);const x=T(n,["toolResponse"]);return x!=null&&S(e,["toolResponse"],x),e}function Zde(n){const e={},t=T(n,["handle"]);if(t!=null&&S(e,["handle"],t),T(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function efe(n){const e={};if(T(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const t=T(n,["computerUse"]);t!=null&&S(e,["computerUse"],t);const i=T(n,["fileSearch"]);i!=null&&S(e,["fileSearch"],i);const r=T(n,["googleSearch"]);r!=null&&S(e,["googleSearch"],Kde(r));const s=T(n,["googleMaps"]);s!=null&&S(e,["googleMaps"],Xde(s));const a=T(n,["codeExecution"]);if(a!=null&&S(e,["codeExecution"],a),T(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const o=T(n,["functionDeclarations"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["functionDeclarations"],f)}const l=T(n,["googleSearchRetrieval"]);if(l!=null&&S(e,["googleSearchRetrieval"],l),T(n,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const c=T(n,["urlContext"]);c!=null&&S(e,["urlContext"],c);const h=T(n,["mcpServers"]);if(h!=null){let f=h;Array.isArray(f)&&(f=f.map(p=>p)),S(e,["mcpServers"],f)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function tfe(n){const e=[];for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)){const i=n[t];if(typeof i=="object"&&i!=null&&Object.keys(i).length>0){const r=Object.keys(i).map(s=>`${t}.${s}`);e.push(...r)}else e.push(t)}return e.join(",")}function nfe(n,e){let t=null;const i=n.bidiGenerateContentSetup;if(typeof i=="object"&&i!==null&&"setup"in i){const s=i.setup;typeof s=="object"&&s!==null?(n.bidiGenerateContentSetup=s,t=s):delete n.bidiGenerateContentSetup}else i!==void 0&&delete n.bidiGenerateContentSetup;const r=n.fieldMask;if(t){const s=tfe(t);if(Array.isArray(e==null?void 0:e.lockAdditionalFields)&&(e==null?void 0:e.lockAdditionalFields.length)===0)s?n.fieldMask=s:delete n.fieldMask;else if(e!=null&&e.lockAdditionalFields&&e.lockAdditionalFields.length>0&&r!==null&&Array.isArray(r)&&r.length>0){const a=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let o=[];r.length>0&&(o=r.map(c=>a.includes(c)?`generationConfig.${c}`:c));const l=[];s&&l.push(s),o.length>0&&l.push(...o),l.length>0?n.fieldMask=l.join(","):delete n.fieldMask}else delete n.fieldMask}else r!==null&&Array.isArray(r)&&r.length>0?n.fieldMask=r.join(","):delete n.fieldMask;return n}class ife extends Yh{constructor(e){super(),this.apiClient=e}async create(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const o=qde(this.apiClient,e);s=At("auth_tokens",o._url),a=o._query,delete o.config,delete o._url,delete o._query;const l=nfe(o,e.config);return r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(c=>c.json()),r.then(c=>c)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rfe(n,e){const t={},i=T(n,["force"]);return e!==void 0&&i!=null&&S(e,["_query","force"],i),t}function sfe(n){const e={},t=T(n,["name"]);t!=null&&S(e,["_url","name"],t);const i=T(n,["config"]);return i!=null&&rfe(i,e),e}function afe(n){const e={},t=T(n,["name"]);return t!=null&&S(e,["_url","name"],t),e}function ofe(n,e){const t={},i=T(n,["pageSize"]);e!==void 0&&i!=null&&S(e,["_query","pageSize"],i);const r=T(n,["pageToken"]);return e!==void 0&&r!=null&&S(e,["_query","pageToken"],r),t}function lfe(n){const e={},t=T(n,["parent"]);t!=null&&S(e,["_url","parent"],t);const i=T(n,["config"]);return i!=null&&ofe(i,e),e}function cfe(n){const e={},t=T(n,["sdkHttpResponse"]);t!=null&&S(e,["sdkHttpResponse"],t);const i=T(n,["nextPageToken"]);i!=null&&S(e,["nextPageToken"],i);const r=T(n,["documents"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(a=>a)),S(e,["documents"],s)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ufe extends Yh{constructor(e){super(),this.apiClient=e,this.list=async t=>new Km(Lh.PAGED_ITEM_DOCUMENTS,i=>this.listInternal({parent:t.parent,config:i.config}),await this.listInternal(t),t)}async get(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=afe(e);return s=At("{name}",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var t,i;let r="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=sfe(e);r=At("{name}",a._url),s=a._query,delete a._url,delete a._query,await this.apiClient.request({path:r,queryParams:s,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=lfe(e);return s=At("{parent}/documents",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=cfe(l),h=new Aoe;return Object.assign(h,c),h})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class hfe extends Yh{constructor(e,t=new ufe(e)){super(),this.apiClient=e,this.documents=t,this.list=async(i={})=>new Km(Lh.PAGED_ITEM_FILE_SEARCH_STORES,r=>this.listInternal(r),await this.listInternal(i),i)}async uploadToFileSearchStore(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(e.fileSearchStoreName,e.file,e.config)}async create(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Qhe(e);return s=At("fileSearchStores",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async get(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=tde(e);return s=At("{name}",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>l)}}async delete(e){var t,i;let r="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const a=ede(e);r=At("{name}",a._url),s=a._query,delete a._url,delete a._query,await this.apiClient.request({path:r,queryParams:s,body:JSON.stringify(a),httpMethod:"DELETE",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=ode(e);return s=At("fileSearchStores",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=lde(l),h=new Soe;return Object.assign(h,c),h})}}async uploadToFileSearchStoreInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=cde(e);return s=At("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=ude(l),h=new Doe;return Object.assign(h,c),h})}}async importFile(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=rde(e);return s=At("{file_search_store_name}:importFile",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json()),r.then(l=>{const c=ide(l),h=new FP;return Object.assign(h,c),h})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let F$=function(){const{crypto:n}=globalThis;if(n!=null&&n.randomUUID)return F$=n.randomUUID.bind(n),n.randomUUID();const e=new Uint8Array(1),t=n?()=>n.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^t()&15>>+i/4).toString(16))};const dfe=()=>F$();/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function BM(n){return typeof n=="object"&&n!==null&&("name"in n&&n.name==="AbortError"||"message"in n&&String(n.message).includes("FetchRequestCanceledException"))}const VM=n=>{if(n instanceof Error)return n;if(typeof n=="object"&&n!==null){try{if(Object.prototype.toString.call(n)==="[object Error]"){const e=new Error(n.message,n.cause?{cause:n.cause}:{});return n.stack&&(e.stack=n.stack),n.cause&&!e.cause&&(e.cause=n.cause),n.name&&(e.name=n.name),e}}catch{}try{return new Error(JSON.stringify(n))}catch{}}return new Error(n)};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class pl extends Error{}class fa extends pl{constructor(e,t,i,r){super(`${fa.makeMessage(e,t,i)}`),this.status=e,this.headers=r,this.error=t}static makeMessage(e,t,i){const r=t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,i,r){if(!e||!r)return new ZC({message:i,cause:VM(t)});const s=t;return e===400?new P$(e,s,i,r):e===401?new L$(e,s,i,r):e===403?new O$(e,s,i,r):e===404?new B$(e,s,i,r):e===409?new V$(e,s,i,r):e===422?new W$(e,s,i,r):e===429?new H$(e,s,i,r):e>=500?new z$(e,s,i,r):new fa(e,s,i,r)}}class WM extends fa{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ZC extends fa{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class U$ extends ZC{constructor({message:e}={}){super({message:e??"Request timed out."})}}class P$ extends fa{}class L$ extends fa{}class O$ extends fa{}class B$ extends fa{}class V$ extends fa{}class W$ extends fa{}class H$ extends fa{}class z$ extends fa{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const ffe=/^[a-z][a-z0-9+.-]*:/i,pfe=n=>ffe.test(n);let HM=n=>(HM=Array.isArray,HM(n));const gfe=HM;let mfe=gfe;const r7=mfe;function s7(n){if(!n)return!0;for(const e in n)return!1;return!0}function yfe(n,e){return Object.prototype.hasOwnProperty.call(n,e)}const vfe=(n,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new pl(`${n} must be an integer`);if(e<0)throw new pl(`${n} must be a positive integer`);return e},_fe=n=>{try{return JSON.parse(n)}catch{return}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const xfe=n=>new Promise(e=>setTimeout(e,n));/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function bfe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function G$(...n){const e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...n)}function Tfe(n){let e=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():n[Symbol.iterator]();return G$({start(){},async pull(t){const{done:i,value:r}=await e.next();i?t.close():t.enqueue(r)},async cancel(){var t;await((t=e.return)===null||t===void 0?void 0:t.call(e))}})}function q$(n){if(n[Symbol.asyncIterator])return n;const e=n.getReader();return{async next(){try{const t=await e.read();return t!=null&&t.done&&e.releaseLock(),t}catch(t){throw e.releaseLock(),t}},async return(){const t=e.cancel();return e.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Efe(n){var e,t;if(n===null||typeof n!="object")return;if(n[Symbol.asyncIterator]){await((t=(e=n[Symbol.asyncIterator]()).return)===null||t===void 0?void 0:t.call(e));return}const i=n.getReader(),r=i.cancel();i.releaseLock(),await r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const wfe=({headers:n,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Afe(n){return Object.entries(n).filter(([e,t])=>typeof t<"u").map(([e,t])=>{if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(t===null)return`${encodeURIComponent(e)}=`;throw new pl(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Sfe="0.0.1";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const $$=()=>{var n;if(typeof File>"u"){const{process:e}=globalThis,t=typeof((n=e==null?void 0:e.versions)===null||n===void 0?void 0:n.node)=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function Dk(n,e,t){return $$(),new File(n,e??"unknown_file",t)}function Dfe(n){return(typeof n=="object"&&n!==null&&("name"in n&&n.name&&String(n.name)||"url"in n&&n.url&&String(n.url)||"filename"in n&&n.filename&&String(n.filename)||"path"in n&&n.path&&String(n.path))||"").split(/[\\/]/).pop()||void 0}const Cfe=n=>n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const j$=n=>n!=null&&typeof n=="object"&&typeof n.size=="number"&&typeof n.type=="string"&&typeof n.text=="function"&&typeof n.slice=="function"&&typeof n.arrayBuffer=="function",Ife=n=>n!=null&&typeof n=="object"&&typeof n.name=="string"&&typeof n.lastModified=="number"&&j$(n),Rfe=n=>n!=null&&typeof n=="object"&&typeof n.url=="string"&&typeof n.blob=="function";async function Nfe(n,e,t){if($$(),n=await n,Ife(n))return n instanceof File?n:Dk([await n.arrayBuffer()],n.name);if(Rfe(n)){const r=await n.blob();return e||(e=new URL(n.url).pathname.split(/[\\/]/).pop()),Dk(await zM(r),e,t)}const i=await zM(n);if(e||(e=Dfe(n)),!(t!=null&&t.type)){const r=i.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof r=="string"&&(t=Object.assign(Object.assign({},t),{type:r}))}return Dk(i,e,t)}async function zM(n){var e,t,i,r,s;let a=[];if(typeof n=="string"||ArrayBuffer.isView(n)||n instanceof ArrayBuffer)a.push(n);else if(j$(n))a.push(n instanceof Blob?n:await n.arrayBuffer());else if(Cfe(n))try{for(var o=!0,l=tc(n),c;c=await l.next(),e=c.done,!e;o=!0){r=c.value,o=!1;const h=r;a.push(...await zM(h))}}catch(h){t={error:h}}finally{try{!o&&!e&&(i=l.return)&&await i.call(l)}finally{if(t)throw t.error}}else{const h=(s=n==null?void 0:n.constructor)===null||s===void 0?void 0:s.name;throw new Error(`Unexpected data type: ${typeof n}${h?`; constructor: ${h}`:""}${kfe(n)}`)}return a}function kfe(n){return typeof n!="object"||n===null?"":`; props: [${Object.getOwnPropertyNames(n).map(t=>`"${t}"`).join(", ")}]`}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class X${constructor(e){this._client=e}}X$._key=[];/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function K$(n){return n.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const a7=Object.freeze(Object.create(null)),Mfe=(n=K$)=>(function(t,...i){if(t.length===1)return t[0];let r=!1;const s=[],a=t.reduce((h,f,p)=>{var y,x,v;/[?#]/.test(f)&&(r=!0);const _=i[p];let E=(r?encodeURIComponent:n)(""+_);return p!==i.length&&(_==null||typeof _=="object"&&_.toString===((v=Object.getPrototypeOf((x=Object.getPrototypeOf((y=_.hasOwnProperty)!==null&&y!==void 0?y:a7))!==null&&x!==void 0?x:a7))===null||v===void 0?void 0:v.toString))&&(E=_+"",s.push({start:h.length+f.length,length:E.length,error:`Value of type ${Object.prototype.toString.call(_).slice(8,-1)} is not a valid path parameter`})),h+f+(p===i.length?"":E)},""),o=a.split(/[?#]/,1)[0],l=/(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;let c;for(;(c=l.exec(o))!==null;){const h=c[0].startsWith("/"),f=h?1:0,p=h?c[0].slice(1):c[0];s.push({start:c.index+f,length:p.length,error:`Value "${p}" can't be safely passed as a path parameter`})}if(s.sort((h,f)=>h.start-f.start),s.length>0){let h=0;const f=s.reduce((p,y)=>{const x=" ".repeat(y.start-h),v="^".repeat(y.length);return h=y.start+y.length,p+x+v},"");throw new pl(`Path parameters result in path with invalid segments:
${s.map(p=>p.error).join(`
`)}
${a}
${f}`)}return a}),Vw=Mfe(K$);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Y$ extends X${create(e,t){var i;const{api_version:r=this._client.apiVersion}=e,s=fD(e,["api_version"]);if("model"in s&&"agent_config"in s)throw new pl("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in s&&"generation_config"in s)throw new pl("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Vw`/${r}/interactions`,Object.assign(Object.assign({body:s},t),{stream:(i=e.stream)!==null&&i!==void 0?i:!1}))}delete(e,t={},i){const{api_version:r=this._client.apiVersion}=t??{};return this._client.delete(Vw`/${r}/interactions/${e}`,i)}cancel(e,t={},i){const{api_version:r=this._client.apiVersion}=t??{};return this._client.post(Vw`/${r}/interactions/${e}/cancel`,i)}get(e,t={},i){var r;const s=t??{},{api_version:a=this._client.apiVersion}=s,o=fD(s,["api_version"]);return this._client.get(Vw`/${a}/interactions/${e}`,Object.assign(Object.assign({query:o},i),{stream:(r=t==null?void 0:t.stream)!==null&&r!==void 0?r:!1}))}}Y$._key=Object.freeze(["interactions"]);class J$ extends Y${}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Ffe(n){let e=0;for(const r of n)e+=r.length;const t=new Uint8Array(e);let i=0;for(const r of n)t.set(r,i),i+=r.length;return t}let Ww;function WP(n){let e;return(Ww??(e=new globalThis.TextEncoder,Ww=e.encode.bind(e)))(n)}let Hw;function o7(n){let e;return(Hw??(e=new globalThis.TextDecoder,Hw=e.decode.bind(e)))(n)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class eI{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null,this.searchIndex=0}decode(e){var t;if(e==null)return[];const i=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?WP(e):e;this.buffer=Ffe([this.buffer,i]);const r=[];let s;for(;(s=Ufe(this.buffer,(t=this.carriageReturnIndex)!==null&&t!==void 0?t:this.searchIndex))!=null;){if(s.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=s.index;continue}if(this.carriageReturnIndex!=null&&(s.index!==this.carriageReturnIndex+1||s.carriage)){r.push(o7(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null,this.searchIndex=0;continue}const a=this.carriageReturnIndex!==null?s.preceding-1:s.preceding,o=o7(this.buffer.subarray(0,a));r.push(o),this.buffer=this.buffer.subarray(s.index),this.carriageReturnIndex=null,this.searchIndex=0}return this.searchIndex=Math.max(0,this.buffer.length-1),r}flush(){return this.buffer.length?this.decode(`
`):[]}}eI.NEWLINE_CHARS=new Set([`
`,"\r"]);eI.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ufe(n,e){const r=e??0,s=n.indexOf(10,r),a=n.indexOf(13,r);if(s===-1&&a===-1)return null;let o;return s!==-1&&a!==-1?o=Math.min(s,a):o=s!==-1?s:a,n[o]===10?{preceding:o,index:o+1,carriage:!1}:{preceding:o,index:o+1,carriage:!0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const pD={off:0,error:200,warn:300,info:400,debug:500},l7=(n,e,t)=>{if(n){if(yfe(pD,n))return n;ra(t).warn(`${e} was set to ${JSON.stringify(n)}, expected one of ${JSON.stringify(Object.keys(pD))}`)}};function xx(){}function zw(n,e,t){return!e||pD[n]>pD[t]?xx:e[n].bind(e)}const Pfe={error:xx,warn:xx,info:xx,debug:xx};let c7=new WeakMap;function ra(n){var e;const t=n.logger,i=(e=n.logLevel)!==null&&e!==void 0?e:"off";if(!t)return Pfe;const r=c7.get(t);if(r&&r[0]===i)return r[1];const s={error:zw("error",t,i),warn:zw("warn",t,i),info:zw("info",t,i),debug:zw("debug",t,i)};return c7.set(t,[i,s]),s}const ng=n=>(n.options&&(n.options=Object.assign({},n.options),delete n.options.headers),n.headers&&(n.headers=Object.fromEntries((n.headers instanceof Headers?[...n.headers]:Object.entries(n.headers)).map(([e,t])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":t]))),"retryOfRequestLogID"in n&&(n.retryOfRequestLogID&&(n.retryOf=n.retryOfRequestLogID),delete n.retryOfRequestLogID),n);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class vy{constructor(e,t,i){this.iterator=e,this.controller=t,this.client=i}static fromSSEResponse(e,t,i){let r=!1;const s=i?ra(i):console;function a(){return ec(this,arguments,function*(){var l,c,h,f;if(r)throw new pl("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let p=!1;try{try{for(var y=!0,x=tc(Lfe(e,t)),v;v=yield en(x.next()),l=v.done,!l;y=!0){f=v.value,y=!1;const _=f;if(!p)if(_.data.startsWith("[DONE]")){p=!0;continue}else try{yield yield en(JSON.parse(_.data))}catch(E){throw s.error("Could not parse message into JSON:",_.data),s.error("From chunk:",_.raw),E}}}catch(_){c={error:_}}finally{try{!y&&!l&&(h=x.return)&&(yield en(h.call(x)))}finally{if(c)throw c.error}}p=!0}catch(_){if(BM(_))return yield en(void 0);throw _}finally{p||t.abort()}})}return new vy(a,t,i)}static fromReadableStream(e,t,i){let r=!1;function s(){return ec(this,arguments,function*(){var l,c,h,f;const p=new eI,y=q$(e);try{for(var x=!0,v=tc(y),_;_=yield en(v.next()),l=_.done,!l;x=!0){f=_.value,x=!1;const E=f;for(const w of p.decode(E))yield yield en(w)}}catch(E){c={error:E}}finally{try{!x&&!l&&(h=v.return)&&(yield en(h.call(v)))}finally{if(c)throw c.error}}for(const E of p.flush())yield yield en(E)})}function a(){return ec(this,arguments,function*(){var l,c,h,f;if(r)throw new pl("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let p=!1;try{try{for(var y=!0,x=tc(s()),v;v=yield en(x.next()),l=v.done,!l;y=!0){f=v.value,y=!1;const _=f;p||_&&(yield yield en(JSON.parse(_)))}}catch(_){c={error:_}}finally{try{!y&&!l&&(h=x.return)&&(yield en(h.call(x)))}finally{if(c)throw c.error}}p=!0}catch(_){if(BM(_))return yield en(void 0);throw _}finally{p||t.abort()}})}return new vy(a,t,i)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],t=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const a=i.next();e.push(a),t.push(a)}return s.shift()}});return[new vy(()=>r(e),this.controller,this.client),new vy(()=>r(t),this.controller,this.client)]}toReadableStream(){const e=this;let t;return G$({async start(){t=e[Symbol.asyncIterator]()},async pull(i){try{const{value:r,done:s}=await t.next();if(s)return i.close();const a=WP(JSON.stringify(r)+`
`);i.enqueue(a)}catch(r){i.error(r)}},async cancel(){var i;await((i=t.return)===null||i===void 0?void 0:i.call(t))}})}}function Lfe(n,e){return ec(this,arguments,function*(){var i,r,s,a;if(!n.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new pl("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new pl("Attempted to iterate over a response with no body");const o=new Bfe,l=new eI,c=q$(n.body);try{for(var h=!0,f=tc(Ofe(c)),p;p=yield en(f.next()),i=p.done,!i;h=!0){a=p.value,h=!1;const y=a;for(const x of l.decode(y)){const v=o.decode(x);v&&(yield yield en(v))}}}catch(y){r={error:y}}finally{try{!h&&!i&&(s=f.return)&&(yield en(s.call(f)))}finally{if(r)throw r.error}}for(const y of l.flush()){const x=o.decode(y);x&&(yield yield en(x))}})}function Ofe(n){return ec(this,arguments,function*(){var t,i,r,s;try{for(var a=!0,o=tc(n),l;l=yield en(o.next()),t=l.done,!t;a=!0){s=l.value,a=!1;const c=s;if(c==null)continue;const h=c instanceof ArrayBuffer?new Uint8Array(c):typeof c=="string"?WP(c):c;yield yield en(h)}}catch(c){i={error:c}}finally{try{!a&&!t&&(r=o.return)&&(yield en(r.call(o)))}finally{if(i)throw i.error}}})}class Bfe{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;const s={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,i,r]=Vfe(e,":");return r.startsWith(" ")&&(r=r.substring(1)),t==="event"?this.event=r:t==="data"&&this.data.push(r),null}}function Vfe(n,e){const t=n.indexOf(e);return t!==-1?[n.substring(0,t),e,n.substring(t+e.length)]:[n,"",""]}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function Wfe(n,e){const{response:t,requestLogID:i,retryOfRequestLogID:r,startTime:s}=e,a=await(async()=>{var o;if(e.options.stream)return ra(n).debug("response",t.status,t.url,t.headers,t.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(t,e.controller,n):vy.fromSSEResponse(t,e.controller,n);if(t.status===204)return null;if(e.options.__binaryResponse)return t;const l=t.headers.get("content-type"),c=(o=l==null?void 0:l.split(";")[0])===null||o===void 0?void 0:o.trim();return(c==null?void 0:c.includes("application/json"))||(c==null?void 0:c.endsWith("+json"))?t.headers.get("content-length")==="0"?void 0:await t.json():await t.text()})();return ra(n).debug(`[${i}] response parsed`,ng({retryOfRequestLogID:r,url:t.url,status:t.status,body:a,durationMs:Date.now()-s})),a}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class HP extends Promise{constructor(e,t,i=Wfe){super(r=>{r(null)}),this.responsePromise=t,this.parseResponse=i,this.client=e}_thenUnwrap(e){return new HP(this.client,this.responsePromise,async(t,i)=>e(await this.parseResponse(t,i),i))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Q$=Symbol("brand.privateNullableHeaders");function*Hfe(n){if(!n)return;if(Q$ in n){const{values:i,nulls:r}=n;yield*i.entries();for(const s of r)yield[s,null];return}let e=!1,t;n instanceof Headers?t=n.entries():r7(n)?t=n:(e=!0,t=Object.entries(n??{}));for(let i of t){const r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");const s=r7(i[1])?i[1]:[i[1]];let a=!1;for(const o of s)o!==void 0&&(e&&!a&&(a=!0,yield[r,null]),yield[r,o])}}const tx=n=>{const e=new Headers,t=new Set;for(const i of n){const r=new Set;for(const[s,a]of Hfe(i)){const o=s.toLowerCase();r.has(o)||(e.delete(s),r.add(o)),a===null?(e.delete(s),t.add(o)):(e.append(s,a),t.delete(o))}}return{[Q$]:!0,values:e,nulls:t}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Ck=n=>{var e,t,i,r,s,a;if(typeof globalThis.process<"u")return(i=(t=(e=eoe)===null||e===void 0?void 0:e[n])===null||t===void 0?void 0:t.trim())!==null&&i!==void 0?i:void 0;if(typeof globalThis.Deno<"u")return(a=(s=(r=globalThis.Deno.env)===null||r===void 0?void 0:r.get)===null||s===void 0?void 0:s.call(r,n))===null||a===void 0?void 0:a.trim()};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var Z$;class tI{constructor(e){var t,i,r,s,a,o,l,{baseURL:c=Ck("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:h=(t=Ck("GEMINI_API_KEY"))!==null&&t!==void 0?t:null,apiVersion:f="v1beta"}=e,p=fD(e,["baseURL","apiKey","apiVersion"]);const y=Object.assign(Object.assign({apiKey:h,apiVersion:f},p),{baseURL:c||"https://generativelanguage.googleapis.com"});this.baseURL=y.baseURL,this.timeout=(i=y.timeout)!==null&&i!==void 0?i:tI.DEFAULT_TIMEOUT,this.logger=(r=y.logger)!==null&&r!==void 0?r:console;const x="warn";this.logLevel=x,this.logLevel=(a=(s=l7(y.logLevel,"ClientOptions.logLevel",this))!==null&&s!==void 0?s:l7(Ck("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&a!==void 0?a:x,this.fetchOptions=y.fetchOptions,this.maxRetries=(o=y.maxRetries)!==null&&o!==void 0?o:2,this.fetch=(l=y.fetch)!==null&&l!==void 0?l:bfe(),this.encoder=wfe,this._options=y,this.apiKey=h,this.apiVersion=f,this.clientAdapter=y.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!t.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){const t=tx([e.headers]);if(!(t.values.has("authorization")||t.values.has("x-goog-api-key"))){if(this.apiKey)return tx([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return tx([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Afe(e)}getUserAgent(){return`${this.constructor.name}/JS ${Sfe}`}defaultIdempotencyKey(){return`stainless-node-retry-${dfe()}`}makeStatusError(e,t,i,r){return fa.generate(e,t,i,r)}buildURL(e,t,i){const r=!this.baseURLOverridden()&&i||this.baseURL,s=pfe(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),a=this.defaultQuery(),o=Object.fromEntries(s.searchParams);return(!s7(a)||!s7(o))&&(t=Object.assign(Object.assign(Object.assign({},o),a),t)),typeof t=="object"&&t&&!Array.isArray(t)&&(s.search=this.stringifyQuery(t)),s.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){const t=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${t}`}}async prepareRequest(e,{url:t,options:i}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,i){return this.request(Promise.resolve(i).then(r=>Object.assign({method:e,path:t},r)))}request(e,t=null){return new HP(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,i){var r,s,a;const o=await e,l=(r=o.maxRetries)!==null&&r!==void 0?r:this.maxRetries;t==null&&(t=l),await this.prepareOptions(o);const{req:c,url:h,timeout:f}=await this.buildRequest(o,{retryCount:l-t});await this.prepareRequest(c,{url:h,options:o});const p="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),y=i===void 0?"":`, retryOf: ${i}`,x=Date.now();if(ra(this).debug(`[${p}] sending request`,ng({retryOfRequestLogID:i,method:o.method,url:h,options:o,headers:c.headers})),!((s=o.signal)===null||s===void 0)&&s.aborted)throw new WM;const v=new AbortController,_=await this.fetchWithTimeout(h,c,f,v).catch(VM),E=Date.now();if(_ instanceof globalThis.Error){const A=`retrying, ${t} attempts remaining`;if(!((a=o.signal)===null||a===void 0)&&a.aborted)throw new WM;const N=BM(_)||/timed? ?out/i.test(String(_)+("cause"in _?String(_.cause):""));if(t)return ra(this).info(`[${p}] connection ${N?"timed out":"failed"} - ${A}`),ra(this).debug(`[${p}] connection ${N?"timed out":"failed"} (${A})`,ng({retryOfRequestLogID:i,url:h,durationMs:E-x,message:_.message})),this.retryRequest(o,t,i??p);throw ra(this).info(`[${p}] connection ${N?"timed out":"failed"} - error; no more retries left`),ra(this).debug(`[${p}] connection ${N?"timed out":"failed"} (error; no more retries left)`,ng({retryOfRequestLogID:i,url:h,durationMs:E-x,message:_.message})),N?new U$:new ZC({cause:_})}const w=`[${p}${y}] ${c.method} ${h} ${_.ok?"succeeded":"failed"} with status ${_.status} in ${E-x}ms`;if(!_.ok){const A=await this.shouldRetry(_);if(t&&A){const R=`retrying, ${t} attempts remaining`;return await Efe(_.body),ra(this).info(`${w} - ${R}`),ra(this).debug(`[${p}] response error (${R})`,ng({retryOfRequestLogID:i,url:_.url,status:_.status,headers:_.headers,durationMs:E-x})),this.retryRequest(o,t,i??p,_.headers)}const N=A?"error; no more retries left":"error; not retryable";ra(this).info(`${w} - ${N}`);const k=await _.text().catch(R=>VM(R).message),F=_fe(k),C=F?void 0:k;throw ra(this).debug(`[${p}] response error (${N})`,ng({retryOfRequestLogID:i,url:_.url,status:_.status,headers:_.headers,message:C,durationMs:Date.now()-x})),this.makeStatusError(_.status,F,C,_.headers)}return ra(this).info(w),ra(this).debug(`[${p}] response start`,ng({retryOfRequestLogID:i,url:_.url,status:_.status,headers:_.headers,durationMs:E-x})),{response:_,options:o,controller:v,requestLogID:p,retryOfRequestLogID:i,startTime:x}}async fetchWithTimeout(e,t,i,r){const s=t||{},{signal:a,method:o}=s,l=fD(s,["signal","method"]),c=this._makeAbort(r);a&&a.addEventListener("abort",c,{once:!0});const h=setTimeout(c,i),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,p=Object.assign(Object.assign(Object.assign({signal:r.signal},f?{duplex:"half"}:{}),{method:"GET"}),l);o&&(p.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,p)}finally{clearTimeout(h)}}async shouldRetry(e){const t=e.headers.get("x-should-retry");return t==="true"?!0:t==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,i,r){var s;let a;const o=r==null?void 0:r.get("retry-after-ms");if(o){const c=parseFloat(o);Number.isNaN(c)||(a=c)}const l=r==null?void 0:r.get("retry-after");if(l&&!a){const c=parseFloat(l);Number.isNaN(c)?a=Date.parse(l)-Date.now():a=c*1e3}if(a===void 0){const c=(s=e.maxRetries)!==null&&s!==void 0?s:this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(t,c)}return await xfe(a),this.makeRequest(e,t-1,i)}calculateDefaultRetryTimeoutMillis(e,t){const s=t-e,a=Math.min(.5*Math.pow(2,s),8),o=1-Math.random()*.25;return a*o*1e3}async buildRequest(e,{retryCount:t=0}={}){var i,r,s;const a=Object.assign({},e),{method:o,path:l,query:c,defaultBaseURL:h}=a,f=this.buildURL(l,c,h);"timeout"in a&&vfe("timeout",a.timeout),a.timeout=(i=a.timeout)!==null&&i!==void 0?i:this.timeout;const{bodyHeaders:p,body:y}=this.buildBody({options:a}),x=await this.buildHeaders({options:e,method:o,bodyHeaders:p,retryCount:t});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:o,headers:x},a.signal&&{signal:a.signal}),globalThis.ReadableStream&&y instanceof globalThis.ReadableStream&&{duplex:"half"}),y&&{body:y}),(r=this.fetchOptions)!==null&&r!==void 0?r:{}),(s=a.fetchOptions)!==null&&s!==void 0?s:{}),url:f,timeout:a.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:i,retryCount:r}){let s={};this.idempotencyHeader&&t!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);const a=await this.authHeaders(e);let o=tx([s,{Accept:"application/json","User-Agent":this.getUserAgent()},this._options.defaultHeaders,i,e.headers,a]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};const i=tx([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&i.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:Tfe(e)}:typeof e=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:this.encoder({body:e,headers:i})}}tI.DEFAULT_TIMEOUT=6e4;class rs extends tI{constructor(){super(...arguments),this.interactions=new J$(this)}}Z$=rs;rs.GeminiNextGenAPIClient=Z$;rs.GeminiNextGenAPIClientError=pl;rs.APIError=fa;rs.APIConnectionError=ZC;rs.APIConnectionTimeoutError=U$;rs.APIUserAbortError=WM;rs.NotFoundError=B$;rs.ConflictError=V$;rs.RateLimitError=H$;rs.BadRequestError=P$;rs.AuthenticationError=L$;rs.InternalServerError=z$;rs.PermissionDeniedError=O$;rs.UnprocessableEntityError=W$;rs.toFile=Nfe;rs.Interactions=J$;/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function zfe(n,e){const t={},i=T(n,["name"]);return i!=null&&S(t,["_url","name"],i),t}function Gfe(n,e){const t={},i=T(n,["name"]);return i!=null&&S(t,["_url","name"],i),t}function qfe(n,e){const t={},i=T(n,["sdkHttpResponse"]);return i!=null&&S(t,["sdkHttpResponse"],i),t}function $fe(n,e){const t={},i=T(n,["sdkHttpResponse"]);return i!=null&&S(t,["sdkHttpResponse"],i),t}function jfe(n,e,t){const i={};if(T(n,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const r=T(n,["tunedModelDisplayName"]);if(e!==void 0&&r!=null&&S(e,["displayName"],r),T(n,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const s=T(n,["epochCount"]);e!==void 0&&s!=null&&S(e,["tuningTask","hyperparameters","epochCount"],s);const a=T(n,["learningRateMultiplier"]);if(a!=null&&S(i,["tuningTask","hyperparameters","learningRateMultiplier"],a),T(n,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(T(n,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(T(n,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(T(n,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(T(n,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");const o=T(n,["batchSize"]);e!==void 0&&o!=null&&S(e,["tuningTask","hyperparameters","batchSize"],o);const l=T(n,["learningRate"]);if(e!==void 0&&l!=null&&S(e,["tuningTask","hyperparameters","learningRate"],l),T(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(T(n,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(T(n,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(T(n,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(T(n,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(T(n,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(T(n,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return i}function Xfe(n,e,t){const i={};let r=T(t,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const F=T(n,["validationDataset"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec"],Ik(F))}else if(r==="PREFERENCE_TUNING"){const F=T(n,["validationDataset"]);e!==void 0&&F!=null&&S(e,["preferenceOptimizationSpec"],Ik(F))}else if(r==="DISTILLATION"){const F=T(n,["validationDataset"]);e!==void 0&&F!=null&&S(e,["distillationSpec"],Ik(F))}const s=T(n,["tunedModelDisplayName"]);e!==void 0&&s!=null&&S(e,["tunedModelDisplayName"],s);const a=T(n,["description"]);e!==void 0&&a!=null&&S(e,["description"],a);let o=T(t,["config","method"]);if(o===void 0&&(o="SUPERVISED_FINE_TUNING"),o==="SUPERVISED_FINE_TUNING"){const F=T(n,["epochCount"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","hyperParameters","epochCount"],F)}else if(o==="PREFERENCE_TUNING"){const F=T(n,["epochCount"]);e!==void 0&&F!=null&&S(e,["preferenceOptimizationSpec","hyperParameters","epochCount"],F)}else if(o==="DISTILLATION"){const F=T(n,["epochCount"]);e!==void 0&&F!=null&&S(e,["distillationSpec","hyperParameters","epochCount"],F)}let l=T(t,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){const F=T(n,["learningRateMultiplier"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],F)}else if(l==="PREFERENCE_TUNING"){const F=T(n,["learningRateMultiplier"]);e!==void 0&&F!=null&&S(e,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],F)}else if(l==="DISTILLATION"){const F=T(n,["learningRateMultiplier"]);e!==void 0&&F!=null&&S(e,["distillationSpec","hyperParameters","learningRateMultiplier"],F)}let c=T(t,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){const F=T(n,["exportLastCheckpointOnly"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","exportLastCheckpointOnly"],F)}else if(c==="PREFERENCE_TUNING"){const F=T(n,["exportLastCheckpointOnly"]);e!==void 0&&F!=null&&S(e,["preferenceOptimizationSpec","exportLastCheckpointOnly"],F)}else if(c==="DISTILLATION"){const F=T(n,["exportLastCheckpointOnly"]);e!==void 0&&F!=null&&S(e,["distillationSpec","exportLastCheckpointOnly"],F)}let h=T(t,["config","method"]);if(h===void 0&&(h="SUPERVISED_FINE_TUNING"),h==="SUPERVISED_FINE_TUNING"){const F=T(n,["adapterSize"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","hyperParameters","adapterSize"],F)}else if(h==="PREFERENCE_TUNING"){const F=T(n,["adapterSize"]);e!==void 0&&F!=null&&S(e,["preferenceOptimizationSpec","hyperParameters","adapterSize"],F)}else if(h==="DISTILLATION"){const F=T(n,["adapterSize"]);e!==void 0&&F!=null&&S(e,["distillationSpec","hyperParameters","adapterSize"],F)}let f=T(t,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){const F=T(n,["tuningMode"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","tuningMode"],F)}const p=T(n,["customBaseModel"]);e!==void 0&&p!=null&&S(e,["customBaseModel"],p);let y=T(t,["config","method"]);if(y===void 0&&(y="SUPERVISED_FINE_TUNING"),y==="SUPERVISED_FINE_TUNING"){const F=T(n,["batchSize"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","hyperParameters","batchSize"],F)}let x=T(t,["config","method"]);if(x===void 0&&(x="SUPERVISED_FINE_TUNING"),x==="SUPERVISED_FINE_TUNING"){const F=T(n,["learningRate"]);e!==void 0&&F!=null&&S(e,["supervisedTuningSpec","hyperParameters","learningRate"],F)}const v=T(n,["labels"]);e!==void 0&&v!=null&&S(e,["labels"],v);const _=T(n,["beta"]);e!==void 0&&_!=null&&S(e,["preferenceOptimizationSpec","hyperParameters","beta"],_);const E=T(n,["baseTeacherModel"]);e!==void 0&&E!=null&&S(e,["distillationSpec","baseTeacherModel"],E);const w=T(n,["tunedTeacherModelSource"]);e!==void 0&&w!=null&&S(e,["distillationSpec","tunedTeacherModelSource"],w);const A=T(n,["sftLossWeightMultiplier"]);e!==void 0&&A!=null&&S(e,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],A);const N=T(n,["outputUri"]);e!==void 0&&N!=null&&S(e,["outputUri"],N);const k=T(n,["encryptionSpec"]);return e!==void 0&&k!=null&&S(e,["encryptionSpec"],k),i}function Kfe(n,e){const t={},i=T(n,["baseModel"]);i!=null&&S(t,["baseModel"],i);const r=T(n,["preTunedModel"]);r!=null&&S(t,["preTunedModel"],r);const s=T(n,["trainingDataset"]);s!=null&&ape(s);const a=T(n,["config"]);return a!=null&&jfe(a,t),t}function Yfe(n,e){const t={},i=T(n,["baseModel"]);i!=null&&S(t,["baseModel"],i);const r=T(n,["preTunedModel"]);r!=null&&S(t,["preTunedModel"],r);const s=T(n,["trainingDataset"]);s!=null&&ope(s,t,e);const a=T(n,["config"]);return a!=null&&Xfe(a,t,e),t}function Jfe(n,e){const t={},i=T(n,["name"]);return i!=null&&S(t,["_url","name"],i),t}function Qfe(n,e){const t={},i=T(n,["name"]);return i!=null&&S(t,["_url","name"],i),t}function Zfe(n,e,t){const i={},r=T(n,["pageSize"]);e!==void 0&&r!=null&&S(e,["_query","pageSize"],r);const s=T(n,["pageToken"]);e!==void 0&&s!=null&&S(e,["_query","pageToken"],s);const a=T(n,["filter"]);return e!==void 0&&a!=null&&S(e,["_query","filter"],a),i}function epe(n,e,t){const i={},r=T(n,["pageSize"]);e!==void 0&&r!=null&&S(e,["_query","pageSize"],r);const s=T(n,["pageToken"]);e!==void 0&&s!=null&&S(e,["_query","pageToken"],s);const a=T(n,["filter"]);return e!==void 0&&a!=null&&S(e,["_query","filter"],a),i}function tpe(n,e){const t={},i=T(n,["config"]);return i!=null&&Zfe(i,t),t}function npe(n,e){const t={},i=T(n,["config"]);return i!=null&&epe(i,t),t}function ipe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["nextPageToken"]);r!=null&&S(t,["nextPageToken"],r);const s=T(n,["tunedModels"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(o=>ej(o))),S(t,["tuningJobs"],a)}return t}function rpe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["nextPageToken"]);r!=null&&S(t,["nextPageToken"],r);const s=T(n,["tuningJobs"]);if(s!=null){let a=s;Array.isArray(a)&&(a=a.map(o=>GM(o))),S(t,["tuningJobs"],a)}return t}function spe(n,e){const t={},i=T(n,["name"]);i!=null&&S(t,["model"],i);const r=T(n,["name"]);return r!=null&&S(t,["endpoint"],r),t}function ape(n,e){const t={};if(T(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(T(n,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const i=T(n,["examples"]);if(i!=null){let r=i;Array.isArray(r)&&(r=r.map(s=>s)),S(t,["examples","examples"],r)}return t}function ope(n,e,t){const i={};let r=T(t,["config","method"]);if(r===void 0&&(r="SUPERVISED_FINE_TUNING"),r==="SUPERVISED_FINE_TUNING"){const a=T(n,["gcsUri"]);e!==void 0&&a!=null&&S(e,["supervisedTuningSpec","trainingDatasetUri"],a)}else if(r==="PREFERENCE_TUNING"){const a=T(n,["gcsUri"]);e!==void 0&&a!=null&&S(e,["preferenceOptimizationSpec","trainingDatasetUri"],a)}else if(r==="DISTILLATION"){const a=T(n,["gcsUri"]);e!==void 0&&a!=null&&S(e,["distillationSpec","promptDatasetUri"],a)}let s=T(t,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const a=T(n,["vertexDatasetResource"]);e!==void 0&&a!=null&&S(e,["supervisedTuningSpec","trainingDatasetUri"],a)}else if(s==="PREFERENCE_TUNING"){const a=T(n,["vertexDatasetResource"]);e!==void 0&&a!=null&&S(e,["preferenceOptimizationSpec","trainingDatasetUri"],a)}else if(s==="DISTILLATION"){const a=T(n,["vertexDatasetResource"]);e!==void 0&&a!=null&&S(e,["distillationSpec","promptDatasetUri"],a)}if(T(n,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return i}function ej(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["name"]);r!=null&&S(t,["name"],r);const s=T(n,["state"]);s!=null&&S(t,["state"],m$(s));const a=T(n,["createTime"]);a!=null&&S(t,["createTime"],a);const o=T(n,["tuningTask","startTime"]);o!=null&&S(t,["startTime"],o);const l=T(n,["tuningTask","completeTime"]);l!=null&&S(t,["endTime"],l);const c=T(n,["updateTime"]);c!=null&&S(t,["updateTime"],c);const h=T(n,["description"]);h!=null&&S(t,["description"],h);const f=T(n,["baseModel"]);f!=null&&S(t,["baseModel"],f);const p=T(n,["_self"]);return p!=null&&S(t,["tunedModel"],spe(p)),t}function GM(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["name"]);r!=null&&S(t,["name"],r);const s=T(n,["state"]);s!=null&&S(t,["state"],m$(s));const a=T(n,["createTime"]);a!=null&&S(t,["createTime"],a);const o=T(n,["startTime"]);o!=null&&S(t,["startTime"],o);const l=T(n,["endTime"]);l!=null&&S(t,["endTime"],l);const c=T(n,["updateTime"]);c!=null&&S(t,["updateTime"],c);const h=T(n,["error"]);h!=null&&S(t,["error"],h);const f=T(n,["description"]);f!=null&&S(t,["description"],f);const p=T(n,["baseModel"]);p!=null&&S(t,["baseModel"],p);const y=T(n,["tunedModel"]);y!=null&&S(t,["tunedModel"],y);const x=T(n,["preTunedModel"]);x!=null&&S(t,["preTunedModel"],x);const v=T(n,["supervisedTuningSpec"]);v!=null&&S(t,["supervisedTuningSpec"],v);const _=T(n,["preferenceOptimizationSpec"]);_!=null&&S(t,["preferenceOptimizationSpec"],_);const E=T(n,["distillationSpec"]);E!=null&&S(t,["distillationSpec"],E);const w=T(n,["tuningDataStats"]);w!=null&&S(t,["tuningDataStats"],w);const A=T(n,["encryptionSpec"]);A!=null&&S(t,["encryptionSpec"],A);const N=T(n,["partnerModelTuningSpec"]);N!=null&&S(t,["partnerModelTuningSpec"],N);const k=T(n,["customBaseModel"]);k!=null&&S(t,["customBaseModel"],k);const F=T(n,["evaluateDatasetRuns"]);if(F!=null){let q=F;Array.isArray(q)&&(q=q.map(X=>X)),S(t,["evaluateDatasetRuns"],q)}const C=T(n,["experiment"]);C!=null&&S(t,["experiment"],C);const M=T(n,["fullFineTuningSpec"]);M!=null&&S(t,["fullFineTuningSpec"],M);const R=T(n,["labels"]);R!=null&&S(t,["labels"],R);const L=T(n,["outputUri"]);L!=null&&S(t,["outputUri"],L);const H=T(n,["pipelineJob"]);H!=null&&S(t,["pipelineJob"],H);const P=T(n,["serviceAccount"]);P!=null&&S(t,["serviceAccount"],P);const O=T(n,["tunedModelDisplayName"]);O!=null&&S(t,["tunedModelDisplayName"],O);const B=T(n,["tuningJobState"]);B!=null&&S(t,["tuningJobState"],B);const re=T(n,["veoTuningSpec"]);return re!=null&&S(t,["veoTuningSpec"],re),t}function lpe(n,e){const t={},i=T(n,["sdkHttpResponse"]);i!=null&&S(t,["sdkHttpResponse"],i);const r=T(n,["name"]);r!=null&&S(t,["name"],r);const s=T(n,["metadata"]);s!=null&&S(t,["metadata"],s);const a=T(n,["done"]);a!=null&&S(t,["done"],a);const o=T(n,["error"]);return o!=null&&S(t,["error"],o),t}function Ik(n,e){const t={},i=T(n,["gcsUri"]);i!=null&&S(t,["validationDatasetUri"],i);const r=T(n,["vertexDatasetResource"]);return r!=null&&S(t,["validationDatasetUri"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class cpe extends Yh{constructor(e){super(),this.apiClient=e,this.list=async(t={})=>new Km(Lh.PAGED_ITEM_TUNING_JOBS,i=>this.listInternal(i),await this.listInternal(t),t),this.get=async t=>await this.getInternal(t),this.tune=async t=>{var i;if(this.apiClient.isVertexAI())if(t.baseModel.startsWith("projects/")){const r={tunedModelName:t.baseModel};!((i=t.config)===null||i===void 0)&&i.preTunedModelCheckpointId&&(r.checkpointId=t.config.preTunedModelCheckpointId);const s=Object.assign(Object.assign({},t),{preTunedModel:r});return s.baseModel=void 0,await this.tuneInternal(s)}else{const r=Object.assign({},t);return await this.tuneInternal(r)}else{const r=Object.assign({},t),s=await this.tuneMldevInternal(r);let a="";return s.metadata!==void 0&&s.metadata.tunedModel!==void 0?a=s.metadata.tunedModel:s.name!==void 0&&s.name.includes("/operations/")&&(a=s.name.split("/operations/")[0]),{name:a,state:NM.JOB_STATE_QUEUED}}}}async getInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Qfe(e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>GM(h))}else{const c=Jfe(e);return o=At("{name}",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>ej(h))}}async listInternal(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=npe(e);return o=At("tuningJobs",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=rpe(h),p=new F9;return Object.assign(p,f),p})}else{const c=tpe(e);return o=At("tunedModels",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"GET",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=ipe(h),p=new F9;return Object.assign(p,f),p})}}async cancel(e){var t,i,r,s;let a,o="",l={};if(this.apiClient.isVertexAI()){const c=Gfe(e);return o=At("{name}:cancel",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=$fe(h),p=new U9;return Object.assign(p,f),p})}else{const c=zfe(e);return o=At("{name}:cancel",c._url),l=c._query,delete c._url,delete c._query,a=this.apiClient.request({path:o,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(r=e.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(s=e.config)===null||s===void 0?void 0:s.abortSignal}).then(h=>h.json().then(f=>{const p=f;return p.sdkHttpResponse={headers:h.headers},p})),a.then(h=>{const f=qfe(h),p=new U9;return Object.assign(p,f),p})}}async tuneInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI()){const o=Yfe(e,e);return s=At("tuningJobs",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>GM(l))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(e){var t,i;let r,s="",a={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Kfe(e);return s=At("tunedModels",o._url),a=o._query,delete o._url,delete o._query,r=this.apiClient.request({path:s,queryParams:a,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(t=e.config)===null||t===void 0?void 0:t.httpOptions,abortSignal:(i=e.config)===null||i===void 0?void 0:i.abortSignal}).then(l=>l.json().then(c=>{const h=c;return h.sdkHttpResponse={headers:l.headers},h})),r.then(l=>lpe(l))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class upe{async download(e,t){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const hpe=1024*1024*8,dpe=3,fpe=1e3,ppe=2,gD="x-goog-upload-status";async function gpe(n,e,t,i){var r;const s=await tj(n,e,t,i),a=await(s==null?void 0:s.json());if(((r=s==null?void 0:s.headers)===null||r===void 0?void 0:r[gD])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return a.file}async function mpe(n,e,t,i){var r;const s=await tj(n,e,t,i),a=await(s==null?void 0:s.json());if(((r=s==null?void 0:s.headers)===null||r===void 0?void 0:r[gD])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const o=u$(a),l=new UP;return Object.assign(l,o),l}async function tj(n,e,t,i){var r,s,a;let o=e;const l=(i==null?void 0:i.baseUrl)||((r=t.clientOptions.httpOptions)===null||r===void 0?void 0:r.baseUrl);if(l){const y=new URL(l),x=new URL(e);x.protocol=y.protocol,x.host=y.host,x.port=y.port,o=x.toString()}let c=0,h=0,f=new MM(new Response),p="upload";for(c=n.size;h<c;){const y=Math.min(hpe,c-h),x=n.slice(h,h+y);h+y>=c&&(p+=", finalize");let v=0,_=fpe;for(;v<dpe;){const E=Object.assign(Object.assign({},(i==null?void 0:i.headers)||{}),{"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":String(h),"Content-Length":String(y)});if(f=await t.request({path:"",body:x,httpMethod:"POST",httpOptions:Object.assign(Object.assign({},i),{apiVersion:"",baseUrl:o,headers:E})}),!((s=f==null?void 0:f.headers)===null||s===void 0)&&s[gD])break;v++,await vpe(_),_=_*ppe}if(h+=y,((a=f==null?void 0:f.headers)===null||a===void 0?void 0:a[gD])!=="active")break;if(c<=h)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return f}async function ype(n){return{size:n.size,type:n.type}}function vpe(n){return new Promise(e=>setTimeout(e,n))}class _pe{async upload(e,t,i,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await gpe(e,t,i,r)}async uploadToFileSearchStore(e,t,i,r){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await mpe(e,t,i,r)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await ype(e)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class xpe{create(e,t,i){return new bpe(e,t,i)}}class bpe{constructor(e,t,i){this.url=e,this.headers=t,this.callbacks=i}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const u7="x-goog-api-key";class Tpe{constructor(e){this.apiKey=e}async addAuthHeaders(e,t){if(e.get(u7)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(u7,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Epe="gl-node/";class nj{get interactions(){var e;if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const t=this.httpOptions;t!=null&&t.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const i=new rs({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:t==null?void 0:t.timeout,maxRetries:(e=t==null?void 0:t.retryOptions)===null||e===void 0?void 0:e.attempts});return this._interactions=i.interactions,this._interactions}constructor(e){var t;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(t=e.vertexai)!==null&&t!==void 0?t:!1,this.apiKey=e.apiKey;const i=roe(e.httpOptions,e.vertexai,void 0,void 0);i&&(e.httpOptions?e.httpOptions.baseUrl=i:e.httpOptions={baseUrl:i}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;const r=new Tpe(this.apiKey);this.apiClient=new xde({auth:r,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:Epe+"web",uploader:new _pe,downloader:new upe}),this.models=new Bde(this.apiClient),this.live=new Mde(this.apiClient,r,new xpe),this.batches=new Ple(this.apiClient),this.chats=new xce(this.models,this.apiClient),this.caches=new yce(this.apiClient),this.files=new kce(this.apiClient),this.operations=new Vde(this.apiClient),this.authTokens=new ife(this.apiClient),this.tunings=new cpe(this.apiClient),this.fileSearchStores=new hfe(this.apiClient)}}/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wpe=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ape=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase()),h7=n=>{const e=Ape(n);return e.charAt(0).toUpperCase()+e.slice(1)},ij=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim(),Spe=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Dpe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cpe=Se.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:a,...o},l)=>Se.createElement("svg",{ref:l,...Dpe,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:ij("lucide",r),...!s&&!Spe(o)&&{"aria-hidden":"true"},...o},[...a.map(([c,h])=>Se.createElement(c,h)),...Array.isArray(s)?s:[s]]));/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ni=(n,e)=>{const t=Se.forwardRef(({className:i,...r},s)=>Se.createElement(Cpe,{ref:s,iconNode:e,className:ij(`lucide-${wpe(h7(n))}`,`lucide-${n}`,i),...r}));return t.displayName=h7(n),t};/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ipe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],My=Ni("arrow-right",Ipe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rpe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],d7=Ni("book-open",Rpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Npe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Hf=Ni("check",Npe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kpe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mpe=Ni("chevron-right",kpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fpe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],mD=Ni("circle-alert",Fpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Upe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ppe=Ni("circle-check",Upe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lpe=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Kp=Ni("circle-play",Lpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ope=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],yD=Ni("circle-x",Ope);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bpe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Yp=Ni("copy",Bpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vpe=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],f7=Ni("download",Vpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wpe=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]],Hpe=Ni("file-search",Wpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zpe=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Gpe=Ni("file-text",zpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qpe=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],$pe=Ni("file-up",qpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jpe=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],_y=Ni("graduation-cap",jpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xpe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Kpe=Ni("history",Xpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ype=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Jpe=Ni("layers",Ype);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qpe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],bx=Ni("loader-circle",Qpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zpe=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],ege=Ni("log-in",Zpe);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tge=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],nge=Ni("log-out",tge);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ige=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],rge=Ni("message-square-quote",ige);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sge=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],age=Ni("paperclip",sge);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oge=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],rj=Ni("rotate-ccw",oge);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lge=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],cge=Ni("table",lge);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uge=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],hge=Ni("trash-2",uge);/**
 * @license lucide-react v0.546.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dge=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],fge=Ni("trophy",dge),zP=Se.createContext({});function GP(n){const e=Se.useRef(null);return e.current===null&&(e.current=n()),e.current}const pge=typeof window<"u",sj=pge?Se.useLayoutEffect:Se.useEffect,nI=Se.createContext(null);function qP(n,e){n.indexOf(e)===-1&&n.push(e)}function vD(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const cu=(n,e,t)=>t>e?e:t<n?n:t;let $P=()=>{};const Qf={},aj=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function oj(n){return typeof n=="object"&&n!==null}const lj=n=>/^0[^.\s]+$/u.test(n);function cj(n){let e;return()=>(e===void 0&&(e=n()),e)}const cl=n=>n,gge=(n,e)=>t=>e(n(t)),GT=(...n)=>n.reduce(gge),pb=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i};class jP{constructor(){this.subscriptions=[]}add(e){return qP(this.subscriptions,e),()=>vD(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s<r;s++){const a=this.subscriptions[s];a&&a(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ao=n=>n*1e3,ll=n=>n/1e3;function uj(n,e){return e?n*(1e3/e):0}const hj=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,mge=1e-7,yge=12;function vge(n,e,t,i,r){let s,a,o=0;do a=e+(t-e)/2,s=hj(a,i,r)-n,s>0?t=a:e=a;while(Math.abs(s)>mge&&++o<yge);return a}function qT(n,e,t,i){if(n===e&&t===i)return cl;const r=s=>vge(s,0,1,n,t);return s=>s===0||s===1?s:hj(r(s),e,i)}const dj=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,fj=n=>e=>1-n(1-e),pj=qT(.33,1.53,.69,.99),XP=fj(pj),gj=dj(XP),mj=n=>n>=1?1:(n*=2)<1?.5*XP(n):.5*(2-Math.pow(2,-10*(n-1))),KP=n=>1-Math.sin(Math.acos(n)),yj=fj(KP),vj=dj(KP),_ge=qT(.42,0,1,1),xge=qT(0,0,.58,1),_j=qT(.42,0,.58,1),bge=n=>Array.isArray(n)&&typeof n[0]!="number",xj=n=>Array.isArray(n)&&typeof n[0]=="number",Tge={linear:cl,easeIn:_ge,easeInOut:_j,easeOut:xge,circIn:KP,circInOut:vj,circOut:yj,backIn:XP,backInOut:gj,backOut:pj,anticipate:mj},Ege=n=>typeof n=="string",p7=n=>{if(xj(n)){$P(n.length===4);const[e,t,i,r]=n;return qT(e,t,i,r)}else if(Ege(n))return Tge[n];return n},Gw=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function wge(n,e){let t=new Set,i=new Set,r=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(h){a.has(h)&&(c.schedule(h),n()),h(o)}const c={schedule:(h,f=!1,p=!1)=>{const x=p&&r?t:i;return f&&a.add(h),x.add(h),h},cancel:h=>{i.delete(h),a.delete(h)},process:h=>{if(o=h,r){s=!0;return}r=!0;const f=t;t=i,i=f,t.forEach(l),t.clear(),r=!1,s&&(s=!1,c.process(h))}};return c}const Age=40;function bj(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,a=Gw.reduce((A,N)=>(A[N]=wge(s),A),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:h,update:f,preRender:p,render:y,postRender:x}=a,v=()=>{const A=Qf.useManualTiming,N=A?r.timestamp:performance.now();t=!1,A||(r.delta=i?1e3/60:Math.max(Math.min(N-r.timestamp,Age),1)),r.timestamp=N,r.isProcessing=!0,o.process(r),l.process(r),c.process(r),h.process(r),f.process(r),p.process(r),y.process(r),x.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(v))},_=()=>{t=!0,i=!0,r.isProcessing||n(v)};return{schedule:Gw.reduce((A,N)=>{const k=a[N];return A[N]=(F,C=!1,M=!1)=>(t||_(),k.schedule(F,C,M)),A},{}),cancel:A=>{for(let N=0;N<Gw.length;N++)a[Gw[N]].cancel(A)},state:r,steps:a}}const{schedule:vi,cancel:Zf,state:xs,steps:Rk}=bj(typeof requestAnimationFrame<"u"?requestAnimationFrame:cl,!0);let LA;function Sge(){LA=void 0}const la={now:()=>(LA===void 0&&la.set(xs.isProcessing||Qf.useManualTiming?xs.timestamp:performance.now()),LA),set:n=>{LA=n,queueMicrotask(Sge)}},Tj=n=>e=>typeof e=="string"&&e.startsWith(n),Ej=Tj("--"),Dge=Tj("var(--"),YP=n=>Dge(n)?Cge.test(n.split("/*")[0].trim()):!1,Cge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function g7(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const W1={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},gb={...W1,transform:n=>cu(0,1,n)},qw={...W1,default:1},Jx=n=>Math.round(n*1e5)/1e5,JP=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ige(n){return n==null}const Rge=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,QP=(n,e)=>t=>!!(typeof t=="string"&&Rge.test(t)&&t.startsWith(n)||e&&!Ige(t)&&Object.prototype.hasOwnProperty.call(t,e)),wj=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,s,a,o]=i.match(JP);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},Nge=n=>cu(0,255,n),Nk={...W1,transform:n=>Math.round(Nge(n))},gg={test:QP("rgb","red"),parse:wj("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Nk.transform(n)+", "+Nk.transform(e)+", "+Nk.transform(t)+", "+Jx(gb.transform(i))+")"};function kge(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const qM={test:QP("#"),parse:kge,transform:gg.transform},$T=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Bd=$T("deg"),ru=$T("%"),Pt=$T("px"),Mge=$T("vh"),Fge=$T("vw"),m7={...ru,parse:n=>ru.parse(n)/100,transform:n=>ru.transform(n*100)},xy={test:QP("hsl","hue"),parse:wj("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ru.transform(Jx(e))+", "+ru.transform(Jx(t))+", "+Jx(gb.transform(i))+")"},yr={test:n=>gg.test(n)||qM.test(n)||xy.test(n),parse:n=>gg.test(n)?gg.parse(n):xy.test(n)?xy.parse(n):qM.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?gg.transform(n):xy.transform(n),getAnimatableNone:n=>{const e=yr.parse(n);return e.alpha=0,yr.transform(e)}},Uge=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pge(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(JP))==null?void 0:e.length)||0)+(((t=n.match(Uge))==null?void 0:t.length)||0)>0}const Aj="number",Sj="color",Lge="var",Oge="var(",y7="${}",Bge=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function b1(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const o=e.replace(Bge,l=>(yr.test(l)?(i.color.push(s),r.push(Sj),t.push(yr.parse(l))):l.startsWith(Oge)?(i.var.push(s),r.push(Lge),t.push(l)):(i.number.push(s),r.push(Aj),t.push(parseFloat(l))),++s,y7)).split(y7);return{values:t,split:o,indexes:i,types:r}}function Vge(n){return b1(n).values}function Dj({split:n,types:e}){const t=n.length;return i=>{let r="";for(let s=0;s<t;s++)if(r+=n[s],i[s]!==void 0){const a=e[s];a===Aj?r+=Jx(i[s]):a===Sj?r+=yr.transform(i[s]):r+=i[s]}return r}}function Wge(n){return Dj(b1(n))}const Hge=n=>typeof n=="number"?0:yr.test(n)?yr.getAnimatableNone(n):n,zge=(n,e)=>typeof n=="number"?e!=null&&e.trim().endsWith("/")?n:0:Hge(n);function Gge(n){const e=b1(n);return Dj(e)(e.values.map((i,r)=>zge(i,e.split[r])))}const nc={test:Pge,parse:Vge,createTransformer:Wge,getAnimatableNone:Gge};function kk(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function qge({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,a=0;if(!e)r=s=a=t;else{const o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;r=kk(l,o,n+1/3),s=kk(l,o,n),a=kk(l,o,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function _D(n,e){return t=>t>0?e:n}const Ii=(n,e,t)=>n+(e-n)*t,Mk=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},$ge=[qM,gg,xy],jge=n=>$ge.find(e=>e.test(n));function v7(n){const e=jge(n);if(!e)return!1;let t=e.parse(n);return e===xy&&(t=qge(t)),t}const _7=(n,e)=>{const t=v7(n),i=v7(e);if(!t||!i)return _D(n,e);const r={...t};return s=>(r.red=Mk(t.red,i.red,s),r.green=Mk(t.green,i.green,s),r.blue=Mk(t.blue,i.blue,s),r.alpha=Ii(t.alpha,i.alpha,s),gg.transform(r))},$M=new Set(["none","hidden"]);function Xge(n,e){return $M.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function Kge(n,e){return t=>Ii(n,e,t)}function ZP(n){return typeof n=="number"?Kge:typeof n=="string"?YP(n)?_D:yr.test(n)?_7:Qge:Array.isArray(n)?Cj:typeof n=="object"?yr.test(n)?_7:Yge:_D}function Cj(n,e){const t=[...n],i=t.length,r=n.map((s,a)=>ZP(s)(s,e[a]));return s=>{for(let a=0;a<i;a++)t[a]=r[a](s);return t}}function Yge(n,e){const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=ZP(n[r])(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}}function Jge(n,e){const t=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const s=e.types[r],a=n.indexes[s][i[s]],o=n.values[a]??0;t[r]=o,i[s]++}return t}const Qge=(n,e)=>{const t=nc.createTransformer(e),i=b1(n),r=b1(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?$M.has(n)&&!r.values.length||$M.has(e)&&!i.values.length?Xge(n,e):GT(Cj(Jge(i,r),r.values),t):_D(n,e)};function Ij(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Ii(n,e,t):ZP(n)(n,e)}const Zge=n=>{const e=({timestamp:t})=>n(t);return{start:(t=!0)=>vi.update(e,t),stop:()=>Zf(e),now:()=>xs.isProcessing?xs.timestamp:la.now()}},Rj=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let s=0;s<r;s++)i+=Math.round(n(s/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},xD=2e4;function e4(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e<xD;)e+=t,i=n.next(e);return e>=xD?1/0:e}function eme(n,e=100,t){const i=t({...n,keyframes:[0,e]}),r=Math.min(e4(i),xD);return{type:"keyframes",ease:s=>i.next(r*s).value/e,duration:ll(r)}}const Xi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function jM(n,e){return n*Math.sqrt(1-e*e)}const tme=12;function nme(n,e,t){let i=t;for(let r=1;r<tme;r++)i=i-n(i)/e(i);return i}const Fk=.001;function ime({duration:n=Xi.duration,bounce:e=Xi.bounce,velocity:t=Xi.velocity,mass:i=Xi.mass}){let r,s,a=1-e;a=cu(Xi.minDamping,Xi.maxDamping,a),n=cu(Xi.minDuration,Xi.maxDuration,ll(n)),a<1?(r=c=>{const h=c*a,f=h*n,p=h-t,y=jM(c,a),x=Math.exp(-f);return Fk-p/y*x},s=c=>{const f=c*a*n,p=f*t+t,y=Math.pow(a,2)*Math.pow(c,2)*n,x=Math.exp(-f),v=jM(Math.pow(c,2),a);return(-r(c)+Fk>0?-1:1)*((p-y)*x)/v}):(r=c=>{const h=Math.exp(-c*n),f=(c-t)*n+1;return-Fk+h*f},s=c=>{const h=Math.exp(-c*n),f=(t-c)*(n*n);return h*f});const o=5/n,l=nme(r,s,o);if(n=Ao(n),isNaN(l))return{stiffness:Xi.stiffness,damping:Xi.damping,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:a*2*Math.sqrt(i*c),duration:n}}}const rme=["duration","bounce"],sme=["stiffness","damping","mass"];function x7(n,e){return e.some(t=>n[t]!==void 0)}function ame(n){let e={velocity:Xi.velocity,stiffness:Xi.stiffness,damping:Xi.damping,mass:Xi.mass,isResolvedFromDuration:!1,...n};if(!x7(n,sme)&&x7(n,rme))if(e.velocity=0,n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,s=2*cu(.05,1,1-(n.bounce||0))*Math.sqrt(r);e={...e,mass:Xi.mass,stiffness:r,damping:s}}else{const t=ime({...n,velocity:0});e={...e,...t,mass:Xi.mass},e.isResolvedFromDuration=!0}return e}function bD(n=Xi.visualDuration,e=Xi.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const s=t.keyframes[0],a=t.keyframes[t.keyframes.length-1],o={done:!1,value:s},{stiffness:l,damping:c,mass:h,duration:f,velocity:p,isResolvedFromDuration:y}=ame({...t,velocity:-ll(t.velocity||0)}),x=p||0,v=c/(2*Math.sqrt(l*h)),_=a-s,E=ll(Math.sqrt(l/h)),w=Math.abs(_)<5;i||(i=w?Xi.restSpeed.granular:Xi.restSpeed.default),r||(r=w?Xi.restDelta.granular:Xi.restDelta.default);let A,N,k,F,C,M;if(v<1)k=jM(E,v),F=(x+v*E*_)/k,A=L=>{const H=Math.exp(-v*E*L);return a-H*(F*Math.sin(k*L)+_*Math.cos(k*L))},C=v*E*F+_*k,M=v*E*_-F*k,N=L=>Math.exp(-v*E*L)*(C*Math.sin(k*L)+M*Math.cos(k*L));else if(v===1){A=H=>a-Math.exp(-E*H)*(_+(x+E*_)*H);const L=x+E*_;N=H=>Math.exp(-E*H)*(E*L*H-x)}else{const L=E*Math.sqrt(v*v-1);A=B=>{const re=Math.exp(-v*E*B),q=Math.min(L*B,300);return a-re*((x+v*E*_)*Math.sinh(q)+L*_*Math.cosh(q))/L};const H=(x+v*E*_)/L,P=v*E*H-_*L,O=v*E*_-H*L;N=B=>{const re=Math.exp(-v*E*B),q=Math.min(L*B,300);return re*(P*Math.sinh(q)+O*Math.cosh(q))}}const R={calculatedDuration:y&&f||null,velocity:L=>Ao(N(L)),next:L=>{if(!y&&v<1){const P=Math.exp(-v*E*L),O=Math.sin(k*L),B=Math.cos(k*L),re=a-P*(F*O+_*B),q=Ao(P*(C*O+M*B));return o.done=Math.abs(q)<=i&&Math.abs(a-re)<=r,o.value=o.done?a:re,o}const H=A(L);if(y)o.done=L>=f;else{const P=Ao(N(L));o.done=Math.abs(P)<=i&&Math.abs(a-H)<=r}return o.value=o.done?a:H,o},toString:()=>{const L=Math.min(e4(R),xD),H=Rj(P=>R.next(L*P).value,L,30);return L+"ms "+H},toTransition:()=>{}};return R}bD.applyToOptions=n=>{const e=eme(n,100,bD);return n.ease=e.ease,n.duration=Ao(e.duration),n.type="keyframes",n};const ome=5;function Nj(n,e,t){const i=Math.max(e-ome,0);return uj(t-n(i),e-i)}function XM({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:h}){const f=n[0],p={done:!1,value:f},y=M=>o!==void 0&&M<o||l!==void 0&&M>l,x=M=>o===void 0?l:l===void 0||Math.abs(o-M)<Math.abs(l-M)?o:l;let v=t*e;const _=f+v,E=a===void 0?_:a(_);E!==_&&(v=E-f);const w=M=>-v*Math.exp(-M/i),A=M=>E+w(M),N=M=>{const R=w(M),L=A(M);p.done=Math.abs(R)<=c,p.value=p.done?E:L};let k,F;const C=M=>{y(p.value)&&(k=M,F=bD({keyframes:[p.value,x(p.value)],velocity:Nj(A,M,p.value),damping:r,stiffness:s,restDelta:c,restSpeed:h}))};return C(0),{calculatedDuration:null,next:M=>{let R=!1;return!F&&k===void 0&&(R=!0,N(M),C(M)),k!==void 0&&M>=k?F.next(M-k):(!R&&N(M),p)}}}function lme(n,e,t){const i=[],r=t||Qf.mix||Ij,s=n.length-1;for(let a=0;a<s;a++){let o=r(n[a],n[a+1]);if(e){const l=Array.isArray(e)?e[a]||cl:e;o=GT(l,o)}i.push(o)}return i}function cme(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const s=n.length;if($P(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const a=n[0]===n[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=lme(e,i,r),l=o.length,c=h=>{if(a&&h<n[0])return e[0];let f=0;if(l>1)for(;f<n.length-2&&!(h<n[f+1]);f++);const p=pb(n[f],n[f+1],h);return o[f](p)};return t?h=>c(cu(n[0],n[s-1],h)):c}function ume(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=pb(0,e,i);n.push(Ii(t,1,r))}}function hme(n){const e=[0];return ume(e,n.length-1),e}function dme(n,e){return n.map(t=>t*e)}function fme(n,e){return n.map(()=>e||_j).splice(0,n.length-1)}function Qx({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=bge(i)?i.map(p7):p7(i),s={done:!1,value:e[0]},a=dme(t&&t.length===e.length?t:hme(e),n),o=cme(a,e,{ease:Array.isArray(r)?r:fme(e,r)});return{calculatedDuration:n,next:l=>(s.value=o(l),s.done=l>=n,s)}}const pme=n=>n!==null;function iI(n,{repeat:e,repeatType:t="loop"},i,r=1){const s=n.filter(pme),o=r<0||e&&t!=="loop"&&e%2===1?0:s.length-1;return!o||i===void 0?s[o]:i}const gme={decay:XM,inertia:XM,tween:Qx,keyframes:Qx,spring:bD};function kj(n){typeof n.type=="string"&&(n.type=gme[n.type])}class t4{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const mme=n=>n/100;class TD extends t4{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var i,r;const{motionValue:t}=this.options;t&&t.updatedAt!==la.now()&&this.tick(la.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(i=this.options).onStop)==null||r.call(i))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;kj(e);const{type:t=Qx,repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:a=0}=e;let{keyframes:o}=e;const l=t||Qx;l!==Qx&&typeof o[0]!="number"&&(this.mixKeyframes=GT(mme,Ij(o[0],o[1])),o=[0,100]);const c=l({...e,keyframes:o});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=e4(c));const{calculatedDuration:h}=c;this.calculatedDuration=h,this.resolvedDuration=h+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:i,totalDuration:r,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:h,repeat:f,repeatType:p,repeatDelay:y,type:x,onUpdate:v,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const E=this.currentTime-c*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?E<0:E>r;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let A=this.currentTime,N=i;if(f){const M=Math.min(this.currentTime,r)/o;let R=Math.floor(M),L=M%1;!L&&M>=1&&(L=1),L===1&&R--,R=Math.min(R,f+1),!!(R%2)&&(p==="reverse"?(L=1-L,y&&(L-=y/o)):p==="mirror"&&(N=a)),A=cu(0,1,L)*o}let k;w?(this.delayState.value=h[0],k=this.delayState):k=N.next(A),s&&!w&&(k.value=s(k.value));let{done:F}=k;!w&&l!==null&&(F=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return C&&x!==XM&&(k.value=iI(h,this.options,_,this.speed)),v&&v(k.value),C&&this.finish(),k}then(e,t){return this.finished.then(e,t)}get duration(){return ll(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ll(e)}get time(){return ll(this.currentTime)}set time(e){e=Ao(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return Nj(i=>this.generator.next(i).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(la.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ll(this.currentTime))}play(){var r,s;if(this.isStopped)return;const{driver:e=Zge,startTime:t}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(s=(r=this.options).onPlay)==null||s.call(r);const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(la.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",(t=(e=this.options).onComplete)==null||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(t=(e=this.options).onCancel)==null||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(t=this.driver)==null||t.stop(),e.observe(this)}}function yme(n){for(let e=1;e<n.length;e++)n[e]??(n[e]=n[e-1])}const mg=n=>n*180/Math.PI,KM=n=>{const e=mg(Math.atan2(n[1],n[0]));return YM(e)},vme={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:KM,rotateZ:KM,skewX:n=>mg(Math.atan(n[1])),skewY:n=>mg(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},YM=n=>(n=n%360,n<0&&(n+=360),n),b7=KM,T7=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),E7=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),_me={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:T7,scaleY:E7,scale:n=>(T7(n)+E7(n))/2,rotateX:n=>YM(mg(Math.atan2(n[6],n[5]))),rotateY:n=>YM(mg(Math.atan2(-n[2],n[0]))),rotateZ:b7,rotate:b7,skewX:n=>mg(Math.atan(n[4])),skewY:n=>mg(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function JM(n){return n.includes("scale")?1:0}function QM(n,e){if(!n||n==="none")return JM(e);const t=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(t)i=_me,r=t;else{const o=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=vme,r=o}if(!r)return JM(e);const s=i[e],a=r[1].split(",").map(bme);return typeof s=="function"?s(a):a[s]}const xme=(n,e)=>{const{transform:t="none"}=getComputedStyle(n);return QM(t,e)};function bme(n){return parseFloat(n.trim())}const H1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z1=new Set(H1),w7=n=>n===W1||n===Pt,Tme=new Set(["x","y","z"]),Eme=H1.filter(n=>!Tme.has(n));function wme(n){const e=[];return Eme.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const zf={width:({x:n},{paddingLeft:e="0",paddingRight:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},height:({y:n},{paddingTop:e="0",paddingBottom:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:(n,{transform:e})=>QM(e,"x"),y:(n,{transform:e})=>QM(e,"y")};zf.translateX=zf.x;zf.translateY=zf.y;const Nm=new Set;let ZM=!1,eF=!1,tF=!1;function Mj(){if(eF){const n=Array.from(Nm).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=wme(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([s,a])=>{var o;(o=i.getValue(s))==null||o.set(a)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}eF=!1,ZM=!1,Nm.forEach(n=>n.complete(tF)),Nm.clear()}function Fj(){Nm.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(eF=!0)})}function Ame(){tF=!0,Fj(),Mj(),tF=!1}class n4{constructor(e,t,i,r,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Nm.add(this),ZM||(ZM=!0,vi.read(Fj),vi.resolveKeyframes(Mj))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;if(e[0]===null){const s=r==null?void 0:r.get(),a=e[e.length-1];if(s!==void 0)e[0]=s;else if(i&&t){const o=i.readValue(t,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),r&&s===void 0&&r.set(e[0])}yme(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Nm.delete(this)}cancel(){this.state==="scheduled"&&(Nm.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Sme=n=>n.startsWith("--");function Uj(n,e,t){Sme(e)?n.style.setProperty(e,t):n.style[e]=t}const Dme={};function Pj(n,e){const t=cj(n);return()=>Dme[e]??t()}const Cme=Pj(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Lj=Pj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Tx=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,A7={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tx([0,.65,.55,1]),circOut:Tx([.55,0,1,.45]),backIn:Tx([.31,.01,.66,-.59]),backOut:Tx([.33,1.53,.69,.99])};function Oj(n,e){if(n)return typeof n=="function"?Lj()?Rj(n,e):"ease-out":xj(n)?Tx(n):Array.isArray(n)?n.map(t=>Oj(t,e)||A7.easeOut):A7[n]}function Ime(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c=void 0){const h={[e]:t};l&&(h.offset=l);const f=Oj(o,r);Array.isArray(f)&&(h.easing=f);const p={delay:i,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),n.animate(h,p)}function Bj(n){return typeof n=="function"&&"applyToOptions"in n}function Rme({type:n,...e}){return Bj(n)&&Lj()?n.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Vj extends t4{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:i,keyframes:r,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=e,$P(typeof e.type!="string");const c=Rme(e);this.animation=Ime(t,i,r,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const h=iI(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(h),Uj(t,i,h),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;(t=(e=this.animation).finish)==null||t.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,i,r;const e=(t=this.options)==null?void 0:t.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((r=(i=this.animation).commitStyles)==null||r.call(i))}get duration(){var t,i;const e=((i=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:i.call(t).duration)||0;return ll(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ll(e)}get time(){return ll(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ao(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:i,observe:r}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Cme()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),i&&(this.animation.rangeEnd=i),cl):r(this)}}const Wj={anticipate:mj,backInOut:gj,circInOut:vj};function Nme(n){return n in Wj}function kme(n){typeof n.ease=="string"&&Nme(n.ease)&&(n.ease=Wj[n.ease])}const Uk=10;class Mme extends Vj{constructor(e){kme(e),kj(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:i,onComplete:r,element:s,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const o=new TD({...a,autoplay:!1}),l=Math.max(Uk,la.now()-this.startTime),c=cu(0,Uk,l-Uk),h=o.sample(l).value,{name:f}=this.options;s&&f&&Uj(s,f,h),t.setWithVelocity(o.sample(Math.max(0,l-c)).value,h,c),o.stop()}}const S7=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(nc.test(n)||n==="0")&&!n.startsWith("url("));function Fme(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function Ume(n,e,t,i){const r=n[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const s=n[n.length-1],a=S7(r,e),o=S7(s,e);return!a||!o?!1:Fme(n)||(t==="spring"||Bj(t))&&i}function nF(n){n.duration=0,n.type="keyframes"}const Hj=new Set(["opacity","clipPath","filter","transform"]),Pme=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Lme(n){for(let e=0;e<n.length;e++)if(typeof n[e]=="string"&&Pme.test(n[e]))return!0;return!1}const Ome=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bme=cj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Vme(n){var f;const{motionValue:e,name:t,repeatDelay:i,repeatType:r,damping:s,type:a,keyframes:o}=n;if(!(((f=e==null?void 0:e.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=e.owner.getProps();return Bme()&&t&&(Hj.has(t)||Ome.has(t)&&Lme(o))&&(t!=="transform"||!h)&&!c&&!i&&r!=="mirror"&&s!==0&&a!=="inertia"}const Wme=40;class Hme extends t4{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:l,motionValue:c,element:h,...f}){var x;super(),this.stop=()=>{var v,_;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(_=this.keyframeResolver)==null||_.cancel()},this.createdAt=la.now();const p={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:s,repeatType:a,name:l,motionValue:c,element:h,...f},y=(h==null?void 0:h.KeyframeResolver)||n4;this.keyframeResolver=new y(o,(v,_,E)=>this.onKeyframesResolved(v,_,p,!E),l,c,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,t,i,r){var E,w;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=la.now();let f=!0;Ume(e,s,a,o)||(f=!1,(Qf.instantAnimations||!l)&&(h==null||h(iI(e,i,t))),e[0]=e[e.length-1],nF(i),i.repeat=0);const y={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Wme?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},x=f&&!c&&Vme(y),v=(w=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:w.current;let _;if(x)try{_=new Mme({...y,element:v})}catch{_=new TD(y)}else _=new TD(y);_.finished.then(()=>{this.notifyFinished()}).catch(cl),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ame()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function zj(n,e,t,i=0,r=1){const s=Array.from(n).sort((c,h)=>c.sortNodePosition(h)).indexOf(e),a=n.size,o=(a-1)*i;return typeof t=="function"?t(s,a):r===1?s*i:o-s*i}const zme=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gme(n){const e=zme.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function Gj(n,e,t=1){const[i,r]=Gme(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const a=s.trim();return aj(a)?parseFloat(a):a}return YP(r)?Gj(r,e,t+1):r}const qme={type:"spring",stiffness:500,damping:25,restSpeed:10},$me=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),jme={type:"keyframes",duration:.8},Xme={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kme=(n,{keyframes:e})=>e.length>2?jme:z1.has(n)?n.startsWith("scale")?$me(e[1]):qme:Xme;function qj(n,e){if(n!=null&&n.inherit&&e){const{inherit:t,...i}=n;return{...e,...i}}return n}function i4(n,e){const t=(n==null?void 0:n[e])??(n==null?void 0:n.default)??n;return t!==n?qj(t,n):t}const Yme=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Jme(n){for(const e in n)if(!Yme.has(e))return!0;return!1}const r4=(n,e,t,i={},r,s)=>a=>{const o=i4(i,n)||{},l=o.delay||i.delay||0;let{elapsed:c=0}=i;c=c-Ao(l);const h={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-c,onUpdate:p=>{e.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:n,motionValue:e,element:s?void 0:r};Jme(o)||Object.assign(h,Kme(n,h)),h.duration&&(h.duration=Ao(h.duration)),h.repeatDelay&&(h.repeatDelay=Ao(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let f=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(nF(h),h.delay===0&&(f=!0)),(Qf.instantAnimations||Qf.skipAnimations||r!=null&&r.shouldSkipAnimations)&&(f=!0,nF(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,f&&!s&&e.get()!==void 0){const p=iI(h.keyframes,o);if(p!==void 0){vi.update(()=>{h.onUpdate(p),h.onComplete()});return}}return o.isSync?new TD(h):new Hme(h)};function D7(n){const e=[{},{}];return n==null||n.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function s4(n,e,t,i){if(typeof e=="function"){const[r,s]=D7(i);e=e(t!==void 0?t:n.custom,r,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,s]=D7(i);e=e(t!==void 0?t:n.custom,r,s)}return e}function km(n,e,t){const i=n.getProps();return s4(i,e,t!==void 0?t:i.custom,n)}const $j=new Set(["width","height","top","left","right","bottom",...H1]),C7=30,Qme=n=>!isNaN(parseFloat(n));class Zme{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const r=la.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=la.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Qme(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new jP);const i=this.events[e].add(t);return e==="change"?()=>{i(),vi.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=la.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>C7)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,C7);return uj(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,t;(e=this.dependents)==null||e.clear(),(t=this.events.destroy)==null||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function T1(n,e){return new Zme(n,e)}const iF=n=>Array.isArray(n);function e0e(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,T1(t))}function t0e(n){return iF(n)?n[n.length-1]||0:n}function n0e(n,e){const t=km(n,e);let{transitionEnd:i={},transition:r={},...s}=t||{};s={...s,...i};for(const a in s){const o=t0e(s[a]);e0e(n,a,o)}}const Cs=n=>!!(n&&n.getVelocity);function i0e(n){return!!(Cs(n)&&n.add)}function rF(n,e){const t=n.getValue("willChange");if(i0e(t))return t.add(e);if(!t&&Qf.WillChange){const i=new Qf.WillChange("auto");n.addValue("willChange",i),i.add(e)}}function a4(n){return n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const r0e="framerAppearId",jj="data-"+a4(r0e);function Xj(n){return n.props[jj]}function s0e({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function Kj(n,e,{delay:t=0,transitionOverride:i,type:r}={}){let{transition:s,transitionEnd:a,...o}=e;const l=n.getDefaultTransition();s=s?qj(s,l):l;const c=s==null?void 0:s.reduceMotion;i&&(s=i);const h=[],f=r&&n.animationState&&n.animationState.getState()[r];for(const p in o){const y=n.getValue(p,n.latestValues[p]??null),x=o[p];if(x===void 0||f&&s0e(f,p))continue;const v={delay:t,...i4(s||{},p)},_=y.get();if(_!==void 0&&!y.isAnimating()&&!Array.isArray(x)&&x===_&&!v.velocity){vi.update(()=>y.set(x));continue}let E=!1;if(window.MotionHandoffAnimation){const N=Xj(n);if(N){const k=window.MotionHandoffAnimation(N,p,vi);k!==null&&(v.startTime=k,E=!0)}}rF(n,p);const w=c??n.shouldReduceMotion;y.start(r4(p,y,x,w&&$j.has(p)?{type:!1}:v,n,E));const A=y.animation;A&&h.push(A)}if(a){const p=()=>vi.update(()=>{a&&n0e(n,a)});h.length?Promise.all(h).then(p):p()}return h}function sF(n,e,t={}){var l;const i=km(n,e,t.type==="exit"?(l=n.presenceContext)==null?void 0:l.custom:void 0);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(Kj(n,i,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(c=0)=>{const{delayChildren:h=0,staggerChildren:f,staggerDirection:p}=r;return a0e(n,e,c,h,f,p,t)}:()=>Promise.resolve(),{when:o}=r;if(o){const[c,h]=o==="beforeChildren"?[s,a]:[a,s];return c().then(()=>h())}else return Promise.all([s(),a(t.delay)])}function a0e(n,e,t=0,i=0,r=0,s=1,a){const o=[];for(const l of n.variantChildren)l.notify("AnimationStart",e),o.push(sF(l,e,{...a,delay:t+(typeof i=="function"?0:i)+zj(n.variantChildren,l,i,r,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function o0e(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>sF(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=sF(n,e,t);else{const r=typeof e=="function"?km(n,e,t.custom):e;i=Promise.all(Kj(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const l0e={test:n=>n==="auto",parse:n=>n},Yj=n=>e=>e.test(n),Jj=[W1,Pt,ru,Bd,Fge,Mge,l0e],I7=n=>Jj.find(Yj(n));function c0e(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||lj(n):!0}const u0e=new Set(["brightness","contrast","saturate","opacity"]);function h0e(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(JP)||[];if(!i)return n;const r=t.replace(i,"");let s=u0e.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const d0e=/\b([a-z-]*)\(.*?\)/gu,aF={...nc,getAnimatableNone:n=>{const e=n.match(d0e);return e?e.map(h0e).join(" "):n}},oF={...nc,getAnimatableNone:n=>{const e=nc.parse(n);return nc.createTransformer(n)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},R7={...W1,transform:Math.round},f0e={rotate:Bd,rotateX:Bd,rotateY:Bd,rotateZ:Bd,scale:qw,scaleX:qw,scaleY:qw,scaleZ:qw,skew:Bd,skewX:Bd,skewY:Bd,distance:Pt,translateX:Pt,translateY:Pt,translateZ:Pt,x:Pt,y:Pt,z:Pt,perspective:Pt,transformPerspective:Pt,opacity:gb,originX:m7,originY:m7,originZ:Pt},o4={borderWidth:Pt,borderTopWidth:Pt,borderRightWidth:Pt,borderBottomWidth:Pt,borderLeftWidth:Pt,borderRadius:Pt,borderTopLeftRadius:Pt,borderTopRightRadius:Pt,borderBottomRightRadius:Pt,borderBottomLeftRadius:Pt,width:Pt,maxWidth:Pt,height:Pt,maxHeight:Pt,top:Pt,right:Pt,bottom:Pt,left:Pt,inset:Pt,insetBlock:Pt,insetBlockStart:Pt,insetBlockEnd:Pt,insetInline:Pt,insetInlineStart:Pt,insetInlineEnd:Pt,padding:Pt,paddingTop:Pt,paddingRight:Pt,paddingBottom:Pt,paddingLeft:Pt,paddingBlock:Pt,paddingBlockStart:Pt,paddingBlockEnd:Pt,paddingInline:Pt,paddingInlineStart:Pt,paddingInlineEnd:Pt,margin:Pt,marginTop:Pt,marginRight:Pt,marginBottom:Pt,marginLeft:Pt,marginBlock:Pt,marginBlockStart:Pt,marginBlockEnd:Pt,marginInline:Pt,marginInlineStart:Pt,marginInlineEnd:Pt,fontSize:Pt,backgroundPositionX:Pt,backgroundPositionY:Pt,...f0e,zIndex:R7,fillOpacity:gb,strokeOpacity:gb,numOctaves:R7},p0e={...o4,color:yr,backgroundColor:yr,outlineColor:yr,fill:yr,stroke:yr,borderColor:yr,borderTopColor:yr,borderRightColor:yr,borderBottomColor:yr,borderLeftColor:yr,filter:aF,WebkitFilter:aF,mask:oF,WebkitMask:oF},Qj=n=>p0e[n],g0e=new Set([aF,oF]);function Zj(n,e){let t=Qj(n);return g0e.has(t)||(t=nc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const m0e=new Set(["auto","none","0"]);function y0e(n,e,t){let i=0,r;for(;i<n.length&&!r;){const s=n[i];typeof s=="string"&&!m0e.has(s)&&b1(s).values.length&&(r=n[i]),i++}if(r&&t)for(const s of e)n[s]=Zj(t,r)}class v0e extends n4{constructor(e,t,i,r,s){super(e,t,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let f=e[h];if(typeof f=="string"&&(f=f.trim(),YP(f))){const p=Gj(f,t.current);p!==void 0&&(e[h]=p),h===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!$j.has(i)||e.length!==2)return;const[r,s]=e,a=I7(r),o=I7(s),l=g7(r),c=g7(s);if(l!==c&&zf[i]){this.needsMeasurement=!0;return}if(a!==o)if(w7(a)&&w7(o))for(let h=0;h<e.length;h++){const f=e[h];typeof f=="string"&&(e[h]=parseFloat(f))}else zf[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||c0e(e[r]))&&i.push(r);i.length&&y0e(e,i,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zf[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){var o;const{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const s=i.length-1,a=i[s];i[s]=zf[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function eX(n,e,t){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;const r=(t==null?void 0:t[n])??i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n).filter(i=>i!=null)}const tX=(n,e)=>e&&typeof n=="number"?e.transform(n):n;function OA(n){return oj(n)&&"offsetHeight"in n&&!("ownerSVGElement"in n)}const{schedule:l4}=bj(queueMicrotask,!1),Fl={x:!1,y:!1};function nX(){return Fl.x||Fl.y}function _0e(n){return n==="x"||n==="y"?Fl[n]?null:(Fl[n]=!0,()=>{Fl[n]=!1}):Fl.x||Fl.y?null:(Fl.x=Fl.y=!0,()=>{Fl.x=Fl.y=!1})}function iX(n,e){const t=eX(n),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[t,r,()=>i.abort()]}function x0e(n){return!(n.pointerType==="touch"||nX())}function b0e(n,e,t={}){const[i,r,s]=iX(n,t);return i.forEach(a=>{let o=!1,l=!1,c;const h=()=>{a.removeEventListener("pointerleave",x)},f=_=>{c&&(c(_),c=void 0),h()},p=_=>{o=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,f(_))},y=()=>{o=!0,window.addEventListener("pointerup",p,r),window.addEventListener("pointercancel",p,r)},x=_=>{if(_.pointerType!=="touch"){if(o){l=!0;return}f(_)}},v=_=>{if(!x0e(_))return;l=!1;const E=e(a,_);typeof E=="function"&&(c=E,a.addEventListener("pointerleave",x,r))};a.addEventListener("pointerenter",v,r),a.addEventListener("pointerdown",y,r)}),s}const rX=(n,e)=>e?n===e?!0:rX(n,e.parentElement):!1,c4=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,T0e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function E0e(n){return T0e.has(n.tagName)||n.isContentEditable===!0}const w0e=new Set(["INPUT","SELECT","TEXTAREA"]);function A0e(n){return w0e.has(n.tagName)||n.isContentEditable===!0}const BA=new WeakSet;function N7(n){return e=>{e.key==="Enter"&&n(e)}}function Pk(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const S0e=(n,e)=>{const t=n.currentTarget;if(!t)return;const i=N7(()=>{if(BA.has(t))return;Pk(t,"down");const r=N7(()=>{Pk(t,"up")}),s=()=>Pk(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",s,e)});t.addEventListener("keydown",i,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",i),e)};function k7(n){return c4(n)&&!nX()}const M7=new WeakSet;function D0e(n,e,t={}){const[i,r,s]=iX(n,t),a=o=>{const l=o.currentTarget;if(!k7(o)||M7.has(o))return;BA.add(l),t.stopPropagation&&M7.add(o);const c=e(l,o),h=(y,x)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),BA.has(l)&&BA.delete(l),k7(y)&&typeof c=="function"&&c(y,{success:x})},f=y=>{h(y,l===window||l===document||t.useGlobalTarget||rX(l,y.target))},p=y=>{h(y,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",p,r)};return i.forEach(o=>{(t.useGlobalTarget?window:o).addEventListener("pointerdown",a,r),OA(o)&&(o.addEventListener("focus",c=>S0e(c,r)),!E0e(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function u4(n){return oj(n)&&"ownerSVGElement"in n}const VA=new WeakMap;let Vd;const sX=(n,e,t)=>(i,r)=>r&&r[0]?r[0][n+"Size"]:u4(i)&&"getBBox"in i?i.getBBox()[e]:i[t],C0e=sX("inline","width","offsetWidth"),I0e=sX("block","height","offsetHeight");function R0e({target:n,borderBoxSize:e}){var t;(t=VA.get(n))==null||t.forEach(i=>{i(n,{get width(){return C0e(n,e)},get height(){return I0e(n,e)}})})}function N0e(n){n.forEach(R0e)}function k0e(){typeof ResizeObserver>"u"||(Vd=new ResizeObserver(N0e))}function M0e(n,e){Vd||k0e();const t=eX(n);return t.forEach(i=>{let r=VA.get(i);r||(r=new Set,VA.set(i,r)),r.add(e),Vd==null||Vd.observe(i)}),()=>{t.forEach(i=>{const r=VA.get(i);r==null||r.delete(e),r!=null&&r.size||Vd==null||Vd.unobserve(i)})}}const WA=new Set;let by;function F0e(){by=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};WA.forEach(e=>e(n))},window.addEventListener("resize",by)}function U0e(n){return WA.add(n),by||F0e(),()=>{WA.delete(n),!WA.size&&typeof by=="function"&&(window.removeEventListener("resize",by),by=void 0)}}function F7(n,e){return typeof n=="function"?U0e(n):M0e(n,e)}function P0e(n){return u4(n)&&n.tagName==="svg"}const L0e=[...Jj,yr,nc],O0e=n=>L0e.find(Yj(n)),U7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ty=()=>({x:U7(),y:U7()}),P7=()=>({min:0,max:0}),Mr=()=>({x:P7(),y:P7()}),B0e=new WeakMap;function rI(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function mb(n){return typeof n=="string"||Array.isArray(n)}const h4=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],d4=["initial",...h4];function sI(n){return rI(n.animate)||d4.some(e=>mb(n[e]))}function aX(n){return!!(sI(n)||n.variants)}function V0e(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Cs(r))n.addValue(i,r);else if(Cs(s))n.addValue(i,T1(r,{owner:n}));else if(s!==r)if(n.hasValue(i)){const a=n.getValue(i);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=n.getStaticValue(i);n.addValue(i,T1(a!==void 0?a:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const lF={current:null},oX={current:!1},W0e=typeof window<"u";function H0e(){if(oX.current=!0,!!W0e)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>lF.current=n.matches;n.addEventListener("change",e),e()}else lF.current=!1}const L7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ED={};function lX(n){ED=n}function z0e(){return ED}class G0e{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,skipAnimations:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=n4,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=la.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,vi.render(this.render,!1,!0))};const{latestValues:c,renderState:h}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=h,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=sI(t),this.isVariantNode=aX(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(t,{},this);for(const y in p){const x=p[y];c[y]!==void 0&&Cs(x)&&x.set(c[y])}}mount(e){var t,i;if(this.hasBeenMounted)for(const r in this.initialValues)(t=this.values.get(r))==null||t.jump(this.initialValues[r]),this.latestValues[r]=this.initialValues[r];this.current=e,B0e.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(oX.current||H0e(),this.shouldReduceMotion=lF.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Zf(this.notifyUpdate),Zf(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const i=this.features[t];i&&(i.unmount(),i.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Hj.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:c,duration:h}=t.accelerate,f=new Vj({element:this.current,name:e,keyframes:o,times:l,ease:c,duration:Ao(h)}),p=a(f);this.valueSubscriptions.set(e,()=>{p(),f.cancel()});return}const i=z1.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&vi.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ED){const t=ED[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<L7.length;i++){const r=L7[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const s="on"+r,a=e[s];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=V0e(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=T1(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(aj(i)||lj(i))?i=parseFloat(i):!O0e(i)&&nc.test(t)&&(i=Zj(e,t)),this.setBaseTarget(e,Cs(i)?i.get():i)),Cs(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var s;const{initial:t}=this.props;let i;if(typeof t=="string"||typeof t=="object"){const a=s4(this.props,t,(s=this.presenceContext)==null?void 0:s.custom);a&&(i=a[e])}if(t&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Cs(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new jP),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){l4.render(this.render)}}class cX extends G0e{constructor(){super(...arguments),this.KeyframeResolver=v0e}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const i=e.style;return i?i[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Cs(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class yp{constructor(e){this.isMounted=!1,this.node=e}update(){}}function uX({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function q0e({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function $0e(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Lk(n){return n===void 0||n===1}function cF({scale:n,scaleX:e,scaleY:t}){return!Lk(n)||!Lk(e)||!Lk(t)}function ig(n){return cF(n)||hX(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function hX(n){return O7(n.x)||O7(n.y)}function O7(n){return n&&n!=="0%"}function wD(n,e,t){const i=n-t,r=e*i;return t+r}function B7(n,e,t,i,r){return r!==void 0&&(n=wD(n,r,i)),wD(n,t,i)+e}function uF(n,e=0,t=1,i,r){n.min=B7(n.min,e,t,i,r),n.max=B7(n.max,e,t,i,r)}function dX(n,{x:e,y:t}){uF(n.x,e.translate,e.scale,e.originPoint),uF(n.y,t.translate,t.scale,t.originPoint)}const V7=.999999999999,W7=1.0000000000001;function j0e(n,e,t,i=!1){var o;const r=t.length;if(!r)return;e.x=e.y=1;let s,a;for(let l=0;l<r;l++){s=t[l],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(tu(n.x,-s.scroll.offset.x),tu(n.y,-s.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,dX(n,a)),i&&ig(s.latestValues)&&HA(n,s.latestValues,(o=s.layout)==null?void 0:o.layoutBox))}e.x<W7&&e.x>V7&&(e.x=1),e.y<W7&&e.y>V7&&(e.y=1)}function tu(n,e){n.min+=e,n.max+=e}function H7(n,e,t,i,r=.5){const s=Ii(n.min,n.max,r);uF(n,e,t,s,i)}function z7(n,e){return typeof n=="string"?parseFloat(n)/100*(e.max-e.min):n}function HA(n,e,t){const i=t??n;H7(n.x,z7(e.x,i.x),e.scaleX,e.scale,e.originX),H7(n.y,z7(e.y,i.y),e.scaleY,e.scale,e.originY)}function fX(n,e){return uX($0e(n.getBoundingClientRect(),e))}function X0e(n,e,t){const i=fX(n,t),{scroll:r}=e;return r&&(tu(i.x,r.offset.x),tu(i.y,r.offset.y)),i}const K0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Y0e=H1.length;function J0e(n,e,t){let i="",r=!0;for(let s=0;s<Y0e;s++){const a=H1[s],o=n[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const c=parseFloat(o);l=a.startsWith("scale")?c===1:c===0}if(!l||t){const c=tX(o,o4[a]);if(!l){r=!1;const h=K0e[a]||a;i+=`${h}(${c}) `}t&&(e[a]=c)}}return i=i.trim(),t?i=t(e,r?"":i):r&&(i="none"),i}function f4(n,e,t){const{style:i,vars:r,transformOrigin:s}=n;let a=!1,o=!1;for(const l in e){const c=e[l];if(z1.has(l)){a=!0;continue}else if(Ej(l)){r[l]=c;continue}else{const h=tX(c,o4[l]);l.startsWith("origin")?(o=!0,s[l]=h):i[l]=h}}if(e.transform||(a||t?i.transform=J0e(e,n.transform,t):i.transform&&(i.transform="none")),o){const{originX:l="50%",originY:c="50%",originZ:h=0}=s;i.transformOrigin=`${l} ${c} ${h}`}}function pX(n,{style:e,vars:t},i,r){const s=n.style;let a;for(a in e)s[a]=e[a];r==null||r.applyProjectionStyles(s,i);for(a in t)s.setProperty(a,t[a])}function G7(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const nx={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Pt.test(n))n=parseFloat(n);else return n;const t=G7(n,e.target.x),i=G7(n,e.target.y);return`${t}% ${i}%`}},Q0e={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=nc.parse(n);if(r.length>5)return i;const s=nc.createTransformer(n),a=typeof r[0]!="number"?1:0,o=t.x.scale*e.x,l=t.y.scale*e.y;r[0+a]/=o,r[1+a]/=l;const c=Ii(o,l,.5);return typeof r[2+a]=="number"&&(r[2+a]/=c),typeof r[3+a]=="number"&&(r[3+a]/=c),s(r)}},hF={borderRadius:{...nx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nx,borderTopRightRadius:nx,borderBottomLeftRadius:nx,borderBottomRightRadius:nx,boxShadow:Q0e};function gX(n,{layout:e,layoutId:t}){return z1.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!hF[n]||n==="opacity")}function p4(n,e,t){var a;const i=n.style,r=e==null?void 0:e.style,s={};if(!i)return s;for(const o in i)(Cs(i[o])||r&&Cs(r[o])||gX(o,n)||((a=t==null?void 0:t.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function Z0e(n){return window.getComputedStyle(n)}class eye extends cX{constructor(){super(...arguments),this.type="html",this.renderInstance=pX}readValueFromInstance(e,t){var i;if(z1.has(t))return(i=this.projection)!=null&&i.isProjecting?JM(t):xme(e,t);{const r=Z0e(e),s=(Ej(t)?r.getPropertyValue(t):r[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return fX(e,t)}build(e,t,i){f4(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return p4(e,t,i)}}const tye={offset:"stroke-dashoffset",array:"stroke-dasharray"},nye={offset:"strokeDashoffset",array:"strokeDasharray"};function iye(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?tye:nye;n[s.offset]=`${-i}`,n[s.array]=`${e} ${t}`}const rye=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function mX(n,{attrX:e,attrY:t,attrScale:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...o},l,c,h){if(f4(n,o,c),l){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:f,style:p}=n;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete f.transformBox);for(const y of rye)f[y]!==void 0&&(p[y]=f[y],delete f[y]);e!==void 0&&(f.x=e),t!==void 0&&(f.y=t),i!==void 0&&(f.scale=i),r!==void 0&&iye(f,r,s,a,!1)}const yX=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),vX=n=>typeof n=="string"&&n.toLowerCase()==="svg";function sye(n,e,t,i){pX(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(yX.has(r)?r:a4(r),e.attrs[r])}function _X(n,e,t){const i=p4(n,e,t);for(const r in n)if(Cs(n[r])||Cs(e[r])){const s=H1.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}class aye extends cX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mr}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(z1.has(t)){const i=Qj(t);return i&&i.default||0}return t=yX.has(t)?t:a4(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return _X(e,t,i)}build(e,t,i){mX(e,t,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,t,i,r){sye(e,t,i,r)}mount(e){this.isSVGTag=vX(e.tagName),super.mount(e)}}const oye=d4.length;function xX(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?xX(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;t<oye;t++){const i=d4[t],r=n.props[i];(mb(r)||r===!1)&&(e[i]=r)}return e}function bX(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}const lye=[...h4].reverse(),cye=h4.length;function uye(n){return e=>Promise.all(e.map(({animation:t,options:i})=>o0e(n,t,i)))}function hye(n){let e=uye(n),t=q7(),i=!0,r=!1;const s=c=>(h,f)=>{var y;const p=km(n,f,c==="exit"?(y=n.presenceContext)==null?void 0:y.custom:void 0);if(p){const{transition:x,transitionEnd:v,..._}=p;h={...h,..._,...v}}return h};function a(c){e=c(n)}function o(c){const{props:h}=n,f=xX(n.parent)||{},p=[],y=new Set;let x={},v=1/0;for(let E=0;E<cye;E++){const w=lye[E],A=t[w],N=h[w]!==void 0?h[w]:f[w],k=mb(N),F=w===c?A.isActive:null;F===!1&&(v=E);let C=N===f[w]&&N!==h[w]&&k;if(C&&(i||r)&&n.manuallyAnimateOnMount&&(C=!1),A.protectedKeys={...x},!A.isActive&&F===null||!N&&!A.prevProp||rI(N)||typeof N=="boolean")continue;if(w==="exit"&&A.isActive&&F!==!0){A.prevResolvedValues&&(x={...x,...A.prevResolvedValues});continue}const M=dye(A.prevProp,N);let R=M||w===c&&A.isActive&&!C&&k||E>v&&k,L=!1;const H=Array.isArray(N)?N:[N];let P=H.reduce(s(w),{});F===!1&&(P={});const{prevResolvedValues:O={}}=A,B={...O,...P},re=oe=>{R=!0,y.has(oe)&&(L=!0,y.delete(oe)),A.needsAnimating[oe]=!0;const ue=n.getValue(oe);ue&&(ue.liveStyle=!1)};for(const oe in B){const ue=P[oe],ge=O[oe];if(x.hasOwnProperty(oe))continue;let j=!1;iF(ue)&&iF(ge)?j=!bX(ue,ge):j=ue!==ge,j?ue!=null?re(oe):y.add(oe):ue!==void 0&&y.has(oe)?re(oe):A.protectedKeys[oe]=!0}A.prevProp=N,A.prevResolvedValues=P,A.isActive&&(x={...x,...P}),(i||r)&&n.blockInitialAnimation&&(R=!1);const q=C&&M;R&&(!q||L)&&p.push(...H.map(oe=>{const ue={type:w};if(typeof oe=="string"&&(i||r)&&!q&&n.manuallyAnimateOnMount&&n.parent){const{parent:ge}=n,j=km(ge,oe);if(ge.enteringChildren&&j){const{delayChildren:G}=j.transition||{};ue.delay=zj(ge.enteringChildren,n,G)}}return{animation:oe,options:ue}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const w=km(n,Array.isArray(h.initial)?h.initial[0]:h.initial);w&&w.transition&&(E.transition=w.transition)}y.forEach(w=>{const A=n.getBaseTarget(w),N=n.getValue(w);N&&(N.liveStyle=!0),E[w]=A??null}),p.push({animation:E})}let _=!!p.length;return i&&(h.initial===!1||h.initial===h.animate)&&!n.manuallyAnimateOnMount&&(_=!1),i=!1,r=!1,_?e(p):Promise.resolve()}function l(c,h){var p;if(t[c].isActive===h)return Promise.resolve();(p=n.variantChildren)==null||p.forEach(y=>{var x;return(x=y.animationState)==null?void 0:x.setActive(c,h)}),t[c].isActive=h;const f=o(c);for(const y in t)t[y].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>t,reset:()=>{t=q7(),r=!0}}}function dye(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!bX(e,n):!1}function Jp(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function q7(){return{animate:Jp(!0),whileInView:Jp(),whileHover:Jp(),whileTap:Jp(),whileDrag:Jp(),whileFocus:Jp(),exit:Jp()}}function dF(n,e){n.min=e.min,n.max=e.max}function Cl(n,e){dF(n.x,e.x),dF(n.y,e.y)}function $7(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}const TX=1e-4,fye=1-TX,pye=1+TX,EX=.01,gye=0-EX,mye=0+EX;function ca(n){return n.max-n.min}function yye(n,e,t){return Math.abs(n-e)<=t}function j7(n,e,t,i=.5){n.origin=i,n.originPoint=Ii(e.min,e.max,n.origin),n.scale=ca(t)/ca(e),n.translate=Ii(t.min,t.max,n.origin)-n.originPoint,(n.scale>=fye&&n.scale<=pye||isNaN(n.scale))&&(n.scale=1),(n.translate>=gye&&n.translate<=mye||isNaN(n.translate))&&(n.translate=0)}function Zx(n,e,t,i){j7(n.x,e.x,t.x,i?i.originX:void 0),j7(n.y,e.y,t.y,i?i.originY:void 0)}function X7(n,e,t,i=0){const r=i?Ii(t.min,t.max,i):t.min;n.min=r+e.min,n.max=n.min+ca(e)}function vye(n,e,t,i){X7(n.x,e.x,t.x,i==null?void 0:i.x),X7(n.y,e.y,t.y,i==null?void 0:i.y)}function K7(n,e,t,i=0){const r=i?Ii(t.min,t.max,i):t.min;n.min=e.min-r,n.max=n.min+ca(e)}function AD(n,e,t,i){K7(n.x,e.x,t.x,i==null?void 0:i.x),K7(n.y,e.y,t.y,i==null?void 0:i.y)}function Y7(n,e,t,i,r){return n-=e,n=wD(n,1/t,i),r!==void 0&&(n=wD(n,1/r,i)),n}function _ye(n,e=0,t=1,i=.5,r,s=n,a=n){if(ru.test(e)&&(e=parseFloat(e),e=Ii(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=Ii(s.min,s.max,i);n===s&&(o-=e),n.min=Y7(n.min,e,t,o,r),n.max=Y7(n.max,e,t,o,r)}function J7(n,e,[t,i,r],s,a){_ye(n,e[t],e[i],e[r],e.scale,s,a)}const xye=["x","scaleX","originX"],bye=["y","scaleY","originY"];function Q7(n,e,t,i){J7(n.x,e,xye,t?t.x:void 0,i?i.x:void 0),J7(n.y,e,bye,t?t.y:void 0,i?i.y:void 0)}function Z7(n){return n.translate===0&&n.scale===1}function wX(n){return Z7(n.x)&&Z7(n.y)}function eV(n,e){return n.min===e.min&&n.max===e.max}function Tye(n,e){return eV(n.x,e.x)&&eV(n.y,e.y)}function tV(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function AX(n,e){return tV(n.x,e.x)&&tV(n.y,e.y)}function nV(n){return ca(n.x)/ca(n.y)}function iV(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}function Cc(n){return[n("x"),n("y")]}function Eye(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y,a=(t==null?void 0:t.z)||0;if((r||s||a)&&(i=`translate3d(${r}px, ${s}px, ${a}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:c,rotate:h,rotateX:f,rotateY:p,skewX:y,skewY:x}=t;c&&(i=`perspective(${c}px) ${i}`),h&&(i+=`rotate(${h}deg) `),f&&(i+=`rotateX(${f}deg) `),p&&(i+=`rotateY(${p}deg) `),y&&(i+=`skewX(${y}deg) `),x&&(i+=`skewY(${x}deg) `)}const o=n.x.scale*e.x,l=n.y.scale*e.y;return(o!==1||l!==1)&&(i+=`scale(${o}, ${l})`),i||"none"}const SX=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],wye=SX.length,rV=n=>typeof n=="string"?parseFloat(n):n,sV=n=>typeof n=="number"||Pt.test(n);function Aye(n,e,t,i,r,s){r?(n.opacity=Ii(0,t.opacity??1,Sye(i)),n.opacityExit=Ii(e.opacity??1,0,Dye(i))):s&&(n.opacity=Ii(e.opacity??1,t.opacity??1,i));for(let a=0;a<wye;a++){const o=SX[a];let l=aV(e,o),c=aV(t,o);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||sV(l)===sV(c)?(n[o]=Math.max(Ii(rV(l),rV(c),i),0),(ru.test(c)||ru.test(l))&&(n[o]+="%")):n[o]=c}(e.rotate||t.rotate)&&(n.rotate=Ii(e.rotate||0,t.rotate||0,i))}function aV(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const Sye=DX(0,.5,yj),Dye=DX(.5,.95,cl);function DX(n,e,t){return i=>i<n?0:i>e?1:t(pb(n,e,i))}function Cye(n,e,t){const i=Cs(n)?n:T1(n);return i.start(r4("",i,e,t)),i.animation}function yb(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const Iye=(n,e)=>n.depth-e.depth;class Rye{constructor(){this.children=[],this.isDirty=!1}add(e){qP(this.children,e),this.isDirty=!0}remove(e){vD(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Iye),this.isDirty=!1,this.children.forEach(e)}}function Nye(n,e){const t=la.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(Zf(i),n(s-e))};return vi.setup(i,!0),()=>Zf(i)}function zA(n){return Cs(n)?n.get():n}class kye{constructor(){this.members=[]}add(e){qP(this.members,e);for(let t=this.members.length-1;t>=0;t--){const i=this.members[t];if(i===e||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(vD(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(vD(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){var t;for(let i=this.members.indexOf(e)-1;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1&&((t=r.instance)==null?void 0:t.isConnected)!==!1)return this.promote(r),!0}return!1}promote(e,t){var r;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:a}=e.options;(s===void 0||s!==a)&&(e.resumeFrom=i,t&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),(r=e.root)!=null&&r.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,i,r,s,a;(i=(t=e.options).onExitComplete)==null||i.call(t),(a=(r=e.resumingFrom)==null?void 0:(s=r.options).onExitComplete)==null||a.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const GA={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ok=["","X","Y","Z"],Mye=1e3;let Fye=0;function Bk(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function CX(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=Xj(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",vi,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&CX(i)}function IX({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},o=e==null?void 0:e()){this.id=Fye++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Lye),this.nodes.forEach(zye),this.nodes.forEach(Gye),this.nodes.forEach(Oye)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rye)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new jP),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=u4(a)&&!P0e(a),this.instance=a;const{layoutId:o,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),n){let h,f=0;const p=()=>this.root.updateBlockedByResize=!1;vi.read(()=>{f=window.innerWidth}),n(a,()=>{const y=window.innerWidth;y!==f&&(f=y,this.root.updateBlockedByResize=!0,h&&h(),h=Nye(p,250),GA.hasAnimatedSinceResize&&(GA.hasAnimatedSinceResize=!1,this.nodes.forEach(cV)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&c&&(o||l)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||c.getDefaultTransition()||Kye,{onLayoutAnimationStart:v,onLayoutAnimationComplete:_}=c.getProps(),E=!this.targetLayout||!AX(this.targetLayout,y),w=!f&&p;if(this.options.layoutRoot||this.resumeFrom||w||f&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const A={...i4(x,"layout"),onPlay:v,onComplete:_};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A),this.setAnimationOrigin(h,w)}else f||cV(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Zf(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qye),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&CX(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const f=this.path[h];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Vye),this.nodes.forEach(oV);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(lV);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Wye),this.nodes.forEach(Hye),this.nodes.forEach(Uye),this.nodes.forEach(Pye)):this.nodes.forEach(lV),this.clearAllSnapshots();const o=la.now();xs.delta=cu(0,1e3/60,o-xs.timestamp),xs.timestamp=o,xs.isProcessing=!0,Rk.update.process(xs),Rk.preRender.process(xs),Rk.render.process(xs),xs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,l4.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Bye),this.sharedNodes.forEach($ye)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ca(this.snapshot.measuredBox.x)&&!ca(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Mr()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!wX(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,h=c!==this.prevTransformTemplateValue;a&&this.instance&&(o||ig(this.latestValues)||h)&&(r(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),Yye(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return Mr();const o=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Jye))){const{scroll:h}=this.root;h&&(tu(o.x,h.offset.x),tu(o.y,h.offset.y))}return o}removeElementScroll(a){var l;const o=Mr();if(Cl(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let c=0;c<this.path.length;c++){const h=this.path[c],{scroll:f,options:p}=h;h!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&Cl(o,a),tu(o.x,f.offset.x),tu(o.y,f.offset.y))}return o}applyTransform(a,o=!1,l){var h,f;const c=l||Mr();Cl(c,a);for(let p=0;p<this.path.length;p++){const y=this.path[p];!o&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(tu(c.x,-y.scroll.offset.x),tu(c.y,-y.scroll.offset.y)),ig(y.latestValues)&&HA(c,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return ig(this.latestValues)&&HA(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(a){var l;const o=Mr();Cl(o,a);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!ig(h.latestValues))continue;let f;h.instance&&(cF(h.latestValues)&&h.updateSnapshot(),f=Mr(),Cl(f,h.measurePageBox())),Q7(o,h.latestValues,(l=h.snapshot)==null?void 0:l.layoutBox,f)}return ig(this.latestValues)&&Q7(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!this.layout||!(h||f))return;this.resolvedRelativeTargetAt=xs.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Mr(),this.targetWithTransforms=Mr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vye(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Cl(this.target,this.layout.layoutBox),dX(this.target,this.targetDelta)):Cl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||cF(this.parent.latestValues)||hX(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mr(),this.relativeTargetOrigin=Mr(),AD(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),Cl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===xs.timestamp&&(l=!1),l)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;Cl(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;j0e(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Mr());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($7(this.prevProjectionDelta.x,this.projectionDelta.x),$7(this.prevProjectionDelta.y,this.projectionDelta.y)),Zx(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!iV(this.projectionDelta.x,this.prevProjectionDelta.x)||!iV(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ty(),this.projectionDelta=Ty(),this.projectionDeltaWithTransform=Ty()}setAnimationOrigin(a,o=!1){const l=this.snapshot,c=l?l.latestValues:{},h={...this.latestValues},f=Ty();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const p=Mr(),y=l?l.source:void 0,x=this.layout?this.layout.source:void 0,v=y!==x,_=this.getStack(),E=!_||_.members.length<=1,w=!!(v&&!E&&this.options.crossfade===!0&&!this.path.some(Xye));this.animationProgress=0;let A;this.mixTargetDelta=N=>{const k=N/1e3;uV(f.x,a.x,k),uV(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(AD(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jye(this.relativeTarget,this.relativeTargetOrigin,p,k),A&&Tye(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Mr()),Cl(A,this.relativeTarget)),v&&(this.animationValues=h,Aye(h,c,this.latestValues,k,w,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,c;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Zf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vi.update(()=>{GA.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=T1(0)),this.motionValue.jump(0,!1),this.currentAnimation=Cye(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mye),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:c,latestValues:h}=a;if(!(!o||!l||!c)){if(this!==a&&this.layout&&c&&RX(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Mr();const f=ca(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const p=ca(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+p}Cl(o,l),HA(o,h),Zx(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new kye),this.sharedNodes.get(a).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const c={};l.z&&Bk("z",a,c,this.animationValues);for(let h=0;h<Ok.length;h++)Bk(`rotate${Ok[h]}`,a,c,this.animationValues),Bk(`skew${Ok[h]}`,a,c,this.animationValues);a.render();for(const h in c)a.setStaticValue(h,c[h]),this.animationValues&&(this.animationValues[h]=c[h]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=zA(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=zA(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ig(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Eye(this.projectionDeltaWithTransform,this.treeScale,h);l&&(f=l(h,f)),a.transform=f;const{x:p,y}=this.projectionDelta;a.transformOrigin=`${p.origin*100}% ${y.origin*100}% 0`,c.animationValues?a.opacity=c===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=c===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in hF){if(h[x]===void 0)continue;const{correct:v,applyTo:_,isCSSVariable:E}=hF[x],w=f==="none"?h[x]:v(h[x],c);if(_){const A=_.length;for(let N=0;N<A;N++)a[_[N]]=w}else E?this.options.visualElement.renderState.vars[x]=w:a[x]=w}this.options.layoutId&&(a.pointerEvents=c===this?zA(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(oV),this.root.sharedNodes.clear()}}}function Uye(n){n.updateLayout()}function Pye(n){var t;const e=((t=n.resumeFrom)==null?void 0:t.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&e&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,a=e.source!==n.layout.source;if(s==="size")Cc(f=>{const p=a?e.measuredBox[f]:e.layoutBox[f],y=ca(p);p.min=i[f].min,p.max=p.min+y});else if(s==="x"||s==="y"){const f=s==="x"?"y":"x";dF(a?e.measuredBox[f]:e.layoutBox[f],i[f])}else RX(s,e.layoutBox,i)&&Cc(f=>{const p=a?e.measuredBox[f]:e.layoutBox[f],y=ca(i[f]);p.max=p.min+y,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[f].max=n.relativeTarget[f].min+y)});const o=Ty();Zx(o,i,e.layoutBox);const l=Ty();a?Zx(l,n.applyTransform(r,!0),e.measuredBox):Zx(l,i,e.layoutBox);const c=!wX(o);let h=!1;if(!n.resumeFrom){const f=n.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:y}=f;if(p&&y){const x=n.options.layoutAnchor||void 0,v=Mr();AD(v,e.layoutBox,p.layoutBox,x);const _=Mr();AD(_,i,y.layoutBox,x),AX(v,_)||(h=!0),f.options.layoutRoot&&(n.relativeTarget=_,n.relativeTargetOrigin=v,n.relativeParent=f)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:h})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function Lye(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function Oye(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Bye(n){n.clearSnapshot()}function oV(n){n.clearMeasurements()}function Vye(n){n.isLayoutDirty=!0,n.updateLayout()}function lV(n){n.isLayoutDirty=!1}function Wye(n){n.isAnimationBlocked&&n.layout&&!n.isLayoutDirty&&(n.snapshot=n.layout,n.isLayoutDirty=!0)}function Hye(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function cV(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function zye(n){n.resolveTargetDelta()}function Gye(n){n.calcProjection()}function qye(n){n.resetSkewAndRotation()}function $ye(n){n.removeLeadSnapshot()}function uV(n,e,t){n.translate=Ii(e.translate,0,t),n.scale=Ii(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function hV(n,e,t,i){n.min=Ii(e.min,t.min,i),n.max=Ii(e.max,t.max,i)}function jye(n,e,t,i){hV(n.x,e.x,t.x,i),hV(n.y,e.y,t.y,i)}function Xye(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Kye={duration:.45,ease:[.4,0,.1,1]},dV=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),fV=dV("applewebkit/")&&!dV("chrome/")?Math.round:cl;function pV(n){n.min=fV(n.min),n.max=fV(n.max)}function Yye(n){pV(n.x),pV(n.y)}function RX(n,e,t){return n==="position"||n==="preserve-aspect"&&!yye(nV(e),nV(t),.2)}function Jye(n){var e;return n!==n.root&&((e=n.scroll)==null?void 0:e.wasRoot)}const Qye=IX({attachResizeListener:(n,e)=>yb(n,"resize",e),measureScroll:()=>{var n,e;return{x:document.documentElement.scrollLeft||((n=document.body)==null?void 0:n.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Vk={current:void 0},NX=IX({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Vk.current){const n=new Qye({});n.mount(window),n.setOptions({layoutScroll:!0}),Vk.current=n}return Vk.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),g4=Se.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function gV(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Zye(...n){return e=>{let t=!1;const i=n.map(r=>{const s=gV(r,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let r=0;r<i.length;r++){const s=i[r];typeof s=="function"?s():gV(n[r],null)}}}}function eve(...n){return Se.useCallback(Zye(...n),n)}class tve extends Se.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(OA(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=t.offsetParent,r=OA(i)&&i.offsetWidth||0,s=OA(i)&&i.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left,o.bottom=s-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function nve({children:n,isPresent:e,anchorX:t,anchorY:i,root:r,pop:s}){var p;const a=Se.useId(),o=Se.useRef(null),l=Se.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=Se.useContext(g4),h=((p=n.props)==null?void 0:p.ref)??(n==null?void 0:n.ref),f=eve(o,h);return Se.useInsertionEffect(()=>{const{width:y,height:x,top:v,left:_,right:E,bottom:w}=l.current;if(e||s===!1||!o.current||!y||!x)return;const A=t==="left"?`left: ${_}`:`right: ${E}`,N=i==="bottom"?`bottom: ${w}`:`top: ${v}`;o.current.dataset.motionPopId=a;const k=document.createElement("style");c&&(k.nonce=c);const F=r??document.head;return F.appendChild(k),k.sheet&&k.sheet.insertRule(`
          [data-motion-pop-id="${a}"] {
            position: absolute !important;
            width: ${y}px !important;
            height: ${x}px !important;
            ${A}px !important;
            ${N}px !important;
          }
        `),()=>{var C;(C=o.current)==null||C.removeAttribute("data-motion-pop-id"),F.contains(k)&&F.removeChild(k)}},[e]),J.jsx(tve,{isPresent:e,childRef:o,sizeRef:l,pop:s,children:s===!1?n:Se.cloneElement(n,{ref:f})})}const ive=({children:n,initial:e,isPresent:t,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:l,root:c})=>{const h=GP(rve),f=Se.useId();let p=!0,y=Se.useMemo(()=>(p=!1,{id:f,initial:e,isPresent:t,custom:r,onExitComplete:x=>{h.set(x,!0);for(const v of h.values())if(!v)return;i&&i()},register:x=>(h.set(x,!1),()=>h.delete(x))}),[t,h,i]);return s&&p&&(y={...y}),Se.useMemo(()=>{h.forEach((x,v)=>h.set(v,!1))},[t]),Se.useEffect(()=>{!t&&!h.size&&i&&i()},[t]),n=J.jsx(nve,{pop:a==="popLayout",isPresent:t,anchorX:o,anchorY:l,root:c,children:n}),J.jsx(nI.Provider,{value:y,children:n})};function rve(){return new Map}function kX(n=!0){const e=Se.useContext(nI);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:i,register:r}=e,s=Se.useId();Se.useEffect(()=>{if(n)return r(s)},[n]);const a=Se.useCallback(()=>n&&i&&i(s),[s,i,n]);return!t&&i?[!1,a]:[!0]}const $w=n=>n.key||"";function mV(n){const e=[];return Se.Children.forEach(n,t=>{Se.isValidElement(t)&&e.push(t)}),e}const fF=({children:n,custom:e,initial:t=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:c})=>{const[h,f]=kX(a),p=Se.useMemo(()=>mV(n),[n]),y=a&&!h?[]:p.map($w),x=Se.useRef(!0),v=Se.useRef(p),_=GP(()=>new Map),E=Se.useRef(new Set),[w,A]=Se.useState(p),[N,k]=Se.useState(p);sj(()=>{x.current=!1,v.current=p;for(let M=0;M<N.length;M++){const R=$w(N[M]);y.includes(R)?(_.delete(R),E.current.delete(R)):_.get(R)!==!0&&_.set(R,!1)}},[N,y.length,y.join("-")]);const F=[];if(p!==w){let M=[...p];for(let R=0;R<N.length;R++){const L=N[R],H=$w(L);y.includes(H)||(M.splice(R,0,L),F.push(L))}return s==="wait"&&F.length&&(M=F),k(mV(M)),A(p),null}const{forceRender:C}=Se.useContext(zP);return J.jsx(J.Fragment,{children:N.map(M=>{const R=$w(M),L=a&&!h?!1:p===N||y.includes(R),H=()=>{if(E.current.has(R))return;if(_.has(R))E.current.add(R),_.set(R,!0);else return;let P=!0;_.forEach(O=>{O||(P=!1)}),P&&(C==null||C(),k(v.current),a&&(f==null||f()),i&&i())};return J.jsx(ive,{isPresent:L,initial:!x.current||t?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:c,onExitComplete:L?void 0:H,anchorX:o,anchorY:l,children:M},R)})})},MX=Se.createContext({strict:!1}),yV={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let vV=!1;function sve(){if(vV)return;const n={};for(const e in yV)n[e]={isEnabled:t=>yV[e].some(i=>!!t[i])};lX(n),vV=!0}function FX(){return sve(),z0e()}function ave(n){const e=FX();for(const t in n)e[t]={...e[t],...n[t]};lX(e)}const ove=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function SD(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||ove.has(n)}let UX=n=>!SD(n);function lve(n){typeof n=="function"&&(UX=e=>e.startsWith("on")?!SD(e):n(e))}try{lve(require("@emotion/is-prop-valid").default)}catch{}function cve(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||Cs(n[r])||(UX(r)||t===!0&&SD(r)||!e&&!SD(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}const aI=Se.createContext({});function uve(n,e){if(sI(n)){const{initial:t,animate:i}=n;return{initial:t===!1||mb(t)?t:void 0,animate:mb(i)?i:void 0}}return n.inherit!==!1?e:{}}function hve(n){const{initial:e,animate:t}=uve(n,Se.useContext(aI));return Se.useMemo(()=>({initial:e,animate:t}),[_V(e),_V(t)])}function _V(n){return Array.isArray(n)?n.join(" "):n}const m4=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function PX(n,e,t){for(const i in e)!Cs(e[i])&&!gX(i,t)&&(n[i]=e[i])}function dve({transformTemplate:n},e){return Se.useMemo(()=>{const t=m4();return f4(t,e,n),Object.assign({},t.vars,t.style)},[e])}function fve(n,e){const t=n.style||{},i={};return PX(i,t,n),Object.assign(i,dve(n,e)),i}function pve(n,e){const t={},i=fve(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const LX=()=>({...m4(),attrs:{}});function gve(n,e,t,i){const r=Se.useMemo(()=>{const s=LX();return mX(s,e,vX(i),n.transformTemplate,n.style),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};PX(s,n.style,n),r.style={...s,...r.style}}return r}const mve=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function y4(n){return typeof n!="string"||n.includes("-")?!1:!!(mve.indexOf(n)>-1||/[A-Z]/u.test(n))}function yve(n,e,t,{latestValues:i},r,s=!1,a){const l=(a??y4(n)?gve:pve)(e,i,r,n),c=cve(e,typeof n=="string",s),h=n!==Se.Fragment?{...c,...l,ref:t}:{},{children:f}=e,p=Se.useMemo(()=>Cs(f)?f.get():f,[f]);return Se.createElement(n,{...h,children:p})}function vve({scrapeMotionValuesFromProps:n,createRenderState:e},t,i,r){return{latestValues:_ve(t,i,r,n),renderState:e()}}function _ve(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=zA(s[p]);let{initial:a,animate:o}=n;const l=sI(n),c=aX(n);e&&c&&!l&&n.inherit!==!1&&(a===void 0&&(a=e.initial),o===void 0&&(o=e.animate));let h=t?t.initial===!1:!1;h=h||a===!1;const f=h?o:a;if(f&&typeof f!="boolean"&&!rI(f)){const p=Array.isArray(f)?f:[f];for(let y=0;y<p.length;y++){const x=s4(n,p[y]);if(x){const{transitionEnd:v,transition:_,...E}=x;for(const w in E){let A=E[w];if(Array.isArray(A)){const N=h?A.length-1:0;A=A[N]}A!==null&&(r[w]=A)}for(const w in v)r[w]=v[w]}}}return r}const OX=n=>(e,t)=>{const i=Se.useContext(aI),r=Se.useContext(nI),s=()=>vve(n,e,i,r);return t?s():GP(s)},xve=OX({scrapeMotionValuesFromProps:p4,createRenderState:m4}),bve=OX({scrapeMotionValuesFromProps:_X,createRenderState:LX}),Tve=Symbol.for("motionComponentSymbol");function Eve(n,e,t){const i=Se.useRef(t);Se.useInsertionEffect(()=>{i.current=t});const r=Se.useRef(null);return Se.useCallback(s=>{var o;s&&((o=n.onMount)==null||o.call(n,s));const a=i.current;if(typeof a=="function")if(s){const l=a(s);typeof l=="function"&&(r.current=l)}else r.current?(r.current(),r.current=null):a(s);else a&&(a.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const BX=Se.createContext({});function iy(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function wve(n,e,t,i,r,s){var A,N;const{visualElement:a}=Se.useContext(aI),o=Se.useContext(MX),l=Se.useContext(nI),c=Se.useContext(g4),h=c.reducedMotion,f=c.skipAnimations,p=Se.useRef(null),y=Se.useRef(!1);i=i||o.renderer,!p.current&&i&&(p.current=i(n,{visualState:e,parent:a,props:t,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:h,skipAnimations:f,isSVG:s}),y.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const x=p.current,v=Se.useContext(BX);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&Ave(p.current,t,r,v);const _=Se.useRef(!1);Se.useInsertionEffect(()=>{x&&_.current&&x.update(t,l)});const E=t[jj],w=Se.useRef(!!E&&typeof window<"u"&&!((A=window.MotionHandoffIsComplete)!=null&&A.call(window,E))&&((N=window.MotionHasOptimisedAnimation)==null?void 0:N.call(window,E)));return sj(()=>{y.current=!0,x&&(_.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),w.current&&x.animationState&&x.animationState.animateChanges())}),Se.useEffect(()=>{x&&(!w.current&&x.animationState&&x.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,E)}),w.current=!1),x.enteringChildren=void 0)}),x}function Ave(n,e,t,i){const{layoutId:r,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutAnchor:h,layoutCrossfade:f}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:VX(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||o&&iy(o),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:h})}function VX(n){if(n)return n.options.allowProjection!==!1?n.projection:VX(n.parent)}function Wk(n,{forwardMotionProps:e=!1,type:t}={},i,r){i&&ave(i);const s=t?t==="svg":y4(n),a=s?bve:xve;function o(c,h){let f;const p={...Se.useContext(g4),...c,layoutId:Sve(c)},{isStatic:y}=p,x=hve(c),v=a(c,y);if(!y&&typeof window<"u"){Dve();const _=Cve(p);f=_.MeasureLayout,x.visualElement=wve(n,v,p,r,_.ProjectionNode,s)}return J.jsxs(aI.Provider,{value:x,children:[f&&x.visualElement?J.jsx(f,{visualElement:x.visualElement,...p}):null,yve(n,c,Eve(v,x.visualElement,h),v,y,e,s)]})}o.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const l=Se.forwardRef(o);return l[Tve]=n,l}function Sve({layoutId:n}){const e=Se.useContext(zP).id;return e&&n!==void 0?e+"-"+n:n}function Dve(n,e){Se.useContext(MX).strict}function Cve(n){const e=FX(),{drag:t,layout:i}=e;if(!t&&!i)return{};const r={...t,...i};return{MeasureLayout:t!=null&&t.isEnabled(n)||i!=null&&i.isEnabled(n)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ive(n,e){if(typeof Proxy>"u")return Wk;const t=new Map,i=(s,a)=>Wk(s,a,n,e),r=(s,a)=>i(s,a);return new Proxy(r,{get:(s,a)=>a==="create"?i:(t.has(a)||t.set(a,Wk(a,void 0,n,e)),t.get(a))})}const Rve=(n,e)=>e.isSVG??y4(n)?new aye(e):new eye(e,{allowProjection:n!==Se.Fragment});class Nve extends yp{constructor(e){super(e),e.animationState||(e.animationState=hye(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();rI(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let kve=0;class Mve extends yp{constructor(){super(...arguments),this.id=kve++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:a,custom:o}=this.node.getProps();if(typeof a=="string"){const l=km(this.node,a,o);if(l){const{transition:c,transitionEnd:h,...f}=l;for(const p in f)(s=this.node.getValue(p))==null||s.jump(f[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Fve={animation:{Feature:Nve},exit:{Feature:Mve}};function jT(n){return{point:{x:n.pageX,y:n.pageY}}}const Uve=n=>e=>c4(e)&&n(e,jT(e));function eb(n,e,t,i){return yb(n,e,Uve(t),i)}const WX=({current:n})=>n?n.ownerDocument.defaultView:null,xV=(n,e)=>Math.abs(n-e);function Pve(n,e){const t=xV(n.x,e.x),i=xV(n.y,e.y);return Math.sqrt(t**2+i**2)}const bV=new Set(["auto","scroll"]);class HX{constructor(e,t,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jw(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Hk(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,v=Pve(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!v)return;const{point:_}=y,{timestamp:E}=xs;this.history.push({..._,timestamp:E});const{onStart:w,onMove:A}=this.handlers;x||(w&&w(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=jw(x,this.transformPagePoint),vi.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:v,onSessionEnd:_,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Hk(y.type==="pointercancel"?this.lastMoveEventInfo:jw(x,this.transformPagePoint),this.history);this.startEvent&&v&&v(y,w),_&&_(y,w)},!c4(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=r||window;const l=jT(e),c=jw(l,this.transformPagePoint),{point:h}=c,{timestamp:f}=xs;this.history=[{...h,timestamp:f}];const{onSessionStart:p}=t;p&&p(e,Hk(c,this.history)),this.removeListeners=GT(eb(this.contextWindow,"pointermove",this.handlePointerMove),eb(this.contextWindow,"pointerup",this.handlePointerUp),eb(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const i=getComputedStyle(t);(bV.has(i.overflowX)||bV.has(i.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-t.x,y:r.y-t.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),vi.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Zf(this.updatePoint)}}function jw(n,e){return e?{point:e(n.point)}:n}function TV(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Hk({point:n},e){return{point:n,delta:TV(n,zX(e)),offset:TV(n,Lve(e)),velocity:Ove(e,.1)}}function Lve(n){return n[0]}function zX(n){return n[n.length-1]}function Ove(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=zX(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Ao(e)));)t--;if(!i)return{x:0,y:0};i===n[0]&&n.length>2&&r.timestamp-i.timestamp>Ao(e)*2&&(i=n[1]);const s=ll(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const a={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Bve(n,{min:e,max:t},i){return e!==void 0&&n<e?n=i?Ii(e,n,i.min):Math.max(n,e):t!==void 0&&n>t&&(n=i?Ii(t,n,i.max):Math.min(n,t)),n}function EV(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function Vve(n,{top:e,left:t,bottom:i,right:r}){return{x:EV(n.x,t,r),y:EV(n.y,e,i)}}function wV(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,i]=[i,t]),{min:t,max:i}}function Wve(n,e){return{x:wV(n.x,e.x),y:wV(n.y,e.y)}}function Hve(n,e){let t=.5;const i=ca(n),r=ca(e);return r>i?t=pb(e.min,e.max-i,n.min):i>r&&(t=pb(n.min,n.max-r,e.min)),cu(0,1,t)}function zve(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const pF=.35;function Gve(n=pF){return n===!1?n=0:n===!0&&(n=pF),{x:AV(n,"left","right"),y:AV(n,"top","bottom")}}function AV(n,e,t){return{min:SV(n,e),max:SV(n,t)}}function SV(n,e){return typeof n=="number"?n:n[e]||0}const qve=new WeakMap;class $ve{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Mr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=f=>{t&&this.snapToCursor(jT(f).point),this.stopAnimation()},a=(f,p)=>{const{drag:y,dragPropagation:x,onDragStart:v}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_0e(y),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Cc(E=>{let w=this.getAxisMotionValue(E).get()||0;if(ru.test(w)){const{projection:A}=this.visualElement;if(A&&A.layout){const N=A.layout.layoutBox[E];N&&(w=ca(N)*(parseFloat(w)/100))}}this.originPoint[E]=w}),v&&vi.update(()=>v(f,p),!1,!0),rF(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},o=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:v,onDrag:_}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=p;if(x&&this.currentDirection===null){this.currentDirection=Xve(E),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,E),this.updateAxis("y",p.point,E),this.visualElement.render(),_&&vi.update(()=>_(f,p),!1,!0)},l=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new HX(e,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:WX(this.visualElement),element:this.visualElement.current})}stop(e,t){const i=e||this.latestPointerEvent,r=t||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&vi.postRender(()=>o(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Xw(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let a=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(a=Bve(a,this.constraints[e],this.elastic[e])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:t}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,r=this.constraints;e&&iy(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=Vve(i.layoutBox,e):this.constraints=!1,this.elastic=Gve(t),r!==this.constraints&&!iy(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Cc(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=zve(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!iy(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=X0e(i,r.root,this.visualElement.getTransformPagePoint());let a=Wve(r.layout.layoutBox,s);if(t){const o=t(q0e(a));this.hasMutatedConstraints=!!o,o&&(a=uX(o))}return a}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},c=Cc(h=>{if(!Xw(h,t,this.currentDirection))return;let f=l&&l[h]||{};(a===!0||a===h)&&(f={min:0,max:0});const p=r?200:1e6,y=r?40:1e7,x={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(h,x)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return rF(this.visualElement,e),i.start(r4(e,i,0,t,this.visualElement,!1))}stopAnimation(){Cc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Cc(t=>{const{drag:i}=this.getProps();if(!Xw(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:a,max:o}=r.layout.layoutBox[t],l=s.get()||0;s.set(e[t]-Ii(a,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!iy(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Cc(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();r[a]=Hve({min:l,max:l},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Cc(a=>{if(!Xw(a,e,null))return;const o=this.getAxisMotionValue(a),{min:l,max:c}=this.constraints[a];o.set(Ii(l,c,r[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qve.set(this.visualElement,this);const e=this.visualElement.current,t=eb(e,"pointerdown",c=>{const{drag:h,dragListener:f=!0}=this.getProps(),p=c.target,y=p!==e&&A0e(p);h&&f&&!y&&this.start(c)});let i;const r=()=>{const{dragConstraints:c}=this.getProps();iy(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),i||(i=jve(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),vi.read(r);const o=yb(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Cc(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.get()+c[f].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),l&&l(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:a=pF,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function DV(n){let e=!0;return()=>{if(e){e=!1;return}n()}}function jve(n,e,t){const i=F7(n,DV(t)),r=F7(e,DV(t));return()=>{i(),r()}}function Xw(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function Xve(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class Kve extends yp{constructor(e){super(e),this.removeGroupControls=cl,this.removeListeners=cl,this.controls=new $ve(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cl}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const zk=n=>(e,t)=>{n&&vi.update(()=>n(e,t),!1,!0)};class Yve extends yp{constructor(){super(...arguments),this.removePointerDownListener=cl}onPointerDown(e){this.session=new HX(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WX(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:zk(e),onStart:zk(t),onMove:zk(i),onEnd:(s,a)=>{delete this.session,r&&vi.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=eb(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Gk=!1;class Jve extends Se.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),Gk&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),GA.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,{projection:a}=i;return a&&(a.isPresent=s,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Gk=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==s?a.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?a.promote():a.relegate()||vi.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=t,i.root.didUpdate(),l4.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;Gk=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function GX(n){const[e,t]=kX(),i=Se.useContext(zP);return J.jsx(Jve,{...n,layoutGroup:i,switchLayoutGroup:Se.useContext(BX),isPresent:e,safeToRemove:t})}const Qve={pan:{Feature:Yve},drag:{Feature:Kve,ProjectionNode:NX,MeasureLayout:GX}};function CV(n,e,t){const{props:i}=n;n.animationState&&i.whileHover&&n.animationState.setActive("whileHover",t==="Start");const r="onHover"+t,s=i[r];s&&vi.postRender(()=>s(e,jT(e)))}class Zve extends yp{mount(){const{current:e}=this.node;e&&(this.unmount=b0e(e,(t,i)=>(CV(this.node,i,"Start"),r=>CV(this.node,r,"End"))))}unmount(){}}class e1e extends yp{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=GT(yb(this.node.current,"focus",()=>this.onFocus()),yb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function IV(n,e,t){const{props:i}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&i.whileTap&&n.animationState.setActive("whileTap",t==="Start");const r="onTap"+(t==="End"?"":t),s=i[r];s&&vi.postRender(()=>s(e,jT(e)))}class t1e extends yp{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:i}=this.node.props;this.unmount=D0e(e,(r,s)=>(IV(this.node,s,"Start"),(a,{success:o})=>IV(this.node,a,o?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const gF=new WeakMap,qk=new WeakMap,n1e=n=>{const e=gF.get(n.target);e&&e(n)},i1e=n=>{n.forEach(n1e)};function r1e({root:n,...e}){const t=n||document;qk.has(t)||qk.set(t,{});const i=qk.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(i1e,{root:n,...e})),i[r]}function s1e(n,e,t){const i=r1e(e);return gF.set(n,t),i.observe(n),()=>{gF.delete(n),i.unobserve(n)}}const a1e={some:0,all:1};class o1e extends yp{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,a={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:a1e[r]},o=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:f,onViewportLeave:p}=this.node.getProps(),y=h?f:p;y&&y(c)};this.stopObserver=s1e(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(l1e(e,t))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function l1e({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const c1e={inView:{Feature:o1e},tap:{Feature:t1e},focus:{Feature:e1e},hover:{Feature:Zve}},u1e={layout:{ProjectionNode:NX,MeasureLayout:GX}},h1e={...Fve,...c1e,...Qve,...u1e},Ic=Ive(h1e,Rve);function qX(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;e<r;e++)n[e]&&(t=qX(n[e]))&&(i&&(i+=" "),i+=t)}else for(t in n)n[t]&&(i&&(i+=" "),i+=t);return i}function $X(){for(var n,e,t=0,i="",r=arguments.length;t<r;t++)(n=arguments[t])&&(e=qX(n))&&(i&&(i+=" "),i+=e);return i}const d1e=(n,e)=>{const t=new Array(n.length+e.length);for(let i=0;i<n.length;i++)t[i]=n[i];for(let i=0;i<e.length;i++)t[n.length+i]=e[i];return t},f1e=(n,e)=>({classGroupId:n,validator:e}),jX=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),DD="-",RV=[],p1e="arbitrary..",g1e=n=>{const e=y1e(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return m1e(a);const o=a.split(DD),l=o[0]===""&&o.length>1?1:0;return XX(o,l,e)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=i[a],c=t[a];return l?c?d1e(c,l):l:c||RV}return t[a]||RV}}},XX=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],s=t.nextPart.get(r);if(s){const c=XX(n,e+1,s);if(c)return c}const a=t.validators;if(a===null)return;const o=e===0?n.join(DD):n.slice(e).join(DD),l=a.length;for(let c=0;c<l;c++){const h=a[c];if(h.validator(o))return h.classGroupId}},m1e=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),i=e.slice(0,t);return i?p1e+i:void 0})(),y1e=n=>{const{theme:e,classGroups:t}=n;return v1e(t,e)},v1e=(n,e)=>{const t=jX();for(const i in n){const r=n[i];v4(r,t,i,e)}return t},v4=(n,e,t,i)=>{const r=n.length;for(let s=0;s<r;s++){const a=n[s];_1e(a,e,t,i)}},_1e=(n,e,t,i)=>{if(typeof n=="string"){x1e(n,e,t);return}if(typeof n=="function"){b1e(n,e,t,i);return}T1e(n,e,t,i)},x1e=(n,e,t)=>{const i=n===""?e:KX(e,n);i.classGroupId=t},b1e=(n,e,t,i)=>{if(E1e(n)){v4(n(i),e,t,i);return}e.validators===null&&(e.validators=[]),e.validators.push(f1e(t,n))},T1e=(n,e,t,i)=>{const r=Object.entries(n),s=r.length;for(let a=0;a<s;a++){const[o,l]=r[a];v4(l,KX(e,o),t,i)}},KX=(n,e)=>{let t=n;const i=e.split(DD),r=i.length;for(let s=0;s<r;s++){const a=i[s];let o=t.nextPart.get(a);o||(o=jX(),t.nextPart.set(a,o)),t=o}return t},E1e=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,w1e=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),i=Object.create(null);const r=(s,a)=>{t[s]=a,e++,e>n&&(e=0,i=t,t=Object.create(null))};return{get(s){let a=t[s];if(a!==void 0)return a;if((a=i[s])!==void 0)return r(s,a),a},set(s,a){s in t?t[s]=a:r(s,a)}}},mF="!",NV=":",A1e=[],kV=(n,e,t,i,r)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:i,isExternal:r}),S1e=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=r=>{const s=[];let a=0,o=0,l=0,c;const h=r.length;for(let v=0;v<h;v++){const _=r[v];if(a===0&&o===0){if(_===NV){s.push(r.slice(l,v)),l=v+1;continue}if(_==="/"){c=v;continue}}_==="["?a++:_==="]"?a--:_==="("?o++:_===")"&&o--}const f=s.length===0?r:r.slice(l);let p=f,y=!1;f.endsWith(mF)?(p=f.slice(0,-1),y=!0):f.startsWith(mF)&&(p=f.slice(1),y=!0);const x=c&&c>l?c-l:void 0;return kV(s,y,p,x)};if(e){const r=e+NV,s=i;i=a=>a.startsWith(r)?s(a.slice(r.length)):kV(A1e,!1,a,void 0,!0)}if(t){const r=i;i=s=>t({className:s,parseClassName:r})}return i},D1e=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,i)=>{e.set(t,1e6+i)}),t=>{const i=[];let r=[];for(let s=0;s<t.length;s++){const a=t[s],o=a[0]==="[",l=e.has(a);o||l?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(a)):r.push(a)}return r.length>0&&(r.sort(),i.push(...r)),i}},C1e=n=>({cache:w1e(n.cacheSize),parseClassName:S1e(n),sortModifiers:D1e(n),...g1e(n)}),I1e=/\s+/,R1e=(n,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,a=[],o=n.trim().split(I1e);let l="";for(let c=o.length-1;c>=0;c-=1){const h=o[c],{isExternal:f,modifiers:p,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:v}=t(h);if(f){l=h+(l.length>0?" "+l:l);continue}let _=!!v,E=i(_?x.substring(0,v):x);if(!E){if(!_){l=h+(l.length>0?" "+l:l);continue}if(E=i(x),!E){l=h+(l.length>0?" "+l:l);continue}_=!1}const w=p.length===0?"":p.length===1?p[0]:s(p).join(":"),A=y?w+mF:w,N=A+E;if(a.indexOf(N)>-1)continue;a.push(N);const k=r(E,_);for(let F=0;F<k.length;++F){const C=k[F];a.push(A+C)}l=h+(l.length>0?" "+l:l)}return l},N1e=(...n)=>{let e=0,t,i,r="";for(;e<n.length;)(t=n[e++])&&(i=YX(t))&&(r&&(r+=" "),r+=i);return r},YX=n=>{if(typeof n=="string")return n;let e,t="";for(let i=0;i<n.length;i++)n[i]&&(e=YX(n[i]))&&(t&&(t+=" "),t+=e);return t},k1e=(n,...e)=>{let t,i,r,s;const a=l=>{const c=e.reduce((h,f)=>f(h),n());return t=C1e(c),i=t.cache.get,r=t.cache.set,s=o,o(l)},o=l=>{const c=i(l);if(c)return c;const h=R1e(l,t);return r(l,h),h};return s=a,(...l)=>s(N1e(...l))},M1e=[],Cr=n=>{const e=t=>t[n]||M1e;return e.isThemeGetter=!0,e},JX=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QX=/^\((?:(\w[\w-]*):)?(.+)\)$/i,F1e=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,U1e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P1e=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,L1e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,O1e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B1e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kd=n=>F1e.test(n),gn=n=>!!n&&!Number.isNaN(Number(n)),Md=n=>!!n&&Number.isInteger(Number(n)),$k=n=>n.endsWith("%")&&gn(n.slice(0,-1)),Uu=n=>U1e.test(n),ZX=()=>!0,V1e=n=>P1e.test(n)&&!L1e.test(n),_4=()=>!1,W1e=n=>O1e.test(n),H1e=n=>B1e.test(n),z1e=n=>!Ut(n)&&!Lt(n),G1e=n=>vp(n,nK,_4),Ut=n=>JX.test(n),Qp=n=>vp(n,iK,V1e),MV=n=>vp(n,Q1e,gn),q1e=n=>vp(n,sK,ZX),$1e=n=>vp(n,rK,_4),FV=n=>vp(n,eK,_4),j1e=n=>vp(n,tK,H1e),Kw=n=>vp(n,aK,W1e),Lt=n=>QX.test(n),ix=n=>Ym(n,iK),X1e=n=>Ym(n,rK),UV=n=>Ym(n,eK),K1e=n=>Ym(n,nK),Y1e=n=>Ym(n,tK),Yw=n=>Ym(n,aK,!0),J1e=n=>Ym(n,sK,!0),vp=(n,e,t)=>{const i=JX.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},Ym=(n,e,t=!1)=>{const i=QX.exec(n);return i?i[1]?e(i[1]):t:!1},eK=n=>n==="position"||n==="percentage",tK=n=>n==="image"||n==="url",nK=n=>n==="length"||n==="size"||n==="bg-size",iK=n=>n==="length",Q1e=n=>n==="number",rK=n=>n==="family-name",sK=n=>n==="number"||n==="weight",aK=n=>n==="shadow",Z1e=()=>{const n=Cr("color"),e=Cr("font"),t=Cr("text"),i=Cr("font-weight"),r=Cr("tracking"),s=Cr("leading"),a=Cr("breakpoint"),o=Cr("container"),l=Cr("spacing"),c=Cr("radius"),h=Cr("shadow"),f=Cr("inset-shadow"),p=Cr("text-shadow"),y=Cr("drop-shadow"),x=Cr("blur"),v=Cr("perspective"),_=Cr("aspect"),E=Cr("ease"),w=Cr("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...N(),Lt,Ut],F=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],M=()=>[Lt,Ut,l],R=()=>[kd,"full","auto",...M()],L=()=>[Md,"none","subgrid",Lt,Ut],H=()=>["auto",{span:["full",Md,Lt,Ut]},Md,Lt,Ut],P=()=>[Md,"auto",Lt,Ut],O=()=>["auto","min","max","fr",Lt,Ut],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...M()],X=()=>[kd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],oe=()=>[kd,"screen","full","dvw","lvw","svw","min","max","fit",...M()],ue=()=>[kd,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],ge=()=>[n,Lt,Ut],j=()=>[...N(),UV,FV,{position:[Lt,Ut]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",K1e,G1e,{size:[Lt,Ut]}],te=()=>[$k,ix,Qp],ie=()=>["","none","full",c,Lt,Ut],_e=()=>["",gn,ix,Qp],Ie=()=>["solid","dashed","dotted","double"],Pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Fe=()=>[gn,$k,UV,FV],Ge=()=>["","none",x,Lt,Ut],ct=()=>["none",gn,Lt,Ut],gt=()=>["none",gn,Lt,Ut],Mt=()=>[gn,Lt,Ut],W=()=>[kd,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Uu],breakpoint:[Uu],color:[ZX],container:[Uu],"drop-shadow":[Uu],ease:["in","out","in-out"],font:[z1e],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Uu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Uu],shadow:[Uu],spacing:["px",gn],text:[Uu],"text-shadow":[Uu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kd,Ut,Lt,_]}],container:["container"],columns:[{columns:[gn,Ut,Lt,o]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Md,"auto",Lt,Ut]}],basis:[{basis:[kd,"full","auto",o,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gn,kd,"auto","initial","none",Ut]}],grow:[{grow:["",gn,Lt,Ut]}],shrink:[{shrink:["",gn,Lt,Ut]}],order:[{order:[Md,"first","last","none",Lt,Ut]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,ix,Qp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,J1e,q1e]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$k,Ut]}],"font-family":[{font:[X1e,$1e,e]}],"font-features":[{"font-features":[Ut]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Lt,Ut]}],"line-clamp":[{"line-clamp":[gn,"none",Lt,MV]}],leading:[{leading:[s,...M()]}],"list-image":[{"list-image":["none",Lt,Ut]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Lt,Ut]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ge()}],"text-color":[{text:ge()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[gn,"from-font","auto",Lt,Qp]}],"text-decoration-color":[{decoration:ge()}],"underline-offset":[{"underline-offset":[gn,"auto",Lt,Ut]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Lt,Ut]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Lt,Ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Md,Lt,Ut],radial:["",Lt,Ut],conic:[Md,Lt,Ut]},Y1e,j1e]}],"bg-color":[{bg:ge()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:ge()}],"gradient-via":[{via:ge()}],"gradient-to":[{to:ge()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ie(),"hidden","none"]}],"divide-style":[{divide:[...Ie(),"hidden","none"]}],"border-color":[{border:ge()}],"border-color-x":[{"border-x":ge()}],"border-color-y":[{"border-y":ge()}],"border-color-s":[{"border-s":ge()}],"border-color-e":[{"border-e":ge()}],"border-color-bs":[{"border-bs":ge()}],"border-color-be":[{"border-be":ge()}],"border-color-t":[{"border-t":ge()}],"border-color-r":[{"border-r":ge()}],"border-color-b":[{"border-b":ge()}],"border-color-l":[{"border-l":ge()}],"divide-color":[{divide:ge()}],"outline-style":[{outline:[...Ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gn,Lt,Ut]}],"outline-w":[{outline:["",gn,ix,Qp]}],"outline-color":[{outline:ge()}],shadow:[{shadow:["","none",h,Yw,Kw]}],"shadow-color":[{shadow:ge()}],"inset-shadow":[{"inset-shadow":["none",f,Yw,Kw]}],"inset-shadow-color":[{"inset-shadow":ge()}],"ring-w":[{ring:_e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ge()}],"ring-offset-w":[{"ring-offset":[gn,Qp]}],"ring-offset-color":[{"ring-offset":ge()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":ge()}],"text-shadow":[{"text-shadow":["none",p,Yw,Kw]}],"text-shadow-color":[{"text-shadow":ge()}],opacity:[{opacity:[gn,Lt,Ut]}],"mix-blend":[{"mix-blend":[...Pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gn]}],"mask-image-linear-from-pos":[{"mask-linear-from":Fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":Fe()}],"mask-image-linear-from-color":[{"mask-linear-from":ge()}],"mask-image-linear-to-color":[{"mask-linear-to":ge()}],"mask-image-t-from-pos":[{"mask-t-from":Fe()}],"mask-image-t-to-pos":[{"mask-t-to":Fe()}],"mask-image-t-from-color":[{"mask-t-from":ge()}],"mask-image-t-to-color":[{"mask-t-to":ge()}],"mask-image-r-from-pos":[{"mask-r-from":Fe()}],"mask-image-r-to-pos":[{"mask-r-to":Fe()}],"mask-image-r-from-color":[{"mask-r-from":ge()}],"mask-image-r-to-color":[{"mask-r-to":ge()}],"mask-image-b-from-pos":[{"mask-b-from":Fe()}],"mask-image-b-to-pos":[{"mask-b-to":Fe()}],"mask-image-b-from-color":[{"mask-b-from":ge()}],"mask-image-b-to-color":[{"mask-b-to":ge()}],"mask-image-l-from-pos":[{"mask-l-from":Fe()}],"mask-image-l-to-pos":[{"mask-l-to":Fe()}],"mask-image-l-from-color":[{"mask-l-from":ge()}],"mask-image-l-to-color":[{"mask-l-to":ge()}],"mask-image-x-from-pos":[{"mask-x-from":Fe()}],"mask-image-x-to-pos":[{"mask-x-to":Fe()}],"mask-image-x-from-color":[{"mask-x-from":ge()}],"mask-image-x-to-color":[{"mask-x-to":ge()}],"mask-image-y-from-pos":[{"mask-y-from":Fe()}],"mask-image-y-to-pos":[{"mask-y-to":Fe()}],"mask-image-y-from-color":[{"mask-y-from":ge()}],"mask-image-y-to-color":[{"mask-y-to":ge()}],"mask-image-radial":[{"mask-radial":[Lt,Ut]}],"mask-image-radial-from-pos":[{"mask-radial-from":Fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":Fe()}],"mask-image-radial-from-color":[{"mask-radial-from":ge()}],"mask-image-radial-to-color":[{"mask-radial-to":ge()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[gn]}],"mask-image-conic-from-pos":[{"mask-conic-from":Fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":Fe()}],"mask-image-conic-from-color":[{"mask-conic-from":ge()}],"mask-image-conic-to-color":[{"mask-conic-to":ge()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Lt,Ut]}],filter:[{filter:["","none",Lt,Ut]}],blur:[{blur:Ge()}],brightness:[{brightness:[gn,Lt,Ut]}],contrast:[{contrast:[gn,Lt,Ut]}],"drop-shadow":[{"drop-shadow":["","none",y,Yw,Kw]}],"drop-shadow-color":[{"drop-shadow":ge()}],grayscale:[{grayscale:["",gn,Lt,Ut]}],"hue-rotate":[{"hue-rotate":[gn,Lt,Ut]}],invert:[{invert:["",gn,Lt,Ut]}],saturate:[{saturate:[gn,Lt,Ut]}],sepia:[{sepia:["",gn,Lt,Ut]}],"backdrop-filter":[{"backdrop-filter":["","none",Lt,Ut]}],"backdrop-blur":[{"backdrop-blur":Ge()}],"backdrop-brightness":[{"backdrop-brightness":[gn,Lt,Ut]}],"backdrop-contrast":[{"backdrop-contrast":[gn,Lt,Ut]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gn,Lt,Ut]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gn,Lt,Ut]}],"backdrop-invert":[{"backdrop-invert":["",gn,Lt,Ut]}],"backdrop-opacity":[{"backdrop-opacity":[gn,Lt,Ut]}],"backdrop-saturate":[{"backdrop-saturate":[gn,Lt,Ut]}],"backdrop-sepia":[{"backdrop-sepia":["",gn,Lt,Ut]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Lt,Ut]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gn,"initial",Lt,Ut]}],ease:[{ease:["linear","initial",E,Lt,Ut]}],delay:[{delay:[gn,Lt,Ut]}],animate:[{animate:["none",w,Lt,Ut]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Lt,Ut]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:gt()}],"scale-x":[{"scale-x":gt()}],"scale-y":[{"scale-y":gt()}],"scale-z":[{"scale-z":gt()}],"scale-3d":["scale-3d"],skew:[{skew:Mt()}],"skew-x":[{"skew-x":Mt()}],"skew-y":[{"skew-y":Mt()}],transform:[{transform:[Lt,Ut,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:W()}],"translate-x":[{"translate-x":W()}],"translate-y":[{"translate-y":W()}],"translate-z":[{"translate-z":W()}],"translate-none":["translate-none"],accent:[{accent:ge()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ge()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Lt,Ut]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Lt,Ut]}],fill:[{fill:["none",...ge()]}],"stroke-w":[{stroke:[gn,ix,Qp,MV]}],stroke:[{stroke:["none",...ge()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oK=k1e(Z1e),sa=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),yF=[.001,0,0,.001,0,0],jk=1.35,go={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Hd={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},vb="pdfjs_internal_editor_",sn={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Dn={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},e_e={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},vF={TRIANGLES:1,LATTICE:2},Ir={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},qA={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},fr={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},ry={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},oI={ERRORS:0,WARNINGS:1,INFOS:5},_b={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},rx={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},t_e={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let lI=oI.WARNINGS;function n_e(n){Number.isInteger(n)&&(lI=n)}function i_e(){return lI}function cI(n){lI>=oI.INFOS&&console.info(`Info: ${n}`)}function an(n){lI>=oI.WARNINGS&&console.warn(`Warning: ${n}`)}function Wn(n){throw new Error(n)}function Fn(n,e){n||Wn(e)}function r_e(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function lK(n,e=null,t=null){if(!n)return null;if(t&&typeof n=="string"){if(t.addDefaultProtocol&&n.startsWith("www.")){const r=n.match(/\./g);(r==null?void 0:r.length)>=2&&(n=`http://${n}`)}if(t.tryConvertEncoding)try{n=u_e(n)}catch{}}const i=e?URL.parse(n,e):URL.parse(n);return r_e(i)?i:null}function cK(n,e,t=!1){const i=URL.parse(n);return i?(i.hash=e,i.href):t&&lK(n,"http://example.com")?n.split("#",1)[0]+`${e?`#${e}`:""}`:""}function _F(n){return n.substring(n.lastIndexOf("/")+1)}function tn(n,e,t,i=!1){return Object.defineProperty(n,e,{value:t,enumerable:!i,configurable:!0,writable:!1}),t}const Jm=(function(){function e(t,i){this.message=t,this.name=i}return e.prototype=new Error,e.constructor=e,e})();class PV extends Jm{constructor(e,t){super(e,"PasswordException"),this.code=t}}class Xk extends Jm{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class xF extends Jm{constructor(e){super(e,"InvalidPDFException")}}class CD extends Jm{constructor(e,t,i){super(e,"ResponseException"),this.status=t,this.missing=i}}class s_e extends Jm{constructor(e){super(e,"FormatError")}}class ep extends Jm{constructor(e){super(e,"AbortException")}}function a_e(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&Wn("Invalid argument for bytesToString");const e=n.length,t=8192;if(e<t)return String.fromCharCode.apply(null,n);const i=[];for(let r=0;r<e;r+=t){const s=Math.min(r+t,e),a=n.subarray(r,s);i.push(String.fromCharCode.apply(null,a))}return i.join("")}function uI(n){typeof n!="string"&&Wn("Invalid argument for stringToBytes");const e=n.length,t=new Uint8Array(e);for(let i=0;i<e;++i)t[i]=n.charCodeAt(i)&255;return t}function o_e(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function l_e(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function c_e(){try{return new Function(""),!0}catch{return!1}}class Pr{static get isLittleEndian(){return tn(this,"isLittleEndian",l_e())}static get isEvalSupported(){return tn(this,"isEvalSupported",c_e())}static get isOffscreenCanvasSupported(){return tn(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return tn(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return tn(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return tn(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return tn(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){var e,t;return tn(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const Kk=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));var Mh,$A,bF;class St{static makeHexColor(e,t,i){return`#${Kk[e]}${Kk[t]}${Kk[i]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,i=0){const r=e[i],s=e[i+1];e[i]=r*t[0]+s*t[2]+t[4],e[i+1]=r*t[1]+s*t[3]+t[5]}static applyTransformToBezier(e,t,i=0){const r=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5];for(let h=0;h<6;h+=2){const f=e[i+h],p=e[i+h+1];e[i+h]=f*r+p*a+l,e[i+h+1]=f*s+p*o+c}}static applyInverseTransform(e,t){const i=e[0],r=e[1],s=t[0]*t[3]-t[1]*t[2];e[0]=(i*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/s,e[1]=(-i*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/s}static axialAlignedBoundingBox(e,t,i){const r=t[0],s=t[1],a=t[2],o=t[3],l=t[4],c=t[5],h=e[0],f=e[1],p=e[2],y=e[3];let x=r*h+l,v=x,_=r*p+l,E=_,w=o*f+c,A=w,N=o*y+c,k=N;if(s!==0||a!==0){const F=s*h,C=s*p,M=a*f,R=a*y;x+=M,E+=M,_+=R,v+=R,w+=F,k+=F,N+=C,A+=C}i[0]=Math.min(i[0],x,_,v,E),i[1]=Math.min(i[1],w,N,A,k),i[2]=Math.max(i[2],x,_,v,E),i[3]=Math.max(i[3],w,N,A,k)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const i=e[0],r=e[1],s=e[2],a=e[3],o=i**2+r**2,l=i*s+r*a,c=s**2+a**2,h=(o+c)/2,f=Math.sqrt(h**2-(o*c-l**2));t[0]=Math.sqrt(h+f||1),t[1]=Math.sqrt(h-f||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>r)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[i,s,r,a]}static pointBoundingBox(e,t,i){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}static rectBoundingBox(e,t,i,r,s){s[0]=Math.min(s[0],e,i),s[1]=Math.min(s[1],t,r),s[2]=Math.max(s[2],e,i),s[3]=Math.max(s[3],t,r)}static bezierBoundingBox(e,t,i,r,s,a,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,l),Q(this,Mh,bF).call(this,e,i,s,o,t,r,a,l,3*(-e+3*(i-s)+o),6*(e-2*i+s),3*(i-e),c),Q(this,Mh,bF).call(this,e,i,s,o,t,r,a,l,3*(-t+3*(r-a)+l),6*(t-2*r+a),3*(r-t),c)}}Mh=new WeakSet,$A=function(e,t,i,r,s,a,o,l,c,h){if(c<=0||c>=1)return;const f=1-c,p=c*c,y=p*c,x=f*(f*(f*e+3*c*t)+3*p*i)+y*r,v=f*(f*(f*s+3*c*a)+3*p*o)+y*l;h[0]=Math.min(h[0],x),h[1]=Math.min(h[1],v),h[2]=Math.max(h[2],x),h[3]=Math.max(h[3],v)},bF=function(e,t,i,r,s,a,o,l,c,h,f,p){if(Math.abs(c)<1e-12){Math.abs(h)>=1e-12&&Q(this,Mh,$A).call(this,e,t,i,r,s,a,o,l,-f/h,p);return}const y=h**2-4*f*c;if(y<0)return;const x=Math.sqrt(y),v=2*c;Q(this,Mh,$A).call(this,e,t,i,r,s,a,o,l,(-h+x)/v,p),Q(this,Mh,$A).call(this,e,t,i,r,s,a,o,l,(-h-x)/v,p)},Y(St,Mh);function u_e(n){return decodeURIComponent(escape(n))}let Yk=null,LV=null;function h_e(n){return Yk||(Yk=/([\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,LV=new Map([["ﬅ","ſt"]])),n.replaceAll(Yk,(e,t,i)=>t?t.normalize("NFKC"):LV.get(i))}function uK(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),a_e(n)}const Ey="pdfjs_internal_id_";function d_e(n,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[i,r,...s]=t;if(!n(i)&&!Number.isInteger(i)||!e(r))return!1;const a=s.length;let o=!0;switch(r.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of s)if(!(typeof l=="number"||o&&l===null))return!1;return!0}const hK=()=>[],x4=()=>new Map,TF=()=>Object.create(null);function Yr(n,e,t){return Math.min(Math.max(n,e),t)}typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((e,t)=>e+t,0)});class xb{static textContent(e){const t=[],i={items:t,styles:Object.create(null)};function r(s){var l;if(!s)return;let a=null;const o=s.name;if(o==="#text")a=s.value;else if(xb.shouldBuildText(o))(l=s==null?void 0:s.attributes)!=null&&l.textContent?a=s.attributes.textContent:s.value&&(a=s.value);else return;if(a!==null&&t.push({str:a}),!!s.children)for(const c of s.children)r(c)}return r(e),i}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class dK{static setupStorage(e,t,i,r,s){const a=r.getValue(t,{value:null});switch(i.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),s==="print")break;e.addEventListener("input",o=>{r.setValue(t,{value:o.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(a.value===i.attributes.xfaOn?e.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",o=>{r.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),s==="print")break;e.addEventListener("input",o=>{r.setValue(t,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of i.children)o.attributes.value===a.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;r.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:i=null,intent:r,linkService:s}){const{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${r}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&s.addLinkAttributes(e,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(e,a.dataId,t,i)}static render(e){var f,p;const t=e.annotationStorage,i=e.linkService,r=e.xfaHtml,s=e.intent||"display",a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:s,linkService:i});const o=s!=="richText",l=e.div;if(l.append(a),e.viewport){const y=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=y}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(r.children.length===0){if(r.value){const y=document.createTextNode(r.value);a.append(y),o&&xb.shouldBuildText(r.name)&&c.push(y)}return{textDivs:c}}const h=[[r,-1,a]];for(;h.length>0;){const[y,x,v]=h.at(-1);if(x+1===y.children.length){h.pop();continue}const _=y.children[++h.at(-1)[1]];if(_===null)continue;const{name:E}=_;if(E==="#text"){const A=document.createTextNode(_.value);c.push(A),v.append(A);continue}const w=(f=_==null?void 0:_.attributes)!=null&&f.xmlns?document.createElementNS(_.attributes.xmlns,E):document.createElement(E);if(v.append(w),_.attributes&&this.setAttributes({html:w,element:_,storage:t,intent:s,linkService:i}),((p=_.children)==null?void 0:p.length)>0)h.push([_,-1,w]);else if(_.value){const A=document.createTextNode(_.value);o&&xb.shouldBuildText(E)&&c.push(A),w.append(A)}}for(const y of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))y.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const Ou="http://www.w3.org/2000/svg",dg=class dg{};Ze(dg,"CSS",96),Ze(dg,"PDF",72),Ze(dg,"PDF_TO_CSS_UNITS",dg.CSS/dg.PDF);let tp=dg;async function XT(n,e="text"){if(Ex(n,document.baseURI)){const t=await fetch(n);if(!t.ok)throw new Error(t.statusText);switch(e){case"blob":return t.blob();case"bytes":return t.bytes();case"json":return t.json()}return t.text()}return new Promise((t,i)=>{const r=new XMLHttpRequest;r.open("GET",n,!0),r.responseType=e==="bytes"?"arraybuffer":e,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){switch(e){case"bytes":t(new Uint8Array(r.response));return;case"blob":case"json":t(r.response);return}t(r.responseText);return}i(new Error(r.statusText))}},r.send(null)})}class KT{constructor({viewBox:e,userUnit:t,scale:i,rotation:r,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=i,this.rotation=r,this.offsetX=s,this.offsetY=a,i*=t;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,f,p,y;switch(r%=360,r<0&&(r+=360),r){case 180:h=-1,f=0,p=0,y=1;break;case 90:h=0,f=1,p=1,y=0;break;case 270:h=0,f=-1,p=-1,y=0;break;case 0:h=1,f=0,p=0,y=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(p=-p,y=-y);let x,v,_,E;h===0?(x=Math.abs(c-e[1])*i+s,v=Math.abs(l-e[0])*i+a,_=(e[3]-e[1])*i,E=(e[2]-e[0])*i):(x=Math.abs(l-e[0])*i+s,v=Math.abs(c-e[1])*i+a,_=(e[2]-e[0])*i,E=(e[3]-e[1])*i),this.transform=[h*i,f*i,p*i,y*i,x-h*i*l-p*i*c,v-f*i*l-y*i*c],this.width=_,this.height=E}get rawDims(){const e=this.viewBox;return tn(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}={}){return new KT({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(e,t){const i=[e,t];return St.applyTransform(i,this.transform),i}convertToViewportRectangle(e){const t=[e[0],e[1]];St.applyTransform(t,this.transform);const i=[e[2],e[3]];return St.applyTransform(i,this.transform),[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){const i=[e,t];return St.applyInverseTransform(i,this.transform),i}}class b4 extends Jm{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function hI(n){const e=n.length;let t=0;for(;t<e&&n[t].trim()==="";)t++;return n.substring(t,t+5).toLowerCase()==="data:"}function T4(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function f_e(n){return[n]=n.split(/[#?]/,1),_F(n)}function p_e(n,e="document.pdf"){if(typeof n!="string")return e;if(hI(n))return an('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(o=>{try{return new URL(o)}catch{try{return new URL(decodeURIComponent(o))}catch{try{return new URL(o,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(o),"https://foo.bar")}catch{return null}}}}})(n);if(!i)return e;const r=o=>{try{let l=decodeURIComponent(o);return l.includes("/")&&(l=_F(l),/^\.pdf$/i.test(l))?o:l}catch{return o}},s=/\.pdf$/i,a=_F(i.pathname);if(s.test(a))return r(a);if(i.searchParams.size>0){const o=c=>[...c].findLast(h=>s.test(h)),l=o(i.searchParams.values())??o(i.searchParams.keys());if(l)return r(l)}if(i.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(l)return r(l[0])}return e}class OV{constructor(){Ze(this,"started",Object.create(null));Ze(this,"times",[])}time(e){e in this.started&&an(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||an(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:i}of this.times)t=Math.max(i.length,t);for(const{name:i,start:r,end:s}of this.times)e.push(`${i.padEnd(t)} ${s-r}ms
`);return e.join("")}}function Ex(n,e){const t=e?URL.parse(n,e):URL.parse(n);return/https?:/.test((t==null?void 0:t.protocol)??"")}function gl(n){n.preventDefault()}function Yi(n){n.preventDefault(),n.stopPropagation()}function fK(n){console.log("Deprecated API usage: "+n)}var Gb;class ID{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;g(this,Gb)||V(this,Gb,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=g(this,Gb).exec(e);if(!t)return null;const i=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let h=parseInt(t[8],10);h=h>=0&&h<=23?h:0;let f=parseInt(t[9],10)||0;return f=f>=0&&f<=59?f:0,c==="-"?(a+=h,o+=f):c==="+"&&(a-=h,o-=f),new Date(Date.UTC(i,r,s,a,o,l))}}Gb=new WeakMap,Y(ID,Gb);function g_e(n,{scale:e=1,rotation:t=0}){const{width:i,height:r}=n.attributes.style,s=[0,0,parseInt(i),parseInt(r)];return new KT({viewBox:s,userUnit:1,scale:e,rotation:t})}function YT(n){if(n.startsWith("#")){const e=parseInt(n.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(e=>parseInt(e)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(an(`Not a valid color format: "${n}"`),[0,0,0])}function m_e(n){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of n.keys()){e.style.color=t;const i=window.getComputedStyle(e).color;n.set(t,YT(i))}e.remove()}function Bi(n){const{a:e,b:t,c:i,d:r,e:s,f:a}=n.getTransform();return[e,t,i,r,s,a]}function bc(n){const{a:e,b:t,c:i,d:r,e:s,f:a}=n.getTransform().invertSelf();return[e,t,i,r,s,a]}function Lm(n,e,t=!1,i=!0){if(e instanceof KT){const{pageWidth:r,pageHeight:s}=e.rawDims,{style:a}=n,o=Pr.isCSSRoundSupported,l=`var(--total-scale-factor) * ${r}px`,c=`var(--total-scale-factor) * ${s}px`,h=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,f=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(a.width=h,a.height=f):(a.width=f,a.height=h)}i&&n.setAttribute("data-main-rotation",e.rotation)}class uu{constructor(){const{pixelRatio:e}=uu;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,i,r,s=-1){let a=1/0,o=1/0,l=1/0;i=uu.capPixels(i,s),i>0&&(a=Math.sqrt(i/(e*t))),r!==-1&&(o=r/e,l=r/t);const c=Math.min(a,o,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,i):i}return e}}const EF=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class y_e{static get isDarkMode(){var e;return tn(this,"isDarkMode",!!((e=window==null?void 0:window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches))}}class v_e{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);const{color:i}=window.getComputedStyle(e);return e.remove(),tn(this,"commentForegroundColor",YT(i))}}function __e(n,e,t,i){i=Yr(i??1,0,1);const r=255*(1-i);return n=Math.round(n*i+r),e=Math.round(e*i+r),t=Math.round(t*i+r),[n,e,t]}function BV(n,e){const t=n[0]/255,i=n[1]/255,r=n[2]/255,s=Math.max(t,i,r),a=Math.min(t,i,r),o=(s+a)/2;if(s===a)e[0]=e[1]=0;else{const l=s-a;switch(e[1]=o<.5?l/(s+a):l/(2-s-a),s){case t:e[0]=((i-r)/l+(i<r?6:0))*60;break;case i:e[0]=((r-t)/l+2)*60;break;case r:e[0]=((t-i)/l+4)*60;break}}e[2]=o}function wF(n,e){const t=n[0],i=n[1],r=n[2],s=(1-Math.abs(2*r-1))*i,a=s*(1-Math.abs(t/60%2-1)),o=r-s/2;switch(Math.floor(t/60)){case 0:e[0]=s+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=s+o,e[2]=o;break;case 2:e[0]=o,e[1]=s+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=s+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=s+o;break;case 5:case 6:e[0]=s+o,e[1]=o,e[2]=a+o;break}}function VV(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function WV(n,e,t){wF(n,t),t.map(VV);const i=.2126*t[0]+.7152*t[1]+.0722*t[2];wF(e,t),t.map(VV);const r=.2126*t[0]+.7152*t[1]+.0722*t[2];return i>r?(i+.05)/(r+.05):(r+.05)/(i+.05)}const HV=new Map;function x_e(n,e){const t=n[0]+n[1]*256+n[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let i=HV.get(t);if(i)return i;const r=new Float32Array(9),s=r.subarray(0,3),a=r.subarray(3,6);BV(n,a);const o=r.subarray(6,9);BV(e,o);const l=o[2]<.5,c=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),WV(a,o,s)<c){let h,f;l?(h=a[2],f=1):(h=0,f=a[2]);const p=.005;for(;f-h>p;){const y=a[2]=(h+f)/2;l===WV(a,o,s)<c?h=y:f=y}a[2]=l?f:h}return wF(a,s),i=St.makeHexColor(Math.round(s[0]*255),Math.round(s[1]*255),Math.round(s[2]*255)),HV.set(t,i),i}function pK({html:n,dir:e,className:t},i){const r=document.createDocumentFragment();if(typeof n=="string"){const s=document.createElement("p");s.dir=e||"auto";const a=n.split(/(?:\r\n?|\n)/);for(let o=0,l=a.length;o<l;++o){const c=a[o];s.append(document.createTextNode(c)),o<l-1&&s.append(document.createElement("br"))}r.append(s)}else dK.render({xfaHtml:n,div:r,intent:"richText"});r.firstElementChild.classList.add("richText",t),i.append(r)}function gK(n){const e=new Path2D;if(!n)return e;for(let t=0,i=n.length;t<i;)switch(n[t++]){case rx.moveTo:e.moveTo(n[t++],n[t++]);break;case rx.lineTo:e.lineTo(n[t++],n[t++]);break;case rx.curveTo:e.bezierCurveTo(n[t++],n[t++],n[t++],n[t++],n[t++],n[t++]);break;case rx.quadraticCurveTo:e.quadraticCurveTo(n[t++],n[t++],n[t++],n[t++]);break;case rx.closePath:e.closePath();break;default:an(`Unrecognized drawing path operator: ${n[t-1]}`);break}return e}var qo,ps,$y,Nc,_g,jy,qb,Ci,AF,wx,rg,jA,XA;class b_e{constructor(){Y(this,Ci);Y(this,qo,null);Y(this,ps,null);Y(this,$y,null);Y(this,Nc,0);Y(this,_g,[]);Y(this,jy,null);Y(this,qb,null)}get pagesNumber(){return g(this,Nc)}set pagesNumber(e){g(this,Nc)!==e&&(V(this,Nc,e),Q(this,Ci,AF).call(this))}addListener(e){g(this,_g).push(e)}removeListener(e){const t=g(this,_g).indexOf(e);t>=0&&g(this,_g).splice(t,1)}movePages(e,t,i){Q(this,Ci,rg).call(this,!0);const r=g(this,ps),s=g(this,qo),a=t.length,o=new Uint32Array(a);let l=0;for(let p=0;p<a;p++){const y=t[p]-1;o[p]=r[y],y<i&&(l+=1)}const c=g(this,Nc);let h=i-l;const f=c-a;h=Yr(h,0,f);for(let p=0,y=0;p<c;p++)e.has(p+1)||(r[y++]=r[p]);r.copyWithin(h+a,h,f),r.set(o,h),Q(this,Ci,XA).call(this,s,null),Q(this,Ci,jA).call(this),Q(this,Ci,wx).call(this,{type:"move"}),r.every((p,y)=>p===y+1)&&Q(this,Ci,AF).call(this)}deletePages(e){Q(this,Ci,rg).call(this,!0);const t=g(this,ps),i=g(this,qo);this.pagesNumber-=e.length,Q(this,Ci,rg).call(this,!1);const r=g(this,ps);let s=0,a=0;for(const o of e){const l=o-1;l!==s&&(r.set(t.subarray(s,l),a),a+=l-s),s=l+1}s<t.length&&r.set(t.subarray(s),a),Q(this,Ci,XA).call(this,i,null),Q(this,Ci,jA).call(this),Q(this,Ci,wx).call(this,{type:"delete",pageNumbers:e})}copyPages(e){Q(this,Ci,rg).call(this,!0),V(this,qb,e),V(this,jy,e.map(t=>g(this,ps)[t-1])),Q(this,Ci,wx).call(this,{type:"copy",pageNumbers:e})}pastePages(e){Q(this,Ci,rg).call(this,!0);const t=g(this,ps),i=g(this,qo),r=g(this,qb),s=new Map;let a=e;for(const l of r)s.set(++a,l);this.pagesNumber+=r.length,Q(this,Ci,rg).call(this,!1);const o=g(this,ps);o.set(t.subarray(0,e),0),o.set(g(this,jy),e),o.set(t.subarray(e),e+r.length),Q(this,Ci,XA).call(this,i,s),Q(this,Ci,jA).call(this),Q(this,Ci,wx).call(this,{type:"paste"}),V(this,jy,null)}hasBeenAltered(){return g(this,ps)!==null}getPageMappingForSaving(){const e=g(this,qo);let t=0;for(const r of e.values())t=Math.max(t,r.length);const i=new Array(t);for(let r=0;r<t;r++)i[r]={document:null,pageIndices:[],includePages:[]};for(const[r,s]of e)for(let a=0,o=s.length;a<o;a++)i[a].includePages.push([r-1,s[a]-1]);for(const{includePages:r,pageIndices:s}of i){r.sort((a,o)=>a[0]-o[0]);for(let a=0,o=r.length;a<o;a++)s.push(r[a][1]),r[a]=r[a][0]}return i}getPrevPageNumber(e){return g(this,$y)[e-1]??0}getPageNumber(e){var t;return g(this,qo)?((t=g(this,qo).get(e))==null?void 0:t[0])??0:e}getPageId(e){var t;return((t=g(this,ps))==null?void 0:t[e-1])??e}getMapping(){return g(this,ps).subarray(0,this.pagesNumber)}}qo=new WeakMap,ps=new WeakMap,$y=new WeakMap,Nc=new WeakMap,_g=new WeakMap,jy=new WeakMap,qb=new WeakMap,Ci=new WeakSet,AF=function(){V(this,ps,null),V(this,qo,null)},wx=function(e){for(const t of g(this,_g))t(e)},rg=function(e){if(g(this,ps))return;const t=g(this,Nc),i=V(this,ps,new Uint32Array(t));V(this,$y,new Int32Array(i));const r=V(this,qo,new Map);if(e)for(let s=1;s<=t;s++)i[s-1]=s,r.set(s,[s])},jA=function(){const e=g(this,qo),t=g(this,ps);e.clear();for(let i=0,r=g(this,Nc);i<r;i++){const s=t[i],a=e.get(s);a?a.push(i+1):e.set(s,[i+1])}},XA=function(e,t){var a;const i=g(this,$y),r=g(this,ps),s=new Map;for(let o=0,l=g(this,Nc);o<l;o++){const c=t==null?void 0:t.get(o+1);if(c){i[o]=-c;continue}const h=r[o],f=s.get(h)||0;i[o]=(a=e.get(h))==null?void 0:a[f],s.set(h,f+1)}};var $d,jd,$o,jo,$b,Xd,Xy,Ky,jb,DC,mK,Ds,yK,vK,sy,Ax;const Hu=class Hu{constructor(e){Y(this,Ds);Y(this,$d,null);Y(this,jd,null);Y(this,$o);Y(this,jo,null);Y(this,$b,null);Y(this,Xd,null);Y(this,Xy,null);Y(this,Ky,null);V(this,$o,e),g(Hu,jb)||V(Hu,jb,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 e=V(this,$d,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=g(this,$o)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",gl,{signal:t}),e.addEventListener("pointerdown",Q(Hu,DC,mK),{signal:t}));const i=V(this,jo,document.createElement("div"));i.className="buttons",e.append(i);const r=g(this,$o).toolbarPosition;if(r){const{style:s}=e,a=g(this,$o)._uiManager.direction==="ltr"?1-r[0]:r[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return g(this,$d)}hide(){var e;g(this,$d).classList.add("hidden"),(e=g(this,jd))==null||e.hideDropdown()}show(){var e,t;g(this,$d).classList.remove("hidden"),(e=g(this,$b))==null||e.shown(),(t=g(this,Xd))==null||t.shown()}addDeleteButton(){const{editorType:e,_uiManager:t}=g(this,$o),i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",g(Hu,jb)[e]),Q(this,Ds,sy).call(this,i)&&i.addEventListener("click",r=>{t.delete()},{signal:t._signal}),g(this,jo).append(i)}async addAltText(e){const t=await e.render();Q(this,Ds,sy).call(this,t),g(this,jo).append(t,g(this,Ds,Ax)),V(this,$b,e)}addComment(e,t=null){if(g(this,Xd))return;const i=e.renderForToolbar();if(!i)return;Q(this,Ds,sy).call(this,i);const r=V(this,Xy,g(this,Ds,Ax));t?(g(this,jo).insertBefore(i,t),g(this,jo).insertBefore(r,t)):g(this,jo).append(i,r),V(this,Xd,e),e.toolbar=this}addColorPicker(e){if(g(this,jd))return;V(this,jd,e);const t=e.renderButton();Q(this,Ds,sy).call(this,t),g(this,jo).append(t,g(this,Ds,Ax))}async addEditSignatureButton(e){const t=V(this,Ky,await e.renderEditButton(g(this,$o)));Q(this,Ds,sy).call(this,t),g(this,jo).append(t,g(this,Ds,Ax))}removeButton(e){var t,i;switch(e){case"comment":(t=g(this,Xd))==null||t.removeToolbarCommentButton(),V(this,Xd,null),(i=g(this,Xy))==null||i.remove(),V(this,Xy,null);break}}async addButton(e,t){switch(e){case"colorPicker":t&&this.addColorPicker(t);break;case"altText":t&&await this.addAltText(t);break;case"editSignature":t&&await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":t&&this.addComment(t);break}}async addButtonBefore(e,t,i){if(!t&&e==="comment")return;const r=g(this,jo).querySelector(i);r&&e==="comment"&&this.addComment(t,r)}updateEditSignatureButton(e){g(this,Ky)&&(g(this,Ky).title=e)}remove(){var e;g(this,$d).remove(),(e=g(this,jd))==null||e.destroy(),V(this,jd,null)}};$d=new WeakMap,jd=new WeakMap,$o=new WeakMap,jo=new WeakMap,$b=new WeakMap,Xd=new WeakMap,Xy=new WeakMap,Ky=new WeakMap,jb=new WeakMap,DC=new WeakSet,mK=function(e){e.stopPropagation()},Ds=new WeakSet,yK=function(e){g(this,$o)._focusEventsAllowed=!1,Yi(e)},vK=function(e){g(this,$o)._focusEventsAllowed=!0,Yi(e)},sy=function(e){const t=g(this,$o)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",Q(this,Ds,yK).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",Q(this,Ds,vK).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",gl,{signal:t}),!0)},Ax=function(){const e=document.createElement("div");return e.className="divider",e},Y(Hu,DC),Y(Hu,jb,null);let SF=Hu;var Xb,xg,Gu,$h,_K,xK,DF;class T_e{constructor(e){Y(this,$h);Y(this,Xb,null);Y(this,xg,null);Y(this,Gu);V(this,Gu,e)}show(e,t,i){const[r,s]=Q(this,$h,xK).call(this,t,i),{style:a}=g(this,xg)||V(this,xg,Q(this,$h,_K).call(this));e.append(g(this,xg)),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){g(this,xg).remove()}}Xb=new WeakMap,xg=new WeakMap,Gu=new WeakMap,$h=new WeakSet,_K=function(){const e=V(this,xg,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const t=g(this,Gu)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",gl,{signal:t});const i=V(this,Xb,document.createElement("div"));return i.className="buttons",e.append(i),g(this,Gu).hasCommentManager()&&Q(this,$h,DF).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{g(this,Gu).commentSelection("floating_button")}),Q(this,$h,DF).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{g(this,Gu).highlightSelection("floating_button")}),e},xK=function(e,t){let i=0,r=0;for(const s of e){const a=s.y+s.height;if(a<i)continue;const o=s.x+(t?s.width:0);if(a>i){r=o,i=a;continue}t?o>r&&(r=o):o<r&&(r=o)}return[t?1-r:r,i]},DF=function(e,t,i,r){const s=document.createElement("button");s.classList.add("basic",e),s.tabIndex=0,s.setAttribute("data-l10n-id",t);const a=document.createElement("span");s.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",i);const o=g(this,Gu)._signal;o instanceof AbortSignal&&!o.aborted&&(s.addEventListener("contextmenu",gl,{signal:o}),s.addEventListener("click",r,{signal:o})),g(this,Xb).append(s)};function bK(n,e,t){for(const i of t)e.addEventListener(i,n[i].bind(n))}var bg,Tg,Yy,Eg;const li=class li{static initializeAndAddPointerId(e){(g(li,Tg)||V(li,Tg,new Set)).add(e)}static setPointer(e,t){g(li,bg)||V(li,bg,t),g(li,Eg)??V(li,Eg,e)}static setTimeStamp(e){V(li,Yy,e)}static isSamePointerId(e){return g(li,bg)===e}static isSamePointerIdOrRemove(e){var t;return g(li,bg)===e?!0:((t=g(li,Tg))==null||t.delete(e),!1)}static isSamePointerType(e){return g(li,Eg)===e}static isInitializedAndDifferentPointerType(e){return g(li,Eg)!==null&&!li.isSamePointerType(e)}static isSameTimeStamp(e){return g(li,Yy)===e}static isUsingMultiplePointers(){var e;return((e=g(li,Tg))==null?void 0:e.size)>=1}static clearPointerType(){V(li,Eg,null)}static clearPointerIds(){V(li,bg,NaN),V(li,Tg,null)}static clearTimeStamp(){V(li,Yy,NaN)}};bg=new WeakMap,Tg=new WeakMap,Yy=new WeakMap,Eg=new WeakMap,Y(li,bg,NaN),Y(li,Tg,null),Y(li,Yy,NaN),Y(li,Eg,null);let Ps=li;var CC;class E_e{constructor(){Y(this,CC,0)}get id(){return`${vb}${Dr(this,CC)._++}`}}CC=new WeakMap;var Jy,Kb,Ls,Qy,KA;const N5=class N5{constructor(){Y(this,Qy);Y(this,Jy,uK());Y(this,Kb,0);Y(this,Ls,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;const s=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return tn(this,"_isSVGFittingCanvas",s)}async getFromFile(e){const{lastModified:t,name:i,size:r,type:s}=e;return Q(this,Qy,KA).call(this,`${t}_${i}_${r}_${s}`,e)}async getFromUrl(e){return Q(this,Qy,KA).call(this,e,e)}async getFromBlob(e,t){const i=await t;return Q(this,Qy,KA).call(this,e,i)}async getFromId(e){g(this,Ls)||V(this,Ls,new Map);const t=g(this,Ls).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:i}=t;return delete t.blobPromise,this.getFromBlob(t.id,i)}return this.getFromUrl(t.url)}getFromCanvas(e,t){g(this,Ls)||V(this,Ls,new Map);let i=g(this,Ls).get(e);if(i!=null&&i.bitmap)return i.refCounter+=1,i;const r=new OffscreenCanvas(t.width,t.height);return r.getContext("2d").drawImage(t,0,0),i={bitmap:r.transferToImageBitmap(),id:`image_${g(this,Jy)}_${Dr(this,Kb)._++}`,refCounter:1,isSvg:!1},g(this,Ls).set(e,i),g(this,Ls).set(i.id,i),i}getSvgUrl(e){const t=g(this,Ls).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){var r;g(this,Ls)||V(this,Ls,new Map);const t=g(this,Ls).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:i}=t;if(!t.url&&!t.file){const s=new OffscreenCanvas(i.width,i.height);s.getContext("bitmaprenderer").transferFromImageBitmap(i),t.blobPromise=s.convertToBlob()}(r=i.close)==null||r.call(i),t.bitmap=null}isValidId(e){return e.startsWith(`image_${g(this,Jy)}_`)}};Jy=new WeakMap,Kb=new WeakMap,Ls=new WeakMap,Qy=new WeakSet,KA=async function(e,t){g(this,Ls)||V(this,Ls,new Map);let i=g(this,Ls).get(e);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${g(this,Jy)}_${Dr(this,Kb)._++}`,refCounter:0,isSvg:!1});let r;if(typeof t=="string"?(i.url=t,r=await XT(t,"blob")):t instanceof File?r=i.file=t:t instanceof Blob&&(r=t),r.type==="image/svg+xml"){const s=N5._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,h)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,c()},a.onload=async()=>{const f=i.svgUrl=a.result;o.src=await s?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=h});a.readAsDataURL(r),await l}else i.bitmap=await createImageBitmap(r);i.refCounter=1}catch(r){an(r),i=null}return g(this,Ls).set(e,i),i&&g(this,Ls).set(i.id,i),i};let CF=N5;var nr,Kd,Yb,Oi;class w_e{constructor(e=128){Y(this,nr,[]);Y(this,Kd,!1);Y(this,Yb);Y(this,Oi,-1);V(this,Yb,e)}add({cmd:e,undo:t,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),g(this,Kd))return;const l={cmd:e,undo:t,post:i,type:s};if(g(this,Oi)===-1){g(this,nr).length>0&&(g(this,nr).length=0),V(this,Oi,0),g(this,nr).push(l);return}if(a&&g(this,nr)[g(this,Oi)].type===s){o&&(l.undo=g(this,nr)[g(this,Oi)].undo),g(this,nr)[g(this,Oi)]=l;return}const c=g(this,Oi)+1;c===g(this,Yb)?g(this,nr).splice(0,1):(V(this,Oi,c),c<g(this,nr).length&&g(this,nr).splice(c)),g(this,nr).push(l)}undo(){if(g(this,Oi)===-1)return;V(this,Kd,!0);const{undo:e,post:t}=g(this,nr)[g(this,Oi)];e(),t==null||t(),V(this,Kd,!1),V(this,Oi,g(this,Oi)-1)}redo(){if(g(this,Oi)<g(this,nr).length-1){V(this,Oi,g(this,Oi)+1),V(this,Kd,!0);const{cmd:e,post:t}=g(this,nr)[g(this,Oi)];e(),t==null||t(),V(this,Kd,!1)}}hasSomethingToUndo(){return g(this,Oi)!==-1}hasSomethingToRedo(){return g(this,Oi)<g(this,nr).length-1}cleanType(e){if(g(this,Oi)!==-1){for(let t=g(this,Oi);t>=0;t--)if(g(this,nr)[t].type!==e){g(this,nr).splice(t+1,g(this,Oi)-t),V(this,Oi,t);return}g(this,nr).length=0,V(this,Oi,-1)}}destroy(){V(this,nr,null)}}nr=new WeakMap,Kd=new WeakMap,Yb=new WeakMap,Oi=new WeakMap;var IC,TK;class JT{constructor(e){Y(this,IC);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=Pr.platform;for(const[i,r,s={}]of e)for(const a of i){const o=a.startsWith("mac+");t&&o?(this.callbacks.set(a.slice(4),{callback:r,options:s}),this.allKeys.add(a.split("+").at(-1))):!t&&!o&&(this.callbacks.set(a,{callback:r,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const i=this.callbacks.get(Q(this,IC,TK).call(this,t));if(!i)return;const{callback:r,options:{bubbles:s=!1,args:a=[],checker:o=null}}=i;o&&!o(e,t)||(r.bind(e,...a,t)(),s||Yi(t))}}IC=new WeakSet,TK=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t};const RC=class RC{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return m_e(e),tn(this,"_colors",e)}convert(e){const t=YT(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[i,r]of this._colors)if(r.every((s,a)=>s===t[a]))return RC._colorsMapping.get(i);return t}getHexCode(e){const t=this._colors.get(e);return t?St.makeHexColor(...t):e}};Ze(RC,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let IF=RC;var Zy,Ya,ev,Gi,gr,tv,Xo,nv,Ko,Os,Yd,Jd,Qd,Zd,kc,Yo,wg,Jb,Qb,iv,Zb,Mc,ef,rv,tf,Fc,NC,nf,sv,e2,rf,Ag,av,sf,t2,mr,Yn,qu,af,of,n2,ov,i2,lf,Uc,$u,r2,s2,Jo,wt,YA,RF,EK,wK,AK,Sx,SK,DK,CK,NF,IK,RK,NK,kK,Zs,Bu,MK,FK,kF,UK,Dx,MF;const Dy=class Dy{constructor(e,t,i,r,s,a,o,l,c,h,f,p,y,x,v,_){Y(this,wt);Y(this,Zy,new AbortController);Y(this,Ya,null);Y(this,ev,null);Y(this,Gi,new Map);Y(this,gr,new Map);Y(this,tv,null);Y(this,Xo,null);Y(this,nv,null);Y(this,Ko,new w_e);Y(this,Os,null);Y(this,Yd,null);Y(this,Jd,null);Y(this,Qd,0);Y(this,Zd,new Set);Y(this,kc,null);Y(this,Yo,null);Y(this,wg,new Set);Ze(this,"_editorUndoBar",null);Y(this,Jb,!1);Y(this,Qb,!1);Y(this,iv,!1);Y(this,Zb,null);Y(this,Mc,null);Y(this,ef,null);Y(this,rv,null);Y(this,tf,!1);Y(this,Fc,null);Y(this,NC,new E_e);Y(this,nf,!1);Y(this,sv,!1);Y(this,e2,!1);Y(this,rf,null);Y(this,Ag,null);Y(this,av,null);Y(this,sf,null);Y(this,t2,null);Y(this,mr,sn.NONE);Y(this,Yn,new Set);Y(this,qu,null);Y(this,af,null);Y(this,of,null);Y(this,n2,null);Y(this,ov,null);Y(this,i2,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});Y(this,lf,[0,0]);Y(this,Uc,null);Y(this,$u,null);Y(this,r2,null);Y(this,s2,null);Y(this,Jo,null);const E=this._signal=g(this,Zy).signal;V(this,$u,e),V(this,r2,t),V(this,s2,i),V(this,tv,r),V(this,Os,s),V(this,af,a),V(this,ov,l),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:E}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:E}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:E}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:E}),o._on("setpreference",this.onSetPreference.bind(this),{signal:E}),o._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:E}),window.addEventListener("pointerdown",()=>{V(this,sv,!0)},{capture:!0,signal:E}),window.addEventListener("pointerup",()=>{V(this,sv,!1)},{capture:!0,signal:E}),window.addEventListener("beforeunload",Q(this,wt,EK).bind(this),{capture:!0,signal:E}),Q(this,wt,SK).call(this),Q(this,wt,kK).call(this),Q(this,wt,NF).call(this),V(this,Xo,l.annotationStorage),V(this,Zb,l.filterFactory),V(this,of,c),V(this,rv,h||null),V(this,Jb,f),V(this,Qb,p),V(this,iv,y),V(this,t2,x||null),this.viewParameters={realScale:tp.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=v||null,this._supportsPinchToZoom=_!==!1,s==null||s.setSidebarUiManager(this)}static get _keyboardManager(){const e=Dy.prototype,t=a=>g(a,$u).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),i=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return tn(this,"_keyboardManager",new JT([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],e.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:i}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&g(a,$u).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&g(a,$u).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}]]))}destroy(){var e,t,i,r,s,a,o,l,c;(e=g(this,Jo))==null||e.resolve(),V(this,Jo,null),(t=g(this,Zy))==null||t.abort(),V(this,Zy,null),this._signal=null;for(const h of g(this,gr).values())h.destroy();g(this,gr).clear(),g(this,Gi).clear(),g(this,wg).clear(),(i=g(this,sf))==null||i.clear(),V(this,Ya,null),g(this,Yn).clear(),g(this,Ko).destroy(),(r=g(this,tv))==null||r.destroy(),(s=g(this,Os))==null||s.destroy(),(a=g(this,af))==null||a.destroy(),(o=g(this,Fc))==null||o.hide(),V(this,Fc,null),(l=g(this,av))==null||l.destroy(),V(this,av,null),V(this,ev,null),g(this,Mc)&&(clearTimeout(g(this,Mc)),V(this,Mc,null)),g(this,Uc)&&(clearTimeout(g(this,Uc)),V(this,Uc,null)),(c=this._editorUndoBar)==null||c.destroy(),V(this,ov,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return g(this,t2)}get useNewAltTextFlow(){return g(this,Qb)}get useNewAltTextWhenAddingImage(){return g(this,iv)}get hcmFilter(){return tn(this,"hcmFilter",g(this,of)?g(this,Zb).addHCMFilter(g(this,of).foreground,g(this,of).background):"none")}get direction(){return tn(this,"direction",getComputedStyle(g(this,$u)).direction)}get _highlightColors(){return tn(this,"_highlightColors",g(this,rv)?new Map(g(this,rv).split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return tn(this,"highlightColors",null);const t=new Map,i=!!g(this,of);for(const[r,s]of e){const a=r.endsWith("_HCM");if(i&&a){t.set(r.replace("_HCM",""),s);continue}!i&&!a&&t.set(r,s)}return tn(this,"highlightColors",t)}get highlightColorNames(){return tn(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),V(this,Jd,e)}setMainHighlightColorPicker(e){V(this,av,e)}editAltText(e,t=!1){var i;(i=g(this,tv))==null||i.editAltText(this,e,t)}hasCommentManager(){return!!g(this,Os)}editComment(e,t,i,r){var s;(s=g(this,Os))==null||s.showDialog(this,e,t,i,r)}selectComment(e,t){const i=g(this,gr).get(e),r=i==null?void 0:i.getEditorByUID(t);r==null||r.toggleComment(!0,!0)}updateComment(e){var t;(t=g(this,Os))==null||t.updateComment(e.getData())}updatePopupColor(e){var t;(t=g(this,Os))==null||t.updatePopupColor(e)}removeComment(e){var t;(t=g(this,Os))==null||t.removeComments([e.uid])}deleteComment(e,t){const i=()=>{e.comment=t},r=()=>{var s;(s=this._editorUndoBar)==null||s.show(i,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:r,undo:i,mustExec:!0})}toggleComment(e,t,i=void 0){var r;(r=g(this,Os))==null||r.toggleCommentPopup(e,t,i)}makeCommentColor(e,t){var i;return e&&((i=g(this,Os))==null?void 0:i.makeCommentColor(e,t))||null}getCommentDialogElement(){var e;return((e=g(this,Os))==null?void 0:e.dialogElement)||null}async waitForEditorsRendered(e){if(g(this,gr).has(e-1))return;const{resolve:t,promise:i}=Promise.withResolvers(),r=s=>{s.pageNumber===e&&(this._eventBus._off("editorsrendered",r),t())};this._eventBus.on("editorsrendered",r),await i}getSignature(e){var t;(t=g(this,af))==null||t.getSignature({uiManager:this,editor:e})}get signatureManager(){return g(this,af)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":V(this,iv,t);break}}onPageChanging({pageNumber:e}){V(this,Qd,e-1)}deletePage(e){for(const t of this.getEditors(e))t.remove();g(this,gr).delete(e),g(this,Qd)===e&&V(this,Qd,0)}focusMainContainer(){g(this,$u).focus()}findParent(e,t){for(const i of g(this,gr).values()){const{x:r,y:s,width:a,height:o}=i.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=s&&t<=s+o)return i}return null}disableUserSelect(e=!1){g(this,r2).classList.toggle("noUserSelect",e)}addShouldRescale(e){g(this,wg).add(e)}removeShouldRescale(e){g(this,wg).delete(e)}onScaleChanging({scale:e}){var t;this.commitOrRemove(),this.viewParameters.realScale=e*tp.PDF_TO_CSS_UNITS;for(const i of g(this,wg))i.onScaleChanging();(t=g(this,Jd))==null||t.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",t=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:s,focusNode:a,focusOffset:o}=i,l=i.toString(),h=Q(this,wt,YA).call(this,i).closest(".textLayer"),f=this.getSelectionBoxes(h);if(!f)return;i.empty();const p=Q(this,wt,RF).call(this,h),y=g(this,mr)===sn.NONE,x=()=>{const v=p==null?void 0:p.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:f,anchorNode:r,anchorOffset:s,focusNode:a,focusOffset:o,text:l});y&&this.showAllEditors("highlight",!0,!0),t&&(v==null||v.editComment())};if(y){this.switchToMode(sn.HIGHLIGHT,x);return}x()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!g(this,Xo))return null;const t=`${vb}${e}`,i=g(this,Xo).getRawValue(t);return i&&g(this,Xo).remove(t),i}addToAnnotationStorage(e){!e.isEmpty()&&g(this,Xo)&&!g(this,Xo).has(e.id)&&g(this,Xo).setValue(e.id,e)}a11yAlert(e,t=null){const i=g(this,s2);i&&(i.setAttribute("data-l10n-id",e),t?i.setAttribute("data-l10n-args",JSON.stringify(t)):i.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,g(this,tf)&&(V(this,tf,!1),Q(this,wt,Sx).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of g(this,Yn))if(t.div.contains(e)){V(this,Ag,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!g(this,Ag))return;const[e,t]=g(this,Ag);V(this,Ag,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){Q(this,wt,NF).call(this),this.setEditingState(!0)}removeEditListeners(){Q(this,wt,IK).call(this),this.setEditingState(!1)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const i of g(this,Yo))if(i.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const i of g(this,Yo))if(i.isHandlingMimeForPasting(t.type)){i.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=g(this,Ya))==null||i.commitOrRemove(),!this.hasSelection)return;const t=[];for(const r of g(this,Yn)){const s=r.serialize(!0);s&&t.push(s)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const s of t.items)for(const a of g(this,Yo))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let i=t.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){an(`paste: "${s.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const r=this.currentLayer;try{const s=[];for(const l of i){const c=await r.deserialize(l);if(!c)return;s.push(c)}const a=()=>{for(const l of s)Q(this,wt,kF).call(this,l);Q(this,wt,MF).call(this,s)},o=()=>{for(const l of s)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){an(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),g(this,mr)!==sn.NONE&&!this.isEditorHandlingKeyboard&&Dy._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,g(this,tf)&&(V(this,tf,!1),Q(this,wt,Sx).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(e){e?(Q(this,wt,DK).call(this),Q(this,wt,RK).call(this),Q(this,wt,Zs).call(this,{isEditing:g(this,mr)!==sn.NONE,isEmpty:Q(this,wt,Dx).call(this),hasSomethingToUndo:g(this,Ko).hasSomethingToUndo(),hasSomethingToRedo:g(this,Ko).hasSomethingToRedo(),hasSelectedEditor:!1})):(Q(this,wt,CK).call(this),Q(this,wt,NK).call(this),Q(this,wt,Zs).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!g(this,Yo)){V(this,Yo,e);for(const t of g(this,Yo))Q(this,wt,Bu).call(this,t.defaultPropertiesToUpdate)}}getId(){return g(this,NC).id}get currentLayer(){return g(this,gr).get(g(this,Qd))}getLayer(e){return g(this,gr).get(e)}get currentPageIndex(){return g(this,Qd)}addLayer(e){g(this,gr).set(e.pageIndex,e),g(this,nf)?e.enable():e.disable()}removeLayer(e){g(this,gr).delete(e.pageIndex)}async updateMode(e,t=null,i=!1,r=!1,s=!1,a=!1){var o,l,c,h,f,p;if(g(this,mr)!==e&&!(g(this,Jo)&&(await g(this,Jo).promise,!g(this,Jo)))){if(V(this,Jo,Promise.withResolvers()),(o=g(this,Jd))==null||o.commitOrRemove(),g(this,mr)===sn.POPUP&&((l=g(this,Os))==null||l.hideSidebar()),(c=g(this,Os))==null||c.destroyPopup(),V(this,mr,e),e===sn.NONE){this.setEditingState(!1),Q(this,wt,FK).call(this);for(const y of g(this,Gi).values())y.hideStandaloneCommentButton();(h=this._editorUndoBar)==null||h.hide(),this.toggleComment(null),g(this,Jo).resolve();return}for(const y of g(this,Gi).values())y.addStandaloneCommentButton();e===sn.SIGNATURE&&await((f=g(this,af))==null?void 0:f.loadSignatures()),i&&Ps.clearPointerType(),this.setEditingState(!0),await Q(this,wt,MK).call(this),this.unselectAll();for(const y of g(this,gr).values())y.updateMode(e);if(e===sn.POPUP){g(this,ev)||V(this,ev,await g(this,ov).getAnnotationsByType(new Set(g(this,Yo).map(v=>v._editorType))));const y=new Set,x=[];for(const v of g(this,Gi).values()){const{annotationElementId:_,hasComment:E,deleted:w}=v;_&&y.add(_),E&&!w&&x.push(v.getData())}for(const v of g(this,ev)){const{id:_,popupRef:E,contentsObj:w}=v;E&&(w!=null&&w.str)&&!y.has(_)&&!g(this,Zd).has(_)&&x.push(v)}(p=g(this,Os))==null||p.showSidebar(x)}if(!t){r&&this.addNewEditorFromKeyboard(),g(this,Jo).resolve();return}for(const y of g(this,Gi).values())y.uid===t?(this.setSelected(y),a?y.editComment():s?y.enterInEditMode():y.focus()):y.unselect();g(this,Jo).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==g(this,mr)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(g(this,Yo)){switch(e){case Dn.CREATE:this.currentLayer.addNewEditor(t);return;case Dn.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(g(this,n2)||V(this,n2,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(const i of g(this,Yn))i.updateParams(e,t);else for(const i of g(this,Yo))i.updateDefaultParams(e,t)}}showAllEditors(e,t,i=!1){var s;for(const a of g(this,Gi).values())a.editorType===e&&a.show(t);(((s=g(this,n2))==null?void 0:s.get(Dn.HIGHLIGHT_SHOW_ALL))??!0)!==t&&Q(this,wt,Bu).call(this,[[Dn.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(g(this,e2)!==e){V(this,e2,e);for(const t of g(this,gr).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(const t of g(this,Gi).values())t.pageIndex===e&&(yield t)}getEditor(e){return g(this,Gi).get(e)}addEditor(e){g(this,Gi).set(e.id,e)}removeEditor(e){var t,i;e.div.contains(document.activeElement)&&(g(this,Mc)&&clearTimeout(g(this,Mc)),V(this,Mc,setTimeout(()=>{this.focusMainContainer(),V(this,Mc,null)},0))),g(this,Gi).delete(e.id),e.annotationElementId&&((t=g(this,sf))==null||t.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!g(this,Zd).has(e.annotationElementId))&&((i=g(this,Xo))==null||i.remove(e.id))}addDeletedAnnotationElement(e){g(this,Zd).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return g(this,Zd).has(e)}removeDeletedAnnotationElement(e){g(this,Zd).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){g(this,Ya)!==e&&(V(this,Ya,e),e&&Q(this,wt,Bu).call(this,e.propertiesToUpdate))}updateUI(e){g(this,wt,UK)===e&&Q(this,wt,Bu).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){Q(this,wt,Bu).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(g(this,Yn).has(e)){g(this,Yn).delete(e),e.unselect(),Q(this,wt,Zs).call(this,{hasSelectedEditor:this.hasSelection});return}g(this,Yn).add(e),e.select(),Q(this,wt,Bu).call(this,e.propertiesToUpdate),Q(this,wt,Zs).call(this,{hasSelectedEditor:!0})}setSelected(e){var t;this.updateToolbar({mode:e.mode,editId:e.uid}),(t=g(this,Jd))==null||t.commitOrRemove();for(const i of g(this,Yn))i!==e&&i.unselect();g(this,Yn).clear(),g(this,Yn).add(e),e.select(),Q(this,wt,Bu).call(this,e.propertiesToUpdate),Q(this,wt,Zs).call(this,{hasSelectedEditor:!0})}isSelected(e){return g(this,Yn).has(e)}get firstSelectedEditor(){return g(this,Yn).values().next().value}unselect(e){e.unselect(),g(this,Yn).delete(e),Q(this,wt,Zs).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return g(this,Yn).size!==0}get isEnterHandled(){return g(this,Yn).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;g(this,Ko).undo(),Q(this,wt,Zs).call(this,{hasSomethingToUndo:g(this,Ko).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Q(this,wt,Dx).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){g(this,Ko).redo(),Q(this,wt,Zs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:g(this,Ko).hasSomethingToRedo(),isEmpty:Q(this,wt,Dx).call(this)})}addCommands(e){g(this,Ko).add(e),Q(this,wt,Zs).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Q(this,wt,Dx).call(this)})}cleanUndoStack(e){g(this,Ko).cleanType(e)}delete(){var s;this.commitOrRemove();const e=(s=this.currentLayer)==null?void 0:s.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...g(this,Yn)],i=()=>{var a;(a=this._editorUndoBar)==null||a.show(r,t.length===1?t[0].editorType:t.length);for(const o of t)o.remove()},r=()=>{for(const a of t)Q(this,wt,kF).call(this,a)};this.addCommands({cmd:i,undo:r,mustExec:!0})}commitOrRemove(){var e;(e=g(this,Ya))==null||e.commitOrRemove()}hasSomethingToControl(){return g(this,Ya)||this.hasSelection}selectAll(){for(const e of g(this,Yn))e.commit();Q(this,wt,MF).call(this,g(this,Gi).values())}unselectAll(){var e;if(!(g(this,Ya)&&(g(this,Ya).commitOrRemove(),g(this,mr)!==sn.NONE))&&!((e=g(this,Jd))!=null&&e.commitOrRemove())&&this.hasSelection){for(const t of g(this,Yn))t.unselect();g(this,Yn).clear(),Q(this,wt,Zs).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;g(this,lf)[0]+=e,g(this,lf)[1]+=t;const[r,s]=g(this,lf),a=[...g(this,Yn)],o=1e3;g(this,Uc)&&clearTimeout(g(this,Uc)),V(this,Uc,setTimeout(()=>{V(this,Uc,null),g(this,lf)[0]=g(this,lf)[1]=0,this.addCommands({cmd:()=>{for(const l of a)g(this,Gi).has(l.id)&&(l.translateInPage(r,s),l.translationDone())},undo:()=>{for(const l of a)g(this,Gi).has(l.id)&&(l.translateInPage(-r,-s),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(e,t),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),V(this,kc,new Map);for(const e of g(this,Yn))g(this,kc).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!g(this,kc))return!1;this.disableUserSelect(!1);const e=g(this,kc);V(this,kc,null);let t=!1;for(const[{x:r,y:s,pageIndex:a},o]of e)o.newX=r,o.newY=s,o.newPageIndex=a,t||(t=r!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!t)return!1;const i=(r,s,a,o)=>{if(g(this,Gi).has(r.id)){const l=g(this,gr).get(o);l?r._setParentAndPosition(l,s,a):(r.pageIndex=o,r.x=s,r.y=a)}};return this.addCommands({cmd:()=>{for(const[r,{newX:s,newY:a,newPageIndex:o}]of e)i(r,s,a,o)},undo:()=>{for(const[r,{savedX:s,savedY:a,savedPageIndex:o}]of e)i(r,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(g(this,kc))for(const i of g(this,kc).keys())i.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||g(this,Yn).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return g(this,Ya)===e}getActive(){return g(this,Ya)}getMode(){return g(this,mr)}isEditingMode(){return g(this,mr)!==sn.NONE}get imageManager(){return tn(this,"imageManager",new CF)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let c=0,h=t.rangeCount;c<h;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:r,width:s,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,h,f,p)=>({x:(h-r)/a,y:1-(c+f-i)/s,width:p/a,height:f/s});break;case"180":o=(c,h,f,p)=>({x:1-(c+f-i)/s,y:1-(h+p-r)/a,width:f/s,height:p/a});break;case"270":o=(c,h,f,p)=>({x:1-(h+p-r)/a,y:(c-i)/s,width:p/a,height:f/s});break;default:o=(c,h,f,p)=>({x:(c-i)/s,y:(h-r)/a,width:f/s,height:p/a});break}const l=[];for(let c=0,h=t.rangeCount;c<h;c++){const f=t.getRangeAt(c);if(!f.collapsed)for(const{x:p,y,width:x,height:v}of f.getClientRects())x===0||v===0||l.push(o(p,y,x,v))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(g(this,nv)||V(this,nv,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=g(this,nv))==null||t.delete(e)}renderAnnotationElement(e){var r;const t=(r=g(this,nv))==null?void 0:r.get(e.data.id);if(!t)return;const i=g(this,Xo).getRawValue(t);i&&(g(this,mr)===sn.NONE&&!i.hasBeenModified||i.renderAnnotationElement(e))}setMissingCanvas(e,t,i){var s;const r=(s=g(this,sf))==null?void 0:s.get(e);r&&(r.setCanvas(t,i),g(this,sf).delete(e))}addMissingCanvas(e,t){(g(this,sf)||V(this,sf,new Map)).set(e,t)}};Zy=new WeakMap,Ya=new WeakMap,ev=new WeakMap,Gi=new WeakMap,gr=new WeakMap,tv=new WeakMap,Xo=new WeakMap,nv=new WeakMap,Ko=new WeakMap,Os=new WeakMap,Yd=new WeakMap,Jd=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,kc=new WeakMap,Yo=new WeakMap,wg=new WeakMap,Jb=new WeakMap,Qb=new WeakMap,iv=new WeakMap,Zb=new WeakMap,Mc=new WeakMap,ef=new WeakMap,rv=new WeakMap,tf=new WeakMap,Fc=new WeakMap,NC=new WeakMap,nf=new WeakMap,sv=new WeakMap,e2=new WeakMap,rf=new WeakMap,Ag=new WeakMap,av=new WeakMap,sf=new WeakMap,t2=new WeakMap,mr=new WeakMap,Yn=new WeakMap,qu=new WeakMap,af=new WeakMap,of=new WeakMap,n2=new WeakMap,ov=new WeakMap,i2=new WeakMap,lf=new WeakMap,Uc=new WeakMap,$u=new WeakMap,r2=new WeakMap,s2=new WeakMap,Jo=new WeakMap,wt=new WeakSet,YA=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},RF=function(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const i of g(this,gr).values())if(i.hasTextLayer(e))return i;return null},EK=function(e){var t;this.commitOrRemove(),(t=this.currentLayer)==null||t.endDrawingSession(!1)},wK=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const i=Q(this,wt,YA).call(this,e).closest(".textLayer"),r=this.getSelectionBoxes(i);r&&(g(this,Fc)||V(this,Fc,new T_e(this)),g(this,Fc).show(i,r,this.direction==="ltr"))},AK=function(){var s,a,o;const e=document.getSelection();if(!e||e.isCollapsed){g(this,qu)&&((s=g(this,Fc))==null||s.hide(),V(this,qu,null),Q(this,wt,Zs).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===g(this,qu))return;const r=Q(this,wt,YA).call(this,e).closest(".textLayer");if(!r){g(this,qu)&&((a=g(this,Fc))==null||a.hide(),V(this,qu,null),Q(this,wt,Zs).call(this,{hasSelectedText:!1}));return}if((o=g(this,Fc))==null||o.hide(),V(this,qu,t),Q(this,wt,Zs).call(this,{hasSelectedText:!0}),!(g(this,mr)!==sn.HIGHLIGHT&&g(this,mr)!==sn.NONE)&&(g(this,mr)===sn.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),V(this,tf,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=g(this,mr)===sn.HIGHLIGHT?Q(this,wt,RF).call(this,r):null;if(l==null||l.toggleDrawing(),g(this,sv)){const c=new AbortController,h=this.combinedSignal(c),f=p=>{p.type==="pointerup"&&p.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),p.type==="pointerup"&&Q(this,wt,Sx).call(this,"main_toolbar"))};window.addEventListener("pointerup",f,{signal:h}),window.addEventListener("blur",f,{signal:h})}else l==null||l.toggleDrawing(!0),Q(this,wt,Sx).call(this,"main_toolbar")}},Sx=function(e=""){g(this,mr)===sn.HIGHLIGHT?this.highlightSelection(e):g(this,Jb)&&Q(this,wt,wK).call(this)},SK=function(){document.addEventListener("selectionchange",Q(this,wt,AK).bind(this),{signal:this._signal})},DK=function(){if(g(this,ef))return;V(this,ef,new AbortController);const e=this.combinedSignal(g(this,ef));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},CK=function(){var e;(e=g(this,ef))==null||e.abort(),V(this,ef,null)},NF=function(){if(g(this,rf))return;V(this,rf,new AbortController);const e=this.combinedSignal(g(this,rf));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},IK=function(){var e;(e=g(this,rf))==null||e.abort(),V(this,rf,null)},RK=function(){if(g(this,Yd))return;V(this,Yd,new AbortController);const e=this.combinedSignal(g(this,Yd));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},NK=function(){var e;(e=g(this,Yd))==null||e.abort(),V(this,Yd,null)},kK=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Zs=function(e){Object.entries(e).some(([i,r])=>g(this,i2)[i]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(g(this,i2),e)}),g(this,mr)===sn.HIGHLIGHT&&e.hasSelectedEditor===!1&&Q(this,wt,Bu).call(this,[[Dn.HIGHLIGHT_FREE,!0]]))},Bu=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},MK=async function(){if(!g(this,nf)){V(this,nf,!0);const e=[];for(const t of g(this,gr).values())e.push(t.enable());await Promise.all(e);for(const t of g(this,Gi).values())t.enable()}},FK=function(){if(this.unselectAll(),g(this,nf)){V(this,nf,!1);for(const e of g(this,gr).values())e.disable();for(const e of g(this,Gi).values())e.disable()}},kF=function(e){const t=g(this,gr).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},UK=function(){let e=null;for(e of g(this,Yn));return e},Dx=function(){if(g(this,Gi).size===0)return!0;if(g(this,Gi).size===1)for(const e of g(this,Gi).values())return e.isEmpty();return!1},MF=function(e){for(const t of g(this,Yn))t.unselect();g(this,Yn).clear();for(const t of e)t.isEmpty()||(g(this,Yn).add(t),t.select());Q(this,wt,Zs).call(this,{hasSelectedEditor:this.hasSelection})},Ze(Dy,"TRANSLATE_SMALL",1),Ze(Dy,"TRANSLATE_BIG",10);let Om=Dy;var zr,Pc,Pl,lv,Lc,Ja,cv,Oc,wa,ju,Sg,Bc,cf,Zl,Cx,JA;const ea=class ea{constructor(e){Y(this,Zl);Y(this,zr,null);Y(this,Pc,!1);Y(this,Pl,null);Y(this,lv,null);Y(this,Lc,null);Y(this,Ja,null);Y(this,cv,!1);Y(this,Oc,null);Y(this,wa,null);Y(this,ju,null);Y(this,Sg,null);Y(this,Bc,!1);V(this,wa,e),V(this,Bc,e._uiManager.useNewAltTextFlow),g(ea,cf)||V(ea,cf,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(e){ea._l10n??(ea._l10n=e)}async render(){const e=V(this,Pl,document.createElement("button"));e.className="altText",e.tabIndex="0";const t=V(this,lv,document.createElement("span"));e.append(t),g(this,Bc)?(e.classList.add("new"),e.setAttribute("data-l10n-id",g(ea,cf).missing),t.setAttribute("data-l10n-id",g(ea,cf)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=g(this,wa)._uiManager._signal;e.addEventListener("contextmenu",gl,{signal:i}),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:i});const r=s=>{s.preventDefault(),g(this,wa)._uiManager.editAltText(g(this,wa)),g(this,Bc)&&g(this,wa)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:g(this,Zl,Cx)}})};return e.addEventListener("click",r,{capture:!0,signal:i}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(V(this,cv,!0),r(s))},{signal:i}),await Q(this,Zl,JA).call(this),e}finish(){g(this,Pl)&&(g(this,Pl).focus({focusVisible:g(this,cv)}),V(this,cv,!1))}isEmpty(){return g(this,Bc)?g(this,zr)===null:!g(this,zr)&&!g(this,Pc)}hasData(){return g(this,Bc)?g(this,zr)!==null||!!g(this,ju):this.isEmpty()}get guessedText(){return g(this,ju)}async setGuessedText(e){g(this,zr)===null&&(V(this,ju,e),V(this,Sg,await ea._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),Q(this,Zl,JA).call(this))}toggleAltTextBadge(e=!1){var t;if(!g(this,Bc)||g(this,zr)){(t=g(this,Oc))==null||t.remove(),V(this,Oc,null);return}if(!g(this,Oc)){const i=V(this,Oc,document.createElement("div"));i.className="noAltTextBadge",g(this,wa).div.append(i)}g(this,Oc).classList.toggle("hidden",!e)}serialize(e){let t=g(this,zr);return!e&&g(this,ju)===t&&(t=g(this,Sg)),{altText:t,decorative:g(this,Pc),guessedText:g(this,ju),textWithDisclaimer:g(this,Sg)}}get data(){return{altText:g(this,zr),decorative:g(this,Pc)}}set data({altText:e,decorative:t,guessedText:i,textWithDisclaimer:r,cancel:s=!1}){i&&(V(this,ju,i),V(this,Sg,r)),!(g(this,zr)===e&&g(this,Pc)===t)&&(s||(V(this,zr,e),V(this,Pc,t)),Q(this,Zl,JA).call(this))}toggle(e=!1){g(this,Pl)&&(!e&&g(this,Ja)&&(clearTimeout(g(this,Ja)),V(this,Ja,null)),g(this,Pl).disabled=!e)}shown(){g(this,wa)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:g(this,Zl,Cx)}})}destroy(){var e,t;(e=g(this,Pl))==null||e.remove(),V(this,Pl,null),V(this,lv,null),V(this,Lc,null),(t=g(this,Oc))==null||t.remove(),V(this,Oc,null)}};zr=new WeakMap,Pc=new WeakMap,Pl=new WeakMap,lv=new WeakMap,Lc=new WeakMap,Ja=new WeakMap,cv=new WeakMap,Oc=new WeakMap,wa=new WeakMap,ju=new WeakMap,Sg=new WeakMap,Bc=new WeakMap,cf=new WeakMap,Zl=new WeakSet,Cx=function(){return g(this,zr)&&"added"||g(this,zr)===null&&this.guessedText&&"review"||"missing"},JA=async function(){var r,s,a;const e=g(this,Pl);if(!e)return;if(g(this,Bc)){if(e.classList.toggle("done",!!g(this,zr)),e.setAttribute("data-l10n-id",g(ea,cf)[g(this,Zl,Cx)]),(r=g(this,lv))==null||r.setAttribute("data-l10n-id",g(ea,cf)[`${g(this,Zl,Cx)}-label`]),!g(this,zr)){(s=g(this,Lc))==null||s.remove();return}}else{if(!g(this,zr)&&!g(this,Pc)){e.classList.remove("done"),(a=g(this,Lc))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=g(this,Lc);if(!t){V(this,Lc,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${g(this,wa).id}`;const o=100,l=g(this,wa)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(g(this,Ja)),V(this,Ja,null)},{once:!0}),e.addEventListener("mouseenter",()=>{V(this,Ja,setTimeout(()=>{V(this,Ja,null),g(this,Lc).classList.add("show"),g(this,wa)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var c;g(this,Ja)&&(clearTimeout(g(this,Ja)),V(this,Ja,null)),(c=g(this,Lc))==null||c.classList.remove("show")},{signal:l})}g(this,Pc)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=g(this,zr)),t.parentNode||e.append(t);const i=g(this,wa).getElementForAltText();i==null||i.setAttribute("aria-describedby",t.id)},Y(ea,cf,null),Ze(ea,"_l10n",null);let RD=ea;var gs,Qo,Dg,xi,a2,uf,Zo,hf,df,Cg,o2,FF;class Jw{constructor(e){Y(this,o2);Y(this,gs,null);Y(this,Qo,null);Y(this,Dg,!1);Y(this,xi,null);Y(this,a2,null);Y(this,uf,null);Y(this,Zo,null);Y(this,hf,null);Y(this,df,!1);Y(this,Cg,null);V(this,xi,e)}renderForToolbar(){const e=V(this,Qo,document.createElement("button"));return e.className="comment",Q(this,o2,FF).call(this,e,!1)}renderForStandalone(){const e=V(this,gs,document.createElement("button"));e.className="annotationCommentButton";const t=g(this,xi).commentButtonPosition;if(t){const{style:i}=e;i.insetInlineEnd=`calc(${100*(g(this,xi)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const r=g(this,xi).commentButtonColor;r&&(i.backgroundColor=r)}return Q(this,o2,FF).call(this,e,!0)}focusButton(){setTimeout(()=>{var e;(e=g(this,gs)??g(this,Qo))==null||e.focus()},0)}onUpdatedColor(){if(!g(this,gs))return;const e=g(this,xi).commentButtonColor;e&&(g(this,gs).style.backgroundColor=e),g(this,xi)._uiManager.updatePopupColor(g(this,xi))}get commentButtonWidth(){var e;return(((e=g(this,gs))==null?void 0:e.getBoundingClientRect().width)??0)/g(this,xi).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(g(this,Cg))return g(this,Cg);if(!g(this,gs))return null;const{x:e,y:t,height:i}=g(this,gs).getBoundingClientRect(),{x:r,y:s,width:a,height:o}=g(this,xi).parent.boundingClientRect;return[(e-r)/a,(t+i-s)/o]}set commentPopupPositionInLayer(e){V(this,Cg,e)}hasDefaultPopupPosition(){return g(this,Cg)===null}removeStandaloneCommentButton(){var e;(e=g(this,gs))==null||e.remove(),V(this,gs,null)}removeToolbarCommentButton(){var e;(e=g(this,Qo))==null||e.remove(),V(this,Qo,null)}setCommentButtonStates({selected:e,hasPopup:t}){g(this,gs)&&(g(this,gs).classList.toggle("selected",e),g(this,gs).ariaExpanded=t)}edit(e){const t=this.commentPopupPositionInLayer;let i,r;if(t)[i,r]=t;else{[i,r]=g(this,xi).commentButtonPosition;const{width:h,height:f,x:p,y}=g(this,xi);i=p+i*h,r=y+r*f}const s=g(this,xi).parent.boundingClientRect,{x:a,y:o,width:l,height:c}=s;g(this,xi)._uiManager.editComment(g(this,xi),a+i*l,o+r*c,{...e,parentDimensions:s})}finish(){g(this,Qo)&&(g(this,Qo).focus({focusVisible:g(this,Dg)}),V(this,Dg,!1))}isDeleted(){return g(this,df)||g(this,Zo)===""}isEmpty(){return g(this,Zo)===null}hasBeenEdited(){return this.isDeleted()||g(this,Zo)!==g(this,a2)}serialize(){return this.data}get data(){return{text:g(this,Zo),richText:g(this,uf),date:g(this,hf),deleted:this.isDeleted()}}set data(e){if(e!==g(this,Zo)&&V(this,uf,null),e===null){V(this,Zo,""),V(this,df,!0);return}V(this,Zo,e),V(this,hf,new Date),V(this,df,!1)}restoreData({text:e,richText:t,date:i}){V(this,Zo,e),V(this,uf,t),V(this,hf,i),V(this,df,!1)}setInitialText(e,t=null){V(this,a2,e),this.data=e,V(this,hf,null),V(this,uf,t)}shown(){}destroy(){var e,t;(e=g(this,Qo))==null||e.remove(),V(this,Qo,null),(t=g(this,gs))==null||t.remove(),V(this,gs,null),V(this,Zo,""),V(this,uf,null),V(this,hf,null),V(this,xi,null),V(this,Dg,!1),V(this,df,!1)}}gs=new WeakMap,Qo=new WeakMap,Dg=new WeakMap,xi=new WeakMap,a2=new WeakMap,uf=new WeakMap,Zo=new WeakMap,hf=new WeakMap,df=new WeakMap,Cg=new WeakMap,o2=new WeakSet,FF=function(e,t){if(!g(this,xi)._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[g(this,xi)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const i=g(this,xi)._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return e;e.addEventListener("contextmenu",gl,{signal:i}),t&&(e.addEventListener("focusin",s=>{g(this,xi)._focusEventsAllowed=!1,Yi(s)},{capture:!0,signal:i}),e.addEventListener("focusout",s=>{g(this,xi)._focusEventsAllowed=!0,Yi(s)},{capture:!0,signal:i})),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:i});const r=s=>{s.preventDefault(),e===g(this,Qo)?this.edit():g(this,xi).toggleComment(!0)};return e.addEventListener("click",r,{capture:!0,signal:i}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(V(this,Dg,!0),r(s))},{signal:i}),e.addEventListener("pointerenter",()=>{g(this,xi).toggleComment(!1,!0)},{signal:i}),e.addEventListener("pointerleave",()=>{g(this,xi).toggleComment(!1,!1)},{signal:i}),e};var uv,Ig,l2,c2,u2,h2,d2,Xu,Rg,Ku,Ng,Yu,gp,PK,LK,OK;const k5=class k5{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:i=null,onPinchStart:r=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){Y(this,gp);Y(this,uv);Y(this,Ig,!1);Y(this,l2,null);Y(this,c2);Y(this,u2);Y(this,h2);Y(this,d2);Y(this,Xu,null);Y(this,Rg);Y(this,Ku,null);Y(this,Ng);Y(this,Yu,null);V(this,uv,e),V(this,l2,i),V(this,c2,t),V(this,u2,r),V(this,h2,s),V(this,d2,a),V(this,Ng,new AbortController),V(this,Rg,AbortSignal.any([o,g(this,Ng).signal])),e.addEventListener("touchstart",Q(this,gp,PK).bind(this),{passive:!1,signal:g(this,Rg)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/uu.pixelRatio}destroy(){var e,t;(e=g(this,Ng))==null||e.abort(),V(this,Ng,null),(t=g(this,Xu))==null||t.abort(),V(this,Xu,null)}};uv=new WeakMap,Ig=new WeakMap,l2=new WeakMap,c2=new WeakMap,u2=new WeakMap,h2=new WeakMap,d2=new WeakMap,Xu=new WeakMap,Rg=new WeakMap,Ku=new WeakMap,Ng=new WeakMap,Yu=new WeakMap,gp=new WeakSet,PK=function(e){var r,s,a;if((r=g(this,c2))!=null&&r.call(this))return;if(e.touches.length===1){if(g(this,Xu))return;const o=V(this,Xu,new AbortController),l=AbortSignal.any([g(this,Rg),o.signal]),c=g(this,uv),h={capture:!0,signal:l,passive:!1},f=p=>{var y;p.pointerType==="touch"&&((y=g(this,Xu))==null||y.abort(),V(this,Xu,null))};c.addEventListener("pointerdown",p=>{p.pointerType==="touch"&&(Yi(p),f(p))},h),c.addEventListener("pointerup",f,h),c.addEventListener("pointercancel",f,h);return}if(!g(this,Yu)){V(this,Yu,new AbortController);const o=AbortSignal.any([g(this,Rg),g(this,Yu).signal]),l=g(this,uv),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",Q(this,gp,LK).bind(this),c);const h=Q(this,gp,OK).bind(this);l.addEventListener("touchend",h,c),l.addEventListener("touchcancel",h,c),c.capture=!0,l.addEventListener("pointerdown",Yi,c),l.addEventListener("pointermove",Yi,c),l.addEventListener("pointercancel",Yi,c),l.addEventListener("pointerup",Yi,c),(s=g(this,u2))==null||s.call(this)}if(Yi(e),e.touches.length!==2||(a=g(this,l2))!=null&&a.call(this)){V(this,Ku,null);return}let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]),V(this,Ku,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:i.screenX,touch1Y:i.screenY})},LK=function(e){var N;if(!g(this,Ku)||e.touches.length!==2)return;Yi(e);let[t,i]=e.touches;t.identifier>i.identifier&&([t,i]=[i,t]);const{screenX:r,screenY:s}=t,{screenX:a,screenY:o}=i,l=g(this,Ku),{touch0X:c,touch0Y:h,touch1X:f,touch1Y:p}=l,y=f-c,x=p-h,v=a-r,_=o-s,E=Math.hypot(v,_)||1,w=Math.hypot(y,x)||1;if(!g(this,Ig)&&Math.abs(w-E)<=k5.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=r,l.touch0Y=s,l.touch1X=a,l.touch1Y=o,!g(this,Ig)){V(this,Ig,!0);return}const A=[(r+a)/2,(s+o)/2];(N=g(this,h2))==null||N.call(this,A,w,E)},OK=function(e){var t;e.touches.length>=2||(g(this,Yu)&&(g(this,Yu).abort(),V(this,Yu,null),(t=g(this,d2))==null||t.call(this)),g(this,Ku)&&(Yi(e),V(this,Ku,null),V(this,Ig,!1)))};let ND=k5;var kg,Ll,Pi,Jn,Ju,hv,ff,f2,ms,Mg,Qu,el,pf,p2,Fg,Qa,g2,Ug,Zu,Vc,dv,fv,tl,Pg,m2,kC,$t,UF,y2,PF,QA,BK,VK,LF,ZA,OF,WK,HK,zK,BF,GK,VF,qK,$K,jK,WF,Ix;const rn=class rn{constructor(e){Y(this,$t);Y(this,kg,null);Y(this,Ll,null);Y(this,Pi,null);Y(this,Jn,null);Y(this,Ju,null);Y(this,hv,!1);Y(this,ff,null);Y(this,f2,"");Y(this,ms,null);Y(this,Mg,null);Y(this,Qu,null);Y(this,el,null);Y(this,pf,null);Y(this,p2,"");Y(this,Fg,!1);Y(this,Qa,null);Y(this,g2,!1);Y(this,Ug,!1);Y(this,Zu,!1);Y(this,Vc,null);Y(this,dv,0);Y(this,fv,0);Y(this,tl,null);Y(this,Pg,null);Ze(this,"isSelected",!1);Ze(this,"_isCopy",!1);Ze(this,"_editToolbar",null);Ze(this,"_initialOptions",Object.create(null));Ze(this,"_initialData",null);Ze(this,"_isVisible",!0);Ze(this,"_uiManager",null);Ze(this,"_focusEventsAllowed",!0);Y(this,m2,!1);Y(this,kC,rn._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:t,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,a];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=rn.prototype._resizeWithKeyboard,t=Om.TRANSLATE_SMALL,i=Om.TRANSLATE_BIG;return tn(this,"_resizerKeyboardManager",new JT([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],rn.prototype._stopResizingWithKeyboard]]))}updatePageIndex(e){this.pageIndex=e}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 tn(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new A_e({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(rn._l10n??(rn._l10n=e),rn._l10nResizer||(rn._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"})),rn._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);rn._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Wn("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return g(this,m2)}set _isDraggable(e){var t;V(this,m2,e),(t=this.div)==null||t.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=g(this,kC)}setParent(e){var t;e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(Q(this,$t,Ix).call(this),(t=g(this,el))==null||t.remove(),V(this,el,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(g(this,Fg)?V(this,Fg,!1):this.parent.setSelected(this))}focusout(e){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,r){const[s,a]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(e+i)/s,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[i,r]=this.parentDimensions;this.setAt(e*i,t*r,this.width*i,this.height*r),this._onTranslated()}translate(e,t){Q(this,$t,UF).call(this,this.parentDimensions,e,t)}translateInPage(e,t){g(this,Qa)||V(this,Qa,[this.x,this.y,this.width,this.height]),Q(this,$t,UF).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){g(this,Qa)||V(this,Qa,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[r,s]}=this;if(this.x+=e/r,this.y+=t/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:f,y:p}=this.div.getBoundingClientRect();this.parent.findNewParent(this,f,p)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.getBaseTranslation();a+=l,o+=c;const{style:h}=i;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),i.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!g(this,Qa)&&(g(this,Qa)[0]!==this.x||g(this,Qa)[1]!==this.y)}get _hasBeenResized(){return!!g(this,Qa)&&(g(this,Qa)[2]!==this.width||g(this,Qa)[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:i}=rn,r=i/e,s=i/t;switch(this.rotation){case 90:return[-r,s];case 180:return[r,s];case 270:return[r,-s];default:return[-r,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[i,r]}=this;let{x:s,y:a,width:o,height:l}=this;if(o*=i,l*=r,s*=i,a*=r,this._mustFixPosition)switch(e){case 0:s=Yr(s,0,i-o),a=Yr(a,0,r-l);break;case 90:s=Yr(s,0,i-l),a=Yr(a,o,r);break;case 180:s=Yr(s,o,i),a=Yr(a,l,r);break;case 270:s=Yr(s,l,i),a=Yr(a,0,r-o);break}this.x=s/=i,this.y=a/=r;const[c,h]=this.getBaseTranslation();s+=c,a+=h,t.left=`${(100*s).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var i;return Q(i=rn,y2,PF).call(i,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var i;return Q(i=rn,y2,PF).call(i,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,i]}=this;return[t*e,i*e]}setDims(){const{div:{style:e},width:t,height:i}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=g(this,Pi))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||g(this,Ug))return this._editToolbar;this._editToolbar=new SF(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[t,i]of e)await this._editToolbar.addButton(t,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){var e;(e=this._editToolbar)==null||e.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){var e;(e=this._editToolbar)==null||e.removeButton("comment")}removeEditToolbar(){var e,t;(e=this._editToolbar)==null||e.remove(),this._editToolbar=null,(t=g(this,Pi))==null||t.destroy()}addContainer(e){var i;const t=(i=this._editToolbar)==null?void 0:i.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return g(this,Pi)||(RD.initialize(rn._l10n),V(this,Pi,new RD(this)),g(this,kg)&&(g(this,Pi).data=g(this,kg),V(this,kg,null))),g(this,Pi)}get altTextData(){var e;return(e=g(this,Pi))==null?void 0:e.data}set altTextData(e){g(this,Pi)&&(g(this,Pi).data=e)}get guessedAltText(){var e;return(e=g(this,Pi))==null?void 0:e.guessedText}async setGuessedAltText(e){var t;await((t=g(this,Pi))==null?void 0:t.setGuessedText(e))}serializeAltText(e){var t;return(t=g(this,Pi))==null?void 0:t.serialize(e)}hasAltText(){return!!g(this,Pi)&&!g(this,Pi).isEmpty()}hasAltTextData(){var e;return((e=g(this,Pi))==null?void 0:e.hasData())??!1}focusCommentButton(){var e;(e=g(this,Jn))==null||e.focusButton()}addCommentButton(){return this.canAddComment?g(this,Jn)||V(this,Jn,new Jw(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(g(this,Ju)){this._uiManager.isEditingMode()&&g(this,Ju).classList.remove("hidden");return}this.hasComment&&(V(this,Ju,g(this,Jn).renderForStandalone()),this.div.append(g(this,Ju)))}}removeStandaloneCommentButton(){g(this,Jn).removeStandaloneCommentButton(),V(this,Ju,null)}hideStandaloneCommentButton(){var e;(e=g(this,Ju))==null||e.classList.add("hidden")}get comment(){if(!g(this,Jn))return null;const{data:{richText:e,text:t,date:i,deleted:r}}=g(this,Jn);return{text:t,richText:e,date:i,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){g(this,Jn)||V(this,Jn,new Jw(this)),typeof e=="object"&&e!==null?g(this,Jn).restoreData(e):g(this,Jn).data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:i}){if(!t||(g(this,Jn)||V(this,Jn,new Jw(this)),g(this,Jn).setInitialText(e,i),!this.annotationElementId))return;const r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){var e;return(e=g(this,Jn))==null?void 0:e.hasBeenEdited()}get hasDeletedComment(){var e;return(e=g(this,Jn))==null?void 0:e.isDeleted()}get hasComment(){return!!g(this,Jn)&&!g(this,Jn).isEmpty()&&!g(this,Jn).isDeleted()}async editComment(e){g(this,Jn)||V(this,Jn,new Jw(this)),g(this,Jn).edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){g(this,Jn).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,r]=e.rect,[s]=this.pageDimensions,[a]=this.pageTranslation,o=a+s+1,l=r-100,c=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,r]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){g(this,Jn).data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){var a;const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=g(this,hv)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),Q(this,$t,VF).call(this);const[t,i]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*i/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/i).toFixed(2)}%`);const[r,s]=this.getInitialTranslation();return this.translate(r,s),bK(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(g(this,Pg)||V(this,Pg,new ND({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:Q(this,$t,WK).bind(this),onPinching:Q(this,$t,HK).bind(this),onPinchEnd:Q(this,$t,zK).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),e}pointerdown(e){const{isMac:t}=Pr.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(V(this,Fg,!0),this._isDraggable){Q(this,$t,GK).call(this,e);return}Q(this,$t,BF).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){g(this,Vc)&&clearTimeout(g(this,Vc)),V(this,Vc,setTimeout(()=>{var e;V(this,Vc,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,i=this.rotation){const r=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/r,h=t/r,f=this.x*s,p=this.y*a,y=this.width*s,x=this.height*a;switch(i){case 0:return[f+c+o,a-p-h-x+l,f+c+y+o,a-p-h+l];case 90:return[f+h+o,a-p+c+l,f+h+x+o,a-p+c+y+l];case 180:return[f-c-y+o,a-p+h+l,f-c+o,a-p+h+x+l];case 270:return[f-h-x+o,a-p-c-y+l,f-h+o,a-p-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[i,r,s,a]=e,o=s-i,l=a-r;switch(this.rotation){case 0:return[i,t-a,o,l];case 90:return[i,t-r,l,o];case 180:return[s,t-r,o,l];case 270:return[s,t-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&rn._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var e;(e=g(this,Jn))==null||e.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:i,opacity:r,deleted:s,richText:a},uid:o,pageIndex:l,creationDate:c,modificationDate:h}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:i||h,popupRef:!s,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),V(this,Ug,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),V(this,Ug,!1),!0):!1}isInEditMode(){return g(this,Ug)}shouldGetKeyboardEvents(){return g(this,Zu)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:i,right:r}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return t<a&&r>0&&e<s&&i>0}rebuild(){Q(this,$t,VF).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,t=null){var i;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((i=this._initialData)==null?void 0:i.popupRef)||""}}static async deserialize(e,t,i){const r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,V(r,kg,e.accessibilityData),r._isCopy=e.isCopy||!1;const[s,a]=r.pageDimensions,[o,l,c,h]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/s,r.y=l/a,r.width=c/s,r.height=h/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,t,i;if((e=g(this,pf))==null||e.abort(),V(this,pf,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),g(this,Vc)&&(clearTimeout(g(this,Vc)),V(this,Vc,null)),Q(this,$t,Ix).call(this),this.removeEditToolbar(),g(this,tl)){for(const r of g(this,tl).values())clearTimeout(r);V(this,tl,null)}this.parent=null,(t=g(this,Pg))==null||t.destroy(),V(this,Pg,null),(i=g(this,el))==null||i.remove(),V(this,el,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Q(this,$t,BK).call(this),g(this,ms).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,t]}=this,[i,r,s,a]=this.getPDFRect();return[rn._round(i+(s-i)*e),rn._round(r+(a-r)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return g(this,Jn).commentPopupPositionInLayer}set commentPopupPosition(e){g(this,Jn).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return g(this,Jn).hasDefaultPopupPosition()}get commentButtonWidth(){return g(this,Jn).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){var t;(t=g(this,Jn))==null||t.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),V(this,Qu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=g(this,ms).children;if(!g(this,Ll)){V(this,Ll,Array.from(t));const a=Q(this,$t,qK).bind(this),o=Q(this,$t,$K).bind(this),l=this._uiManager._signal;for(const c of g(this,Ll)){const h=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",Q(this,$t,jK).bind(this,h),{signal:l}),c.setAttribute("data-l10n-id",rn._l10nResizer[h])}}const i=g(this,Ll)[0];let r=0;for(const a of t){if(a===i)break;r++}const s=(360-this.rotation+this.parentRotation)%360/90*(g(this,Ll).length/4);if(s!==r){if(s<r)for(let o=0;o<r-s;o++)g(this,ms).append(g(this,ms).firstElementChild);else if(s>r)for(let o=0;o<s-r;o++)g(this,ms).firstElementChild.before(g(this,ms).lastElementChild);let a=0;for(const o of t){const c=g(this,Ll)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",rn._l10nResizer[c])}}Q(this,$t,WF).call(this,0),V(this,Zu,!0),g(this,ms).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){g(this,Zu)&&Q(this,$t,OF).call(this,g(this,p2),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){Q(this,$t,Ix).call(this),this.div.focus()}select(){var e,t,i;if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var r,s;(r=this.div)!=null&&r.classList.contains("selectedEditor")&&((s=this._editToolbar)==null||s.show())});return}(t=this._editToolbar)==null||t.show(),(i=g(this,Pi))==null||i.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>{var e;return(e=this.div)==null?void 0:e.focus({preventScroll:!0})},0)}unselect(){var e,t,i,r,s;this.isSelected&&(this.isSelected=!1,(e=g(this,ms))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(r=this._editToolbar)==null||r.hide(),(s=g(this,Pi))==null||s.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return g(this,g2)}set isEditing(e){V(this,g2,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){g(this,tl)||V(this,tl,new Map);const{action:i}=e;let r=g(this,tl).get(i);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(e),g(this,tl).delete(i),g(this,tl).size===0&&V(this,tl,null)},rn._telemetryTimeout),g(this,tl).set(i,r);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),V(this,hv,!1)}disable(){this.div&&(this.div.tabIndex=-1),V(this,hv,!0)}updateFakeAnnotationElement(e){if(!g(this,el)&&!this.deleted){V(this,el,e.addFakeAnnotation(this));return}if(this.deleted){g(this,el).remove(),V(this,el,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&g(this,el).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const i=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),i.before(t)}return t}resetAnnotationElement(e){const{firstElementChild:t}=e.container;(t==null?void 0:t.nodeName)==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};kg=new WeakMap,Ll=new WeakMap,Pi=new WeakMap,Jn=new WeakMap,Ju=new WeakMap,hv=new WeakMap,ff=new WeakMap,f2=new WeakMap,ms=new WeakMap,Mg=new WeakMap,Qu=new WeakMap,el=new WeakMap,pf=new WeakMap,p2=new WeakMap,Fg=new WeakMap,Qa=new WeakMap,g2=new WeakMap,Ug=new WeakMap,Zu=new WeakMap,Vc=new WeakMap,dv=new WeakMap,fv=new WeakMap,tl=new WeakMap,Pg=new WeakMap,m2=new WeakMap,kC=new WeakMap,$t=new WeakSet,UF=function([e,t],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},y2=new WeakSet,PF=function(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},QA=function(e){switch(e){case 90:{const[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,i]=this.pageDimensions;return[0,t/i,-i/t,0]}default:return[1,0,0,1]}},BK=function(){if(g(this,ms))return;V(this,ms,document.createElement("div")),g(this,ms).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const i of e){const r=document.createElement("div");g(this,ms).append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",Q(this,$t,VK).bind(this,i),{signal:t}),r.addEventListener("contextmenu",gl,{signal:t}),r.tabIndex=-1}this.div.prepend(g(this,ms))},VK=function(e,t){var h;t.preventDefault();const{isMac:i}=Pr.platform;if(t.button!==0||t.ctrlKey&&i)return;(h=g(this,Pi))==null||h.toggle(!1);const r=this._isDraggable;this._isDraggable=!1,V(this,Mg,[t.screenX,t.screenY]);const s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",Q(this,$t,OF).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Yi,{passive:!1,signal:a}),window.addEventListener("contextmenu",gl,{signal:a}),V(this,Qu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const o=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const c=()=>{var f;s.abort(),this.parent.togglePointerEvents(!0),(f=g(this,Pi))==null||f.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=l,Q(this,$t,ZA).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},LF=function(e,t,i,r){this.width=i,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},ZA=function(){if(!g(this,Qu))return;const{savedX:e,savedY:t,savedWidth:i,savedHeight:r}=g(this,Qu);V(this,Qu,null);const s=this.x,a=this.y,o=this.width,l=this.height;s===e&&a===t&&o===i&&l===r||this.addCommands({cmd:Q(this,$t,LF).bind(this,s,a,o,l),undo:Q(this,$t,LF).bind(this,e,t,i,r),mustExec:!0})},OF=function(e,t){const[i,r]=this.parentDimensions,s=this.x,a=this.y,o=this.width,l=this.height,c=rn.MIN_SIZE/i,h=rn.MIN_SIZE/r,f=Q(this,$t,QA).call(this,this.rotation),p=(q,X)=>[f[0]*q+f[2]*X,f[1]*q+f[3]*X],y=Q(this,$t,QA).call(this,360-this.rotation),x=(q,X)=>[y[0]*q+y[2]*X,y[1]*q+y[3]*X];let v,_,E=!1,w=!1;switch(e){case"topLeft":E=!0,v=(q,X)=>[0,0],_=(q,X)=>[q,X];break;case"topMiddle":v=(q,X)=>[q/2,0],_=(q,X)=>[q/2,X];break;case"topRight":E=!0,v=(q,X)=>[q,0],_=(q,X)=>[0,X];break;case"middleRight":w=!0,v=(q,X)=>[q,X/2],_=(q,X)=>[0,X/2];break;case"bottomRight":E=!0,v=(q,X)=>[q,X],_=(q,X)=>[0,0];break;case"bottomMiddle":v=(q,X)=>[q/2,X],_=(q,X)=>[q/2,0];break;case"bottomLeft":E=!0,v=(q,X)=>[0,X],_=(q,X)=>[q,0];break;case"middleLeft":w=!0,v=(q,X)=>[0,X/2],_=(q,X)=>[q,X/2];break}const A=v(o,l),N=_(o,l);let k=p(...N);const F=rn._round(s+k[0]),C=rn._round(a+k[1]);let M=1,R=1,L,H;if(t.fromKeyboard)({deltaX:L,deltaY:H}=t);else{const{screenX:q,screenY:X}=t,[oe,ue]=g(this,Mg);[L,H]=this.screenToPageTranslation(q-oe,X-ue),g(this,Mg)[0]=q,g(this,Mg)[1]=X}if([L,H]=x(L/i,H/r),E){const q=Math.hypot(o,l);M=R=Math.max(Math.min(Math.hypot(N[0]-A[0]-L,N[1]-A[1]-H)/q,1/o,1/l),c/o,h/l)}else w?M=Yr(Math.abs(N[0]-A[0]-L),c,1)/o:R=Yr(Math.abs(N[1]-A[1]-H),h,1)/l;const P=rn._round(o*M),O=rn._round(l*R);k=p(..._(P,O));const B=F-k[0],re=C-k[1];g(this,Qa)||V(this,Qa,[this.x,this.y,this.width,this.height]),this.width=P,this.height=O,this.x=B,this.y=re,this.setDims(),this.fixAndSetPosition(),this._onResizing()},WK=function(){var e;V(this,Qu,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=g(this,Pi))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},HK=function(e,t,i){let s=.7*(i/t)+1-.7;if(s===1)return;const a=Q(this,$t,QA).call(this,this.rotation),o=(F,C)=>[a[0]*F+a[2]*C,a[1]*F+a[3]*C],[l,c]=this.parentDimensions,h=this.x,f=this.y,p=this.width,y=this.height,x=rn.MIN_SIZE/l,v=rn.MIN_SIZE/c;s=Math.max(Math.min(s,1/p,1/y),x/p,v/y);const _=rn._round(p*s),E=rn._round(y*s);if(_===p&&E===y)return;g(this,Qa)||V(this,Qa,[h,f,p,y]);const w=o(p/2,y/2),A=rn._round(h+w[0]),N=rn._round(f+w[1]),k=o(_/2,E/2);this.x=A-k[0],this.y=N-k[1],this.width=_,this.height=E,this.setDims(),this.fixAndSetPosition(),this._onResizing()},zK=function(){var e;(e=g(this,Pi))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),Q(this,$t,ZA).call(this)},BF=function(e){const{isMac:t}=Pr.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},GK=function(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let i=!1;const r=new AbortController,s=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:s},o=c=>{r.abort(),V(this,ff,null),V(this,Fg,!1),this._uiManager.endDragSession()||Q(this,$t,BF).call(this,c),i&&this._onStopDragging()};t&&(V(this,dv,e.clientX),V(this,fv,e.clientY),V(this,ff,e.pointerId),V(this,f2,e.pointerType),window.addEventListener("pointermove",c=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:h,clientY:f,pointerId:p}=c;if(p!==g(this,ff)){Yi(c);return}const[y,x]=this.screenToPageTranslation(h-g(this,dv),f-g(this,fv));V(this,dv,h),V(this,fv,f),this._uiManager.dragSelectedEditors(y,x)},a),window.addEventListener("touchmove",Yi,a),window.addEventListener("pointerdown",c=>{c.pointerType===g(this,f2)&&(g(this,Pg)||c.isPrimary)&&o(c),Yi(c)},a));const l=c=>{if(!g(this,ff)||g(this,ff)===c.pointerId){o(c);return}Yi(c)};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})},VF=function(){if(g(this,pf)||!this.div)return;V(this,pf,new AbortController);const e=this._uiManager.combinedSignal(g(this,pf));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},qK=function(e){rn._resizerKeyboardManager.exec(this,e)},$K=function(e){var t;g(this,Zu)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==g(this,ms)&&Q(this,$t,Ix).call(this)},jK=function(e){V(this,p2,g(this,Zu)?e:"")},WF=function(e){if(g(this,Ll))for(const t of g(this,Ll))t.tabIndex=e},Ix=function(){V(this,Zu,!1),Q(this,$t,WF).call(this,-1),Q(this,$t,ZA).call(this)},Y(rn,y2),Ze(rn,"_l10n",null),Ze(rn,"_l10nResizer",null),Ze(rn,"_borderLineWidth",-1),Ze(rn,"_colorManager",new IF),Ze(rn,"_zIndex",1),Ze(rn,"_telemetryTimeout",1e3);let Ei=rn;class A_e extends Ei{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const zV=3285377520,Vo=4294901760,Tc=65535;class XK{constructor(e){this.h1=e?e&4294967295:zV,this.h2=e?e&4294967295:zV}update(e){let t,i;if(typeof e=="string"){t=new Uint8Array(e.length*2),i=0;for(let v=0,_=e.length;v<_;v++){const E=e.charCodeAt(v);E<=255?t[i++]=E:(t[i++]=E>>>8,t[i++]=E&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),i=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,s=i-r*4,a=new Uint32Array(t.buffer,0,r);let o=0,l=0,c=this.h1,h=this.h2;const f=3432918353,p=461845907,y=f&Tc,x=p&Tc;for(let v=0;v<r;v++)v&1?(o=a[v],o=o*f&Vo|o*y&Tc,o=o<<15|o>>>17,o=o*p&Vo|o*x&Tc,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[v],l=l*f&Vo|l*y&Tc,l=l<<15|l>>>17,l=l*p&Vo|l*x&Tc,h^=l,h=h<<13|h>>>19,h=h*5+3864292196);switch(o=0,s){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*f&Vo|o*y&Tc,o=o<<15|o>>>17,o=o*p&Vo|o*x&Tc,r&1?c^=o:h^=o}this.h1=c,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Vo|e*36045&Tc,t=t*4283543511&Vo|((t<<16|e>>>16)*2950163797&Vo)>>>16,e^=t>>>1,e=e*444984403&Vo|e*60499&Tc,t=t*3301882366&Vo|((t<<16|e>>>16)*3120437893&Vo)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const bb=Object.freeze({map:null,hash:"",transfer:void 0});var Lg,Og,eh,ys,MC,KK;class E4{constructor(){Y(this,MC);Y(this,Lg,!1);Y(this,Og,null);Y(this,eh,null);Y(this,ys,new Map);Ze(this,"onSetModified",null);Ze(this,"onResetModified",null);Ze(this,"onAnnotationEditor",null)}getValue(e,t){const i=g(this,ys).get(e);return i===void 0?t:Object.assign(t,i)}getRawValue(e){return g(this,ys).get(e)}remove(e){const t=g(this,ys).get(e);if(t!==void 0&&(t instanceof Ei&&g(this,eh).delete(t.annotationElementId),g(this,ys).delete(e),g(this,ys).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const i of g(this,ys).values())if(i instanceof Ei)return;this.onAnnotationEditor(null)}}setValue(e,t){const i=g(this,ys).get(e);let r=!1;if(i!==void 0)for(const[s,a]of Object.entries(t))i[s]!==a&&(r=!0,i[s]=a);else r=!0,g(this,ys).set(e,t);r&&Q(this,MC,KK).call(this),t instanceof Ei&&((g(this,eh)||V(this,eh,new Map)).set(t.annotationElementId,t),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type))}has(e){return g(this,ys).has(e)}get size(){return g(this,ys).size}resetModified(){g(this,Lg)&&(V(this,Lg,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new YK(this)}get serializable(){if(g(this,ys).size===0)return bb;const e=new Map,t=new XK,i=[],r=Object.create(null);let s=!1;for(const[a,o]of g(this,ys)){const l=o instanceof Ei?o.serialize(!1,r):o;o.page&&(o.pageIndex=o.page._pageIndex,delete o.page),l&&(e.set(a,l),t.update(`${a}:${JSON.stringify(l)}`),s||(s=!!l.bitmap))}if(s)for(const a of e.values())a.bitmap&&i.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:i}:bb}get editorStats(){let e=null;const t=new Map;let i=0,r=0;for(const s of g(this,ys).values()){if(!(s instanceof Ei)){s.popup&&(s.popup.deleted?r+=1:i+=1);continue}s.isCommentDeleted?r+=1:s.hasEditedComment&&(i+=1);const a=s.telemetryFinalData;if(!a)continue;const{type:o}=a;t.has(o)||t.set(o,Object.getPrototypeOf(s).constructor),e||(e=Object.create(null));const l=e[o]||(e[o]=new Map);for(const[c,h]of Object.entries(a)){if(c==="type")continue;const f=l.getOrInsertComputed(c,x4);f.set(h,(f.get(h)??0)+1)}}if((r>0||i>0)&&(e||(e=Object.create(null)),e.comments={deleted:r,edited:i}),!e)return null;for(const[s,a]of t)e[s]=a.computeTelemetryFinalData(e[s]);return e}resetModifiedIds(){V(this,Og,null)}updateEditor(e,t){var r;const i=(r=g(this,eh))==null?void 0:r.get(e);return i?(i.updateFromAnnotationLayer(t),!0):!1}getEditor(e){var t;return((t=g(this,eh))==null?void 0:t.get(e))||null}get modifiedIds(){if(g(this,Og))return g(this,Og);const e=[];if(g(this,eh))for(const t of g(this,eh).values())t.serialize()&&e.push(t.annotationElementId);return V(this,Og,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return g(this,ys).entries()}}Lg=new WeakMap,Og=new WeakMap,eh=new WeakMap,ys=new WeakMap,MC=new WeakSet,KK=function(){g(this,Lg)||(V(this,Lg,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var v2;class YK extends E4{constructor(t){super();Y(this,v2,bb);const{serializable:i}=t;if(i===bb)return;const{map:r,hash:s,transfer:a}=i,o=structuredClone(r,a?{transfer:a}:null);V(this,v2,{map:o,hash:s,transfer:[]})}get print(){Wn("Should not call PrintAnnotationStorage.print")}get serializable(){return g(this,v2)}get modifiedIds(){return tn(this,"modifiedIds",{ids:new Set,hash:""})}}v2=new WeakMap;var pv;class S_e{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){Y(this,pv,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),g(this,pv).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:i}){if(!(!e||g(this,pv).has(e.loadedName))){if(Fn(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:s,style:a}=e,o=new FontFace(r,s,a);this.addNativeFontFace(o);try{await o.load(),g(this,pv).add(r),i==null||i(e)}catch{an(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Wn("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const i=e.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(r){throw an(`Failed to load font '${i.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const r=this._queueLoadingCallback(i);this._prepareFontLoadEvent(e,r)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return tn(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return tn(this,"isSyncFontLoadingSupported",sa||Pr.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Fn(!r.done,"completeRequest() cannot be called twice."),r.done=!0;i.length>0&&i[0].done;){const s=i.shift();setTimeout(s.callback,0)}}const{loadingRequests:i}=this,r={done:!1,complete:t,callback:e};return i.push(r),r}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return tn(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function i(N,k){return N.charCodeAt(k)<<24|N.charCodeAt(k+1)<<16|N.charCodeAt(k+2)<<8|N.charCodeAt(k+3)&255}function r(N,k,F,C){const M=N.substring(0,k),R=N.substring(k+F);return M+C+R}let s,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;function h(N,k){if(++c>30){an("Load test font never loaded."),k();return}if(l.font="30px "+N,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){k();return}setTimeout(h.bind(null,N,k))}const f=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=r(p,976,f.length,f);const x=16,v=1482184792;let _=i(p,x);for(s=0,a=f.length-3;s<a;s+=4)_=_-v+i(f,s)|0;s<f.length&&(_=_-v+i(f+"XXX",s)|0),p=r(p,x,4,o_e(_));const E=`url(data:font/opentype;base64,${btoa(p)});`,w=`@font-face {font-family:"${f}";src:${E}}`;this.insertRule(w);const A=this._document.createElement("div");A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px";for(const N of[e.loadedName,f]){const k=this._document.createElement("span");k.textContent="Hi",k.style.fontFamily=N,A.append(k)}this._document.body.append(A),h(f,()=>{A.remove(),t.complete()})}}pv=new WeakMap;var ci;class D_e{constructor(e,t=null,i,r){Y(this,ci);this.compiledGlyphs=Object.create(null),V(this,ci,e),this._inspectFont=t,i&&Object.assign(this,i),r&&(this.charProcOperatorList=r)}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var i;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;let t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${e}}`}return(i=this._inspectFont)==null||i.call(this,this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const i=this.loadedName+"_path_"+t;let r;try{r=e.get(i)}catch(a){an(`getPathGenerator - ignoring character: "${a}".`)}const s=gK(r==null?void 0:r.path);return this.fontExtraProperties||e.delete(i),this.compiledGlyphs[t]=s}get black(){return g(this,ci).black}get bold(){return g(this,ci).bold}get disableFontFace(){return g(this,ci).disableFontFace??!1}set disableFontFace(e){tn(this,"disableFontFace",!!e)}get fontExtraProperties(){return g(this,ci).fontExtraProperties??!1}get isInvalidPDFjsFont(){return g(this,ci).isInvalidPDFjsFont}get isType3Font(){return g(this,ci).isType3Font}get italic(){return g(this,ci).italic}get missingFile(){return g(this,ci).missingFile}get remeasure(){return g(this,ci).remeasure}get vertical(){return g(this,ci).vertical}get ascent(){return g(this,ci).ascent}get defaultWidth(){return g(this,ci).defaultWidth}get descent(){return g(this,ci).descent}get bbox(){return g(this,ci).bbox}set bbox(e){tn(this,"bbox",e)}get fontMatrix(){return g(this,ci).fontMatrix}get fallbackName(){return g(this,ci).fallbackName}get loadedName(){return g(this,ci).loadedName}get mimetype(){return g(this,ci).mimetype}get name(){return g(this,ci).name}get data(){return g(this,ci).data}clearData(){g(this,ci).clearData()}get cssFontInfo(){return g(this,ci).cssFontInfo}get systemFontInfo(){return g(this,ci).systemFontInfo}get defaultVMetrics(){return g(this,ci).defaultVMetrics}}ci=new WeakMap;var gv,mv,_2,yv,eS;const Cy=class Cy{constructor(e){Y(this,yv);Y(this,gv);Y(this,mv);Y(this,_2);V(this,gv,e),V(this,mv,new DataView(g(this,gv))),V(this,_2,new TextDecoder)}static write(e){const t=new TextEncoder,i={};let r=0;for(const c of Cy.strings){const h=t.encode(e[c]);i[c]=h,r+=4+h.length}const s=new ArrayBuffer(r),a=new Uint8Array(s),o=new DataView(s);let l=0;for(const c of Cy.strings){const h=i[c],f=h.length;o.setUint32(l,f),a.set(h,l+4),l+=4+f}return Fn(l===s.byteLength,"CssFontInfo.write: Buffer overflow"),s}get fontFamily(){return Q(this,yv,eS).call(this,0)}get fontWeight(){return Q(this,yv,eS).call(this,1)}get italicAngle(){return Q(this,yv,eS).call(this,2)}};gv=new WeakMap,mv=new WeakMap,_2=new WeakMap,yv=new WeakSet,eS=function(e){Fn(e<Cy.strings.length,"Invalid string index");let t=0;for(let r=0;r<e;r++)t+=g(this,mv).getUint32(t)+4;const i=g(this,mv).getUint32(t);return g(this,_2).decode(new Uint8Array(g(this,gv),t+4,i))},Ze(Cy,"strings",["fontFamily","fontWeight","italicAngle"]);let kD=Cy;var gf,Wc,Bg,Vg,Rx;const Iy=class Iy{constructor(e){Y(this,Vg);Y(this,gf);Y(this,Wc);Y(this,Bg);V(this,gf,e),V(this,Wc,new DataView(g(this,gf))),V(this,Bg,new TextDecoder)}static write(e){const t=new TextEncoder,i={};let r=0;for(const p of Iy.strings){const y=t.encode(e[p]);i[p]=y,r+=4+y.length}r+=4;let s,a,o=1+r;e.style&&(s=t.encode(e.style.style),a=t.encode(e.style.weight),o+=4+s.length+4+a.length);const l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let f=0;h.setUint8(f++,e.guessFallback?1:0),h.setUint32(f,0),f+=4,r=0;for(const p of Iy.strings){const y=i[p],x=y.length;r+=4+x,h.setUint32(f,x),c.set(y,f+4),f+=4+x}return h.setUint32(f-r-4,r),e.style&&(h.setUint32(f,s.length),c.set(s,f+4),f+=4+s.length,h.setUint32(f,a.length),c.set(a,f+4),f+=4+a.length),Fn(f<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(f)}get guessFallback(){return g(this,Wc).getUint8(0)!==0}get css(){return Q(this,Vg,Rx).call(this,0)}get loadedName(){return Q(this,Vg,Rx).call(this,1)}get baseFontName(){return Q(this,Vg,Rx).call(this,2)}get src(){return Q(this,Vg,Rx).call(this,3)}get style(){let e=1;e+=4+g(this,Wc).getUint32(e);const t=g(this,Wc).getUint32(e),i=g(this,Bg).decode(new Uint8Array(g(this,gf),e+4,t));e+=4+t;const r=g(this,Wc).getUint32(e),s=g(this,Bg).decode(new Uint8Array(g(this,gf),e+4,r));return{style:i,weight:s}}};gf=new WeakMap,Wc=new WeakMap,Bg=new WeakMap,Vg=new WeakSet,Rx=function(e){Fn(e<Iy.strings.length,"Invalid string index");let t=5;for(let r=0;r<e;r++)t+=g(this,Wc).getUint32(t)+4;const i=g(this,Wc).getUint32(t);return g(this,Bg).decode(new Uint8Array(g(this,gf),t+4,i))},Ze(Iy,"strings",["css","loadedName","baseFontName","src"]);let MD=Iy;var vv,_v,xv,bv,Za,Hc,x2,ui,Ki,Ml,tS,Nx;const un=class un{constructor({data:e,extra:t}){Y(this,Ki);Y(this,Hc);Y(this,x2);Y(this,ui);V(this,Hc,e),V(this,x2,new TextDecoder),V(this,ui,new DataView(g(this,Hc))),t&&Object.assign(this,t)}get black(){return Q(this,Ki,Ml).call(this,0)}get bold(){return Q(this,Ki,Ml).call(this,1)}get disableFontFace(){return Q(this,Ki,Ml).call(this,2)}get fontExtraProperties(){return Q(this,Ki,Ml).call(this,3)}get isInvalidPDFjsFont(){return Q(this,Ki,Ml).call(this,4)}get isType3Font(){return Q(this,Ki,Ml).call(this,5)}get italic(){return Q(this,Ki,Ml).call(this,6)}get missingFile(){return Q(this,Ki,Ml).call(this,7)}get remeasure(){return Q(this,Ki,Ml).call(this,8)}get vertical(){return Q(this,Ki,Ml).call(this,9)}get ascent(){return Q(this,Ki,tS).call(this,0)}get defaultWidth(){return Q(this,Ki,tS).call(this,1)}get descent(){return Q(this,Ki,tS).call(this,2)}get bbox(){let e=g(un,_v);if(g(this,ui).getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<4;r++)i.push(g(this,ui).getInt16(e,!0)),e+=2;return i}get fontMatrix(){let e=g(un,xv);if(g(this,ui).getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<6;r++)i.push(g(this,ui).getFloat64(e,!0)),e+=8;return i}get defaultVMetrics(){let e=g(un,bv);if(g(this,ui).getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<3;r++)i.push(g(this,ui).getInt16(e,!0)),e+=2;return i}get fallbackName(){return Q(this,Ki,Nx).call(this,0)}get loadedName(){return Q(this,Ki,Nx).call(this,1)}get mimetype(){return Q(this,Ki,Nx).call(this,2)}get name(){return Q(this,Ki,Nx).call(this,3)}get data(){let e=g(un,Za);const t=g(this,ui).getUint32(e);e+=4+t;const i=g(this,ui).getUint32(e);e+=4+i;const r=g(this,ui).getUint32(e);e+=4+r;const s=g(this,ui).getUint32(e);if(s!==0)return new Uint8Array(g(this,Hc),e+4,s)}clearData(){let e=g(un,Za);const t=g(this,ui).getUint32(e);e+=4+t;const i=g(this,ui).getUint32(e);e+=4+i;const r=g(this,ui).getUint32(e);e+=4+r;const s=g(this,ui).getUint32(e);new Uint8Array(g(this,Hc),e+4,s).fill(0),g(this,ui).setUint32(e,0)}get cssFontInfo(){let e=g(un,Za);const t=g(this,ui).getUint32(e);e+=4+t;const i=g(this,ui).getUint32(e);e+=4+i;const r=g(this,ui).getUint32(e);if(r===0)return null;const s=new Uint8Array(r);return s.set(new Uint8Array(g(this,Hc),e+4,r)),new kD(s.buffer)}get systemFontInfo(){let e=g(un,Za);const t=g(this,ui).getUint32(e);e+=4+t;const i=g(this,ui).getUint32(e);if(i===0)return null;const r=new Uint8Array(i);return r.set(new Uint8Array(g(this,Hc),e+4,i)),new MD(r.buffer)}static write(e){const t=e.systemFontInfo?MD.write(e.systemFontInfo):null,i=e.cssFontInfo?kD.write(e.cssFontInfo):null,r=new TextEncoder,s={};let a=0;for(const v of un.strings)s[v]=r.encode(e[v]),a+=4+s[v].length;const o=g(un,Za)+4+a+4+(t?t.byteLength:0)+4+(i?i.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(o),c=new Uint8Array(l),h=new DataView(l);let f=0;const p=un.bools.length;let y=0,x=0;for(let v=0;v<p;v++){const _=e[un.bools[v]];y|=(_===void 0?0:_?2:1)<<x,x+=2,(x===8||v===p-1)&&(h.setUint8(f++,y),y=0,x=0)}Fn(f===g(un,vv),"FontInfo.write: Boolean properties offset mismatch");for(const v of un.numbers)h.setFloat64(f,e[v]),f+=8;if(Fn(f===g(un,_v),"FontInfo.write: Number properties offset mismatch"),e.bbox){h.setUint8(f++,4);for(const v of e.bbox)h.setInt16(f,v,!0),f+=2}else h.setUint8(f++,0),f+=8;if(Fn(f===g(un,xv),"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){h.setUint8(f++,6);for(const v of e.fontMatrix)h.setFloat64(f,v,!0),f+=8}else h.setUint8(f++,0),f+=48;if(Fn(f===g(un,bv),"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){h.setUint8(f++,1);for(const v of e.defaultVMetrics)h.setInt16(f,v,!0),f+=2}else h.setUint8(f++,0),f+=6;Fn(f===g(un,Za),"FontInfo.write: DefaultVMetrics properties offset mismatch"),h.setUint32(g(un,Za),0),f+=4;for(const v of un.strings){const _=s[v],E=_.length;h.setUint32(f,E),c.set(_,f+4),f+=4+E}if(h.setUint32(g(un,Za),f-g(un,Za)-4),!t)h.setUint32(f,0),f+=4;else{const v=t.byteLength;h.setUint32(f,v),Fn(f+4+v<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(t),f+4),f+=4+v}if(!i)h.setUint32(f,0),f+=4;else{const v=i.byteLength;h.setUint32(f,v),Fn(f+4+v<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(i),f+4),f+=4+v}return e.data===void 0?(h.setUint32(f,0),f+=4):(h.setUint32(f,e.data.length),c.set(e.data,f+4),f+=4+e.data.length),Fn(f<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(f)}};vv=new WeakMap,_v=new WeakMap,xv=new WeakMap,bv=new WeakMap,Za=new WeakMap,Hc=new WeakMap,x2=new WeakMap,ui=new WeakMap,Ki=new WeakSet,Ml=function(e){Fn(e<un.bools.length,"Invalid boolean index");const t=Math.floor(e/4),i=e*2%8,r=g(this,ui).getUint8(t)>>i&3;return r===0?void 0:r===2},tS=function(e){return Fn(e<un.numbers.length,"Invalid number index"),g(this,ui).getFloat64(g(un,vv)+e*8)},Nx=function(e){Fn(e<un.strings.length,"Invalid string index");let t=g(un,Za)+4;for(let s=0;s<e;s++)t+=g(this,ui).getUint32(t)+4;const i=g(this,ui).getUint32(t),r=new Uint8Array(i);return r.set(new Uint8Array(g(this,Hc),t+4,i)),g(this,x2).decode(r)},Ze(un,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),Ze(un,"numbers",["ascent","defaultWidth","descent"]),Ze(un,"strings",["fallbackName","loadedName","mimetype","name"]),Y(un,vv,Math.ceil(un.bools.length*2/8)),Y(un,_v,g(un,vv)+un.numbers.length*8),Y(un,xv,g(un,_v)+1+8),Y(un,bv,g(un,xv)+1+48),Y(un,Za,g(un,bv)+1+6);let HF=un;var b2,T2,E2,w2,A2,S2,D2,C2;const _i=class _i{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let t,i=null,r=[],s=[],a=[],o=[],l=null,c=null;switch(e[0]){case"RadialAxial":t=e[1]==="axial"?1:2,i=e[2],a=e[3],t===1?r.push(...e[4],...e[5]):r.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":t=3,l=e[1],r=e[2],s=e[3],o=e[4]||[],i=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const h=Math.floor(r.length/2),f=Math.floor(s.length/3),p=a.length,y=o.length;let x=0;for(const k of o)x+=1,x=Math.ceil(x/4)*4,x+=4+k.coords.length*4,x+=4+k.colors.length*4,k.verticesPerRow!==void 0&&(x+=4);const v=20+h*8+f*3+p*8+(i?16:0)+(c?3:0)+x,_=new ArrayBuffer(v),E=new DataView(_),w=new Uint8Array(_);E.setUint8(g(_i,b2),t),E.setUint8(g(_i,T2),i?1:0),E.setUint8(g(_i,E2),c?1:0),E.setUint8(g(_i,w2),l),E.setUint32(g(_i,A2),h,!0),E.setUint32(g(_i,S2),f,!0),E.setUint32(g(_i,D2),p,!0),E.setUint32(g(_i,C2),y,!0);let A=20;new Float32Array(_,A,h*2).set(r),A+=h*8,w.set(s,A),A+=f*3;for(const[k,F]of a)E.setFloat32(A,k,!0),A+=4,E.setUint32(A,parseInt(F.slice(1),16),!0),A+=4;if(i)for(const k of i)E.setFloat32(A,k,!0),A+=4;c&&(w.set(c,A),A+=3);for(let k=0;k<o.length;k++){const F=o[k];E.setUint8(A,F.type),A+=1,A=Math.ceil(A/4)*4,E.setUint32(A,F.coords.length,!0),A+=4,new Int32Array(_,A,F.coords.length).set(F.coords),A+=F.coords.length*4,E.setUint32(A,F.colors.length,!0),A+=4,new Int32Array(_,A,F.colors.length).set(F.colors),A+=F.colors.length*4,F.verticesPerRow!==void 0&&(E.setUint32(A,F.verticesPerRow,!0),A+=4)}return _}getIR(){const e=this.view,t=this.data[g(_i,b2)],i=!!this.data[g(_i,T2)],r=!!this.data[g(_i,E2)],s=e.getUint32(g(_i,A2),!0),a=e.getUint32(g(_i,S2),!0),o=e.getUint32(g(_i,D2),!0),l=e.getUint32(g(_i,C2),!0);let c=20;const h=new Float32Array(this.buffer,c,s*2);c+=s*8;const f=new Uint8Array(this.buffer,c,a*3);c+=a*3;const p=[];for(let _=0;_<o;++_){const E=e.getFloat32(c,!0);c+=4;const w=e.getUint32(c,!0);c+=4,p.push([E,`#${w.toString(16).padStart(6,"0")}`])}let y=null;if(i){y=[];for(let _=0;_<4;++_)y.push(e.getFloat32(c,!0)),c+=4}let x=null;r&&(x=new Uint8Array(this.buffer,c,3),c+=3);const v=[];for(let _=0;_<l;++_){const E=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;const w=e.getUint32(c,!0);c+=4;const A=new Int32Array(this.buffer,c,w);c+=w*4;const N=e.getUint32(c,!0);c+=4;const k=new Int32Array(this.buffer,c,N);c+=N*4;const F={type:E,coords:A,colors:k};E===vF.LATTICE&&(F.verticesPerRow=e.getUint32(c,!0),c+=4),v.push(F)}if(t===1)return["RadialAxial","axial",y,p,Array.from(h.slice(0,2)),Array.from(h.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",y,p,[h[0],h[1]],[h[3],h[4]],h[2],h[5]];if(t===3){const _=this.data[g(_i,w2)];let E=null;if(h.length>0){let w=h[0],A=h[0],N=h[1],k=h[1];for(let F=0;F<h.length;F+=2){const C=h[F],M=h[F+1];w=w>C?C:w,N=N>M?M:N,A=A<C?C:A,k=k<M?M:k}E=[w,N,A,k]}return["Mesh",_,h,f,v,E,y,x]}throw new Error(`Unsupported pattern kind: ${t}`)}};b2=new WeakMap,T2=new WeakMap,E2=new WeakMap,w2=new WeakMap,A2=new WeakMap,S2=new WeakMap,D2=new WeakMap,C2=new WeakMap,Y(_i,b2,0),Y(_i,T2,1),Y(_i,E2,2),Y(_i,w2,3),Y(_i,A2,4),Y(_i,S2,8),Y(_i,D2,12),Y(_i,C2,16);let zF=_i;var Tv;class C_e{constructor(e){Y(this,Tv);V(this,Tv,e)}static write(e){let t,i;return Pr.isFloat16ArraySupported?(i=new ArrayBuffer(e.length*2),t=new Float16Array(i)):(i=new ArrayBuffer(e.length*4),t=new Float32Array(i)),t.set(e),i}get path(){return Pr.isFloat16ArraySupported?new Float16Array(g(this,Tv)):new Float32Array(g(this,Tv))}}Tv=new WeakMap;function I_e(n){if(n instanceof URL)return n;if(typeof n=="string"){if(sa){if(/^[a-z][a-z0-9\-+.]+:/i.test(n))return new URL(n);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}const e=URL.parse(n,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function R_e(n){if(sa&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return uI(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Qw(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}const GF=n=>typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0,N_e=n=>typeof n=="object"&&typeof(n==null?void 0:n.name)=="string",k_e=d_e.bind(null,GF,N_e);var th,FC;class M_e{constructor(){Y(this,th,new Map);Y(this,FC,Promise.resolve())}postMessage(e,t){const i={data:structuredClone(e,t?{transfer:t}:null)};g(this,FC).then(()=>{for(const[r]of g(this,th))r.call(this,i)})}addEventListener(e,t,i=null){let r=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:s}=i;if(s.aborted){an("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,t);r=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}g(this,th).set(t,r)}removeEventListener(e,t){const i=g(this,th).get(t);i==null||i(),g(this,th).delete(t)}terminate(){for(const[,e]of g(this,th))e==null||e();g(this,th).clear()}}th=new WeakMap,FC=new WeakMap;const Zw={DATA:1,ERROR:2},hr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function GV(){}function Ta(n){if(n instanceof ep||n instanceof xF||n instanceof PV||n instanceof CD||n instanceof Xk)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||Wn('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new ep(n.message);case"InvalidPDFException":return new xF(n.message);case"PasswordException":return new PV(n.message,n.code);case"ResponseException":return new CD(n.message,n.status,n.missing);case"UnknownErrorException":return new Xk(n.message,n.details)}return new Xk(n.message,n.toString())}var Ev,dl,JK,QK,ZK,nS;class kx{constructor(e,t,i){Y(this,dl);Y(this,Ev,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",Q(this,dl,JK).bind(this),{signal:g(this,Ev).signal})}on(e,t){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){const r=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},i)}catch(a){s.reject(a)}return s.promise}sendWithStream(e,t,i,r){const s=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const h=Promise.withResolvers();return this.streamControllers[s]={controller:c,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:s,data:t,desiredSize:c.desiredSize},r),h.promise},pull:c=>{const h=Promise.withResolvers();return this.streamControllers[s].pullCall=h,l.postMessage({sourceName:a,targetName:o,stream:hr.PULL,streamId:s,desiredSize:c.desiredSize}),h.promise},cancel:c=>{Fn(c instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[s].cancelCall=h,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:hr.CANCEL,streamId:s,reason:Ta(c)}),h.promise}},i)}destroy(){var e;(e=g(this,Ev))==null||e.abort(),V(this,Ev,null)}}Ev=new WeakMap,dl=new WeakSet,JK=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){Q(this,dl,ZK).call(this,e);return}if(e.callback){const i=e.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],e.callback===Zw.DATA)r.resolve(e.data);else if(e.callback===Zw.ERROR)r.reject(Ta(e.reason));else throw new Error("Unexpected callback case");return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const i=this.sourceName,r=e.sourceName,s=this.comObj;Promise.try(t,e.data).then(function(a){s.postMessage({sourceName:i,targetName:r,callback:Zw.DATA,callbackId:e.callbackId,data:a})},function(a){s.postMessage({sourceName:i,targetName:r,callback:Zw.ERROR,callbackId:e.callbackId,reason:Ta(a)})});return}if(e.streamId){Q(this,dl,QK).call(this,e);return}t(e.data)},QK=function(e){const t=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(c,h=1,f){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=h,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:r,stream:hr.ENQUEUE,streamId:t,chunk:c},f)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:hr.CLOSE,streamId:t}),delete a.streamSinks[t])},error(c){Fn(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:hr.ERROR,streamId:t,reason:Ta(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,Promise.try(o,e.data,l).then(function(){s.postMessage({sourceName:i,targetName:r,stream:hr.START_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:i,targetName:r,stream:hr.START_COMPLETE,streamId:t,reason:Ta(c)})})},ZK=function(e){const t=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case hr.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Ta(e.reason));break;case hr.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Ta(e.reason));break;case hr.PULL:if(!o){s.postMessage({sourceName:i,targetName:r,stream:hr.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||GV).then(function(){s.postMessage({sourceName:i,targetName:r,stream:hr.PULL_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:i,targetName:r,stream:hr.PULL_COMPLETE,streamId:t,reason:Ta(c)})});break;case hr.ENQUEUE:if(Fn(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case hr.CLOSE:if(Fn(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),Q(this,dl,nS).call(this,a,t);break;case hr.ERROR:Fn(a,"error should have stream controller"),a.controller.error(Ta(e.reason)),Q(this,dl,nS).call(this,a,t);break;case hr.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Ta(e.reason)),Q(this,dl,nS).call(this,a,t);break;case hr.CANCEL:if(!o)break;const l=Ta(e.reason);Promise.try(o.onCancel||GV,l).then(function(){s.postMessage({sourceName:i,targetName:r,stream:hr.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:i,targetName:r,stream:hr.CANCEL_COMPLETE,streamId:t,reason:Ta(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},nS=async function(e,t){var i,r,s;await Promise.allSettled([(i=e.startCall)==null?void 0:i.promise,(r=e.pullCall)==null?void 0:r.promise,(s=e.cancelCall)==null?void 0:s.promise]),delete this.streamControllers[t]};var I2;class eY{constructor({enableHWA:e=!1}){Y(this,I2,!1);V(this,I2,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(e,t);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!g(this,I2)})}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Wn("Abstract method `_createCanvas` called.")}}I2=new WeakMap;class F_e extends eY{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const i=this._document.createElement("canvas");return i.width=e,i.height=t,i}}class tY{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){Wn("Abstract method `_fetch` called.")}}class qV extends tY{async _fetch(e){const t=await XT(e,this.isCompressed?"bytes":"text");return t instanceof Uint8Array?t:uI(t)}}class nY{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,i,r,s){return"none"}destroy(e=!1){}}var Wg,wv,nh,ih,Bs,Hg,zg,It,Us,Mx,ay,iS,oy,iY,qF,ly,Fx,Ux,$F,Px;class U_e extends nY{constructor({docId:t,ownerDocument:i=globalThis.document}){super();Y(this,It);Y(this,Wg);Y(this,wv);Y(this,nh);Y(this,ih);Y(this,Bs);Y(this,Hg);Y(this,zg,0);V(this,ih,t),V(this,Bs,i)}addFilter(t){if(!t)return"none";let i=g(this,It,Us).get(t);if(i)return i;const[r,s,a]=Q(this,It,iS).call(this,t),o=t.length===1?r:`${r}${s}${a}`;if(i=g(this,It,Us).get(o),i)return g(this,It,Us).set(t,i),i;const l=`g_${g(this,ih)}_transfer_map_${Dr(this,zg)._++}`,c=Q(this,It,oy).call(this,l);g(this,It,Us).set(t,c),g(this,It,Us).set(o,c);const h=Q(this,It,ly).call(this,l);return Q(this,It,Ux).call(this,r,s,a,h),c}addHCMFilter(t,i){var x;const r=`${t}-${i}`,s="base";let a=g(this,It,Mx).get(s);if((a==null?void 0:a.key)===r||(a?((x=a.filter)==null||x.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},g(this,It,Mx).set(s,a)),!t||!i))return a.url;const o=Q(this,It,Px).call(this,t);t=St.makeHexColor(...o);const l=Q(this,It,Px).call(this,i);if(i=St.makeHexColor(...l),g(this,It,ay).style.color="",t==="#000000"&&i==="#ffffff"||t===i)return a.url;const c=new Array(256);for(let v=0;v<=255;v++){const _=v/255;c[v]=_<=.03928?_/12.92:((_+.055)/1.055)**2.4}const h=c.join(","),f=`g_${g(this,ih)}_hcm_filter`,p=a.filter=Q(this,It,ly).call(this,f);Q(this,It,Ux).call(this,h,h,h,p),Q(this,It,qF).call(this,p);const y=(v,_)=>{const E=o[v]/255,w=l[v]/255,A=new Array(_+1);for(let N=0;N<=_;N++)A[N]=E+N/_*(w-E);return A.join(",")};return Q(this,It,Ux).call(this,y(0,5),y(1,5),y(2,5),p),a.url=Q(this,It,oy).call(this,f),a.url}addAlphaFilter(t){let i=g(this,It,Us).get(t);if(i)return i;const[r]=Q(this,It,iS).call(this,[t]),s=`alpha_${r}`;if(i=g(this,It,Us).get(s),i)return g(this,It,Us).set(t,i),i;const a=`g_${g(this,ih)}_alpha_map_${Dr(this,zg)._++}`,o=Q(this,It,oy).call(this,a);g(this,It,Us).set(t,o),g(this,It,Us).set(s,o);const l=Q(this,It,ly).call(this,a);return Q(this,It,$F).call(this,r,l),o}addLuminosityFilter(t){let i=g(this,It,Us).get(t||"luminosity");if(i)return i;let r,s;if(t?([r]=Q(this,It,iS).call(this,[t]),s=`luminosity_${r}`):s="luminosity",i=g(this,It,Us).get(s),i)return g(this,It,Us).set(t,i),i;const a=`g_${g(this,ih)}_luminosity_map_${Dr(this,zg)._++}`,o=Q(this,It,oy).call(this,a);g(this,It,Us).set(t,o),g(this,It,Us).set(s,o);const l=Q(this,It,ly).call(this,a);return Q(this,It,iY).call(this,l),t&&Q(this,It,$F).call(this,r,l),o}addHighlightHCMFilter(t,i,r,s,a){var w;const o=`${i}-${r}-${s}-${a}`;let l=g(this,It,Mx).get(t);if((l==null?void 0:l.key)===o||(l?((w=l.filter)==null||w.remove(),l.key=o,l.url="none",l.filter=null):(l={key:o,url:"none",filter:null},g(this,It,Mx).set(t,l)),!i||!r))return l.url;const[c,h]=[i,r].map(Q(this,It,Px).bind(this));let f=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[y,x]=[s,a].map(Q(this,It,Px).bind(this));p<f&&([f,p,y,x]=[p,f,x,y]),g(this,It,ay).style.color="";const v=(A,N,k)=>{const F=new Array(256),C=(p-f)/k,M=A/255,R=(N-A)/(255*k);let L=0;for(let H=0;H<=k;H++){const P=Math.round(f+H*C),O=M+H*R;for(let B=L;B<=P;B++)F[B]=O;L=P+1}for(let H=L;H<256;H++)F[H]=F[L-1];return F.join(",")},_=`g_${g(this,ih)}_hcm_${t}_filter`,E=l.filter=Q(this,It,ly).call(this,_);return Q(this,It,qF).call(this,E),Q(this,It,Ux).call(this,v(y[0],x[0],5),v(y[1],x[1],5),v(y[2],x[2],5),E),l.url=Q(this,It,oy).call(this,_),l.url}destroy(t=!1){var i,r,s,a;t&&((i=g(this,Hg))!=null&&i.size)||((r=g(this,nh))==null||r.parentNode.parentNode.remove(),V(this,nh,null),(s=g(this,wv))==null||s.clear(),V(this,wv,null),(a=g(this,Hg))==null||a.clear(),V(this,Hg,null),V(this,zg,0))}}Wg=new WeakMap,wv=new WeakMap,nh=new WeakMap,ih=new WeakMap,Bs=new WeakMap,Hg=new WeakMap,zg=new WeakMap,It=new WeakSet,Us=function(){return g(this,wv)||V(this,wv,new Map)},Mx=function(){return g(this,Hg)||V(this,Hg,new Map)},ay=function(){if(!g(this,nh)){const t=g(this,Bs).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 r=g(this,Bs).createElementNS(Ou,"svg");r.setAttribute("width",0),r.setAttribute("height",0),V(this,nh,g(this,Bs).createElementNS(Ou,"defs")),t.append(r),r.append(g(this,nh)),g(this,Bs).body.append(t)}return g(this,nh)},iS=function(t){if(t.length===1){const c=t[0],h=new Array(256);for(let p=0;p<256;p++)h[p]=c[p]/255;const f=h.join(",");return[f,f,f]}const[i,r,s]=t,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=i[c]/255,o[c]=r[c]/255,l[c]=s[c]/255;return[a.join(","),o.join(","),l.join(",")]},oy=function(t){if(g(this,Wg)===void 0){V(this,Wg,"");const i=g(this,Bs).URL;i!==g(this,Bs).baseURI&&(hI(i)?an('#createUrl: ignore "data:"-URL for performance reasons.'):V(this,Wg,cK(i,"")))}return`url(${g(this,Wg)}#${t})`},iY=function(t){const i=g(this,Bs).createElementNS(Ou,"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)},qF=function(t){const i=g(this,Bs).createElementNS(Ou,"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)},ly=function(t){const i=g(this,Bs).createElementNS(Ou,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",t),g(this,It,ay).append(i),i},Fx=function(t,i,r){const s=g(this,Bs).createElementNS(Ou,i);s.setAttribute("type","discrete"),s.setAttribute("tableValues",r),t.append(s)},Ux=function(t,i,r,s){const a=g(this,Bs).createElementNS(Ou,"feComponentTransfer");s.append(a),Q(this,It,Fx).call(this,a,"feFuncR",t),Q(this,It,Fx).call(this,a,"feFuncG",i),Q(this,It,Fx).call(this,a,"feFuncB",r)},$F=function(t,i){const r=g(this,Bs).createElementNS(Ou,"feComponentTransfer");i.append(r),Q(this,It,Fx).call(this,r,"feFuncA",t)},Px=function(t){return g(this,It,ay).style.color=t,YT(getComputedStyle(g(this,It,ay)).getPropertyValue("color"))};class rY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(i=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){Wn("Abstract method `_fetch` called.")}}class $V extends rY{async _fetch(e){return XT(e,"bytes")}}class sY{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(i=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){Wn("Abstract method `_fetch` called.")}}class jV extends sY{async _fetch(e){return XT(e,"bytes")}}sa&&an("Please use the `legacy` build in Node.js environments.");async function w4(n){const t=await process.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(t)}class P_e extends nY{}class L_e extends eY{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,t)}}class O_e extends tY{async _fetch(e){return w4(e)}}class B_e extends rY{async _fetch(e){return w4(e)}}class V_e extends sY{async _fetch(e){return w4(e)}}const K0="__forcedDependency",{floor:XV,ceil:KV}=Math;function eA(n,e,t,i,r,s){n[e*4+0]=Math.min(n[e*4+0],t),n[e*4+1]=Math.min(n[e*4+1],i),n[e*4+2]=Math.max(n[e*4+2],r),n[e*4+3]=Math.max(n[e*4+3],s)}const jF=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Av,mf;class W_e{constructor(e,t){Y(this,Av);Y(this,mf);V(this,Av,e),V(this,mf,t)}get length(){return g(this,Av).length}isEmpty(e){return g(this,Av)[e]===jF}minX(e){return g(this,mf)[e*4+0]/256}minY(e){return g(this,mf)[e*4+1]/256}maxX(e){return(g(this,mf)[e*4+2]+1)/256}maxY(e){return(g(this,mf)[e*4+3]+1)/256}}Av=new WeakMap,mf=new WeakMap;const tA=(n,e)=>n==null?void 0:n.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));var Aa,Sa,Gg,Ol,qg,rh,Qn,hi,sh,Da,R2,Sv,$g,jg,ah,Vs,zc,N2,XF;class H_e{constructor(e,t,i=!1){Y(this,N2);Y(this,Aa,{__proto__:null});Y(this,Sa,{__proto__:null,transform:[],moveText:[],sameLineText:[],[K0]:[]});Y(this,Gg,new Map);Y(this,Ol,[]);Y(this,qg,[]);Y(this,rh,[[1,0,0,1,0,0]]);Y(this,Qn,[-1/0,-1/0,1/0,1/0]);Y(this,hi,new Float64Array([1/0,1/0,-1/0,-1/0]));Y(this,sh,-1);Y(this,Da,new Set);Y(this,R2,new Map);Y(this,Sv,new Map);Y(this,$g);Y(this,jg);Y(this,ah);Y(this,Vs);Y(this,zc);V(this,$g,e.width),V(this,jg,e.height),Q(this,N2,XF).call(this,t),i&&V(this,zc,new Map)}growOperationsCount(e){e>=g(this,Vs).length&&Q(this,N2,XF).call(this,e,g(this,Vs))}save(e){return V(this,Aa,{__proto__:g(this,Aa)}),V(this,Sa,{__proto__:g(this,Sa),transform:{__proto__:g(this,Sa).transform},moveText:{__proto__:g(this,Sa).moveText},sameLineText:{__proto__:g(this,Sa).sameLineText},[K0]:{__proto__:g(this,Sa)[K0]}}),V(this,Qn,{__proto__:g(this,Qn)}),g(this,Ol).push(e),this}restore(e){var r;const t=Object.getPrototypeOf(g(this,Aa));if(t===null)return this;V(this,Aa,t),V(this,Sa,Object.getPrototypeOf(g(this,Sa))),V(this,Qn,Object.getPrototypeOf(g(this,Qn)));const i=g(this,Ol).pop();return i!==void 0&&((r=tA(g(this,zc),e))==null||r.dependencies.add(i),g(this,Vs)[e]=g(this,Vs)[i]),this}recordOpenMarker(e){return g(this,Ol).push(e),this}getOpenMarker(){return g(this,Ol).length===0?null:g(this,Ol).at(-1)}recordCloseMarker(e){var i;const t=g(this,Ol).pop();return t!==void 0&&((i=tA(g(this,zc),e))==null||i.dependencies.add(t),g(this,Vs)[e]=g(this,Vs)[t]),this}beginMarkedContent(e){return g(this,qg).push(e),this}endMarkedContent(e){var i;const t=g(this,qg).pop();return t!==void 0&&((i=tA(g(this,zc),e))==null||i.dependencies.add(t),g(this,Vs)[e]=g(this,Vs)[t]),this}pushBaseTransform(e){return g(this,rh).push(St.multiplyByDOMMatrix(g(this,rh).at(-1),e.getTransform())),this}popBaseTransform(){return g(this,rh).length>1&&g(this,rh).pop(),this}recordSimpleData(e,t){return g(this,Aa)[e]=t,this}recordIncrementalData(e,t){return g(this,Sa)[e].push(t),this}resetIncrementalData(e,t){return g(this,Sa)[e].length=0,this}recordNamedData(e,t){return g(this,Gg).set(e,t),this}recordSimpleDataFromNamed(e,t,i){g(this,Aa)[e]=g(this,Gg).get(t)??i}recordFutureForcedDependency(e,t){return this.recordIncrementalData(K0,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const t of e)t in g(this,Aa)&&this.recordFutureForcedDependency(t,g(this,Aa)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of g(this,Da))this.recordFutureForcedDependency(K0,e);return this}resetBBox(e){return g(this,sh)!==e&&(V(this,sh,e),g(this,hi)[0]=1/0,g(this,hi)[1]=1/0,g(this,hi)[2]=-1/0,g(this,hi)[3]=-1/0),this}recordClipBox(e,t,i,r,s,a){const o=St.multiplyByDOMMatrix(g(this,rh).at(-1),t.getTransform()),l=[1/0,1/0,-1/0,-1/0];St.axialAlignedBoundingBox([i,s,r,a],o,l);const c=St.intersect(g(this,Qn),l);return c?(g(this,Qn)[0]=c[0],g(this,Qn)[1]=c[1],g(this,Qn)[2]=c[2],g(this,Qn)[3]=c[3]):(g(this,Qn)[0]=g(this,Qn)[1]=1/0,g(this,Qn)[2]=g(this,Qn)[3]=-1/0),this}recordBBox(e,t,i,r,s,a){const o=g(this,Qn);if(o[0]===1/0)return this;const l=St.multiplyByDOMMatrix(g(this,rh).at(-1),t.getTransform());if(o[0]===-1/0)return St.axialAlignedBoundingBox([i,s,r,a],l,g(this,hi)),this;const c=[1/0,1/0,-1/0,-1/0];return St.axialAlignedBoundingBox([i,s,r,a],l,c),g(this,hi)[0]=Math.min(g(this,hi)[0],Math.max(c[0],o[0])),g(this,hi)[1]=Math.min(g(this,hi)[1],Math.max(c[1],o[1])),g(this,hi)[2]=Math.max(g(this,hi)[2],Math.min(c[2],o[2])),g(this,hi)[3]=Math.max(g(this,hi)[3],Math.min(c[3],o[3])),this}recordCharacterBBox(e,t,i,r=1,s=0,a=0,o){const l=i.bbox;let c,h;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&g(this,Sv).get(i),c!==!1&&(h=[0,0,0,0],St.axialAlignedBoundingBox(l,i.fontMatrix,h),(r!==1||s!==0||a!==0)&&St.scaleMinMax([r,0,0,-r,s,a],h),c)))return this.recordBBox(e,t,h[0],h[2],h[1],h[3]);if(!o)return this.recordFullPageBBox(e);const f=o();return l&&h&&c===void 0&&(c=h[0]<=s-f.actualBoundingBoxLeft&&h[2]>=s+f.actualBoundingBoxRight&&h[1]<=a-f.actualBoundingBoxAscent&&h[3]>=a+f.actualBoundingBoxDescent,g(this,Sv).set(i,c),c)?this.recordBBox(e,t,h[0],h[2],h[1],h[3]):this.recordBBox(e,t,s-f.actualBoundingBoxLeft,s+f.actualBoundingBoxRight,a-f.actualBoundingBoxAscent,a+f.actualBoundingBoxDescent)}recordFullPageBBox(e){return g(this,hi)[0]=Math.max(0,g(this,Qn)[0]),g(this,hi)[1]=Math.max(0,g(this,Qn)[1]),g(this,hi)[2]=Math.min(g(this,$g),g(this,Qn)[2]),g(this,hi)[3]=Math.min(g(this,jg),g(this,Qn)[3]),this}getSimpleIndex(e){return g(this,Aa)[e]}recordDependencies(e,t){const i=g(this,Da),r=g(this,Aa),s=g(this,Sa);for(const a of t)a in g(this,Aa)?i.add(r[a]):a in s&&s[a].forEach(i.add,i);return this}recordNamedDependency(e,t){return g(this,Gg).has(t)&&g(this,Da).add(g(this,Gg).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[K0]),g(this,zc)){const i=tA(g(this,zc),e),{dependencies:r}=i;g(this,Da).forEach(r.add,r),g(this,Ol).forEach(r.add,r),g(this,qg).forEach(r.add,r),r.delete(e),i.isRenderingOperation=!0}if(g(this,sh)===e){const i=XV(g(this,hi)[0]*256/g(this,$g)),r=XV(g(this,hi)[1]*256/g(this,jg)),s=KV(g(this,hi)[2]*256/g(this,$g)),a=KV(g(this,hi)[3]*256/g(this,jg));eA(g(this,ah),e,i,r,s,a);for(const o of g(this,Da))o!==e&&eA(g(this,ah),o,i,r,s,a);for(const o of g(this,Ol))o!==e&&eA(g(this,ah),o,i,r,s,a);for(const o of g(this,qg))o!==e&&eA(g(this,ah),o,i,r,s,a);t||(g(this,Da).clear(),V(this,sh,-1))}return this}recordShowTextOperation(e,t=!1){const i=Array.from(g(this,Da));this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(const r of i)this.recordIncrementalData("sameLineText",r);return this}bboxToClipBoxDropOperation(e,t=!1){return g(this,sh)===e&&(V(this,sh,-1),g(this,Qn)[0]=Math.max(g(this,Qn)[0],g(this,hi)[0]),g(this,Qn)[1]=Math.max(g(this,Qn)[1],g(this,hi)[1]),g(this,Qn)[2]=Math.min(g(this,Qn)[2],g(this,hi)[2]),g(this,Qn)[3]=Math.min(g(this,Qn)[3],g(this,hi)[3]),t||g(this,Da).clear()),this}_takePendingDependencies(){const e=g(this,Da);return V(this,Da,new Set),e}_extractOperation(e){const t=g(this,R2).get(e);return g(this,R2).delete(e),t}_pushPendingDependencies(e){for(const t of e)g(this,Da).add(t)}take(){return g(this,Sv).clear(),new W_e(g(this,Vs),g(this,ah))}takeDebugMetadata(){return g(this,zc)}}Aa=new WeakMap,Sa=new WeakMap,Gg=new WeakMap,Ol=new WeakMap,qg=new WeakMap,rh=new WeakMap,Qn=new WeakMap,hi=new WeakMap,sh=new WeakMap,Da=new WeakMap,R2=new WeakMap,Sv=new WeakMap,$g=new WeakMap,jg=new WeakMap,ah=new WeakMap,Vs=new WeakMap,zc=new WeakMap,N2=new WeakSet,XF=function(e,t){const i=new ArrayBuffer(e*4);V(this,ah,new Uint8ClampedArray(i)),V(this,Vs,new Uint32Array(i)),t&&t.length>0?(g(this,Vs).set(t),g(this,Vs).fill(jF,t.length)):g(this,Vs).fill(jF)};var yi,qi,Bl,Dv,Cv;const M5=class M5{constructor(e,t,i){Y(this,yi);Y(this,qi);Y(this,Bl);Y(this,Dv,0);Y(this,Cv,0);if(e instanceof M5&&g(e,Bl)===!!i)return e;V(this,yi,e),V(this,qi,t),V(this,Bl,!!i)}growOperationsCount(){throw new Error("Unreachable")}save(e){return Dr(this,Cv)._++,g(this,yi).save(g(this,qi)),this}restore(e){return g(this,Cv)>0&&(g(this,yi).restore(g(this,qi)),Dr(this,Cv)._--),this}recordOpenMarker(e){return Dr(this,Dv)._++,this}getOpenMarker(){return g(this,Dv)>0?g(this,qi):g(this,yi).getOpenMarker()}recordCloseMarker(e){return Dr(this,Dv)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return g(this,yi).pushBaseTransform(e),this}popBaseTransform(){return g(this,yi).popBaseTransform(),this}recordSimpleData(e,t){return g(this,yi).recordSimpleData(e,g(this,qi)),this}recordIncrementalData(e,t){return g(this,yi).recordIncrementalData(e,g(this,qi)),this}resetIncrementalData(e,t){return g(this,yi).resetIncrementalData(e,g(this,qi)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,i){return g(this,yi).recordSimpleDataFromNamed(e,t,g(this,qi)),this}recordFutureForcedDependency(e,t){return g(this,yi).recordFutureForcedDependency(e,g(this,qi)),this}inheritSimpleDataAsFutureForcedDependencies(e){return g(this,yi).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return g(this,yi).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return g(this,Bl)||g(this,yi).resetBBox(g(this,qi)),this}recordClipBox(e,t,i,r,s,a){return g(this,Bl)||g(this,yi).recordClipBox(g(this,qi),t,i,r,s,a),this}recordBBox(e,t,i,r,s,a){return g(this,Bl)||g(this,yi).recordBBox(g(this,qi),t,i,r,s,a),this}recordCharacterBBox(e,t,i,r,s,a,o){return g(this,Bl)||g(this,yi).recordCharacterBBox(g(this,qi),t,i,r,s,a,o),this}recordFullPageBBox(e){return g(this,Bl)||g(this,yi).recordFullPageBBox(g(this,qi)),this}getSimpleIndex(e){return g(this,yi).getSimpleIndex(e)}recordDependencies(e,t){return g(this,yi).recordDependencies(g(this,qi),t),this}recordNamedDependency(e,t){return g(this,yi).recordNamedDependency(g(this,qi),t),this}recordOperation(e){return g(this,yi).recordOperation(g(this,qi),!0),this}recordShowTextOperation(e){return g(this,yi).recordShowTextOperation(g(this,qi),!0),this}bboxToClipBoxDropOperation(e){return g(this,Bl)||g(this,yi).bboxToClipBoxDropOperation(g(this,qi),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};yi=new WeakMap,qi=new WeakMap,Bl=new WeakMap,Dv=new WeakMap,Cv=new WeakMap;let FD=M5;const Wo={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Ts={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function KF(n,e){if(!e)return;const t=e[2]-e[0],i=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],t,i),n.clip(r)}class A4{isModifyingCurrentTransform(){return!1}getPattern(){Wn("Abstract method `getPattern` called.")}}class z_e extends A4{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}_createGradient(e,t=null){let i,r=this._p0,s=this._p1;if(t&&(r=r.slice(),s=s.slice(),St.applyTransform(r,t),St.applyTransform(s,t)),this._type==="axial")i=e.createLinearGradient(r[0],r[1],s[0],s[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(t){const l=new Float32Array(2);St.singularValueDecompose2dScale(t,l),a*=l[0],o*=l[0]}i=e.createRadialGradient(r[0],r[1],a,s[0],s[1],o)}for(const a of this._colorStops)i.addColorStop(a[0],a[1]);return i}getPattern(e,t,i,r){let s;if(r===Ts.STROKE||r===Ts.FILL){if(this.isOriginBased()){let p=St.transform(i,t.baseTransform);this.matrix&&(p=St.transform(p,this.matrix));const y=.001,x=Math.hypot(p[0],p[1]),v=Math.hypot(p[2],p[3]),_=(p[0]*p[2]+p[1]*p[3])/(x*v);if(Math.abs(_)<y)if(this.isRadial()){if(Math.abs(x-v)<y)return this._createGradient(e,p)}else return this._createGradient(e,p)}const a=t.current.getClippedPathBoundingBox(r,Bi(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas("pattern",o,l),h=c.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),i=St.transform(i,[1,0,0,1,a[0],a[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),KF(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=e.createPattern(c.canvas,"no-repeat");const f=new DOMMatrix(i);s.setTransform(f)}else KF(e,this._bbox),s=this._createGradient(e);return s}}function Jk(n,e,t,i,r,s,a,o){const l=e.coords,c=e.colors,h=n.data,f=n.width*4;let p;l[t+1]>l[i+1]&&(p=t,t=i,i=p,p=s,s=a,a=p),l[i+1]>l[r+1]&&(p=i,i=r,r=p,p=a,a=o,o=p),l[t+1]>l[i+1]&&(p=t,t=i,i=p,p=s,s=a,a=p);const y=(l[t]+e.offsetX)*e.scaleX,x=(l[t+1]+e.offsetY)*e.scaleY,v=(l[i]+e.offsetX)*e.scaleX,_=(l[i+1]+e.offsetY)*e.scaleY,E=(l[r]+e.offsetX)*e.scaleX,w=(l[r+1]+e.offsetY)*e.scaleY;if(x>=w)return;const A=c[s],N=c[s+1],k=c[s+2],F=c[a],C=c[a+1],M=c[a+2],R=c[o],L=c[o+1],H=c[o+2],P=Math.round(x),O=Math.round(w);let B,re,q,X,oe,ue,ge,j;for(let G=P;G<=O;G++){if(G<_){const Ie=G<x?0:(x-G)/(x-_);B=y-(y-v)*Ie,re=A-(A-F)*Ie,q=N-(N-C)*Ie,X=k-(k-M)*Ie}else{let Ie;G>w?Ie=1:_===w?Ie=0:Ie=(_-G)/(_-w),B=v-(v-E)*Ie,re=F-(F-R)*Ie,q=C-(C-L)*Ie,X=M-(M-H)*Ie}let Z;G<x?Z=0:G>w?Z=1:Z=(x-G)/(x-w),oe=y-(y-E)*Z,ue=A-(A-R)*Z,ge=N-(N-L)*Z,j=k-(k-H)*Z;const te=Math.round(Math.min(B,oe)),ie=Math.round(Math.max(B,oe));let _e=f*G+te*4;for(let Ie=te;Ie<=ie;Ie++)Z=(B-Ie)/(B-oe),Z<0?Z=0:Z>1&&(Z=1),h[_e++]=re-(re-ue)*Z|0,h[_e++]=q-(q-ge)*Z|0,h[_e++]=X-(X-j)*Z|0,h[_e++]=255}}function G_e(n,e,t){const i=e.coords,r=e.colors;let s,a;switch(e.type){case vF.LATTICE:const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(s=0;s<l;s++){let h=s*o;for(let f=0;f<c;f++,h++)Jk(n,t,i[h],i[h+1],i[h+o],r[h],r[h+1],r[h+o]),Jk(n,t,i[h+o+1],i[h+1],i[h+o],r[h+o+1],r[h+1],r[h+o])}break;case vF.TRIANGLES:for(s=0,a=i.length;s<a;s+=3)Jk(n,t,i[s],i[s+1],i[s+2],r[s],r[s+1],r[s+2]);break;default:throw new Error("illegal figure")}}class q_e extends A4{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,i){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,h=Math.ceil(this._bounds[3])-l,f=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),p=Math.min(Math.ceil(Math.abs(h*e[1]*1.1)),3e3),y=c/f,x=h/p,v={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/y,scaleY:1/x},_=f+4,E=p+4,w=i.getCanvas("mesh",_,E),A=w.context,N=A.createImageData(f,p);if(t){const F=N.data;for(let C=0,M=F.length;C<M;C+=4)F[C]=t[0],F[C+1]=t[1],F[C+2]=t[2],F[C+3]=255}for(const F of this._figures)G_e(N,F,v);return A.putImageData(N,2,2),{canvas:w.canvas,offsetX:o-2*y,offsetY:l-2*x,scaleX:y,scaleY:x}}isModifyingCurrentTransform(){return!0}getPattern(e,t,i,r){KF(e,this._bbox);const s=new Float32Array(2);if(r===Ts.SHADING)St.singularValueDecompose2dScale(Bi(e),s);else if(this.matrix){St.singularValueDecompose2dScale(this.matrix,s);const[o,l]=s;St.singularValueDecompose2dScale(t.baseTransform,s),s[0]*=o,s[1]*=l}else St.singularValueDecompose2dScale(t.baseTransform,s);const a=this._createMeshCanvas(s,r===Ts.SHADING?null:this._background,t.cachedCanvases);return r!==Ts.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class $_e extends A4{getPattern(){return"hotpink"}}function j_e(n){switch(n[0]){case"RadialAxial":return new z_e(n);case"Mesh":return new q_e(n);case"Dummy":return new $_e}throw new Error(`Unknown IR type: ${n[0]}`)}const YV={COLORED:1,UNCOLORED:2},UC=class UC{constructor(e,t,i,r){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=i,this.baseTransform=r}createPatternCanvas(e,t){var ue,ge;const{bbox:i,operatorList:r,paintType:s,tilingType:a,color:o,canvasGraphicsFactory:l}=this;let{xstep:c,ystep:h}=this;c=Math.abs(c),h=Math.abs(h),cI("TilingType: "+a);const f=i[0],p=i[1],y=i[2],x=i[3],v=y-f,_=x-p,E=new Float32Array(2);St.singularValueDecompose2dScale(this.matrix,E);const[w,A]=E;St.singularValueDecompose2dScale(this.baseTransform,E);const N=w*E[0],k=A*E[1];let F=v,C=_,M=!1,R=!1;const L=Math.ceil(c*N),H=Math.ceil(h*k),P=Math.ceil(v*N),O=Math.ceil(_*k);L>=P?F=c:M=!0,H>=O?C=h:R=!0;const B=this.getSizeAndScale(F,this.ctx.canvas.width,N),re=this.getSizeAndScale(C,this.ctx.canvas.height,k),q=e.cachedCanvases.getCanvas("pattern",B.size,re.size),X=q.context,oe=l.createCanvasGraphics(X,t);if(oe.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(oe,s,o),X.translate(-B.scale*f,-re.scale*p),oe.transform(0,B.scale,0,0,re.scale,0,0),X.save(),(ue=oe.dependencyTracker)==null||ue.save(),this.clipBbox(oe,f,p,y,x),oe.baseTransform=Bi(oe.ctx),oe.executeOperatorList(r),oe.endDrawing(),(ge=oe.dependencyTracker)==null||ge.restore(),X.restore(),M||R){const j=q.canvas;M&&(F=c),R&&(C=h);const G=this.getSizeAndScale(F,this.ctx.canvas.width,N),Z=this.getSizeAndScale(C,this.ctx.canvas.height,k),te=G.size,ie=Z.size,_e=e.cachedCanvases.getCanvas("pattern-workaround",te,ie),Ie=_e.context,Pe=M?Math.floor(v/c):0,Fe=R?Math.floor(_/h):0;for(let Ge=0;Ge<=Pe;Ge++)for(let ct=0;ct<=Fe;ct++)Ie.drawImage(j,te*Ge,ie*ct,te,ie,0,0,te,ie);return{canvas:_e.canvas,scaleX:G.scale,scaleY:Z.scale,offsetX:f,offsetY:p}}return{canvas:q.canvas,scaleX:B.scale,scaleY:re.scale,offsetX:f,offsetY:p}}getSizeAndScale(e,t,i){const r=Math.max(UC.MAX_PATTERN_SIZE,t);let s=Math.ceil(e*i);return s>=r?s=r:i=s/e,{scale:i,size:s}}clipBbox(e,t,i,r,s){const a=r-t,o=s-i;e.ctx.rect(t,i,a,o),St.axialAlignedBoundingBox([t,i,r,s],Bi(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,i){const r=e.ctx,s=e.current;switch(t){case YV.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;r.fillStyle=s.fillColor=a,r.strokeStyle=s.strokeColor=o;break;case YV.UNCOLORED:r.fillStyle=r.strokeStyle=i,s.fillColor=s.strokeColor=i;break;default:throw new s_e(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,i,r,s){let a=i;r!==Ts.SHADING&&(a=St.transform(a,t.baseTransform),this.matrix&&(a=St.transform(a,this.matrix)));const o=this.createPatternCanvas(t,s);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}};Ze(UC,"MAX_PATTERN_SIZE",3e3);let YF=UC;function X_e({src:n,srcPos:e=0,dest:t,width:i,height:r,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=Pr.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],h=i>>3,f=i&7,p=l^c,y=n.length;t=new Uint32Array(t.buffer);let x=0;for(let v=0;v<r;++v){for(const E=e+h;e<E;++e,x+=8){const w=n[e];t[x]=l^-(w>>7&1)&p,t[x+1]=l^-(w>>6&1)&p,t[x+2]=l^-(w>>5&1)&p,t[x+3]=l^-(w>>4&1)&p,t[x+4]=l^-(w>>3&1)&p,t[x+5]=l^-(w>>2&1)&p,t[x+6]=l^-(w>>1&1)&p,t[x+7]=l^-(w&1)&p}if(f===0)continue;const _=e<y?n[e++]:255;for(let E=0;E<f;++E,++x)t[x]=l^-(_>>7-E&1)&p}return{srcPos:e,destPos:x}}const JV=16,QV=100,K_e=15,ZV=10,ka=16,Qk=new DOMMatrix,yo=new Float32Array(2),wy=new Float32Array([1/0,1/0,-1/0,-1/0]);function Y_e(n,e){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){e.save(),this.__originalSave()},n.restore=function(){e.restore(),this.__originalRestore()},n.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},n.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},n.transform=function(t,i,r,s,a,o){e.transform(t,i,r,s,a,o),this.__originalTransform(t,i,r,s,a,o)},n.setTransform=function(t,i,r,s,a,o){e.setTransform(t,i,r,s,a,o),this.__originalSetTransform(t,i,r,s,a,o)},n.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},n.rotate=function(t){e.rotate(t),this.__originalRotate(t)},n.clip=function(t){e.clip(t),this.__originalClip(t)},n.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},n.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},n.bezierCurveTo=function(t,i,r,s,a,o){e.bezierCurveTo(t,i,r,s,a,o),this.__originalBezierCurveTo(t,i,r,s,a,o)},n.rect=function(t,i,r,s){e.rect(t,i,r,s),this.__originalRect(t,i,r,s)},n.closePath=function(){e.closePath(),this.__originalClosePath()},n.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class J_e{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let r;return this.cache[e]!==void 0?(r=this.cache[e],this.canvasFactory.reset(r,t,i)):(r=this.canvasFactory.create(t,i),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function nA(n,e,t,i,r,s,a,o,l,c){const[h,f,p,y,x,v]=Bi(n);if(f===0&&p===0){const w=a*h+x,A=Math.round(w),N=o*y+v,k=Math.round(N),F=(a+l)*h+x,C=Math.abs(Math.round(F)-A)||1,M=(o+c)*y+v,R=Math.abs(Math.round(M)-k)||1;return n.setTransform(Math.sign(h),0,0,Math.sign(y),A,k),n.drawImage(e,t,i,r,s,0,0,C,R),n.setTransform(h,f,p,y,x,v),[C,R]}if(h===0&&y===0){const w=o*p+x,A=Math.round(w),N=a*f+v,k=Math.round(N),F=(o+c)*p+x,C=Math.abs(Math.round(F)-A)||1,M=(a+l)*f+v,R=Math.abs(Math.round(M)-k)||1;return n.setTransform(0,Math.sign(f),Math.sign(p),0,A,k),n.drawImage(e,t,i,r,s,0,0,R,C),n.setTransform(h,f,p,y,x,v),[R,C]}n.drawImage(e,t,i,r,s,a,o,l,c);const _=Math.hypot(h,f),E=Math.hypot(p,y);return[_*l,E*c]}class eW{constructor(e,t,i){Ze(this,"alphaIsShape",!1);Ze(this,"fontSize",0);Ze(this,"fontSizeScale",1);Ze(this,"textMatrix",null);Ze(this,"textMatrixScale",1);Ze(this,"fontMatrix",yF);Ze(this,"leading",0);Ze(this,"x",0);Ze(this,"y",0);Ze(this,"lineX",0);Ze(this,"lineY",0);Ze(this,"charSpacing",0);Ze(this,"wordSpacing",0);Ze(this,"textHScale",1);Ze(this,"textRenderingMode",Ir.FILL);Ze(this,"textRise",0);Ze(this,"fillColor","#000000");Ze(this,"strokeColor","#000000");Ze(this,"patternFill",!1);Ze(this,"patternStroke",!1);Ze(this,"fillAlpha",1);Ze(this,"strokeAlpha",1);Ze(this,"lineWidth",1);Ze(this,"activeSMask",null);Ze(this,"transferMaps","none");i==null||i(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=wy.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Ts.FILL,t=null){const i=this.minMax.slice();if(e===Ts.STROKE){t||Wn("Stroke bounding box must include transform."),St.singularValueDecompose2dScale(t,yo);const r=yo[0]*this.lineWidth/2,s=yo[1]*this.lineWidth/2;i[0]-=r,i[1]-=s,i[2]+=r,i[3]+=s}return i}updateClipFromPath(){const e=St.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(wy,0)}getClippedPathBoundingBox(e=Ts.FILL,t=null){return St.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function tW(n,e){if(e instanceof ImageData){n.putImageData(e,0,0);return}const t=e.height,i=e.width,r=t%ka,s=(t-r)/ka,a=r===0?s:s+1,o=n.createImageData(i,ka);let l=0,c;const h=e.data,f=o.data;let p,y,x,v;if(e.kind===qA.GRAYSCALE_1BPP){const _=h.byteLength,E=new Uint32Array(f.buffer,0,f.byteLength>>2),w=E.length,A=i+7>>3,N=4294967295,k=Pr.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(x=p<s?ka:r,c=0,y=0;y<x;y++){const F=_-l;let C=0;const M=F>A?i:F*8-7,R=M&-8;let L=0,H=0;for(;C<R;C+=8)H=h[l++],E[c++]=H&128?N:k,E[c++]=H&64?N:k,E[c++]=H&32?N:k,E[c++]=H&16?N:k,E[c++]=H&8?N:k,E[c++]=H&4?N:k,E[c++]=H&2?N:k,E[c++]=H&1?N:k;for(;C<M;C++)L===0&&(H=h[l++],L=128),E[c++]=H&L?N:k,L>>=1}for(;c<w;)E[c++]=0;n.putImageData(o,0,p*ka)}}else if(e.kind===qA.RGBA_32BPP){for(y=0,v=i*ka*4,p=0;p<s;p++)f.set(h.subarray(l,l+v)),l+=v,n.putImageData(o,0,y),y+=ka;p<a&&(v=i*r*4,f.set(h.subarray(l,l+v)),n.putImageData(o,0,y))}else if(e.kind===qA.RGB_24BPP)for(x=ka,v=i*x,p=0;p<a;p++){for(p>=s&&(x=r,v=i*x),c=0,y=v;y--;)f[c++]=h[l++],f[c++]=h[l++],f[c++]=h[l++],f[c++]=255;n.putImageData(o,0,p*ka)}else throw new Error(`bad image kind: ${e.kind}`)}function nW(n,e){if(e.bitmap){n.drawImage(e.bitmap,0,0);return}const t=e.height,i=e.width,r=t%ka,s=(t-r)/ka,a=r===0?s:s+1,o=n.createImageData(i,ka);let l=0;const c=e.data,h=o.data;for(let f=0;f<a;f++){const p=f<s?ka:r;({srcPos:l}=X_e({src:c,srcPos:l,dest:h,width:i,height:p,nonBlackColor:0})),n.putImageData(o,0,f*ka)}}function sx(n,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of t)n[i]!==void 0&&(e[i]=n[i]);n.setLineDash!==void 0&&(e.setLineDash(n.getLineDash()),e.lineDashOffset=n.lineDashOffset)}function iA(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);const{filter:e}=n;e!=="none"&&e!==""&&(n.filter="none")}function iW(n,e){if(e)return!0;St.singularValueDecompose2dScale(n,yo);const t=Math.fround(uu.pixelRatio*tp.PDF_TO_CSS_UNITS);return yo[0]<=t&&yo[1]<=t}const Q_e=["butt","round","square"],Z_e=["miter","round","bevel"],exe={},rW={};var lc,JF,QF,ZF;const F5=class F5{constructor(e,t,i,r,s,{optionalContentConfig:a,markedContentStack:o=null},l,c,h){Y(this,lc);this.ctx=e,this.current=new eW(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=i,this.canvasFactory=r,this.filterFactory=s,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=o||[],this.optionalContentConfig=a,this.cachedCanvases=new J_e(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=h??null}getObject(e,t,i=null){var r;return typeof t=="string"?((r=this.dependencyTracker)==null||r.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):i}beginDrawing({transform:e,viewport:t,transparency:i=!1,background:r=null}){const s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,i){const l=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Bi(this.compositeCtx))}this.ctx.save(),iA(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Bi(this.ctx)}executeOperatorList(e,t,i,r,s){var E;const a=e.argsArray,o=e.fnArray;let l=t||0;const c=a.length;if(c===l)return l;const h=c-l>ZV&&typeof i=="function",f=h?Date.now()+K_e:0;let p=0;const y=this.commonObjs,x=this.objs;let v,_;for(;;){if(r!==void 0&&l===r.nextBreakPoint)return r.breakIt(l,i),l;if(!s||s(l))if(v=o[l],_=a[l]??null,v!==_b.dependency)_===null?this[v](l):this[v](l,..._);else for(const w of _){(E=this.dependencyTracker)==null||E.recordNamedData(w,l);const A=w.startsWith("g_")?y:x;if(!A.has(w))return A.get(w,i),l}if(l++,l===c)return l;if(h&&++p>ZV){if(Date.now()>f)return i(),l;p=0}}}endDrawing(){Q(this,lc,JF).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),Q(this,lc,QF).call(this)}_scaleImage(e,t){const i=e.width??e.displayWidth,r=e.height??e.displayHeight;let s=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=i,l=r,c="prescale1",h,f;for(;s>2&&o>1||a>2&&l>1;){let p=o,y=l;s>2&&o>1&&(p=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),s/=o/p),a>2&&l>1&&(y=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/y),h=this.cachedCanvases.getCanvas(c,p,y),f=h.context,f.clearRect(0,0,p,y),f.drawImage(e,0,0,o,l,0,0,p,y),e=h.canvas,o=p,l=y,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e,t){var L,H;const i=this.ctx,{width:r,height:s}=t,a=this.current.fillColor,o=this.current.patternFill,l=Bi(i);let c,h,f,p;if((t.bitmap||t.data)&&t.count>1){const P=t.bitmap||t.data.buffer;h=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.getOrInsertComputed(P,x4);const O=c.get(h);if(O&&!o){const B=Math.round(Math.min(l[0],l[2])+l[4]),re=Math.round(Math.min(l[1],l[3])+l[5]);return(L=this.dependencyTracker)==null||L.recordDependencies(e,Wo.transformAndFill),{canvas:O,offsetX:B,offsetY:re}}f=O}f||(p=this.cachedCanvases.getCanvas("maskCanvas",r,s),nW(p.context,t));let y=St.transform(l,[1/r,0,0,-1/s,0,0]);y=St.transform(y,[1,0,0,1,0,-s]);const x=wy.slice();St.axialAlignedBoundingBox([0,0,r,s],y,x);const[v,_,E,w]=x,A=Math.round(E-v)||1,N=Math.round(w-_)||1,k=this.cachedCanvases.getCanvas("fillCanvas",A,N),F=k.context,C=v,M=_;F.translate(-C,-M),F.transform(...y),f||(f=this._scaleImage(p.canvas,bc(F)),f=f.img,c&&o&&c.set(h,f)),F.imageSmoothingEnabled=iW(Bi(F),t.interpolate),nA(F,f,0,0,f.width,f.height,0,0,r,s),F.globalCompositeOperation="source-in";const R=St.transform(bc(F),[1,0,0,1,-C,-M]);return F.fillStyle=o?a.getPattern(i,this,R,Ts.FILL,e):a,F.fillRect(0,0,r,s),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(h,k.canvas)),(H=this.dependencyTracker)==null||H.recordDependencies(e,Wo.transformAndFill),{canvas:k.canvas,offsetX:Math.round(C),offsetY:Math.round(M)}}setLineWidth(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineCap",e),this.ctx.lineCap=Q_e[t]}setLineJoin(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("lineJoin",e),this.ctx.lineJoin=Z_e[t]}setMiterLimit(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,i){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("dash",e);const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=i)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){var i,r,s,a,o;for(const[l,c]of t)switch(l){case"LW":this.setLineWidth(e,c);break;case"LC":this.setLineCap(e,c);break;case"LJ":this.setLineJoin(e,c);break;case"ML":this.setMiterLimit(e,c);break;case"D":this.setDash(e,c[0],c[1]);break;case"RI":this.setRenderingIntent(e,c);break;case"FL":this.setFlatness(e,c);break;case"Font":this.setFont(e,c[0],c[1]);break;case"CA":(i=this.dependencyTracker)==null||i.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=c;break;case"ca":(r=this.dependencyTracker)==null||r.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=c;break;case"BM":(s=this.dependencyTracker)==null||s.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=c;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",e),this.current.activeSMask=c?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(o=this.dependencyTracker)==null||o.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(c);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,i=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(r,t,i);this.suspendedCtx=this.ctx;const a=this.ctx=s.context;a.setTransform(this.suspendedCtx.getTransform()),sx(this.suspendedCtx,a),Y_e(a,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),sx(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,i,r){const s=r[0],a=r[1],o=r[2]-s,l=r[3]-a;o===0||l===0||(this.genericComposeSMask(t.context,i,o,l,t.subtype,t.backdrop,t.transferMap,s,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore())}genericComposeSMask(e,t,i,r,s,a,o,l,c,h,f){let p=e.canvas,y=l-h,x=c-f;if(a)if(y<0||x<0||y+i>p.width||x+r>p.height){const _=this.cachedCanvases.getCanvas("maskExtension",i,r),E=_.context;E.drawImage(p,-y,-x),E.globalCompositeOperation="destination-atop",E.fillStyle=a,E.fillRect(0,0,i,r),E.globalCompositeOperation="source-over",p=_.canvas,y=x=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const _=new Path2D;_.rect(y,x,i,r),e.clip(_),e.globalCompositeOperation="destination-atop",e.fillStyle=a,e.fillRect(y,x,i,r),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),s==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):s==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));const v=new Path2D;v.rect(l,c,i,r),t.clip(v),t.globalCompositeOperation="destination-in",t.drawImage(p,y,x,i,r,l,c,i,r),t.restore()}save(e){var i;this.inSMaskMode&&sx(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone(),(i=this.dependencyTracker)==null||i.save(e)}restore(e){var t;if((t=this.dependencyTracker)==null||t.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&sx(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,i,r,s,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",e),this.ctx.transform(t,i,r,s,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,i,r){let[s]=i;if(!r){s||(s=i[0]=new Path2D),this[t](e,s);return}if(this.dependencyTracker!==null){const a=t===_b.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,r[0]-a,r[2]+a,r[1]-a,r[3]+a).recordDependencies(e,["transform"])}s instanceof Path2D||(s=i[0]=gK(s)),St.axialAlignedBoundingBox(r,Bi(this.ctx),this.current.minMax),this[t](e,s),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,i=!0){var a;const r=this.ctx,s=this.current.strokeColor;if(r.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof s=="object"&&(s!=null&&s.getPattern)){const o=s.isModifyingCurrentTransform()?r.getTransform():null;if(r.save(),r.strokeStyle=s.getPattern(r,this,bc(r),Ts.STROKE,e),o){const l=new Path2D;l.addPath(t,r.getTransform().invertSelf().multiplySelf(o)),t=l}this.rescaleAndStroke(t,!1),r.restore()}else this.rescaleAndStroke(t,!0);(a=this.dependencyTracker)==null||a.recordDependencies(e,Wo.stroke),i&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Ts.STROKE,Bi(this.ctx))),r.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,i=!0){var c,h,f;const r=this.ctx,s=this.current.fillColor,a=this.current.patternFill;let o=!1;if(a){const p=s.isModifyingCurrentTransform()?r.getTransform():null;if((c=this.dependencyTracker)==null||c.save(e),r.save(),r.fillStyle=s.getPattern(r,this,bc(r),Ts.FILL,e),p){const y=new Path2D;y.addPath(t,r.getTransform().invertSelf().multiplySelf(p)),t=y}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(r.fill(t,"evenodd"),this.pendingEOFill=!1):r.fill(t)),(h=this.dependencyTracker)==null||h.recordDependencies(e,Wo.fill),o&&(r.restore(),(f=this.dependencyTracker)==null||f.restore(e)),i&&this.consumePath(e,t,l)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){var i;this.ctx.fill(t),(i=this.dependencyTracker)==null||i.recordDependencies(e,Wo.rawFillPath).recordOperation(e)}clip(e){var t;(t=this.dependencyTracker)==null||t.recordFutureForcedDependency("clipMode",e),this.pendingClip=exe}eoClip(e){var t;(t=this.dependencyTracker)==null||t.recordFutureForcedDependency("clipMode",e),this.pendingClip=rW}beginText(e){var t;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,(t=this.dependencyTracker)==null||t.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const t=this.pendingTextPaths,i=this.ctx;if(this.dependencyTracker){const{dependencyTracker:r}=this;t!==void 0&&r.recordFutureForcedDependency("textClip",r.getOpenMarker()).recordFutureForcedDependency("textClip",e),r.recordCloseMarker(e)}if(t!==void 0){const r=new Path2D,s=i.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:c,path:h}of t)h&&r.addPath(h,new DOMMatrix(a).preMultiplySelf(s).translate(o,l).scale(c,-c));i.clip(r)}delete this.pendingTextPaths}setCharSpacing(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,i){var f,p;(f=this.dependencyTracker)==null||f.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);const r=this.commonObjs.get(t),s=this.current;if(!r)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=r.fontMatrix||yF,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&an("Invalid font matrix for font "+t),i<0?(i=-i,s.fontDirection=-1):s.fontDirection=1,this.current.font=r,this.current.fontSize=i,r.isType3Font)return;const a=r.loadedName||"sans-serif",o=((p=r.systemFontInfo)==null?void 0:p.css)||`"${a}", ${r.fallbackName}`;let l="normal";r.black?l="900":r.bold&&(l="bold");const c=r.italic?"italic":"normal";let h=i;i<JV?h=JV:i>QV&&(h=QV),this.current.fontSizeScale=i/h,this.ctx.font=`${c} ${l} ${h}px ${o}`}setTextRenderingMode(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,i){var r;(r=this.dependencyTracker)==null||r.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,t,i){this.setLeading(e,-i),this.moveText(e,t,i)}setTextMatrix(e,t){var r;(r=this.dependencyTracker)==null||r.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);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(e){var t;this.moveText(e,0,this.current.leading),(t=this.dependencyTracker)==null||t.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}paintChar(e,t,i,r,s,a){var E,w,A,N;const o=this.ctx,l=this.current,c=l.font,h=l.textRenderingMode,f=l.fontSize/l.fontSizeScale,p=h&Ir.FILL_STROKE_MASK,y=!!(h&Ir.ADD_TO_PATH_FLAG),x=l.patternFill&&!c.missingFile,v=l.patternStroke&&!c.missingFile;let _;if((c.disableFontFace||y||x||v)&&!c.missingFile&&(_=c.getPathGenerator(this.commonObjs,t)),_&&(c.disableFontFace||x||v)){o.save(),o.translate(i,r),o.scale(f,-f),(E=this.dependencyTracker)==null||E.recordCharacterBBox(e,o,c);let k;if(p===Ir.FILL||p===Ir.FILL_STROKE)if(s){k=o.getTransform(),o.setTransform(...s);const F=Q(this,lc,ZF).call(this,_,k,s);o.fill(F)}else o.fill(_);if(p===Ir.STROKE||p===Ir.FILL_STROKE)if(a){k||(k=o.getTransform()),o.setTransform(...a);const{a:F,b:C,c:M,d:R}=k,L=St.inverseTransform(a),H=St.transform([F,C,M,R,0,0],L);St.singularValueDecompose2dScale(H,yo),o.lineWidth*=Math.max(yo[0],yo[1])/f,o.stroke(Q(this,lc,ZF).call(this,_,k,a))}else o.lineWidth/=f,o.stroke(_);o.restore()}else(p===Ir.FILL||p===Ir.FILL_STROKE)&&(o.fillText(t,i,r),(w=this.dependencyTracker)==null||w.recordCharacterBBox(e,o,c,f,i,r,()=>o.measureText(t))),(p===Ir.STROKE||p===Ir.FILL_STROKE)&&(this.dependencyTracker&&((A=this.dependencyTracker)==null||A.recordCharacterBBox(e,o,c,f,i,r,()=>o.measureText(t)).recordDependencies(e,Wo.stroke)),o.strokeText(t,i,r));y&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Bi(o),x:i,y:r,fontSize:f,path:_}),(N=this.dependencyTracker)==null||N.recordCharacterBBox(e,o,c,f,i,r))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let i=!1;for(let r=3;r<t.length;r+=4)if(t[r]>0&&t[r]<255){i=!0;break}return tn(this,"isFontSubpixelAAEnabled",i)}showText(e,t){var H,P,O,B;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Wo.showText).resetBBox(e),this.current.textRenderingMode&Ir.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const i=this.current,r=i.font;if(r.isType3Font){this.showType3Text(e,t),(H=this.dependencyTracker)==null||H.recordShowTextOperation(e);return}const s=i.fontSize;if(s===0){(P=this.dependencyTracker)==null||P.recordOperation(e);return}const a=this.ctx,o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,f=i.textHScale*h,p=t.length,y=r.vertical,x=y?1:-1,v=r.defaultVMetrics,_=s*i.fontMatrix[0],E=i.textRenderingMode===Ir.FILL&&!r.disableFontFace&&!i.patternFill;a.save(),i.textMatrix&&a.transform(...i.textMatrix),a.translate(i.x,i.y+i.textRise),h>0?a.scale(f,-1):a.scale(f,1);let w,A;const N=i.textRenderingMode&Ir.FILL_STROKE_MASK,k=N===Ir.FILL||N===Ir.FILL_STROKE,F=N===Ir.STROKE||N===Ir.FILL_STROKE;if(k&&i.patternFill){a.save();const re=i.fillColor.getPattern(a,this,bc(a),Ts.FILL,e);w=Bi(a),a.restore(),a.fillStyle=re}if(F&&i.patternStroke){a.save();const re=i.strokeColor.getPattern(a,this,bc(a),Ts.STROKE,e);A=Bi(a),a.restore(),a.strokeStyle=re}let C=i.lineWidth;const M=i.textMatrixScale;if(M===0||C===0?F&&(C=this.getSinglePixelWidth()):C/=M,o!==1&&(a.scale(o,o),C/=o),a.lineWidth=C,r.isInvalidPDFjsFont){const re=[];let q=0;for(const oe of t)re.push(oe.unicode),q+=oe.width;const X=re.join("");if(a.fillText(X,0,0),this.dependencyTracker!==null){const oe=a.measureText(X);this.dependencyTracker.recordBBox(e,this.ctx,-oe.actualBoundingBoxLeft,oe.actualBoundingBoxRight,-oe.actualBoundingBoxAscent,oe.actualBoundingBoxDescent).recordShowTextOperation(e)}i.x+=q*_*f,a.restore(),this.compose();return}let R=0,L;for(L=0;L<p;++L){const re=t[L];if(typeof re=="number"){R+=x*re*s/1e3;continue}let q=!1;const X=(re.isSpace?c:0)+l,oe=re.fontChar,ue=re.accent;let ge,j,G=re.width;if(y){const ie=re.vmetric||v,_e=-(re.vmetric?ie[1]:G*.5)*_,Ie=ie[2]*_;G=ie?-ie[0]:G,ge=_e/o,j=(R+Ie)/o}else ge=R/o,j=0;let Z;if(r.remeasure&&G>0){Z=a.measureText(oe);const ie=Z.width*1e3/s*o;if(G<ie&&this.isFontSubpixelAAEnabled){const _e=G/ie;q=!0,a.save(),a.scale(_e,1),ge/=_e}else G!==ie&&(ge+=(G-ie)/2e3*s/o)}if(this.contentVisible&&(re.isInFont||r.missingFile)){if(E&&!ue)a.fillText(oe,ge,j),(O=this.dependencyTracker)==null||O.recordCharacterBBox(e,a,Z?{bbox:null}:r,s/o,ge,j,()=>Z??a.measureText(oe));else if(this.paintChar(e,oe,ge,j,w,A),ue){const ie=ge+s*ue.offset.x/o,_e=j-s*ue.offset.y/o;this.paintChar(e,ue.fontChar,ie,_e,w,A)}}const te=y?G*_-X*h:G*_+X*h;R+=te,q&&a.restore()}y?i.y-=R:i.x+=R*f,a.restore(),this.compose(),(B=this.dependencyTracker)==null||B.recordShowTextOperation(e)}showType3Text(e,t){const i=this.ctx,r=this.current,s=r.font,a=r.fontSize,o=r.fontDirection,l=s.vertical?1:-1,c=r.charSpacing,h=r.wordSpacing,f=r.textHScale*o,p=r.fontMatrix||yF,y=t.length,x=r.textRenderingMode===Ir.INVISIBLE;let v,_,E,w;if(x||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),r.textMatrix&&i.transform(...r.textMatrix),i.translate(r.x,r.y+r.textRise),i.scale(f,o);const A=this.dependencyTracker;for(this.dependencyTracker=A?new FD(A,e):null,v=0;v<y;++v){if(_=t[v],typeof _=="number"){w=l*_*a/1e3,this.ctx.translate(w,0),r.x+=w*f;continue}const N=(_.isSpace?h:0)+c,k=s.charProcOperatorList[_.operatorListId];k?this.contentVisible&&(this.save(),i.scale(a,a),i.transform(...p),this.executeOperatorList(k),this.restore()):an(`Type3 character "${_.operatorListId}" is not available.`);const F=[_.width,0];St.applyTransform(F,p),E=F[0]*a+N,i.translate(E,0),r.x+=E*f}i.restore(),A&&(this.dependencyTracker=A)}setCharWidth(e,t,i){}setCharWidthAndBounds(e,t,i,r,s,a,o){var c;const l=new Path2D;l.rect(r,s,a-r,o-s),this.ctx.clip(l),(c=this.dependencyTracker)==null||c.recordBBox(e,this.ctx,r,a,s,o).recordClipBox(e,this.ctx,r,a,s,o),this.endPath(e)}getColorN_Pattern(e,t){let i;if(t[0]==="TilingPattern"){const r=this.baseTransform||Bi(this.ctx),s={createCanvasGraphics:(a,o)=>new F5(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new FD(this.dependencyTracker,o,!0):null)};i=new YF(t,this.ctx,s,r)}else i=this._getPattern(e,t[1],t[2]);return i}setStrokeColorN(e,...t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){var t;(t=this.dependencyTracker)==null||t.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){var t;(t=this.dependencyTracker)==null||t.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,i=null){let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=j_e(this.getObject(e,t)),this.cachedPatterns.set(t,r)),i&&(r.matrix=i),r}shadingFill(e,t){var a;if(!this.contentVisible)return;const i=this.ctx;this.save(e);const r=this._getPattern(e,t);i.fillStyle=r.getPattern(i,this,bc(i),Ts.SHADING,e);const s=bc(i);if(s){const{width:o,height:l}=i.canvas,c=wy.slice();St.axialAlignedBoundingBox([0,0,o,l],s,c);const[h,f,p,y]=c;this.ctx.fillRect(h,f,p-h,y-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Wo.transform).recordDependencies(e,Wo.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){Wn("Should not call beginInlineImage")}beginImageData(){Wn("Should not call beginImageData")}paintFormXObjectBegin(e,t,i){var r;if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=Bi(this.ctx),i)){St.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[s,a,o,l]=i,c=new Path2D;c.rect(s,a,o-s,l-a),this.ctx.clip(c),(r=this.dependencyTracker)==null||r.recordClipBox(e,this.ctx,s,o,a,l),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){var A;if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||cI("TODO: Support non-isolated groups."),t.knockout&&an("Knockout groups not supported.");const r=Bi(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=wy.slice();St.axialAlignedBoundingBox(t.bbox,Bi(i),s);const a=[0,0,i.canvas.width,i.canvas.height];s=St.intersect(s,a)||[0,0,0,0];const o=Math.floor(s[0]),l=Math.floor(s[1]),c=Math.max(Math.ceil(s[2])-o,1),h=Math.max(Math.ceil(s[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,h]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const p=this.cachedCanvases.getCanvas(f,c,h),y=p.context;y.translate(-o,-l),y.transform(...r);let x=new Path2D;const[v,_,E,w]=t.bbox;if(x.rect(v,_,E-v,w-_),t.matrix){const N=new Path2D;N.addPath(x,new DOMMatrix(t.matrix)),x=N}y.clip(x),t.smask&&this.smaskStack.push({canvas:p.canvas,context:y,offsetX:o,offsetY:l,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),(!t.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(o,l),i.save()),sx(i,y),this.ctx=y,(A=this.dependencyTracker)==null||A.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(i),this.groupLevel++}endGroup(e,t){var s;if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,(s=this.dependencyTracker)==null||s.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=Bi(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);const o=wy.slice();St.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],a,o),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(e,t,i,r,s,a){if(Q(this,lc,JF).call(this),iA(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const o=i[2]-i[0],l=i[3]-i[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=i[0],r[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=o,i[3]=l,St.singularValueDecompose2dScale(Bi(this.ctx),yo);const{viewportScale:c}=this,h=Math.ceil(o*this.outputScaleX*c),f=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,f);const{canvas:p,context:y}=this.annotationCanvas;this.annotationCanvasMap.set(t,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=y,this.ctx.save(),this.ctx.setTransform(yo[0],0,0,-yo[1],0,l*yo[1]),iA(this.ctx)}else{iA(this.ctx),this.endPath(e);const c=new Path2D;c.rect(i[0],i[1],o,l),this.ctx.clip(c)}}this.current=new eW(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...r),this.transform(e,...s)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),Q(this,lc,QF).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){var o;if(!this.contentVisible)return;const i=t.count;t=this.getObject(e,t.data,t),t.count=i;const r=this.ctx,s=this._createMaskCanvas(e,t),a=s.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,s.offsetX,s.offsetY),(o=this.dependencyTracker)==null||o.resetBBox(e).recordBBox(e,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(e),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,i,r=0,s=0,a,o){var f,p,y;if(!this.contentVisible)return;t=this.getObject(e,t.data,t);const l=this.ctx;l.save();const c=Bi(l);l.transform(i,r,s,a,0,0);const h=this._createMaskCanvas(e,t);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]),(f=this.dependencyTracker)==null||f.resetBBox(e);for(let x=0,v=o.length;x<v;x+=2){const _=St.transform(c,[i,r,s,a,o[x],o[x+1]]);l.drawImage(h.canvas,_[4],_[5]),(p=this.dependencyTracker)==null||p.recordBBox(e,this.ctx,_[4],_[4]+h.canvas.width,_[5],_[5]+h.canvas.height)}l.restore(),this.compose(),(y=this.dependencyTracker)==null||y.recordOperation(e)}paintImageMaskXObjectGroup(e,t){var a,o,l;if(!this.contentVisible)return;const i=this.ctx,r=this.current.fillColor,s=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(e).recordDependencies(e,Wo.transformAndFill);for(const c of t){const{data:h,width:f,height:p,transform:y}=c,x=this.cachedCanvases.getCanvas("maskCanvas",f,p),v=x.context;v.save();const _=this.getObject(e,h,c);nW(v,_),v.globalCompositeOperation="source-in",v.fillStyle=s?r.getPattern(v,this,bc(i),Ts.FILL,e):r,v.fillRect(0,0,f,p),v.restore(),i.save(),i.transform(...y),i.scale(1,-1),nA(i,x.canvas,0,0,f,p,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(e,i,0,f,0,p),i.restore()}this.compose(),(l=this.dependencyTracker)==null||l.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;const i=this.getObject(e,t);if(!i){an("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,i)}paintImageXObjectRepeat(e,t,i,r,s){if(!this.contentVisible)return;const a=this.getObject(e,t);if(!a){an("Dependent image isn't ready yet");return}const o=a.width,l=a.height,c=[];for(let h=0,f=s.length;h<f;h+=2)c.push({transform:[i,0,0,r,s[h],s[h+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:t,width:i,height:r}=e,s=this.cachedCanvases.getCanvas("inlineImage",i,r),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",s.canvas}paintInlineImageXObject(e,t){var c;if(!this.contentVisible)return;const i=t.width,r=t.height,s=this.ctx;this.save(e);const{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none"),s.scale(1/i,-1/r);let o;if(t.bitmap)o=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)o=t;else{const f=this.cachedCanvases.getCanvas("inlineImage",i,r).context;tW(f,t),o=this.applyTransferMapsToCanvas(f)}const l=this._scaleImage(o,bc(s));s.imageSmoothingEnabled=iW(Bi(s),t.interpolate),(c=this.dependencyTracker)==null||c.resetBBox(e).recordBBox(e,s,0,i,-r,0).recordDependencies(e,Wo.imageXObject).recordOperation(e),nA(s,l.img,0,0,l.paintWidth,l.paintHeight,0,-r,i,r),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,i){var a,o,l;if(!this.contentVisible)return;const r=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const c=t.width,h=t.height,p=this.cachedCanvases.getCanvas("inlineImage",c,h).context;tW(p,t),s=this.applyTransferMapsToCanvas(p)}(a=this.dependencyTracker)==null||a.resetBBox(e);for(const c of i)r.save(),r.transform(...c.transform),r.scale(1,-1),nA(r,s,c.x,c.y,c.w,c.h,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(e,r,0,1,-1,0),r.restore();(l=this.dependencyTracker)==null||l.recordOperation(e),this.compose()}paintSolidColorImageMask(e){var t;this.contentVisible&&((t=this.dependencyTracker)==null||t.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Wo.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,i){}beginMarkedContent(e,t){var i;(i=this.dependencyTracker)==null||i.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,i){var r;(r=this.dependencyTracker)==null||r.beginMarkedContent(e),t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){var t;(t=this.dependencyTracker)==null||t.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,i){var a,o;const r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const s=this.ctx;this.pendingClip?(r||(this.pendingClip===rW?s.clip(t,"evenodd"):s.clip(t)),this.pendingClip=null,(a=this.dependencyTracker)==null||a.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):(o=this.dependencyTracker)==null||o.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=Bi(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),i=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:t,b:i,c:r,d:s}=this.ctx.getTransform();let a,o;if(i===0&&r===0){const l=Math.abs(t),c=Math.abs(s);if(l===c)if(e===0)a=o=1/l;else{const h=l*e;a=o=h<1?1/h:1}else if(e===0)a=1/l,o=1/c;else{const h=l*e,f=c*e;a=h<1?1/h:1,o=f<1?1/f:1}}else{const l=Math.abs(t*s-i*r),c=Math.hypot(t,i),h=Math.hypot(r,s);if(e===0)a=h/l,o=c/l;else{const f=e*l;a=h>f?h/f:1,o=c>f?c/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:i,current:{lineWidth:r}}=this,[s,a]=this.getScaleForStroking();if(s===a){i.lineWidth=(r||1)*s,i.stroke(e);return}const o=i.getLineDash();t&&i.save(),i.scale(s,a),Qk.a=1/s,Qk.d=1/a;const l=new Path2D;if(l.addPath(e,Qk),o.length>0){const c=Math.max(s,a);i.setLineDash(o.map(h=>h/c)),i.lineDashOffset/=c}i.lineWidth=r||1,i.stroke(l),t&&i.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};lc=new WeakSet,JF=function(){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)},QF=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}},ZF=function(e,t,i){const r=new Path2D;return r.addPath(e,new DOMMatrix(i).invertSelf().multiplySelf(t)),r};let Fy=F5;for(const n in _b)Fy.prototype[n]!==void 0&&(Fy.prototype[_b[n]]=Fy.prototype[n]);var k2,M2;class nu{static get workerPort(){return g(this,k2)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");V(this,k2,e)}static get workerSrc(){return g(this,M2)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");V(this,M2,e)}}k2=new WeakMap,M2=new WeakMap,Y(nu,k2,null),Y(nu,M2,"");var Iv,F2;class txe{constructor({parsedData:e,rawData:t}){Y(this,Iv);Y(this,F2);V(this,Iv,e),V(this,F2,t)}getRaw(){return g(this,F2)}get(e){return g(this,Iv).get(e)??null}[Symbol.iterator](){return g(this,Iv).entries()}}Iv=new WeakMap,F2=new WeakMap;const cy=Symbol("INTERNAL");var U2,P2,L2,Rv;class nxe{constructor(e,{name:t,intent:i,usage:r,rbGroups:s}){Y(this,U2,!1);Y(this,P2,!1);Y(this,L2,!1);Y(this,Rv,!0);V(this,U2,!!(e&go.DISPLAY)),V(this,P2,!!(e&go.PRINT)),this.name=t,this.intent=i,this.usage=r,this.rbGroups=s}get visible(){if(g(this,L2))return g(this,Rv);if(!g(this,Rv))return!1;const{print:e,view:t}=this.usage;return g(this,U2)?(t==null?void 0:t.viewState)!=="OFF":g(this,P2)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,t,i=!1){e!==cy&&Wn("Internal method `_setVisible` called."),V(this,L2,i),V(this,Rv,t)}}U2=new WeakMap,P2=new WeakMap,L2=new WeakMap,Rv=new WeakMap;var yf,di,Nv,kv,O2,eU;class ixe{constructor(e,t=go.DISPLAY){Y(this,O2);Y(this,yf,null);Y(this,di,new Map);Y(this,Nv,null);Y(this,kv,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,V(this,kv,e.order);for(const i of e.groups)g(this,di).set(i.id,new nxe(t,i));if(e.baseState==="OFF")for(const i of g(this,di).values())i._setVisible(cy,!1);for(const i of e.on)g(this,di).get(i)._setVisible(cy,!0);for(const i of e.off)g(this,di).get(i)._setVisible(cy,!1);V(this,Nv,this.getHash())}}isVisible(e){if(g(this,di).size===0)return!0;if(!e)return cI("Optional content group not defined."),!0;if(e.type==="OCG")return g(this,di).has(e.id)?g(this,di).get(e.id).visible:(an(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return Q(this,O2,eU).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!g(this,di).has(t))return an(`Optional content group not found: ${t}`),!0;if(g(this,di).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!g(this,di).has(t))return an(`Optional content group not found: ${t}`),!0;if(!g(this,di).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!g(this,di).has(t))return an(`Optional content group not found: ${t}`),!0;if(!g(this,di).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!g(this,di).has(t))return an(`Optional content group not found: ${t}`),!0;if(g(this,di).get(t).visible)return!1}return!0}return an(`Unknown optional content policy ${e.policy}.`),!0}return an(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,i=!0){var s;const r=g(this,di).get(e);if(!r){an(`Optional content group not found: ${e}`);return}if(i&&t&&r.rbGroups.length)for(const a of r.rbGroups)for(const o of a)o!==e&&((s=g(this,di).get(o))==null||s._setVisible(cy,!1,!0));r._setVisible(cy,!!t,!0),V(this,yf,null)}setOCGState({state:e,preserveRB:t}){let i;for(const r of e){switch(r){case"ON":case"OFF":case"Toggle":i=r;continue}const s=g(this,di).get(r);if(s)switch(i){case"ON":this.setVisibility(r,!0,t);break;case"OFF":this.setVisibility(r,!1,t);break;case"Toggle":this.setVisibility(r,!s.visible,t);break}}V(this,yf,null)}get hasInitialVisibility(){return g(this,Nv)===null||this.getHash()===g(this,Nv)}getOrder(){return g(this,di).size?g(this,kv)?g(this,kv).slice():[...g(this,di).keys()]:null}getGroup(e){return g(this,di).get(e)||null}getHash(){if(g(this,yf)!==null)return g(this,yf);const e=new XK;for(const[t,i]of g(this,di))e.update(`${t}:${i.visible}`);return V(this,yf,e.hexdigest())}[Symbol.iterator](){return g(this,di).entries()}}yf=new WeakMap,di=new WeakMap,Nv=new WeakMap,kv=new WeakMap,O2=new WeakSet,eU=function(e){const t=e.length;if(t<2)return!0;const i=e[0];for(let r=1;r<t;r++){const s=e[r];let a;if(Array.isArray(s))a=Q(this,O2,eU).call(this,s);else if(g(this,di).has(s))a=g(this,di).get(s).visible;else return an(`Optional content group not found: ${s}`),!0;switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return i==="And"};var B2,V2;class dI{constructor(e,t,i){Y(this,B2,null);Y(this,V2,null);Ze(this,"_fullReader",null);Ze(this,"_rangeReaders",new Set);Ze(this,"_source",null);this._source=e,V(this,B2,t),V(this,V2,i)}get _progressiveDataLength(){var e;return((e=this._fullReader)==null?void 0:e._loaded)??0}getFullReader(){return Fn(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(g(this,B2))(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new(g(this,V2))(this,e,t);return this._rangeReaders.add(i),i}cancelAllRequests(e){var t;(t=this._fullReader)==null||t.cancel(e);for(const i of new Set(this._rangeReaders))i.cancel(e)}}B2=new WeakMap,V2=new WeakMap;class fI{constructor(e){Ze(this,"onProgress",null);Ze(this,"_contentLength",0);Ze(this,"_filename",null);Ze(this,"_headersCapability",Promise.withResolvers());Ze(this,"_isRangeSupported",!1);Ze(this,"_isStreamingSupported",!1);Ze(this,"_loaded",0);Ze(this,"_stream",null);this._stream=e}_callOnProgress(){var e;(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength})}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(){Wn("Abstract method `read` called")}cancel(e){Wn("Abstract method `cancel` called")}}class pI{constructor(e,t,i){Ze(this,"_stream",null);this._stream=e}async read(){Wn("Abstract method `read` called")}cancel(e){Wn("Abstract method `cancel` called")}}function sW(n){return n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer}function gI(){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}var W2,tU;class rxe extends dI{constructor(t){super(t,sxe,axe);Y(this,W2);Ze(this,"_progressiveDone",!1);Ze(this,"_queuedChunks",[]);const{pdfDataRangeTransport:i}=t,{initialData:r,progressiveDone:s}=i;if((r==null?void 0:r.length)>0){const a=sW(r);this._queuedChunks.push(a)}this._progressiveDone=s,i.addRangeListener((a,o)=>{Q(this,W2,tU).call(this,a,o)}),i.addProgressiveReadListener(a=>{Q(this,W2,tU).call(this,void 0,a)}),i.addProgressiveDoneListener(()=>{var a;(a=this._fullReader)==null||a.progressiveDone(),this._progressiveDone=!0}),i.transportReady()}getFullReader(){const t=super.getFullReader();return this._queuedChunks=null,t}getRangeReader(t,i){const r=super.getRangeReader(t,i);return r&&(r.onDone=()=>this._rangeReaders.delete(r),this._source.pdfDataRangeTransport.requestDataRange(t,i)),r}cancelAllRequests(t){super.cancelAllRequests(t),this._source.pdfDataRangeTransport.abort()}}W2=new WeakSet,tU=function(t,i){const r=sW(i);if(t===void 0)this._fullReader?this._fullReader._enqueue(r):this._queuedChunks.push(r);else{const s=this._rangeReaders.keys().find(a=>a._begin===t);Fn(s,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),s._enqueue(r)}};var H2;class sxe extends fI{constructor(t){super(t);Y(this,H2,gI.bind(this));Ze(this,"_done",!1);Ze(this,"_queuedChunks",null);Ze(this,"_requests",[]);const{pdfDataRangeTransport:i,disableRange:r,disableStream:s}=t._source,{length:a,contentDispositionFilename:o}=i;this._queuedChunks=t._queuedChunks||[];for(const c of this._queuedChunks)this._loaded+=c.byteLength;this._done=t._progressiveDone,this._contentLength=a,this._isStreamingSupported=!s,this._isRangeSupported=!r,T4(o)&&(this._filename=o),this._headersCapability.resolve();const l=this._loaded;Promise.resolve().then(()=>{l>0&&this._loaded===l&&this._callOnProgress()})}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength,this._callOnProgress())}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,g(this,H2).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&g(this,H2).call(this)}}H2=new WeakMap;var z2;class axe extends pI{constructor(t,i,r){super(t,i,r);Y(this,z2,gI.bind(this));Ze(this,"onDone",null);Ze(this,"_begin",-1);Ze(this,"_done",!1);Ze(this,"_queuedChunk",null);Ze(this,"_requests",[]);this._begin=i}_enqueue(t){var i;this._done||(this._requests.length===0?this._queuedChunk=t:(this._requests.shift().resolve({value:t,done:!1}),g(this,z2).call(this)),this._done=!0,(i=this.onDone)==null||i.call(this))}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){var i;this._done=!0,g(this,z2).call(this),(i=this.onDone)==null||i.call(this)}}z2=new WeakMap;function oxe(n){let e=!0,t=i("filename\\*","i").exec(n);if(t){t=t[1];let h=o(t);return h=unescape(h),h=l(h),h=c(h),s(h)}if(t=a(n),t){const h=c(t);return s(h)}if(t=i("filename","i").exec(n),t){t=t[1];let h=o(t);return h=c(h),s(h)}function i(h,f){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function r(h,f){if(h){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const p=new TextDecoder(h,{fatal:!0}),y=uI(f);f=p.decode(y),e=!1}catch{}}return f}function s(h){return e&&/[\x80-\xff]/.test(h)&&(h=r("utf-8",h),e&&(h=r("iso-8859-1",h))),h}function a(h){const f=[];let p;const y=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=y.exec(h))!==null;){let[,v,_,E]=p;if(v=parseInt(v,10),v in f){if(v===0)break;continue}f[v]=[_,E]}const x=[];for(let v=0;v<f.length&&v in f;++v){let[_,E]=f[v];E=o(E),_&&(E=unescape(E),v===0&&(E=l(E))),x.push(E)}return x.join("")}function o(h){if(h.startsWith('"')){const f=h.slice(1).split('\\"');for(let p=0;p<f.length;++p){const y=f[p].indexOf('"');y!==-1&&(f[p]=f[p].slice(0,y),f.length=p+1),f[p]=f[p].replaceAll(/\\(.)/g,"$1")}h=f.join('"')}return h}function l(h){const f=h.indexOf("'");if(f===-1)return h;const p=h.slice(0,f),x=h.slice(f+1).replace(/^[^']*'/,"");return r(p,x)}function c(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,p,y,x){if(y==="q"||y==="Q")return x=x.replaceAll("_"," "),x=x.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,_){return String.fromCharCode(parseInt(_,16))}),r(p,x);try{x=atob(x)}catch{}return r(p,x)})}return""}function aY(n,e){const t=new Headers;if(!n||!e||typeof e!="object")return t;for(const i in e){const r=e[i];r!==void 0&&t.append(i,r)}return t}function mI(n){var e;return((e=URL.parse(n))==null?void 0:e.origin)??null}function oY({responseHeaders:n,isHttp:e,rangeChunkSize:t,disableRange:i}){const r={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(n.get("Content-Length"),10);return!Number.isInteger(s)||(r.suggestedLength=s,s<=2*t)||i||!e||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(r.allowRangeRequests=!0),r}function lY(n){const e=n.get("Content-Disposition");if(e){let t=oxe(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(T4(t))return t}return null}function yI(n,e){return new CD(`Unexpected server response (${n}) while retrieving PDF "${e.href}".`,n,n===404||n===0&&e.protocol==="file:")}function cY(n,e){if(n!==e)throw new Error(`Expected range response-origin "${n}" to match "${e}".`)}function uY(n,e,t,i){return fetch(n,{method:"GET",headers:e,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"})}function hY(n,e){if(n!==200&&n!==206)throw yI(n,e)}function vI(n){if(n instanceof Uint8Array)return n.buffer;if(n instanceof ArrayBuffer)return n;throw new Error(`getArrayBuffer - unexpected data: ${n}`)}class lxe extends dI{constructor(t){super(t,cxe,uxe);Ze(this,"_responseOrigin",null);const{httpHeaders:i,url:r}=t;Fn(/https?:/.test(r.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=aY(!0,i)}}class cxe extends fI{constructor(t){super(t);Ze(this,"_abortController",new AbortController);Ze(this,"_reader",null);const{disableRange:i,disableStream:r,length:s,rangeChunkSize:a,url:o,withCredentials:l}=t._source;this._contentLength=s,this._isStreamingSupported=!r,this._isRangeSupported=!i;const c=new Headers(t.headers);uY(o,c,l,this._abortController).then(h=>{t._responseOrigin=mI(h.url),hY(h.status,o),this._reader=h.body.getReader();const f=h.headers,{allowRangeRequests:p,suggestedLength:y}=oY({responseHeaders:f,isHttp:!0,rangeChunkSize:a,disableRange:i});this._isRangeSupported=p,this._contentLength=y||this._contentLength,this._filename=lY(f),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ep("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}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._callOnProgress(),{value:vI(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}class uxe extends pI{constructor(t,i,r){super(t,i,r);Ze(this,"_abortController",new AbortController);Ze(this,"_readCapability",Promise.withResolvers());Ze(this,"_reader",null);const{url:s,withCredentials:a}=t._source,o=new Headers(t.headers);o.append("Range",`bytes=${i}-${r-1}`),uY(s,o,a,this._abortController).then(l=>{const c=mI(l.url);cY(c,t._responseOrigin),hY(l.status,s),this._reader=l.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:{value:vI(t),done:!1}}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}const Zk=200,aW=206;function hxe(n){return typeof n!="string"?n:uI(n).buffer}var Gc,F1,dY,fY;class dxe extends dI{constructor(t){super(t,fxe,pxe);Y(this,F1);Y(this,Gc,new WeakMap);Ze(this,"_responseOrigin",null);const{httpHeaders:i,url:r}=t;this.url=r,this.isHttp=/https?:/.test(r.protocol),this.headers=aY(this.isHttp,i)}_request(t){const i=new XMLHttpRequest,r={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};g(this,Gc).set(i,r),i.open("GET",this.url),i.withCredentials=this._source.withCredentials;for(const[s,a]of this.headers)i.setRequestHeader(s,a);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.validateStatus=s=>s===aW||s===Zk):r.validateStatus=s=>s===Zk,i.responseType="arraybuffer",Fn(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>t.onError(i.status),i.onreadystatechange=Q(this,F1,fY).bind(this,i),i.onprogress=Q(this,F1,dY).bind(this,i),i.send(null),i}_abortRequest(t){g(this,Gc).has(t)&&(g(this,Gc).delete(t),t.abort())}getRangeReader(t,i){const r=super.getRangeReader(t,i);return r&&(r.onClosed=()=>this._rangeReaders.delete(r)),r}}Gc=new WeakMap,F1=new WeakSet,dY=function(t,i){var s;const r=g(this,Gc).get(t);(s=r==null?void 0:r.onProgress)==null||s.call(r,i)},fY=function(t,i){const r=g(this,Gc).get(t);if(!r||(t.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),t.readyState!==4)||!g(this,Gc).has(t))return;if(g(this,Gc).delete(t),t.status===0&&this.isHttp){r.onError(t.status);return}const s=t.status||Zk;if(!r.validateStatus(s)){r.onError(t.status);return}const a=hxe(t.response);if(s===aW){const o=t.getResponseHeader("Content-Range");/bytes (\d+)-(\d+)\/(\d+)/.test(o)?r.onDone(a):(an('Missing or invalid "Content-Range" header.'),r.onError(0))}else a?r.onDone(a):r.onError(t.status)};var G2,pu,pY,gY,mY,yY;class fxe extends fI{constructor(t){super(t);Y(this,pu);Y(this,G2,gI.bind(this));Ze(this,"_cachedChunks",[]);Ze(this,"_done",!1);Ze(this,"_requests",[]);Ze(this,"_storedError",null);const{length:i}=t._source;this._contentLength=i,this._fullRequestXhr=t._request({onHeadersReceived:Q(this,pu,pY).bind(this),onDone:Q(this,pu,gY).bind(this),onError:Q(this,pu,mY).bind(this),onProgress:Q(this,pu,yY).bind(this)})}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),g(this,G2).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}}G2=new WeakMap,pu=new WeakSet,pY=function(){const t=this._stream,{disableRange:i,rangeChunkSize:r}=t._source,s=this._fullRequestXhr;t._responseOrigin=mI(s.responseURL);const a=s.getAllResponseHeaders(),o=new Headers(a?a.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(h=>{const[f,...p]=h.split(": ");return[f,p.join(": ")]}):[]),{allowRangeRequests:l,suggestedLength:c}=oY({responseHeaders:o,isHttp:t.isHttp,rangeChunkSize:r,disableRange:i});l&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=lY(o),this._isRangeSupported&&t._abortRequest(s),this._headersCapability.resolve()},gY=function(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._cachedChunks.push(t),this._done=!0,this._cachedChunks.length===0&&g(this,G2).call(this)},mY=function(t){this._storedError=yI(t,this._stream.url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0},yY=function(t){var i;(i=this.onProgress)==null||i.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})};var q2,jh,vY,_Y,nU;class pxe extends pI{constructor(t,i,r){super(t,i,r);Y(this,jh);Y(this,q2,gI.bind(this));Ze(this,"onClosed",null);Ze(this,"_done",!1);Ze(this,"_queuedChunk",null);Ze(this,"_requests",[]);Ze(this,"_storedError",null);this._requestXhr=t._request({begin:i,end:r,onHeadersReceived:Q(this,jh,vY).bind(this),onDone:Q(this,jh,_Y).bind(this),onError:Q(this,jh,nU).bind(this),onProgress:null})}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){var i;this._done=!0,g(this,q2).call(this),this._stream._abortRequest(this._requestXhr),(i=this.onClosed)==null||i.call(this)}}q2=new WeakMap,jh=new WeakSet,vY=function(){var i;const t=mI((i=this._requestXhr)==null?void 0:i.responseURL);try{cY(t,this._stream._responseOrigin)}catch(r){this._storedError=r,Q(this,jh,nU).call(this,0)}},_Y=function(t){var i;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,g(this,q2).call(this),(i=this.onClosed)==null||i.call(this)},nU=function(t){this._storedError??(this._storedError=yI(t,this._stream.url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null};function xY(n){const{Readable:e}=process.getBuiltinModule("stream");return typeof e.toWeb=="function"?e.toWeb(n):process.getBuiltinModule("module").createRequire(import.meta.url)("node-readable-to-web-readable-stream").makeDefaultReadableStreamFromNodeReadable(n)}class gxe extends dI{constructor(e){super(e,mxe,yxe);const{url:t}=e;Fn(t.protocol==="file:","PDFNodeStream only supports file:// URLs.")}}class mxe extends fI{constructor(t){super(t);Ze(this,"_reader",null);const{disableRange:i,disableStream:r,length:s,rangeChunkSize:a,url:o}=t._source;this._contentLength=s,this._isStreamingSupported=!r,this._isRangeSupported=!i;const l=process.getBuiltinModule("fs");l.promises.lstat(o).then(c=>{const h=l.createReadStream(o),f=xY(h);this._reader=f.getReader();const{size:p}=c;p<=2*a&&(this._isRangeSupported=!1),this._contentLength=p,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new ep("Streaming is disabled.")),this._headersCapability.resolve()}).catch(c=>{c.code==="ENOENT"&&(c=yI(0,o)),this._headersCapability.reject(c)})}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._callOnProgress(),{value:vI(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t)}}class yxe extends pI{constructor(t,i,r){super(t,i,r);Ze(this,"_readCapability",Promise.withResolvers());Ze(this,"_reader",null);const{url:s}=t._source,a=process.getBuiltinModule("fs");try{const o=a.createReadStream(s,{start:i,end:r-1}),l=xY(o);this._reader=l.getReader(),this._readCapability.resolve()}catch(o){this._readCapability.reject(o)}}async read(){await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:{value:vI(t),done:!1}}cancel(t){var i;(i=this._reader)==null||i.cancel(t)}}const Lx=Symbol("INITIAL_DATA"),vxe=()=>({...Promise.withResolvers(),data:Lx});var Vl,$2,iU;class bY{constructor(){Y(this,$2);Y(this,Vl,new Map)}get(e,t=null){if(t){const r=Q(this,$2,iU).call(this,e);return r.promise.then(()=>t(r.data)),null}const i=g(this,Vl).get(e);if(!i||i.data===Lx)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const t=g(this,Vl).get(e);return!!t&&t.data!==Lx}delete(e){const t=g(this,Vl).get(e);return!t||t.data===Lx?!1:(g(this,Vl).delete(e),!0)}resolve(e,t=null){const i=Q(this,$2,iU).call(this,e);i.data=t,i.resolve()}clear(){var e;for(const{data:t}of g(this,Vl).values())(e=t==null?void 0:t.bitmap)==null||e.close();g(this,Vl).clear()}*[Symbol.iterator](){for(const[e,{data:t}]of g(this,Vl))t!==Lx&&(yield[e,t])}}Vl=new WeakMap,$2=new WeakSet,iU=function(e){return g(this,Vl).getOrInsertComputed(e,vxe)};const _xe=1e5,oW=30;var zq,vf,Ca,j2,X2,Xg,oh,K2,Y2,Kg,J2,Mv,_f,Fv,Q2,Uv,Yg,Z2,eT,Pv,Jg,tT,Lv,Ov,Xh,TY,EY,rU,So,rS,sU,wY,AY;const fs=class fs{constructor({textContentSource:e,container:t,viewport:i}){Y(this,Xh);Y(this,vf,Promise.withResolvers());Y(this,Ca,null);Y(this,j2,!1);Y(this,X2,!!((zq=globalThis.FontInspector)!=null&&zq.enabled));Y(this,Xg,null);Y(this,oh,null);Y(this,K2,0);Y(this,Y2,0);Y(this,Kg,null);Y(this,J2,null);Y(this,Mv,0);Y(this,_f,0);Y(this,Fv,Object.create(null));Y(this,Q2,[]);Y(this,Uv,null);Y(this,Yg,[]);Y(this,Z2,new WeakMap);Y(this,eT,null);var l;if(e instanceof ReadableStream)V(this,Uv,e);else if(typeof e=="object")V(this,Uv,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');V(this,Ca,V(this,J2,t)),V(this,_f,i.scale*uu.pixelRatio),V(this,Mv,i.rotation),V(this,oh,{div:null,properties:null,ctx:null});const{pageWidth:r,pageHeight:s,pageX:a,pageY:o}=i.rawDims;V(this,eT,[1,0,0,-1,-a,o+s]),V(this,Y2,r),V(this,K2,s),Q(l=fs,So,wY).call(l),t.style.setProperty("--min-font-size",g(fs,Lv)),Lm(t,i),g(this,vf).promise.finally(()=>{g(fs,Ov).delete(this),V(this,oh,null),V(this,Fv,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=Pr.platform;return tn(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{g(this,Kg).read().then(({value:t,done:i})=>{if(i){g(this,vf).resolve();return}g(this,Xg)??V(this,Xg,t.lang),Object.assign(g(this,Fv),t.styles),Q(this,Xh,TY).call(this,t.items),e()},g(this,vf).reject)};return V(this,Kg,g(this,Uv).getReader()),g(fs,Ov).add(this),e(),g(this,vf).promise}update({viewport:e,onBefore:t=null}){var s;const i=e.scale*uu.pixelRatio,r=e.rotation;if(r!==g(this,Mv)&&(t==null||t(),V(this,Mv,r),Lm(g(this,J2),{rotation:r})),i!==g(this,_f)){t==null||t(),V(this,_f,i);const a={div:null,properties:null,ctx:Q(s=fs,So,rS).call(s,g(this,Xg))};for(const o of g(this,Yg))a.properties=g(this,Z2).get(o),a.div=o,Q(this,Xh,rU).call(this,a)}}cancel(){var t;const e=new ep("TextLayer task cancelled.");(t=g(this,Kg))==null||t.cancel(e).catch(()=>{}),V(this,Kg,null),g(this,vf).reject(e)}get textDivs(){return g(this,Yg)}get textContentItemsStr(){return g(this,Q2)}static cleanup(){if(!(g(this,Ov).size>0)){g(this,Pv).clear();for(const{canvas:e}of g(this,Jg).values())e.remove();g(this,Jg).clear()}}};vf=new WeakMap,Ca=new WeakMap,j2=new WeakMap,X2=new WeakMap,Xg=new WeakMap,oh=new WeakMap,K2=new WeakMap,Y2=new WeakMap,Kg=new WeakMap,J2=new WeakMap,Mv=new WeakMap,_f=new WeakMap,Fv=new WeakMap,Q2=new WeakMap,Uv=new WeakMap,Yg=new WeakMap,Z2=new WeakMap,eT=new WeakMap,Pv=new WeakMap,Jg=new WeakMap,tT=new WeakMap,Lv=new WeakMap,Ov=new WeakMap,Xh=new WeakSet,TY=function(e){var r,s;if(g(this,j2))return;(s=g(this,oh)).ctx??(s.ctx=Q(r=fs,So,rS).call(r,g(this,Xg)));const t=g(this,Yg),i=g(this,Q2);for(const a of e){if(t.length>_xe){an("Ignoring additional textDivs for performance reasons."),V(this,j2,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=g(this,Ca);V(this,Ca,document.createElement("span")),g(this,Ca).classList.add("markedContent"),a.id&&g(this,Ca).setAttribute("id",`${a.id}`),a.tag==="Artifact"&&(g(this,Ca).ariaHidden=!0),o.append(g(this,Ca))}else a.type==="endMarkedContent"&&V(this,Ca,g(this,Ca).parentNode);continue}i.push(a.str),Q(this,Xh,EY).call(this,a)}},EY=function(e){var x;const t=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};g(this,Yg).push(t);const r=St.transform(g(this,eT),e.transform);let s=Math.atan2(r[1],r[0]);const a=g(this,Fv)[e.fontName];a.vertical&&(s+=Math.PI/2);let o=g(this,X2)&&a.fontSubstitution||a.fontFamily;o=fs.fontFamilyMap.get(o)||o;const l=Math.hypot(r[2],r[3]),c=l*Q(x=fs,So,AY).call(x,o,a,g(this,Xg));let h,f;s===0?(h=r[4],f=r[5]-c):(h=r[4]+c*Math.sin(s),f=r[5]-c*Math.cos(s));const p=t.style;p.left=`${(100*h/g(this,Y2)).toFixed(2)}%`,p.top=`${(100*f/g(this,K2)).toFixed(2)}%`,p.setProperty("--font-height",`${l.toFixed(2)}px`),p.fontFamily=o,i.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,g(this,X2)&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),s!==0&&(i.angle=s*(180/Math.PI));let y=!1;if(e.str.length>1)y=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const v=Math.abs(e.transform[0]),_=Math.abs(e.transform[3]);v!==_&&Math.max(v,_)/Math.min(v,_)>1.5&&(y=!0)}if(y&&(i.canvasWidth=a.vertical?e.height:e.width),g(this,Z2).set(t,i),g(this,oh).div=t,g(this,oh).properties=i,Q(this,Xh,rU).call(this,g(this,oh)),i.hasText&&g(this,Ca).append(t),i.hasEOL){const v=document.createElement("br");v.setAttribute("role","presentation"),g(this,Ca).append(v)}},rU=function(e){var a;const{div:t,properties:i,ctx:r}=e,{style:s}=t;if(i.canvasWidth!==0&&i.hasText){const{fontFamily:o}=s,{canvasWidth:l,fontSize:c}=i;Q(a=fs,So,sU).call(a,r,c*g(this,_f),o);const{width:h}=r.measureText(t.textContent);h>0&&s.setProperty("--scale-x",l*g(this,_f)/h)}i.angle!==0&&s.setProperty("--rotate",`${i.angle}deg`)},So=new WeakSet,rS=function(e=null){let t=g(this,Jg).get(e||(e=""));if(!t){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),t=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),g(this,Jg).set(e,t),g(this,tT).set(t,{size:0,family:""})}return t},sU=function(e,t,i){const r=g(this,tT).get(e);t===r.size&&i===r.family||(e.font=`${t}px ${i}`,r.size=t,r.family=i)},wY=function(){if(g(this,Lv)!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),V(this,Lv,e.getBoundingClientRect().height),e.remove()},AY=function(e,t,i){const r=g(this,Pv).get(e);if(r)return r;const s=Q(this,So,rS).call(this,i);s.canvas.width=s.canvas.height=oW,Q(this,So,sU).call(this,s,oW,e);const a=s.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let c=.8;return o?c=o/(o+l):(Pr.platform.isFirefox&&an("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),g(this,Pv).set(e,c),c},Y(fs,So),Y(fs,Pv,new Map),Y(fs,Jg,new Map),Y(fs,tT,new WeakMap),Y(fs,Lv,null),Y(fs,Ov,new Set);let Tb=fs;const xxe=100;function SY(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const e=new aU,{docId:t}=e,i=n.url?I_e(n.url):null,r=n.data?R_e(n.data):null,s=n.httpHeaders||null,a=n.withCredentials===!0,o=n.password??null,l=n.range instanceof DY?n.range:null,c=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16;let h=n.worker instanceof Eb?n.worker:null;const f=n.verbosity,p=typeof n.docBaseUrl=="string"&&!hI(n.docBaseUrl)?n.docBaseUrl:null,y=Qw(n.cMapUrl),x=n.cMapPacked!==!1,v=n.CMapReaderFactory||(sa?O_e:qV),_=Qw(n.iccUrl),E=Qw(n.standardFontDataUrl),w=n.StandardFontDataFactory||(sa?B_e:$V),A=Qw(n.wasmUrl),N=n.WasmFactory||(sa?V_e:jV),k=n.stopAtErrors!==!0,F=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,C=n.isEvalSupported!==!1,M=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!sa,R=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!sa&&(Pr.platform.isFirefox||!globalThis.chrome),L=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,H=typeof n.disableFontFace=="boolean"?n.disableFontFace:sa,P=n.fontExtraProperties===!0,O=n.enableXfa===!0,B=n.ownerDocument||globalThis.document,re=n.disableRange===!0,q=n.disableStream===!0,X=n.disableAutoFetch===!0,oe=n.pdfBug===!0,ue=n.CanvasFactory||(sa?L_e:F_e),ge=n.FilterFactory||(sa?P_e:U_e),j=n.enableHWA===!0,G=n.useWasm!==!1,Z=n.pagesMapper||new b_e,te=l?l.length:n.length??NaN,ie=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!sa&&!H,_e=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(v===qV&&w===$V&&N===jV&&y&&E&&A&&Ex(y,document.baseURI)&&Ex(E,document.baseURI)&&Ex(A,document.baseURI)),Ie=null;n_e(f);const Pe={canvasFactory:new ue({ownerDocument:B,enableHWA:j}),filterFactory:new ge({docId:t,ownerDocument:B}),cMapReaderFactory:_e?null:new v({baseUrl:y,isCompressed:x}),standardFontDataFactory:_e?null:new w({baseUrl:E}),wasmFactory:_e?null:new N({baseUrl:A})};h||(h=Eb.create({verbosity:f,port:nu.workerPort}),e._worker=h);const Fe={docId:t,apiVersion:"5.5.207",data:r,password:o,disableAutoFetch:X,rangeChunkSize:c,length:te,docBaseUrl:p,enableXfa:O,evaluatorOptions:{maxImageSize:F,disableFontFace:H,ignoreErrors:k,isEvalSupported:C,isOffscreenCanvasSupported:M,isImageDecoderSupported:R,canvasMaxAreaInBytes:L,fontExtraProperties:P,useSystemFonts:ie,useWasm:G,useWorkerFetch:_e,cMapUrl:y,iccUrl:_,standardFontDataUrl:E,wasmUrl:A}},Ge={ownerDocument:B,pdfBug:oe,styleElement:Ie,enableHWA:j,loadingParams:{disableAutoFetch:X,enableXfa:O}};return h.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const ct=h.messageHandler.sendWithPromise("GetDocRequest",Fe,r?[r.buffer]:null);let gt;if(l)gt=new rxe({pdfDataRangeTransport:l,disableRange:re,disableStream:q});else if(!r){if(!i)throw new Error("getDocument - no `url` parameter provided.");const Mt=Ex(i)?lxe:sa?gxe:dxe;gt=new Mt({url:i,length:te,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:re,disableStream:q})}return ct.then(Mt=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const W=new kx(t,Mt,h.port),Re=new Exe(W,e,gt,Ge,Pe,Z);e._transport=Re,W.send("Ready",null)})}).catch(e._capability.reject),e}var PC;const LC=class LC{constructor(){Ze(this,"_capability",Promise.withResolvers());Ze(this,"_transport",null);Ze(this,"_worker",null);Ze(this,"docId",`d${Dr(LC,PC)._++}`);Ze(this,"destroyed",!1);Ze(this,"onPassword",null);Ze(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,t,i,r;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((t=this._transport)==null?void 0:t.destroy())}catch(s){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,s}this._transport=null,(r=this._worker)==null||r.destroy(),this._worker=null}async getData(){return this._transport.getData()}};PC=new WeakMap,Y(LC,PC,0);let aU=LC;var Bv,nT,iT,rT;class DY{constructor(e,t,i=!1,r=null){Y(this,Bv,Promise.withResolvers());Y(this,nT,[]);Y(this,iT,[]);Y(this,rT,[]);this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=r,Object.defineProperty(this,"onDataProgress",{value:()=>{fK("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}addRangeListener(e){g(this,rT).push(e)}addProgressiveReadListener(e){g(this,iT).push(e)}addProgressiveDoneListener(e){g(this,nT).push(e)}onDataRange(e,t){for(const i of g(this,rT))i(e,t)}onDataProgressiveRead(e){g(this,Bv).promise.then(()=>{for(const t of g(this,iT))t(e)})}onDataProgressiveDone(){g(this,Bv).promise.then(()=>{for(const e of g(this,nT))e()})}transportReady(){g(this,Bv).resolve()}requestDataRange(e,t){Wn("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}Bv=new WeakMap,nT=new WeakMap,iT=new WeakMap,rT=new WeakMap;class bxe{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}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 tn(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var lh,Vv,Qg,Ox;class Txe{constructor(e,t,i,r,s=!1){Y(this,Qg);Y(this,lh,!1);Y(this,Vv,null);this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=s?new OV:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new bY,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,V(this,Vv,r)}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}={}){return new KT({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return tn(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,canvas:t=e.canvas,viewport:i,intent:r="display",annotationMode:s=Hd.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:h=null,printAnnotationStorage:f=null,isEditing:p=!1,recordOperations:y=!1,operationsFilter:x=null}){var R,L,H;(R=this._stats)==null||R.time("Overall");const v=this._transport.getRenderingIntent(r,s,f,p),{renderingIntent:_,cacheKey:E}=v;V(this,lh,!1),l||(l=this._transport.getOptionalContentConfig(_));const w=this._intentStates.getOrInsertComputed(E,TF);w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const A=!!(_&go.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(L=this._stats)==null||L.time("Page Request"),this._pumpOperatorList(v));const N=!!(this._pdfBug&&((H=globalThis.StepperManager)!=null&&H.enabled)),k=!this.recordedBBoxes&&(y||N),F=P=>{var O,B;if(w.renderTasks.delete(C),k){const re=(O=C.gfx)==null?void 0:O.dependencyTracker.take();re&&(C.stepper&&C.stepper.setOperatorBBoxes(re,C.gfx.dependencyTracker.takeDebugMetadata()),y&&(this.recordedBBoxes=re))}A&&V(this,lh,!0),Q(this,Qg,Ox).call(this),P?(C.capability.reject(P),this._abortOperatorList({intentState:w,reason:P instanceof Error?P:new Error(P)})):C.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(B=globalThis.Stats)!=null&&B.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},C=new oU({callback:F,params:{canvas:t,canvasContext:e,dependencyTracker:k?new H_e(t,w.operatorList.length,N):null,viewport:i,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!A,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,operationsFilter:x});(w.renderTasks||(w.renderTasks=new Set)).add(C);const M=C.task;return Promise.all([w.displayReadyCapability.promise,l]).then(([P,O])=>{var B;if(this.destroyed){F();return}if((B=this._stats)==null||B.time("Rendering"),!(O.renderingIntent&_))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:P,optionalContentConfig:O}),C.operatorListChanged()}).catch(F),M}getOperatorList({intent:e="display",annotationMode:t=Hd.ENABLE,printAnnotationStorage:i=null,isEditing:r=!1}={}){var c;function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,t,i,r,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,TF);let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:g(this,Vv).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(r){return r.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>xb.textContent(r));const t=this.streamTextContent(e),i={items:[],styles:Object.create(null),lang:null};for await(const r of t)i.lang??(i.lang=r.lang),Object.assign(i.styles,r.styles),i.items.push(...r.items);return i}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),V(this,lh,!1),Promise.all(e)}cleanup(e=!1){V(this,lh,!0);const t=Q(this,Qg,Ox).call(this);return e&&t&&this._stats&&(this._stats=new OV),t}_startRenderPage(e,t){var r,s;const i=this._intentStates.get(t);i&&((r=this._stats)==null||r.timeEnd("Page Request"),(s=i.displayReadyCapability)==null||s.resolve(e))}_renderPageChunk(e,t){for(let i=0,r=e.length;i<r;i++)t.operatorList.fnArray.push(e.fnArray[i]),t.operatorList.argsArray.push(e.argsArray[i]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const i of t.renderTasks)i.operatorListChanged();e.lastChunk&&Q(this,Qg,Ox).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:i,modifiedIds:r}){const{map:s,transfer:a}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:g(this,Vv).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:s,modifiedIds:r},void 0,a).getReader(),c=this._intentStates.get(t);c.streamReader=l;const h=()=>{l.read().then(({value:f,done:p})=>{if(p){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,c),h())},f=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const p of c.renderTasks)p.operatorListChanged();Q(this,Qg,Ox).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(f);else if(c.opListReadCapability)c.opListReadCapability.reject(f);else throw f}})};h()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(t instanceof b4){let r=xxe;t.extraDelay>0&&t.extraDelay<1e3&&(r+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},r);return}}if(e.streamReader.cancel(new ep(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[r,s]of this._intentStates)if(s===e){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}}lh=new WeakMap,Vv=new WeakMap,Qg=new WeakSet,Ox=function(){if(!g(this,lh)||this.destroyed)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),V(this,lh,!1),!0};var xf,Wl,ch,Zg,OC,em,tm,ua,sS,CY,IY,Bx,Wv,aS;const Ui=class Ui{constructor({name:e=null,port:t=null,verbosity:i=i_e()}={}){Y(this,ua);Y(this,xf,Promise.withResolvers());Y(this,Wl,null);Y(this,ch,null);Y(this,Zg,null);if(this.name=e,this.destroyed=!1,this.verbosity=i,t){if(g(Ui,tm).has(t))throw new Error("Cannot use more than one PDFWorker per port.");g(Ui,tm).set(t,this),Q(this,ua,CY).call(this,t)}else Q(this,ua,IY).call(this)}get promise(){return g(this,xf).promise}get port(){return g(this,ch)}get messageHandler(){return g(this,Wl)}destroy(){var e,t;this.destroyed=!0,(e=g(this,Zg))==null||e.terminate(),V(this,Zg,null),g(Ui,tm).delete(g(this,ch)),V(this,ch,null),(t=g(this,Wl))==null||t.destroy(),V(this,Wl,null)}static create(e){const t=g(this,tm).get(e==null?void 0:e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new Ui(e)}static get workerSrc(){if(nu.workerSrc)return nu.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return tn(this,"_setupFakeWorkerGlobal",(async()=>g(this,Wv,aS)?g(this,Wv,aS):(await import(this.workerSrc)).WorkerMessageHandler)())}};xf=new WeakMap,Wl=new WeakMap,ch=new WeakMap,Zg=new WeakMap,OC=new WeakMap,em=new WeakMap,tm=new WeakMap,ua=new WeakSet,sS=function(){g(this,xf).resolve(),g(this,Wl).send("configure",{verbosity:this.verbosity})},CY=function(e){V(this,ch,e),V(this,Wl,new kx("main","worker",e)),g(this,Wl).on("ready",()=>{}),Q(this,ua,sS).call(this)},IY=function(){if(g(Ui,em)||g(Ui,Wv,aS)){Q(this,ua,Bx).call(this);return}let{workerSrc:e}=Ui;try{Ui._isSameOrigin(window.location,e)||(e=Ui._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),i=new kx("main","worker",t),r=()=>{s.abort(),i.destroy(),t.terminate(),this.destroyed?g(this,xf).reject(new Error("Worker was destroyed")):Q(this,ua,Bx).call(this)},s=new AbortController;t.addEventListener("error",()=>{g(this,Zg)||r()},{signal:s.signal}),i.on("test",o=>{if(s.abort(),this.destroyed||!o){r();return}V(this,Wl,i),V(this,ch,t),V(this,Zg,t),Q(this,ua,sS).call(this)}),i.on("ready",o=>{if(s.abort(),this.destroyed){r();return}try{a()}catch{Q(this,ua,Bx).call(this)}});const a=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};a();return}catch{cI("The worker has been disabled.")}Q(this,ua,Bx).call(this)},Bx=function(){g(Ui,em)||(an("Setting up fake worker."),V(Ui,em,!0)),Ui._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){g(this,xf).reject(new Error("Worker was destroyed"));return}const t=new M_e;V(this,ch,t);const i=`fake${Dr(Ui,OC)._++}`,r=new kx(i+"_worker",i,t);e.setup(r,t),V(this,Wl,new kx(i,i+"_worker",t)),Q(this,ua,sS).call(this)}).catch(e=>{g(this,xf).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Wv=new WeakSet,aS=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},Y(Ui,Wv),Y(Ui,OC,0),Y(Ui,em,!1),Y(Ui,tm,new WeakMap),sa&&(V(Ui,em,!0),nu.workerSrc||(nu.workerSrc="./pdf.worker.mjs")),Ui._isSameOrigin=(e,t)=>{const i=URL.parse(e);if(!(i!=null&&i.origin)||i.origin==="null")return!1;const r=new URL(t,i);return i.origin===r.origin},Ui._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},Ui.fromPort=e=>{if(fK("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ui.create(e)};let Eb=Ui;var eo,nm,uh,Ia,qc,Hv,hh,zv,wo,RY,Vx,oS;class Exe{constructor(e,t,i,r,s,a){Y(this,wo);Ze(this,"downloadInfoCapability",Promise.withResolvers());Y(this,eo,null);Y(this,nm,new Map);Y(this,uh,null);Y(this,Ia,new Map);Y(this,qc,new Map);Y(this,Hv,new Map);Y(this,hh,null);Y(this,zv,null);this.messageHandler=e,this.loadingTask=t,V(this,uh,i),this.commonObjs=new bY,this.fontLoader=new S_e({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.enableHWA=r.enableHWA,this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.wasmFactory=s.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler(),this.pagesMapper=a,this.pagesMapper.addListener(Q(this,wo,RY).bind(this))}get annotationStorage(){return tn(this,"annotationStorage",new E4)}getRenderingIntent(e,t=Hd.ENABLE,i=null,r=!1,s=!1){let a=go.DISPLAY,o=bb;switch(e){case"any":a=go.ANY;break;case"display":break;case"print":a=go.PRINT;break;default:an(`getRenderingIntent - invalid intent: ${e}`)}const l=a&go.PRINT&&i instanceof YK?i:this.annotationStorage;switch(t){case Hd.DISABLE:a+=go.ANNOTATIONS_DISABLE;break;case Hd.ENABLE:break;case Hd.ENABLE_FORMS:a+=go.ANNOTATIONS_FORMS;break;case Hd.ENABLE_STORAGE:a+=go.ANNOTATIONS_STORAGE,o=l.serializable;break;default:an(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=go.IS_EDITING),s&&(a+=go.OPLIST);const{ids:c,hash:h}=l.modifiedIds,f=[a,o.hash,h];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=g(this,hh))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const r of g(this,Ia).values())e.push(r._destroy());g(this,Ia).clear(),g(this,qc).clear(),g(this,Hv).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{var r,s;this.commonObjs.clear(),this.fontLoader.clear(),g(this,nm).clear(),this.filterFactory.destroy(),Tb.cleanup(),(r=g(this,uh))==null||r.cancelAllRequests(new ep("Worker was terminated.")),(s=this.messageHandler)==null||s.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(i,r)=>{Fn(g(this,uh),"GetReader - no `BasePDFStream` instance available."),V(this,eo,g(this,uh).getFullReader()),g(this,eo).onProgress=s=>Q(this,wo,oS).call(this,s),r.onPull=()=>{g(this,eo).read().then(function({value:s,done:a}){if(a){r.close();return}Fn(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{r.error(s)})},r.onCancel=s=>{g(this,eo).cancel(s),r.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async i=>{await g(this,eo).headersReady;const{isStreamingSupported:r,isRangeSupported:s,contentLength:a}=g(this,eo);return r&&s&&(g(this,eo).onProgress=null),{isStreamingSupported:r,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(i,r)=>{Fn(g(this,uh),"GetRangeReader - no `BasePDFStream` instance available.");const s=g(this,uh).getRangeReader(i.begin,i.end);if(!s){r.close();return}r.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){r.close();return}Fn(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{r.error(a)})},r.onCancel=a=>{s.cancel(a),r.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:i})=>{this.pagesMapper.pagesNumber=i.numPages,this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,t._capability.resolve(new bxe(i,this))}),e.on("DocException",i=>{t._capability.reject(Ta(i))}),e.on("PasswordRequest",i=>{V(this,hh,Promise.withResolvers());try{if(!t.onPassword)throw Ta(i);const r=s=>{s instanceof Error?g(this,hh).reject(s):g(this,hh).resolve({password:s})};t.onPassword(r,i.code)}catch(r){g(this,hh).reject(r)}return g(this,hh).promise}),e.on("DataLoaded",i=>{Q(this,wo,oS).call(this,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),e.on("StartRenderPage",i=>{if(this.destroyed)return;g(this,Ia).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),e.on("commonobj",([i,r,s])=>{var a;if(this.destroyed||this.commonObjs.has(i))return null;switch(r){case"Font":if("error"in s){const p=s.error;an(`Error during font loading: ${p}`),this.commonObjs.resolve(i,p);break}const o=new HF(s),l=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(p,y)=>globalThis.FontInspector.fontAdded(p,y):null,c=new D_e(o,l,s.extra,s.charProcOperatorList);this.fontLoader.bind(c).catch(()=>e.sendWithPromise("FontFallback",{id:i})).finally(()=>{!c.fontExtraProperties&&c.data&&c.clearData(),this.commonObjs.resolve(i,c)});break;case"CopyLocalImage":const{imageRef:h}=s;Fn(h,"The imageRef must be defined.");for(const p of g(this,Ia).values())for(const[,y]of p.objs)if((y==null?void 0:y.ref)===h)return y.dataLen?(this.commonObjs.resolve(i,structuredClone(y)),y.dataLen):null;break;case"FontPath":this.commonObjs.resolve(i,new C_e(s));break;case"Image":this.commonObjs.resolve(i,s);break;case"Pattern":const f=new zF(s);this.commonObjs.resolve(i,f.getIR());break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),e.on("obj",([i,r,s,a])=>{var l;if(this.destroyed)return;const o=g(this,Ia).get(r);if(!o.objs.has(i)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(s){case"Image":case"Pattern":o.objs.resolve(i,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",i=>{this.destroyed||Q(this,wo,oS).call(this,i)}),e.on("FetchBinaryData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");const r=this[i.type];if(!r)throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);return r.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i;this.annotationStorage.size<=0&&an("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((i=g(this,eo))==null?void 0:i.filename)??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const t=e-1,i=this.pagesMapper.getPageId(e)-1,r=g(this,qc).get(t);if(r)return r;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&g(this,Hv).set(a.refStr,i);const o=new Txe(t,a,this,this.pagesMapper,this._params.pdfBug);return g(this,Ia).set(t,o),o});return g(this,qc).set(t,s),s}async getPageIndex(e){if(!GF(e))throw new Error("Invalid pageIndex request.");const t=await this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}),i=this.pagesMapper.getPageNumber(t+1);if(i===0)throw new Error("GetPageIndex: page has been removed.");return i-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return Q(this,wo,Vx).call(this,"GetFieldObjects")}hasJSActions(){return Q(this,wo,Vx).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return Q(this,wo,Vx).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return Q(this,wo,Vx).call(this,"GetOptionalContentConfig").then(t=>new ixe(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata";return g(this,nm).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(t=>{var i,r;return{info:t[0],metadata:t[1]?new txe(t[1]):null,contentDispositionFilename:((i=g(this,eo))==null?void 0:i.filename)??null,contentLength:((r=g(this,eo))==null?void 0:r.contentLength)??null,hasStructTree:t[2]}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of g(this,Ia).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),g(this,nm).clear(),this.filterFactory.destroy(!0),Tb.cleanup()}}cachedPageNumber(e){if(!GF(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,i=g(this,Hv).get(t);if(i>=0){const r=this.pagesMapper.getPageNumber(i+1);if(r!==0)return r}return null}}eo=new WeakMap,nm=new WeakMap,uh=new WeakMap,Ia=new WeakMap,qc=new WeakMap,Hv=new WeakMap,hh=new WeakMap,zv=new WeakMap,wo=new WeakSet,RY=function({type:e,pageNumbers:t}){var a;if(e==="copy"){V(this,zv,new Map);for(const o of t)g(this,zv).set(o,{proxy:g(this,Ia).get(o-1)||null,promise:g(this,qc).get(o-1)||null});return}if(e==="delete")for(const o of t)g(this,Ia).delete(o-1),g(this,qc).delete(o-1);const i=new Map,r=new Map,{pagesMapper:s}=this;for(let o=0,l=s.pagesNumber;o<l;o++){const c=s.getPrevPageNumber(o+1);if(c<0){const{proxy:y,promise:x}=((a=g(this,zv))==null?void 0:a.get(-c))||{};y&&i.set(o,y),x&&r.set(o,x);continue}const h=c-1,f=g(this,Ia).get(h);f&&i.set(o,f);const p=g(this,qc).get(h);p&&r.set(o,p)}V(this,Ia,i),V(this,qc,r)},Vx=function(e,t=null){return g(this,nm).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))},oS=function({loaded:e,total:t}){var i,r;(r=(i=this.loadingTask).onProgress)==null||r.call(i,{loaded:e,total:t,percent:Yr(Math.round(e/t*100),0,100)})};class wxe{constructor(e){Ze(this,"_internalRenderTask",null);Ze(this,"onContinue",null);Ze(this,"onError",null);this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&(t==null?void 0:t.size)>0}}var bf,im;const fg=class fg{constructor({callback:e,params:t,objs:i,commonObjs:r,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:f=!1,pageColors:p=null,enableHWA:y=!1,operationsFilter:x=null}){Y(this,bf,null);this.callback=e,this.params=t,this.objs=i,this.commonObjs=r,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=f,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new wxe(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=y,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=x}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){var l,c;if(this.cancelled)return;if(this._canvas){if(g(fg,im).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.");g(fg,im).add(this._canvas)}this._pdfBug&&((l=globalThis.StepperManager)!=null&&l.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:i,transform:r,background:s,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Fy(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:r,viewport:i,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,(c=this.graphicsReadyCallback)==null||c.call(this)}cancel(e=null,t=0){var i,r,s;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),g(this,bf)&&(window.cancelAnimationFrame(g(this,bf)),V(this,bf,null)),g(fg,im).delete(this._canvas),e||(e=new b4(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(e),(s=(r=this.task).onError)==null||s.call(r,e)}operatorListChanged(){var e,t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.gfx.dependencyTracker)==null||e.growOperationsCount(this.operatorList.fnArray.length),(t=this.stepper)==null||t.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?V(this,bf,window.requestAnimationFrame(()=>{V(this,bf,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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),g(fg,im).delete(this._canvas),this.callback())))}};bf=new WeakMap,im=new WeakMap,Y(fg,im,new WeakSet);let oU=fg;const Axe="5.5.207",Sxe="527964698";var to,rm,Gv,kr,sT,qv,dh,aT,Tf,Hl,oT,pi,lU,cU,uU,sg,NY,Wd;const Ea=class Ea{constructor({editor:e=null,uiManager:t=null}){Y(this,pi);Y(this,to,null);Y(this,rm,null);Y(this,Gv);Y(this,kr,null);Y(this,sT,!1);Y(this,qv,!1);Y(this,dh,null);Y(this,aT);Y(this,Tf,null);Y(this,Hl,null);var i,r;e?(V(this,qv,!1),V(this,dh,e)):V(this,qv,!0),V(this,Hl,(e==null?void 0:e._uiManager)||t),V(this,aT,g(this,Hl)._eventBus),V(this,Gv,((i=e==null?void 0:e.color)==null?void 0:i.toUpperCase())||((r=g(this,Hl))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98"),g(Ea,oT)||V(Ea,oT,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"}))}static get _keyboardManager(){return tn(this,"_keyboardManager",new JT([[["Escape","mac+Escape"],Ea.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ea.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ea.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ea.prototype._moveToPrevious],[["Home","mac+Home"],Ea.prototype._moveToBeginning],[["End","mac+End"],Ea.prototype._moveToEnd]]))}renderButton(){const e=V(this,to,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",g(this,dh)&&(e.ariaControls=`${g(this,dh).id}_colorpicker_dropdown`);const t=g(this,Hl)._signal;e.addEventListener("click",Q(this,pi,sg).bind(this),{signal:t}),e.addEventListener("keydown",Q(this,pi,uU).bind(this),{signal:t});const i=V(this,rm,document.createElement("span"));return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=g(this,Gv),e.append(i),e}renderMainDropdown(){const e=V(this,kr,Q(this,pi,lU).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===g(this,to)){Q(this,pi,sg).call(this,e);return}const t=e.target.getAttribute("data-color");t&&Q(this,pi,cU).call(this,t,e)}_moveToNext(e){var t,i;if(!g(this,pi,Wd)){Q(this,pi,sg).call(this,e);return}if(e.target===g(this,to)){(t=g(this,kr).firstElementChild)==null||t.focus();return}(i=e.target.nextSibling)==null||i.focus()}_moveToPrevious(e){var t,i;if(e.target===((t=g(this,kr))==null?void 0:t.firstElementChild)||e.target===g(this,to)){g(this,pi,Wd)&&this._hideDropdownFromKeyboard();return}g(this,pi,Wd)||Q(this,pi,sg).call(this,e),(i=e.target.previousSibling)==null||i.focus()}_moveToBeginning(e){var t;if(!g(this,pi,Wd)){Q(this,pi,sg).call(this,e);return}(t=g(this,kr).firstElementChild)==null||t.focus()}_moveToEnd(e){var t;if(!g(this,pi,Wd)){Q(this,pi,sg).call(this,e);return}(t=g(this,kr).lastElementChild)==null||t.focus()}hideDropdown(){var e,t;(e=g(this,kr))==null||e.classList.add("hidden"),g(this,to).ariaExpanded="false",(t=g(this,Tf))==null||t.abort(),V(this,Tf,null)}_hideDropdownFromKeyboard(){var e;if(!g(this,qv)){if(!g(this,pi,Wd)){(e=g(this,dh))==null||e.unselect();return}this.hideDropdown(),g(this,to).focus({preventScroll:!0,focusVisible:g(this,sT)})}}updateColor(e){if(g(this,rm)&&(g(this,rm).style.backgroundColor=e),!g(this,kr))return;const t=g(this,Hl).highlightColors.values();for(const i of g(this,kr).children)i.ariaSelected=t.next().value===e.toUpperCase()}destroy(){var e,t;(e=g(this,to))==null||e.remove(),V(this,to,null),V(this,rm,null),(t=g(this,kr))==null||t.remove(),V(this,kr,null)}};to=new WeakMap,rm=new WeakMap,Gv=new WeakMap,kr=new WeakMap,sT=new WeakMap,qv=new WeakMap,dh=new WeakMap,aT=new WeakMap,Tf=new WeakMap,Hl=new WeakMap,oT=new WeakMap,pi=new WeakSet,lU=function(){const e=document.createElement("div"),t=g(this,Hl)._signal;e.addEventListener("contextmenu",gl,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),g(this,dh)&&(e.id=`${g(this,dh).id}_colorpicker_dropdown`);for(const[i,r]of g(this,Hl).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",r),s.title=i,s.setAttribute("data-l10n-id",g(Ea,oT)[i]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=r,s.ariaSelected=r===g(this,Gv),s.addEventListener("click",Q(this,pi,cU).bind(this,r),{signal:t}),e.append(s)}return e.addEventListener("keydown",Q(this,pi,uU).bind(this),{signal:t}),e},cU=function(e,t){t.stopPropagation(),g(this,aT).dispatch("switchannotationeditorparams",{source:this,type:Dn.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},uU=function(e){Ea._keyboardManager.exec(this,e)},sg=function(e){if(g(this,pi,Wd)){this.hideDropdown();return}if(V(this,sT,e.detail===0),g(this,Tf)||(V(this,Tf,new AbortController),window.addEventListener("pointerdown",Q(this,pi,NY).bind(this),{signal:g(this,Hl).combinedSignal(g(this,Tf))})),g(this,to).ariaExpanded="true",g(this,kr)){g(this,kr).classList.remove("hidden");return}const t=V(this,kr,Q(this,pi,lU).call(this));g(this,to).append(t)},NY=function(e){var t;(t=g(this,kr))!=null&&t.contains(e.target)||this.hideDropdown()},Wd=function(){return g(this,kr)&&!g(this,kr).classList.contains("hidden")},Y(Ea,oT,null);let UD=Ea;var $c,lT,$v,cT;const pg=class pg{constructor(e){Y(this,$c,null);Y(this,lT,null);Y(this,$v,null);V(this,lT,e),V(this,$v,e._uiManager),g(pg,cT)||V(pg,cT,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(g(this,$c))return g(this,$c);const{editorType:e,colorType:t,color:i}=g(this,lT),r=V(this,$c,document.createElement("input"));return r.type="color",r.value=i||"#000000",r.className="basicColorPicker",r.tabIndex=0,r.setAttribute("data-l10n-id",g(pg,cT)[e]),r.addEventListener("input",()=>{g(this,$v).updateParams(t,r.value)},{signal:g(this,$v)._signal}),r}update(e){g(this,$c)&&(g(this,$c).value=e)}destroy(){var e;(e=g(this,$c))==null||e.remove(),V(this,$c,null)}hideDropdown(){}};$c=new WeakMap,lT=new WeakMap,$v=new WeakMap,cT=new WeakMap,Y(pg,cT,null);let PD=pg;function lW(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function ax(n){return Math.max(0,Math.min(255,255*n))}class cW{static CMYK_G([e,t,i,r]){return["G",1-Math.min(1,.3*e+.59*i+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=ax(e),[e,e,e]}static G_HTML([e]){const t=lW(e);return`#${t}${t}${t}`}static RGB_G([e,t,i]){return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map(ax)}static RGB_HTML(e){return`#${e.map(lW).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,i,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,i+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,i,r]){return[ax(1-Math.min(1,e+r)),ax(1-Math.min(1,i+r)),ax(1-Math.min(1,t+r))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,i]){const r=1-e,s=1-t,a=1-i,o=Math.min(r,s,a);return["CMYK",r,s,a,o]}}class Dxe{create(e,t,i=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),i||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${t}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Wn("Abstract method `_createSVG` called.")}}class LD extends Dxe{_createSVG(e){return document.createElementNS(Ou,e)}}const Cxe=9,Bm=new WeakSet,Ixe=new Date().getTimezoneOffset()*60*1e3;class e3{static create(e){switch(e.data.annotationType){case fr.LINK:return new S4(e);case fr.TEXT:return new Nxe(e);case fr.WIDGET:switch(e.data.fieldType){case"Tx":return new kxe(e);case"Btn":return e.data.radioButton?new FY(e):e.data.checkBox?new Fxe(e):new Uxe(e);case"Ch":return new Pxe(e);case"Sig":return new Mxe(e)}return new Qm(e);case fr.POPUP:return new dU(e);case fr.FREETEXT:return new BY(e);case fr.LINE:return new Oxe(e);case fr.SQUARE:return new Bxe(e);case fr.CIRCLE:return new Vxe(e);case fr.POLYLINE:return new VY(e);case fr.CARET:return new Hxe(e);case fr.INK:return new D4(e);case fr.POLYGON:return new Wxe(e);case fr.HIGHLIGHT:return new WY(e);case fr.UNDERLINE:return new zxe(e);case fr.SQUIGGLY:return new Gxe(e);case fr.STRIKEOUT:return new qxe(e);case fr.STAMP:return new HY(e);case fr.FILEATTACHMENT:return new $xe(e);default:return new Vi(e)}}}var sm,jv,nl,uT,hU;const U5=class U5{constructor(e,{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}={}){Y(this,uT);Y(this,sm,null);Y(this,jv,!1);Y(this,nl,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e!=null&&e.str||t!=null&&t.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return U5._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var i;const{data:e}=this,t=(i=this.annotationStorage)==null?void 0:i.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){var o;const e=(o=this.annotationStorage)==null?void 0:o.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:t,inkLists:i,rect:r}=this.data;let s=-1/0,a=-1/0;if((t==null?void 0:t.length)>=8){for(let l=0;l<t.length;l+=8)t[l+1]>a?(a=t[l+1],s=t[l+2]):t[l+1]===a&&(s=Math.max(s,t[l+2]));return[s,a]}if((i==null?void 0:i.length)>=1){for(const l of i)for(let c=0,h=l.length;c<h;c+=2)l[c+1]>a?(a=l[c+1],s=l[c]):l[c+1]===a&&(s=Math.max(s,l[c]));if(s!==1/0)return[s,a]}return r?[r[2],r[3]]:null}_normalizePoint(e){const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-s)/i,e[1]=100*(e[1]-a)/r,e}get commentText(){var t,i,r;const{data:e}=this;return((i=(t=this.annotationStorage.getRawValue(`${vb}${e.id}`))==null?void 0:t.popup)==null?void 0:i.contents)||((r=e.contentsObj)==null?void 0:r.str)||""}set commentText(e){const{data:t}=this,i={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:i})||this.annotationStorage.setValue(`${vb}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:i,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){var e,t;(t=((e=g(this,nl))==null?void 0:e.popup)||this.popup)==null||t.remove(),V(this,nl,this.popup=null)}updateEdited(e){var s;if(!this.container)return;e.rect&&(g(this,sm)||V(this,sm,{rect:this.data.rect.slice(0)}));const{rect:t,popup:i}=e;t&&Q(this,uT,hU).call(this,t);let r=((s=g(this,nl))==null?void 0:s.popup)||this.popup;!r&&(i!=null&&i.text)&&(this._createPopup(i),r=g(this,nl).popup),r&&(r.updateEdited(e),i!=null&&i.deleted&&(r.remove(),V(this,nl,null),this.popup=null))}resetEdited(){var e;g(this,sm)&&(Q(this,uT,hU).call(this,g(this,sm).rect),(e=g(this,nl))==null||e.popup.resetEdited(),V(this,sm,null))}_createContainer(e){const{data:t,parent:{page:i,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),!(this instanceof Qm)&&!(this instanceof S4)&&(s.tabIndex=0);const{style:a}=s;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof dU){const{rotation:v}=t;return!t.hasOwnCanvas&&v!==0&&this.setRotation(v,s),s}const{width:o,height:l}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;const v=t.borderStyle.horizontalCornerRadius,_=t.borderStyle.verticalCornerRadius;if(v>0||_>0){const w=`calc(${v}px * var(--total-scale-factor)) / calc(${_}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof FY){const w=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=w}switch(t.borderStyle.style){case ry.SOLID:a.borderStyle="solid";break;case ry.DASHED:a.borderStyle="dashed";break;case ry.BEVELED:an("Unimplemented border style: beveled");break;case ry.INSET:an("Unimplemented border style: inset");break;case ry.UNDERLINE:a.borderBottomStyle="solid";break}const E=t.borderColor||null;E?(V(this,jv,!0),a.borderColor=St.makeHexColor(E[0]|0,E[1]|0,E[2]|0)):a.borderWidth=0}const c=St.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:f,pageX:p,pageY:y}=r.rawDims;a.left=`${100*(c[0]-p)/h}%`,a.top=`${100*(c[1]-y)/f}%`;const{rotation:x}=t;return t.hasOwnCanvas||x===0?(a.width=`${100*o/h}%`,a.height=`${100*l/f}%`):this.setRotation(x,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:r}=this.parent.viewport.rawDims;let{width:s,height:a}=this;e%180!==0&&([s,a]=[a,s]),t.style.width=`${100*s/i}%`,t.style.height=`${100*a/r}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,i,r)=>{const s=r.detail[t],a=s[0],o=s.slice(1);r.target.style[i]=cW[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[i]:cW[`${a}_rgb`](o)})};return tn(this,"_commonActions",{display:t=>{const{display:i}=t.detail,r=i%2===1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:i===1||i===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(e,t){const i=this._commonActions;for(const r of Object.keys(t.detail)){const s=e[r]||i[r];s==null||s(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const i=this._commonActions;for(const[r,s]of Object.entries(t)){const a=i[r];if(a){const o={detail:{[r]:s},target:e};a(o),delete t[r]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,i,r,s]=this.data.rect.map(v=>Math.fround(v));if(e.length===8){const[v,_,E,w]=e.subarray(2,6);if(r===v&&s===_&&t===E&&i===w)return}const{style:a}=this.container;let o;if(g(this,jv)){const{borderColor:v,borderWidth:_}=a;a.borderWidth=0,o=["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="${v}" stroke-width="${_}">`],this.container.classList.add("hasBorder")}const l=r-t,c=s-i,{svgFactory:h}=this,f=h.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0),f.role="none";const p=h.createElement("defs");f.append(p);const y=h.createElement("clipPath"),x=`clippath_${this.data.id}`;y.setAttribute("id",x),y.setAttribute("clipPathUnits","objectBoundingBox"),p.append(y);for(let v=2,_=e.length;v<_;v+=8){const E=e[v],w=e[v+1],A=e[v+2],N=e[v+3],k=h.createElement("rect"),F=(A-t)/l,C=(s-w)/c,M=(E-A)/l,R=(w-N)/c;k.setAttribute("x",F),k.setAttribute("y",C),k.setAttribute("width",M),k.setAttribute("height",R),y.append(k),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${F}" y="${C}" width="${M}" height="${R}"/>`)}g(this,jv)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(f),this.container.style.clipPath=`url(#${x})`}_createPopup(e=null){const{data:t}=this;let i,r;e?(i={str:e.text},r=e.date):(i=t.contentsObj,r=t.modificationDate),V(this,nl,new dU({data:{color:t.color,titleObj:t.titleObj,modificationDate:r,contentsObj:i,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(g(this,nl)||this.popup||this.data.popupRef)}get extraPopupElement(){return g(this,nl)}render(){Wn("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const i=[];if(this._fieldObjects){const r=this._fieldObjects[e];if(r)for(const{page:s,id:a,exportValues:o}of r){if(s===-1||a===t)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!Bm.has(c)){an(`_getElementsByName - element not allowed: ${a}`);continue}i.push({id:a,exportValue:l,domElement:c})}return i}for(const r of document.getElementsByName(e)){const{exportValue:s}=r,a=r.getAttribute("data-element-id");a!==t&&Bm.has(r)&&i.push({id:a,exportValue:s,domElement:r})}return i}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{var i;(i=this.linkService.eventBus)==null||i.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};sm=new WeakMap,jv=new WeakMap,nl=new WeakMap,uT=new WeakSet,hU=function(e){const{container:{style:t},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}}}=this;i==null||i.splice(0,4,...e),t.left=`${100*(e[0]-o)/s}%`,t.top=`${100*(a-e[3]+l)/a}%`,r===0?(t.width=`${100*(e[2]-e[0])/s}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(r)};let Vi=U5;class Rxe extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}var bo,ag,kY,MY;class S4 extends Vi{constructor(t,i=null){super(t,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});Y(this,bo);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:i}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let s=!1;return t.url?(i.addLinkAttributes(r,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(r,t.action,t.overlaidText),s=!0):t.attachment?(Q(this,bo,kY).call(this,r,t.attachment,t.overlaidText,t.attachmentDest),s=!0):t.setOCGState?(Q(this,bo,MY).call(this,r,t.setOCGState,t.overlaidText),s=!0):t.dest?(this._bindLink(r,t.dest,t.overlaidText),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),s=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(r,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&(this.contentElement=r,this.container.append(r)),this.container}_bindLink(t,i,r=""){t.href=this.linkService.getDestinationHash(i),t.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&Q(this,bo,ag).call(this),r&&(t.title=r)}_bindNamedAction(t,i,r=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(i),!1),r&&(t.title=r),Q(this,bo,ag).call(this)}_bindJSAction(t,i){t.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(i.actions)){const a=r.get(s);a&&(t[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:s}}),!1})}i.overlaidText&&(t.title=i.overlaidText),t.onclick||(t.onclick=()=>!1),Q(this,bo,ag).call(this)}_bindResetFormAction(t,i){const r=t.onclick;if(r||(t.href=this.linkService.getAnchorUrl("")),Q(this,bo,ag).call(this),!this._fieldObjects){an('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(t.onclick=()=>!1);return}t.onclick=()=>{var f;r==null||r();const{fields:s,refs:a,include:o}=i,l=[];if(s.length!==0||a.length!==0){const p=new Set(a);for(const y of s){const x=this._fieldObjects[y]||[];for(const{id:v}of x)p.add(v)}for(const y of Object.values(this._fieldObjects))for(const x of y)p.has(x.id)===o&&l.push(x)}else for(const p of Object.values(this._fieldObjects))l.push(...p);const c=this.annotationStorage,h=[];for(const p of l){const{id:y}=p;switch(h.push(y),p.type){case"text":{const v=p.defaultValue||"";c.setValue(y,{value:v});break}case"checkbox":case"radiobutton":{const v=p.defaultValue===p.exportValues;c.setValue(y,{value:v});break}case"combobox":case"listbox":{const v=p.defaultValue||"";c.setValue(y,{value:v});break}default:continue}const x=document.querySelector(`[data-element-id="${y}"]`);if(x){if(!Bm.has(x)){an(`_bindResetFormAction - element not allowed: ${y}`);continue}}else continue;x.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}})),!1}}}bo=new WeakSet,ag=function(){this.container.setAttribute("data-internal-link","")},kY=function(t,i,r="",s=null){t.href=this.linkService.getAnchorUrl(""),i.description?t.title=i.description:r&&(t.title=r),t.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(i.content,i.filename,s),!1},Q(this,bo,ag).call(this)},MY=function(t,i,r=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(i),!1),r&&(t.title=r),Q(this,bo,ag).call(this)};class Nxe extends Vi{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}class Qm extends Vi{render(){return this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&(((t=e.previousSibling)==null?void 0:t.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Pr.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,i,r,s){i.includes("mouse")?e.addEventListener(i,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(i,a=>{var o;if(i==="blur"){if(!t.focused||!a.relatedTarget)return;t.focused=!1}else if(i==="focus"){if(t.focused)return;t.focused=!0}s&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(a)}}))})}_setEventListeners(e,t,i,r){var s,a,o;for(const[l,c]of i)(c==="Action"||(s=this.data.actions)!=null&&s[c])&&((c==="Focus"||c==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,l,c,r),c==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,t,"blur","Blur",null):c==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":St.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||Cxe,s=e.style;let a;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),h=Math.round(c/(jk*r))||1,f=c/h;a=Math.min(r,l(f/jk))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(r,l(c/jk))}s.fontSize=`calc(${a}px * var(--total-scale-factor))`,s.color=St.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class kxe extends Qm{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,i,r){const s=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=i),s.setValue(a.id,{[r]:i})}render(){var r,s;const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const a=e.getValue(t,{value:this.data.fieldValue});let o=a.value||"";const l=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((r=this.data.textContent)==null?void 0:r.join(`
`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const h={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c??o,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",c??o),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Bm.add(i),this.contentElement=i,i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const{datetimeFormat:f,datetimeType:p,timeStep:y}=this.data,x=!!p&&this.enableScripting;f&&(i.title=f),this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",_=>{e.setValue(t,{value:_.target.value}),this.setPropertyOnSiblings(i,"value",_.target.value,"value"),h.formattedValue=null}),i.addEventListener("resetform",_=>{const E=this.data.defaultFieldValue??"";i.value=h.userValue=E,h.formattedValue=null});let v=_=>{const{formattedValue:E}=h;E!=null&&(_.target.value=E),_.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",E=>{var A;if(h.focused)return;const{target:w}=E;if(x&&(w.type=p,y&&(w.step=y)),h.userValue){const N=h.userValue;if(x)if(p==="time"){const k=new Date(N),F=[k.getHours(),k.getMinutes(),k.getSeconds()];w.value=F.map(C=>C.toString().padStart(2,"0")).join(":")}else w.value=new Date(N-Ixe).toISOString().split(p==="date"?"T":".",1)[0];else w.value=N}h.lastCommittedValue=w.value,h.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(h.focused=!0)}),i.addEventListener("updatefromsandbox",E=>{this.showElementAndHideCanvas(E.target);const w={value(A){h.userValue=A.detail.value??"",x||e.setValue(t,{value:h.userValue.toString()}),A.target.value=h.userValue},formattedValue(A){const{formattedValue:N}=A.detail;h.formattedValue=N,N!=null&&A.target!==document.activeElement&&(A.target.value=N);const k={formattedValue:N};x&&(k.value=N),e.setValue(t,k)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var C;const{charLimit:N}=A.detail,{target:k}=A;if(N===0){k.removeAttribute("maxLength");return}k.setAttribute("maxLength",N);let F=h.userValue;!F||F.length<=N||(F=F.slice(0,N),k.value=h.userValue=F,e.setValue(t,{value:F}),(C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:F,willCommit:!0,commitKey:1,selStart:k.selectionStart,selEnd:k.selectionEnd}}))}};this._dispatchEventFromSandbox(w,E)}),i.addEventListener("keydown",E=>{var N;h.commitKey=1;let w=-1;if(E.key==="Escape"?w=0:E.key==="Enter"&&!this.data.multiLine?w=2:E.key==="Tab"&&(h.commitKey=3),w===-1)return;const{value:A}=E.target;h.lastCommittedValue!==A&&(h.lastCommittedValue=A,h.userValue=A,(N=this.linkService.eventBus)==null||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:A,willCommit:!0,commitKey:w,selStart:E.target.selectionStart,selEnd:E.target.selectionEnd}}))});const _=v;v=null,i.addEventListener("blur",E=>{var N,k;if(!h.focused||!E.relatedTarget)return;(N=this.data.actions)!=null&&N.Blur||(h.focused=!1);const{target:w}=E;let{value:A}=w;if(x){if(A&&p==="time"){const F=A.split(":").map(C=>parseInt(C,10));A=new Date(2e3,0,1,F[0],F[1],F[2]||0).valueOf(),w.step=""}else A.includes("T")||(A=`${A}T00:00`),A=new Date(A).valueOf();w.type="text"}h.userValue=A,h.lastCommittedValue!==A&&((k=this.linkService.eventBus)==null||k.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:A,willCommit:!0,commitKey:h.commitKey,selStart:E.target.selectionStart,selEnd:E.target.selectionEnd}})),_(E)}),(s=this.data.actions)!=null&&s.Keystroke&&i.addEventListener("beforeinput",E=>{var R;h.lastCommittedValue=null;const{data:w,target:A}=E,{value:N,selectionStart:k,selectionEnd:F}=A;let C=k,M=F;switch(E.inputType){case"deleteWordBackward":{const L=N.substring(0,k).match(/\w*[^\w]*$/);L&&(C-=L[0].length);break}case"deleteWordForward":{const L=N.substring(k).match(/^[^\w]*\w*/);L&&(M+=L[0].length);break}case"deleteContentBackward":k===F&&(C-=1);break;case"deleteContentForward":k===F&&(M+=1);break}E.preventDefault(),(R=this.linkService.eventBus)==null||R.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:N,change:w||"",willCommit:!1,selStart:C,selEnd:M}})}),this._setEventListeners(i,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],E=>E.target.value)}if(v&&i.addEventListener("blur",v),this.data.comb){const E=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing=`calc(${E}px * var(--total-scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Mxe extends Qm{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Fxe extends Qm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,i=t.id;let r=e.getValue(i,{value:t.exportValue===t.fieldValue}).value;typeof r=="string"&&(r=r!=="Off",e.setValue(i,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Bm.add(s),s.setAttribute("data-element-id",i),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=t.fieldName,r&&s.setAttribute("checked",!0),s.setAttribute("exportValue",t.exportValue),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i)){const h=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=h),e.setValue(c.id,{value:h})}e.setValue(i,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue||"Off";a.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class FY extends Qm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,i=t.id;let r=e.getValue(i,{value:t.fieldValue===t.buttonValue}).value;if(typeof r=="string"&&(r=r!==t.buttonValue,e.setValue(i,{value:r})),r)for(const a of this._getElementsByName(t.fieldName,i))e.setValue(a.id,{value:!1});const s=document.createElement("input");if(Bm.add(s),s.setAttribute("data-element-id",i),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=t.fieldName,r&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,i))e.setValue(c.id,{value:!1});e.setValue(i,{value:l})}),s.addEventListener("resetform",a=>{const o=t.defaultFieldValue;a.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;s.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const h=a===c.detail.value;for(const f of this._getElementsByName(c.target.name)){const p=h&&f.id===i;f.domElement&&(f.domElement.checked=p),e.setValue(f.id,{value:p})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Uxe extends S4{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),e}}class Pxe extends Qm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,i=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");Bm.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",h=>{const f=this.data.defaultFieldValue;for(const p of r.options)p.selected=p.value===f});for(const h of this.data.options){const f=document.createElement("option");f.textContent=h.displayValue,f.value=h.exportValue,i.value.includes(h.exportValue)&&(f.setAttribute("selected",!0),s=!1),r.append(f)}let a=null;if(s){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),r.prepend(h),a=()=>{h.remove(),r.removeEventListener("input",a),a=null},r.addEventListener("input",a)}const o=h=>{const f=h?"value":"textContent",{options:p,multiple:y}=r;return y?Array.prototype.filter.call(p,x=>x.selected).map(x=>x[f]):p.selectedIndex===-1?null:p[p.selectedIndex][f]};let l=o(!1);const c=h=>{const f=h.target.options;return Array.prototype.map.call(f,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",h=>{const f={value(p){a==null||a();const y=p.detail.value,x=new Set(Array.isArray(y)?y:[y]);for(const v of r.options)v.selected=x.has(v.value);e.setValue(t,{value:o(!0)}),l=o(!1)},multipleSelection(p){r.multiple=!0},remove(p){const y=r.options,x=p.detail.remove;y[x].selected=!1,r.remove(x),y.length>0&&Array.prototype.findIndex.call(y,_=>_.selected)===-1&&(y[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},clear(p){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),l=o(!1)},insert(p){const{index:y,displayValue:x,exportValue:v}=p.detail.insert,_=r.children[y],E=document.createElement("option");E.textContent=x,E.value=v,_?_.before(E):r.append(E),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},items(p){const{items:y}=p.detail;for(;r.length!==0;)r.remove(0);for(const x of y){const{displayValue:v,exportValue:_}=x,E=document.createElement("option");E.textContent=v,E.value=_,r.append(E)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(p)}),l=o(!1)},indices(p){const y=new Set(p.detail.indices);for(const x of p.target.options)x.selected=y.has(x.index);e.setValue(t,{value:o(!0)}),l=o(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(f,h)}),r.addEventListener("input",h=>{var y;const f=o(!0),p=o(!1);e.setValue(t,{value:f}),h.preventDefault(),(y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:p,changeEx:f,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"]],h=>h.target.value)):r.addEventListener("input",function(h){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}var hT,fU;class dU extends Vi{constructor(t){const{data:i,elements:r,parent:s}=t,a=!!s._commentManager;super(t,{isRenderable:!a&&Vi._hasPopupData(i)});Y(this,hT);if(this.elements=r,a&&Vi._hasPopupData(i)){const o=this.popup=Q(this,hT,fU).call(this);for(const l of r)l.popup=o}else this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const i=this.popup=Q(this,hT,fU).call(this),r=[];for(const s of this.elements)s.popup=i,s.container.ariaHasPopup="dialog",r.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(s=>`${Ey}${s}`).join(",")),this.container}}hT=new WeakSet,fU=function(){return new Lxe({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,commentManager:this.parent._commentManager})};var no,Ef,BC,VC,Xv,Kv,$i,jc,wf,am,Yv,Jv,Xc,io,fh,ph,ji,gh,Af,dT,mh,Qv,om,Sf,Gr,Df,fn,lS,pU,gU,mU,cS,yU,UY,PY,LY,OY,uS,hS,vU;class Lxe{constructor({container:e,color:t,elements:i,titleObj:r,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:f,commentManager:p=null}){Y(this,fn);Y(this,no,null);Y(this,Ef,Q(this,fn,LY).bind(this));Y(this,BC,Q(this,fn,vU).bind(this));Y(this,VC,Q(this,fn,hS).bind(this));Y(this,Xv,Q(this,fn,uS).bind(this));Y(this,Kv,null);Y(this,$i,null);Y(this,jc,null);Y(this,wf,null);Y(this,am,null);Y(this,Yv,null);Y(this,Jv,null);Y(this,Xc,!1);Y(this,io,null);Y(this,fh,null);Y(this,ph,null);Y(this,ji,null);Y(this,gh,null);Y(this,Af,null);Y(this,dT,null);Y(this,mh,null);Y(this,Qv,null);Y(this,om,null);Y(this,Sf,!1);Y(this,Gr,null);Y(this,Df,null);V(this,$i,e),V(this,Qv,r),V(this,jc,a),V(this,mh,o),V(this,Yv,l),V(this,Kv,t),V(this,dT,c),V(this,Jv,h),V(this,am,i),V(this,no,p),V(this,Gr,i[0]),V(this,wf,ID.toDateObject(s)),this.trigger=i.flatMap(y=>y.getElementsToTriggerPopup()),p||(Q(this,fn,lS).call(this),g(this,$i).hidden=!0,f&&Q(this,fn,uS).call(this))}renderCommentButton(){if(g(this,ji)){g(this,ji).parentNode||g(this,Gr).container.after(g(this,ji));return}if(g(this,gh)||Q(this,fn,pU).call(this),!g(this,gh))return;const{signal:e}=V(this,fh,new AbortController),t=g(this,Gr).hasOwnCommentButton,i=()=>{g(this,no).toggleCommentPopup(this,!0,void 0,!t)},r=()=>{g(this,no).toggleCommentPopup(this,!1,!0,!t)},s=()=>{g(this,no).toggleCommentPopup(this,!1,!1)};if(t){V(this,ji,g(this,Gr).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",g(this,Ef),{signal:e}),a.addEventListener("click",i,{signal:e}),a.addEventListener("pointerenter",r,{signal:e}),a.addEventListener("pointerleave",s,{signal:e}),a.classList.add("popupTriggerArea")}else{const a=V(this,ji,document.createElement("button"));a.className="annotationCommentButton";const o=g(this,Gr).container;a.style.zIndex=o.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),Q(this,fn,mU).call(this),Q(this,fn,gU).call(this),a.addEventListener("keydown",g(this,Ef),{signal:e}),a.addEventListener("click",i,{signal:e}),a.addEventListener("pointerenter",r,{signal:e}),a.addEventListener("pointerleave",s,{signal:e}),o.after(a)}}get commentButtonColor(){const{color:e,opacity:t}=g(this,Gr).commentData;return e?g(this,Yv)._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{var e;(e=g(this,ji))==null||e.focus()},0)}getData(){const{richText:e,color:t,opacity:i,creationDate:r,modificationDate:s}=g(this,Gr).commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:i,creationDate:r,modificationDate:s}}get elementBeforePopup(){return g(this,ji)}get comment(){return g(this,Df)||V(this,Df,g(this,Gr).commentText),g(this,Df)}set comment(e){e!==this.comment&&(g(this,Gr).commentText=V(this,Df,e))}focus(){var e;(e=g(this,Gr).container)==null||e.focus()}get parentBoundingClientRect(){return g(this,Gr).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){g(this,ji)&&(g(this,ji).classList.toggle("selected",e),g(this,ji).ariaExpanded=t)}setSelectedCommentButton(e){g(this,ji).classList.toggle("selected",e)}get commentPopupPosition(){if(g(this,Af))return g(this,Af);const{x:e,y:t,height:i}=g(this,ji).getBoundingClientRect(),{x:r,y:s,width:a,height:o}=g(this,Gr).layer.getBoundingClientRect();return[(e-r)/a,(t+i-s)/o]}set commentPopupPosition(e){V(this,Af,e)}hasDefaultPopupPosition(){return g(this,Af)===null}get commentButtonPosition(){return g(this,gh)}get commentButtonWidth(){return g(this,ji).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[t,i]=g(this,Af)||this.commentButtonPosition.map(c=>c/100),r=this.parentBoundingClientRect,{x:s,y:a,width:o,height:l}=r;g(this,no).showDialog(null,this,s+t*o,a+i*l,{...e,parentDimensions:r})}render(){var i,r;if(g(this,io))return;const e=V(this,io,document.createElement("div"));if(e.className="popup",g(this,Kv)){const s=e.style.outlineColor=St.makeHexColor(...g(this,Kv));e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`}const t=document.createElement("span");if(t.className="header",(i=g(this,Qv))!=null&&i.str){const s=document.createElement("span");s.className="title",t.append(s),{dir:s.dir,str:s.textContent}=g(this,Qv)}if(e.append(t),g(this,wf)){const s=document.createElement("time");s.className="popupDate",s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:g(this,wf).valueOf()})),s.dateTime=g(this,wf).toISOString(),t.append(s)}pK({html:g(this,fn,cS)||g(this,jc).str,dir:(r=g(this,jc))==null?void 0:r.dir,className:"popupContent"},e),g(this,$i).append(e)}updateEdited({rect:e,popup:t,deleted:i}){var r;if(g(this,no)){i?(this.remove(),V(this,Df,null)):t&&(t.deleted?this.remove():(Q(this,fn,mU).call(this),V(this,Df,t.text))),e&&(V(this,gh,null),Q(this,fn,pU).call(this),Q(this,fn,gU).call(this));return}if(i||t!=null&&t.deleted){this.remove();return}Q(this,fn,lS).call(this),g(this,om)||V(this,om,{contentsObj:g(this,jc),richText:g(this,mh)}),e&&V(this,ph,null),t&&t.text&&(V(this,mh,Q(this,fn,PY).call(this,t.text)),V(this,wf,ID.toDateObject(t.date)),V(this,jc,null)),(r=g(this,io))==null||r.remove(),V(this,io,null)}resetEdited(){var e;g(this,om)&&({contentsObj:Dr(this,jc)._,richText:Dr(this,mh)._}=g(this,om),V(this,om,null),(e=g(this,io))==null||e.remove(),V(this,io,null),V(this,ph,null))}remove(){var e,t,i;if((e=g(this,fh))==null||e.abort(),V(this,fh,null),(t=g(this,io))==null||t.remove(),V(this,io,null),V(this,Sf,!1),V(this,Xc,!1),(i=g(this,ji))==null||i.remove(),V(this,ji,null),this.trigger)for(const r of this.trigger)r.classList.remove("popupTriggerArea")}forceHide(){V(this,Sf,this.isVisible),g(this,Sf)&&(g(this,$i).hidden=!0)}maybeShow(){g(this,no)||(Q(this,fn,lS).call(this),g(this,Sf)&&(g(this,io)||Q(this,fn,hS).call(this),V(this,Sf,!1),g(this,$i).hidden=!1))}get isVisible(){return g(this,no)?!1:g(this,$i).hidden===!1}}no=new WeakMap,Ef=new WeakMap,BC=new WeakMap,VC=new WeakMap,Xv=new WeakMap,Kv=new WeakMap,$i=new WeakMap,jc=new WeakMap,wf=new WeakMap,am=new WeakMap,Yv=new WeakMap,Jv=new WeakMap,Xc=new WeakMap,io=new WeakMap,fh=new WeakMap,ph=new WeakMap,ji=new WeakMap,gh=new WeakMap,Af=new WeakMap,dT=new WeakMap,mh=new WeakMap,Qv=new WeakMap,om=new WeakMap,Sf=new WeakMap,Gr=new WeakMap,Df=new WeakMap,fn=new WeakSet,lS=function(){var t;if(g(this,fh))return;V(this,fh,new AbortController);const{signal:e}=g(this,fh);for(const i of this.trigger)i.addEventListener("click",g(this,Xv),{signal:e}),i.addEventListener("pointerenter",g(this,VC),{signal:e}),i.addEventListener("pointerleave",g(this,BC),{signal:e}),i.classList.add("popupTriggerArea");for(const i of g(this,am))(t=i.container)==null||t.addEventListener("keydown",g(this,Ef),{signal:e})},pU=function(){const e=g(this,am).find(t=>t.hasCommentButton);e&&V(this,gh,e._normalizePoint(e.commentButtonPosition))},gU=function(){if(g(this,Gr).extraPopupElement&&!g(this,Gr).editor)return;g(this,ji)||this.renderCommentButton();const[e,t]=g(this,gh),{style:i}=g(this,ji);i.left=`calc(${e}%)`,i.top=`calc(${t}% - var(--comment-button-dim))`},mU=function(){g(this,Gr).extraPopupElement||(g(this,ji)||this.renderCommentButton(),g(this,ji).style.backgroundColor=this.commentButtonColor||"")},cS=function(){const e=g(this,mh),t=g(this,jc);return e!=null&&e.str&&(!(t!=null&&t.str)||t.str===e.str)&&g(this,mh).html||null},yU=function(){var e,t,i;return((i=(t=(e=g(this,fn,cS))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:i.fontSize)||0},UY=function(){var e,t,i;return((i=(t=(e=g(this,fn,cS))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:i.color)||null},PY=function(e){const t=[],i={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},r={style:{color:g(this,fn,UY),fontSize:g(this,fn,yU)?`calc(${g(this,fn,yU)}px * var(--total-scale-factor))`:""}};for(const s of e.split(`
`))t.push({name:"span",value:s,attributes:r});return i},LY=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&g(this,Xc))&&Q(this,fn,uS).call(this)},OY=function(){if(g(this,ph)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:i,pageX:r,pageY:s}}}=g(this,Yv);let a=!!g(this,Jv),o=a?g(this,Jv):g(this,dT);for(const x of g(this,am))if(!o||St.intersect(x.data.rect,o)!==null){o=x.data.rect,a=!0;break}const l=St.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),h=a?o[2]-o[0]+5:0,f=l[0]+h,p=l[1];V(this,ph,[100*(f-r)/t,100*(p-s)/i]);const{style:y}=g(this,$i);y.left=`${g(this,ph)[0]}%`,y.top=`${g(this,ph)[1]}%`},uS=function(){if(g(this,no)){g(this,no).toggleCommentPopup(this,!1);return}V(this,Xc,!g(this,Xc)),g(this,Xc)?(Q(this,fn,hS).call(this),g(this,$i).addEventListener("click",g(this,Xv)),g(this,$i).addEventListener("keydown",g(this,Ef))):(Q(this,fn,vU).call(this),g(this,$i).removeEventListener("click",g(this,Xv)),g(this,$i).removeEventListener("keydown",g(this,Ef)))},hS=function(){g(this,io)||this.render(),this.isVisible?g(this,Xc)&&g(this,$i).classList.add("focused"):(Q(this,fn,OY).call(this),g(this,$i).hidden=!1,g(this,$i).style.zIndex=parseInt(g(this,$i).style.zIndex)+1e3)},vU=function(){g(this,$i).classList.remove("focused"),!(g(this,Xc)||!this.isVisible)&&(g(this,$i).hidden=!0,g(this,$i).style.zIndex=parseInt(g(this,$i).style.zIndex)-1e3)};class BY extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=sn.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const i=document.createElement("span");i.textContent=t,e.append(i)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var fT;class Oxe extends Vi{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});Y(this,fT,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:i,height:r}=this,s=this.svgFactory.create(i,r,!0),a=V(this,fT,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),a.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),a.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),a.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),a.setAttribute("stroke-width",t.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return g(this,fT)}addHighlightArea(){this.container.classList.add("highlightArea")}}fT=new WeakMap;var pT;class Bxe extends Vi{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});Y(this,pT,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:i,height:r}=this,s=this.svgFactory.create(i,r,!0),a=t.borderStyle.width,o=V(this,pT,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",i-a),o.setAttribute("height",r-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return g(this,pT)}addHighlightArea(){this.container.classList.add("highlightArea")}}pT=new WeakMap;var gT;class Vxe extends Vi{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});Y(this,gT,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:i,height:r}=this,s=this.svgFactory.create(i,r,!0),a=t.borderStyle.width,o=V(this,gT,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",i/2),o.setAttribute("cy",r/2),o.setAttribute("rx",i/2-a/2),o.setAttribute("ry",r/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return g(this,gT)}addHighlightArea(){this.container.classList.add("highlightArea")}}gT=new WeakMap;var mT;class VY extends Vi{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});Y(this,mT,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:i,borderStyle:r,popupRef:s},width:a,height:o}=this;if(!i)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let f=0,p=i.length;f<p;f+=2){const y=i[f]-t[0],x=t[3]-i[f+1];c.push(`${y},${x}`)}c=c.join(" ");const h=V(this,mT,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",c),h.setAttribute("stroke-width",r.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),l.append(h),this.container.append(l),!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return g(this,mT)}addHighlightArea(){this.container.classList.add("highlightArea")}}mT=new WeakMap;class Wxe extends VY{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Hxe extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}}var yT,lm,vT,_U;class D4 extends Vi{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});Y(this,vT);Y(this,yT,null);Y(this,lm,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?sn.HIGHLIGHT:sn.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:i,inkLists:r,borderStyle:s,popupRef:a}}=this,{transform:o,width:l,height:c}=Q(this,vT,_U).call(this,i,t),h=this.svgFactory.create(l,c,!0),f=V(this,yT,this.svgFactory.createElement("svg:g"));h.append(f),f.setAttribute("stroke-width",s.width||1),f.setAttribute("stroke-linecap","round"),f.setAttribute("stroke-linejoin","round"),f.setAttribute("stroke-miterlimit",10),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),f.setAttribute("transform",o);for(let p=0,y=r.length;p<y;p++){const x=this.svgFactory.createElement(this.svgElementName);g(this,lm).push(x),x.setAttribute("points",r[p].join(",")),f.append(x)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:i,points:r,rect:s}=t,a=g(this,yT);if(i>=0&&a.setAttribute("stroke-width",i||1),r)for(let o=0,l=g(this,lm).length;o<l;o++)g(this,lm)[o].setAttribute("points",r[o].join(","));if(s){const{transform:o,width:l,height:c}=Q(this,vT,_U).call(this,this.data.rotation,s);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${c}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return g(this,lm)}addHighlightArea(){this.container.classList.add("highlightArea")}}yT=new WeakMap,lm=new WeakMap,vT=new WeakSet,_U=function(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]}}};class WY extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=sn.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const i=document.createElement("mark");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}}class zxe extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}}class Gxe extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){const i=document.createElement("u");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}}class qxe extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){const i=document.createElement("s");i.classList.add("overlaidText"),i.textContent=e,this.container.append(i)}return this.container}}class HY extends Vi{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=sn.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var _T,xT,xU;class $xe extends Vi{constructor(t){var r;super(t,{isRenderable:!0});Y(this,xT);Y(this,_T,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,(r=this.linkService.eventBus)==null||r.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:i}=this;let r;i.hasAppearance||i.fillAlpha===0?r=document.createElement("div"):(r=document.createElement("img"),r.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(i.fillAlpha*100)}%);`)),r.addEventListener("dblclick",Q(this,xT,xU).bind(this)),V(this,_T,r);const{isMac:s}=Pr.platform;return t.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&Q(this,xT,xU).call(this)}),!i.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):r.classList.add("popupTriggerArea"),t.append(r),t}getElementsToTriggerPopup(){return g(this,_T)}addHighlightArea(){this.container.classList.add("highlightArea")}}_T=new WeakMap,xT=new WeakSet,xU=function(){var t;(t=this.downloadManager)==null||t.openOrDownloadData(this.content,this.filename)};var cm,um,Zv,Cf,bT,hm,ro,TT,Fh,dS,TU;const P5=class P5{constructor({div:e,accessibilityManager:t,annotationCanvasMap:i,annotationEditorUIManager:r,page:s,viewport:a,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:h}){Y(this,Fh);Y(this,cm,null);Y(this,um,null);Y(this,Zv,null);Y(this,Cf,new Map);Y(this,bT,null);Y(this,hm,null);Y(this,ro,[]);Y(this,TT,!1);this.div=e,V(this,cm,t),V(this,um,i),V(this,bT,o||null),V(this,hm,c||null),V(this,Zv,h||new E4),this.page=s,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=r,this._commentManager=l||null}hasEditableAnnotations(){return g(this,Cf).size>0}async render(e){var o;const{annotations:t}=e,i=this.div;Lm(i,this.viewport);const r=new Map,s=[],a={data:null,layer:i,linkService:g(this,hm),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new LD,annotationStorage:g(this,Zv),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const l of t){if(l.noHTML)continue;const c=l.annotationType===fr.POPUP;if(c){const p=r.get(l.id);if(!p)continue;if(!this._commentManager){s.push(l);continue}a.elements=p}else if(l.rect[2]===l.rect[0]||l.rect[3]===l.rect[1])continue;a.data=l;const h=e3.create(a);if(!h.isRenderable)continue;c||(g(this,ro).push(h),l.popupRef&&r.getOrInsertComputed(l.popupRef,hK).push(h));const f=h.render();l.hidden&&(f.style.visibility="hidden"),h._isEditable&&(g(this,Cf).set(h.data.id,h),(o=this._annotationEditorUIManager)==null||o.renderAnnotationElement(h))}await Q(this,Fh,dS).call(this);for(const l of s){const c=a.elements=r.get(l.id);a.data=l;const h=e3.create(a);if(!h.isRenderable)continue;const f=h.render();h.contentElement.id=`${Ey}${l.id}`,l.hidden&&(f.style.visibility="hidden"),c.at(-1).container.after(f)}Q(this,Fh,TU).call(this)}async addLinkAnnotations(e){const t={data:null,layer:this.div,linkService:g(this,hm),svgFactory:new LD,parent:this};for(const i of e){i.borderStyle||(i.borderStyle=P5._defaultBorderStyle),t.data=i;const r=e3.create(t);r.isRenderable&&(r.render(),r.contentElement.id=`${Ey}${i.id}`,g(this,ro).push(r))}await Q(this,Fh,dS).call(this)}update({viewport:e}){const t=this.div;this.viewport=e,Lm(t,{rotation:e.rotation}),Q(this,Fh,TU).call(this),t.hidden=!1}getEditableAnnotations(){return Array.from(g(this,Cf).values())}getEditableAnnotation(e){return g(this,Cf).get(e)}addFakeAnnotation(e){const{div:t}=this,{id:i,rotation:r}=e,s=new Rxe({data:{id:i,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:g(this,hm),annotationStorage:g(this,Zv)});return s.render(),s.contentElement.id=`${Ey}${i}`,s.createOrUpdatePopup(),g(this,ro).push(s),s}removeAnnotation(e){var r;const t=g(this,ro).findIndex(s=>s.data.id===e);if(t<0)return;const[i]=g(this,ro).splice(t,1);(r=g(this,cm))==null||r.removePointerInTextLayer(i.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(const t of e)t.updateFakeAnnotationElement(this);Q(this,Fh,dS).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return tn(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:ry.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};cm=new WeakMap,um=new WeakMap,Zv=new WeakMap,Cf=new WeakMap,bT=new WeakMap,hm=new WeakMap,ro=new WeakMap,TT=new WeakMap,Fh=new WeakSet,dS=async function(){var i,r,s;if(g(this,ro).length===0)return;this.div.replaceChildren();const e=[];if(!g(this,TT)){V(this,TT,!0);for(const{contentElement:a,data:{id:o}}of g(this,ro)){const l=a.id=`${Ey}${o}`;e.push((i=g(this,bT))==null?void 0:i.getAriaAttributes(l).then(c=>{if(c)for(const[h,f]of c)a.setAttribute(h,f)}))}}g(this,ro).sort(({data:{rect:[a,o,l,c]}},{data:{rect:[h,f,p,y]}})=>{if(a===l&&o===c)return 1;if(h===p&&f===y)return-1;const x=c,v=o,_=(o+c)/2,E=y,w=f,A=(f+y)/2;if(_>=E&&A<=v)return-1;if(A>=x&&_<=w)return 1;const N=(a+l)/2,k=(h+p)/2;return N-k});const t=document.createDocumentFragment();for(const a of g(this,ro))t.append(a.container),this._commentManager?(s=((r=a.extraPopupElement)==null?void 0:r.popup)||a.popup)==null||s.renderCommentButton():a.extraPopupElement&&t.append(a.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),g(this,cm))for(const a of g(this,ro))g(this,cm).addPointerInTextLayer(a.contentElement,!1)},TU=function(){var t;if(!g(this,um))return;const e=this.div;for(const[i,r]of g(this,um)){const s=e.querySelector(`[data-annotation-id="${i}"]`);if(!s)continue;r.className="annotationContent";const{firstChild:a}=s;a?a.nodeName==="CANVAS"?a.replaceWith(r):a.classList.contains("annotationContent")?a.after(r):a.before(r):s.append(r);const o=g(this,Cf).get(i);o&&(o._hasNoCanvas?((t=this._annotationEditorUIManager)==null||t.setMissingCanvas(i,s.id,r),o._hasNoCanvas=!1):o.canvas=r)}g(this,um).clear()};let bU=P5;const rA=/\r\n?|\n/g;var so,ET,dm,ao,Tr,zY,GY,qY,fS,Uh,pS,gS,$Y,wU,jY;const Di=class Di extends Ei{constructor(t){super({...t,name:"freeTextEditor"});Y(this,Tr);Y(this,so,"");Y(this,ET,`${this.id}-editor`);Y(this,dm,null);Y(this,ao);Ze(this,"_colorPicker",null);this.color=t.color||Di._defaultColor||Ei._defaultLineColor,V(this,ao,t.fontSize||Di._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){const t=Di.prototype,i=a=>a.isEmpty(),r=Om.TRANSLATE_SMALL,s=Om.TRANSLATE_BIG;return tn(this,"_keyboardManager",new JT([[["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:[-r,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[r,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:i}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,r],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:i}]]))}static initialize(t,i){Ei.initialize(t,i);const r=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(r.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,i){switch(t){case Dn.FREETEXT_SIZE:Di._defaultFontSize=i;break;case Dn.FREETEXT_COLOR:Di._defaultColor=i;break}}updateParams(t,i){switch(t){case Dn.FREETEXT_SIZE:Q(this,Tr,zY).call(this,i);break;case Dn.FREETEXT_COLOR:Q(this,Tr,GY).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[Dn.FREETEXT_SIZE,Di._defaultFontSize],[Dn.FREETEXT_COLOR,Di._defaultColor||Ei._defaultLineColor]]}get propertiesToUpdate(){return[[Dn.FREETEXT_SIZE,g(this,ao)],[Dn.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new PD(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Dn.FREETEXT_COLOR}onUpdatedColor(){var t;this.editorDiv.style.color=this.color,(t=this._colorPicker)==null||t.update(this.color),super.onUpdatedColor()}_translateEmpty(t,i){this._uiManager.translateSelectedEditors(t,i,!0)}getInitialTranslation(){const t=this.parentScale;return[-Di._internalPadding*t,-(Di._internalPadding+g(this,ao))*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"),V(this,dm,new AbortController);const t=this._uiManager.combinedSignal(g(this,dm));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(){var t;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",g(this,ET)),this._isDraggable=!0,(t=g(this,dm))==null||t.abort(),V(this,dm,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){var i;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),(i=this._initialOptions)!=null&&i.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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=g(this,so),i=V(this,so,Q(this,Tr,qY).call(this).trimEnd());if(t===i)return;const r=s=>{if(V(this,so,s),!s){this.remove();return}Q(this,Tr,gS).call(this),this._uiManager.rebuild(this),Q(this,Tr,fS).call(this)};this.addCommands({cmd:()=>{r(i)},undo:()=>{r(t)},mustExec:!1}),Q(this,Tr,fS).call(this)}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){Di._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",g(this,ET)),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:r}=this.editorDiv;if(r.fontSize=`calc(${g(this,ao)}px * var(--total-scale-factor))`,r.color=this.color,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[s,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[h,f]=this.pageDimensions,[p,y]=this.pageTranslation;let x,v;switch(this.rotation){case 0:x=t+(o[0]-p)/h,v=i+this.height-(o[1]-y)/f;break;case 90:x=t+(o[0]-p)/h,v=i-(o[1]-y)/f,[l,c]=[c,-l];break;case 180:x=t-this.width+(o[0]-p)/h,v=i-(o[1]-y)/f,[l,c]=[-l,-c];break;case 270:x=t+(o[0]-p-this.height*f)/h,v=i+(o[1]-y-this.width*h)/f,[l,c]=[-c,l];break}this.setAt(x*s,v*a,l,c)}else this._moveAfterPaste(t,i);Q(this,Tr,gS).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var x,v,_;const i=t.clipboardData||window.clipboardData,{types:r}=i;if(r.length===1&&r[0]==="text/plain")return;t.preventDefault();const s=Q(x=Di,Uh,wU).call(x,i.getData("text")||"").replaceAll(rA,`
`);if(!s)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!s.includes(`
`)){o.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,h=[],f=[];if(l.nodeType===Node.TEXT_NODE){const E=l.parentElement;if(f.push(l.nodeValue.slice(c).replaceAll(rA,"")),E!==this.editorDiv){let w=h;for(const A of this.editorDiv.childNodes){if(A===E){w=f;continue}w.push(Q(v=Di,Uh,pS).call(v,A))}}h.push(l.nodeValue.slice(0,c).replaceAll(rA,""))}else if(l===this.editorDiv){let E=h,w=0;for(const A of this.editorDiv.childNodes)w++===c&&(E=f),E.push(Q(_=Di,Uh,pS).call(_,A))}V(this,so,`${h.join(`
`)}${s}${f.join(`
`)}`),Q(this,Tr,gS).call(this);const p=new Range;let y=Math.sumPrecise(h.map(E=>E.length));for(const{firstChild:E}of this.editorDiv.childNodes)if(E.nodeType===Node.TEXT_NODE){const w=E.nodeValue.length;if(y<=w){p.setStart(E,y),p.setEnd(E,y);break}y-=w}a.removeAllRanges(),a.addRange(p)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=Di._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,i,r){var o;let s=null;if(t instanceof BY){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:h,rotation:f,id:p,popupRef:y,richText:x,contentsObj:v,creationDate:_,modificationDate:E},textContent:w,textPosition:A,parent:{page:{pageNumber:N}}}=t;if(!w||w.length===0)return null;s=t={annotationType:sn.FREETEXT,color:Array.from(c),fontSize:l,value:w.join(`
`),position:A,pageIndex:N-1,rect:h.slice(0),rotation:f,annotationElementId:p,id:p,deleted:!1,popupRef:y,comment:(v==null?void 0:v.str)||null,richText:x,creationDate:_,modificationDate:E}}const a=await super.deserialize(t,i,r);return V(a,ao,t.fontSize),a.color=St.makeHexColor(...t.color),V(a,so,Q(o=Di,Uh,wU).call(o,t.value)),a._initialData=s,t.comment&&a.setCommentData(t),a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Ei._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),r=Object.assign(super.serialize(t),{color:i,fontSize:g(this,ao),value:Q(this,Tr,$Y).call(this)});return this.addComment(r),t?(r.isCopy=!0,r):this.annotationElementId&&!Q(this,Tr,jY).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(t){const i=super.renderAnnotationElement(t);if(!i)return null;const{style:r}=i;r.fontSize=`calc(${g(this,ao)}px * var(--total-scale-factor))`,r.color=this.color,i.replaceChildren();for(const s of g(this,so).split(`
`)){const a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),i.append(a)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:g(this,so)}}),i}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};so=new WeakMap,ET=new WeakMap,dm=new WeakMap,ao=new WeakMap,Tr=new WeakSet,zY=function(t){const i=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--total-scale-factor))`,this.translate(0,-(s-g(this,ao))*this.parentScale),V(this,ao,s),Q(this,Tr,fS).call(this)},r=g(this,ao);this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Dn.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},GY=function(t){const i=s=>{this.color=s,this.onUpdatedColor()},r=this.color;this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Dn.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},qY=function(){var r;const t=[];this.editorDiv.normalize();let i=null;for(const s of this.editorDiv.childNodes)(i==null?void 0:i.nodeType)===Node.TEXT_NODE&&s.nodeName==="BR"||(t.push(Q(r=Di,Uh,pS).call(r,s)),i=s);return t.join(`
`)},fS=function(){const[t,i]=this.parentDimensions;let r;if(this.isAttachedToDOM)r=this.div.getBoundingClientRect();else{const{currentLayer:s,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),r=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=r.width/t,this.height=r.height/i):(this.width=r.height/t,this.height=r.width/i),this.fixAndSetPosition()},Uh=new WeakSet,pS=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(rA,"")},gS=function(){if(this.editorDiv.replaceChildren(),!!g(this,so))for(const t of g(this,so).split(`
`)){const i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(i)}},$Y=function(){return g(this,so).replaceAll(" "," ")},wU=function(t){return t.replaceAll(" "," ")},jY=function(t){const{value:i,fontSize:r,color:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==i||t.fontSize!==r||t.color.some((o,l)=>o!==s[l])||t.pageIndex!==a},Y(Di,Uh),Ze(Di,"_freeTextDefaultContent",""),Ze(Di,"_internalPadding",0),Ze(Di,"_defaultColor",null),Ze(Di,"_defaultFontSize",10),Ze(Di,"_type","freetext"),Ze(Di,"_editorType",sn.FREETEXT);let EU=Di;class Rt{toSVGPath(){Wn("Abstract method `toSVGPath` must be implemented.")}get box(){Wn("Abstract getter `box` must be implemented.")}serialize(e,t){Wn("Abstract method `serialize` must be implemented.")}static _rescale(e,t,i,r,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o]*r,a[o+1]=i+e[o+1]*s;return a}static _rescaleAndSwap(e,t,i,r,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o+1]*r,a[o+1]=i+e[o]*s;return a}static _translate(e,t,i,r){r||(r=new Float32Array(e.length));for(let s=0,a=e.length;s<a;s+=2)r[s]=t+e[s],r[s+1]=i+e[s+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,i,r,s){switch(s){case 90:return[1-t/i,e/r];case 180:return[1-e/i,1-t/r];case 270:return[t/i,1-e/r];default:return[e/i,t/r]}}static _normalizePagePoint(e,t,i){switch(i){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,i,r,s,a){return[(e+5*i)/6,(t+5*r)/6,(5*i+s)/6,(5*r+a)/6,(i+s)/2,(r+a)/2]}}Ze(Rt,"PRECISION",1e-4);var oo,zl,e1,t1,Kc,yn,fm,pm,wT,AT,n1,i1,If,ST,WC,HC,Fr,Wx,XY,KY,YY,JY,QY,ZY;const zu=class zu{constructor({x:e,y:t},i,r,s,a,o=0){Y(this,Fr);Y(this,oo);Y(this,zl,[]);Y(this,e1);Y(this,t1);Y(this,Kc,[]);Y(this,yn,new Float32Array(18));Y(this,fm);Y(this,pm);Y(this,wT);Y(this,AT);Y(this,n1);Y(this,i1);Y(this,If,[]);V(this,oo,i),V(this,i1,s*r),V(this,t1,a),g(this,yn).set([NaN,NaN,NaN,NaN,e,t],6),V(this,e1,o),V(this,AT,g(zu,ST)*r),V(this,wT,g(zu,HC)*r),V(this,n1,r),g(this,If).push(e,t)}isEmpty(){return isNaN(g(this,yn)[8])}add({x:e,y:t}){var R;V(this,fm,e),V(this,pm,t);const[i,r,s,a]=g(this,oo);let[o,l,c,h]=g(this,yn).subarray(8,12);const f=e-c,p=t-h,y=Math.hypot(f,p);if(y<g(this,wT))return!1;const x=y-g(this,AT),v=x/y,_=v*f,E=v*p;let w=o,A=l;o=c,l=h,c+=_,h+=E,(R=g(this,If))==null||R.push(e,t);const N=-E/x,k=_/x,F=N*g(this,i1),C=k*g(this,i1);return g(this,yn).set(g(this,yn).subarray(2,8),0),g(this,yn).set([c+F,h+C],4),g(this,yn).set(g(this,yn).subarray(14,18),12),g(this,yn).set([c-F,h-C],16),isNaN(g(this,yn)[6])?(g(this,Kc).length===0&&(g(this,yn).set([o+F,l+C],2),g(this,Kc).push(NaN,NaN,NaN,NaN,(o+F-i)/s,(l+C-r)/a),g(this,yn).set([o-F,l-C],14),g(this,zl).push(NaN,NaN,NaN,NaN,(o-F-i)/s,(l-C-r)/a)),g(this,yn).set([w,A,o,l,c,h],6),!this.isEmpty()):(g(this,yn).set([w,A,o,l,c,h],6),Math.abs(Math.atan2(A-l,w-o)-Math.atan2(E,_))<Math.PI/2?([o,l,c,h]=g(this,yn).subarray(2,6),g(this,Kc).push(NaN,NaN,NaN,NaN,((o+c)/2-i)/s,((l+h)/2-r)/a),[o,l,w,A]=g(this,yn).subarray(14,18),g(this,zl).push(NaN,NaN,NaN,NaN,((w+o)/2-i)/s,((A+l)/2-r)/a),!0):([w,A,o,l,c,h]=g(this,yn).subarray(0,6),g(this,Kc).push(((w+5*o)/6-i)/s,((A+5*l)/6-r)/a,((5*o+c)/6-i)/s,((5*l+h)/6-r)/a,((o+c)/2-i)/s,((l+h)/2-r)/a),[c,h,o,l,w,A]=g(this,yn).subarray(12,18),g(this,zl).push(((w+5*o)/6-i)/s,((A+5*l)/6-r)/a,((5*o+c)/6-i)/s,((5*l+h)/6-r)/a,((o+c)/2-i)/s,((l+h)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=g(this,Kc),t=g(this,zl);if(isNaN(g(this,yn)[6])&&!this.isEmpty())return Q(this,Fr,XY).call(this);const i=[];i.push(`M${e[4]} ${e[5]}`);for(let r=6;r<e.length;r+=6)isNaN(e[r])?i.push(`L${e[r+4]} ${e[r+5]}`):i.push(`C${e[r]} ${e[r+1]} ${e[r+2]} ${e[r+3]} ${e[r+4]} ${e[r+5]}`);Q(this,Fr,YY).call(this,i);for(let r=t.length-6;r>=6;r-=6)isNaN(t[r])?i.push(`L${t[r+4]} ${t[r+5]}`):i.push(`C${t[r]} ${t[r+1]} ${t[r+2]} ${t[r+3]} ${t[r+4]} ${t[r+5]}`);return Q(this,Fr,KY).call(this,i),i.join(" ")}newFreeDrawOutline(e,t,i,r,s,a){return new eJ(e,t,i,r,s,a)}getOutlines(){var f;const e=g(this,Kc),t=g(this,zl),i=g(this,yn),[r,s,a,o]=g(this,oo),l=new Float32Array((((f=g(this,If))==null?void 0:f.length)??0)+2);for(let p=0,y=l.length-2;p<y;p+=2)l[p]=(g(this,If)[p]-r)/a,l[p+1]=(g(this,If)[p+1]-s)/o;if(l[l.length-2]=(g(this,fm)-r)/a,l[l.length-1]=(g(this,pm)-s)/o,isNaN(i[6])&&!this.isEmpty())return Q(this,Fr,JY).call(this,l);const c=new Float32Array(g(this,Kc).length+24+g(this,zl).length);let h=e.length;for(let p=0;p<h;p+=2){if(isNaN(e[p])){c[p]=c[p+1]=NaN;continue}c[p]=e[p],c[p+1]=e[p+1]}h=Q(this,Fr,ZY).call(this,c,h);for(let p=t.length-6;p>=6;p-=6)for(let y=0;y<6;y+=2){if(isNaN(t[p+y])){c[h]=c[h+1]=NaN,h+=2;continue}c[h]=t[p+y],c[h+1]=t[p+y+1],h+=2}return Q(this,Fr,QY).call(this,c,h),this.newFreeDrawOutline(c,l,g(this,oo),g(this,n1),g(this,e1),g(this,t1))}};oo=new WeakMap,zl=new WeakMap,e1=new WeakMap,t1=new WeakMap,Kc=new WeakMap,yn=new WeakMap,fm=new WeakMap,pm=new WeakMap,wT=new WeakMap,AT=new WeakMap,n1=new WeakMap,i1=new WeakMap,If=new WeakMap,ST=new WeakMap,WC=new WeakMap,HC=new WeakMap,Fr=new WeakSet,Wx=function(){const e=g(this,yn).subarray(4,6),t=g(this,yn).subarray(16,18),[i,r,s,a]=g(this,oo);return[(g(this,fm)+(e[0]-t[0])/2-i)/s,(g(this,pm)+(e[1]-t[1])/2-r)/a,(g(this,fm)+(t[0]-e[0])/2-i)/s,(g(this,pm)+(t[1]-e[1])/2-r)/a]},XY=function(){const[e,t,i,r]=g(this,oo),[s,a,o,l]=Q(this,Fr,Wx).call(this);return`M${(g(this,yn)[2]-e)/i} ${(g(this,yn)[3]-t)/r} L${(g(this,yn)[4]-e)/i} ${(g(this,yn)[5]-t)/r} L${s} ${a} L${o} ${l} L${(g(this,yn)[16]-e)/i} ${(g(this,yn)[17]-t)/r} L${(g(this,yn)[14]-e)/i} ${(g(this,yn)[15]-t)/r} Z`},KY=function(e){const t=g(this,zl);e.push(`L${t[4]} ${t[5]} Z`)},YY=function(e){const[t,i,r,s]=g(this,oo),a=g(this,yn).subarray(4,6),o=g(this,yn).subarray(16,18),[l,c,h,f]=Q(this,Fr,Wx).call(this);e.push(`L${(a[0]-t)/r} ${(a[1]-i)/s} L${l} ${c} L${h} ${f} L${(o[0]-t)/r} ${(o[1]-i)/s}`)},JY=function(e){const t=g(this,yn),[i,r,s,a]=g(this,oo),[o,l,c,h]=Q(this,Fr,Wx).call(this),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(t[2]-i)/s,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-i)/s,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(t[16]-i)/s,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-i)/s,(t[15]-r)/a],0),this.newFreeDrawOutline(f,e,g(this,oo),g(this,n1),g(this,e1),g(this,t1))},QY=function(e,t){const i=g(this,zl);return e.set([NaN,NaN,NaN,NaN,i[4],i[5]],t),t+=6},ZY=function(e,t){const i=g(this,yn).subarray(4,6),r=g(this,yn).subarray(16,18),[s,a,o,l]=g(this,oo),[c,h,f,p]=Q(this,Fr,Wx).call(this);return e.set([NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,f,p,NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/l],t),t+=24},Y(zu,ST,8),Y(zu,WC,2),Y(zu,HC,g(zu,ST)+g(zu,WC));let OD=zu;var r1,gm,yh,DT,lo,CT,ir,zC,tJ;class eJ extends Rt{constructor(t,i,r,s,a,o){super();Y(this,zC);Y(this,r1);Y(this,gm,new Float32Array(4));Y(this,yh);Y(this,DT);Y(this,lo);Y(this,CT);Y(this,ir);V(this,ir,t),V(this,lo,i),V(this,r1,r),V(this,CT,s),V(this,yh,a),V(this,DT,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],Q(this,zC,tJ).call(this,o);const[l,c,h,f]=g(this,gm);for(let p=0,y=t.length;p<y;p+=2)t[p]=(t[p]-l)/h,t[p+1]=(t[p+1]-c)/f;for(let p=0,y=i.length;p<y;p+=2)i[p]=(i[p]-l)/h,i[p+1]=(i[p+1]-c)/f}toSVGPath(){const t=[`M${g(this,ir)[4]} ${g(this,ir)[5]}`];for(let i=6,r=g(this,ir).length;i<r;i+=6){if(isNaN(g(this,ir)[i])){t.push(`L${g(this,ir)[i+4]} ${g(this,ir)[i+5]}`);continue}t.push(`C${g(this,ir)[i]} ${g(this,ir)[i+1]} ${g(this,ir)[i+2]} ${g(this,ir)[i+3]} ${g(this,ir)[i+4]} ${g(this,ir)[i+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,i,r,s],a){const o=r-t,l=s-i;let c,h;switch(a){case 0:c=Rt._rescale(g(this,ir),t,s,o,-l),h=Rt._rescale(g(this,lo),t,s,o,-l);break;case 90:c=Rt._rescaleAndSwap(g(this,ir),t,i,o,l),h=Rt._rescaleAndSwap(g(this,lo),t,i,o,l);break;case 180:c=Rt._rescale(g(this,ir),r,i,-o,l),h=Rt._rescale(g(this,lo),r,i,-o,l);break;case 270:c=Rt._rescaleAndSwap(g(this,ir),r,s,-o,-l),h=Rt._rescaleAndSwap(g(this,lo),r,s,-o,-l);break}return{outline:Array.from(c),points:[Array.from(h)]}}get box(){return g(this,gm)}newOutliner(t,i,r,s,a,o=0){return new OD(t,i,r,s,a,o)}getNewOutline(t,i){const[r,s,a,o]=g(this,gm),[l,c,h,f]=g(this,r1),p=a*h,y=o*f,x=r*h+l,v=s*f+c,_=this.newOutliner({x:g(this,lo)[0]*p+x,y:g(this,lo)[1]*y+v},g(this,r1),g(this,CT),t,g(this,DT),i??g(this,yh));for(let E=2;E<g(this,lo).length;E+=2)_.add({x:g(this,lo)[E]*p+x,y:g(this,lo)[E+1]*y+v});return _.getOutlines()}}r1=new WeakMap,gm=new WeakMap,yh=new WeakMap,DT=new WeakMap,lo=new WeakMap,CT=new WeakMap,ir=new WeakMap,zC=new WeakSet,tJ=function(t){const i=g(this,ir);let r=i[4],s=i[5];const a=[r,s,r,s];let o=r,l=s,c=r,h=s;const f=t?Math.max:Math.min,p=new Float32Array(4);for(let x=6,v=i.length;x<v;x+=6){const _=i[x+4],E=i[x+5];isNaN(i[x])?(St.pointBoundingBox(_,E,a),l>E?(o=_,l=E):l===E&&(o=f(o,_)),h<E?(c=_,h=E):h===E&&(c=f(c,_))):(p[0]=p[1]=1/0,p[2]=p[3]=-1/0,St.bezierBoundingBox(r,s,...i.slice(x,x+6),p),St.rectBoundingBox(p[0],p[1],p[2],p[3],a),l>p[1]?(o=p[0],l=p[1]):l===p[1]&&(o=f(o,p[0])),h<p[3]?(c=p[2],h=p[3]):h===p[3]&&(c=f(c,p[2]))),r=_,s=E}const y=g(this,gm);y[0]=a[0]-g(this,yh),y[1]=a[1]-g(this,yh),y[2]=a[2]-a[0]+2*g(this,yh),y[3]=a[3]-a[1]+2*g(this,yh),this.firstPoint=[o,l],this.lastPoint=[c,h]};var IT,RT,NT,Rf,Gl,da,nJ,mS,iJ,rJ,SU;class AU{constructor(e,t=0,i=0,r=!0){Y(this,da);Y(this,IT);Y(this,RT);Y(this,NT);Y(this,Rf,[]);Y(this,Gl,[]);const s=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:v,y:_,width:E,height:w}of e){const A=Math.floor((v-t)/a)*a,N=Math.ceil((v+E+t)/a)*a,k=Math.floor((_-t)/a)*a,F=Math.ceil((_+w+t)/a)*a,C=[A,k,F,!0],M=[N,k,F,!1];g(this,Rf).push(C,M),St.rectBoundingBox(A,k,N,F,s)}const o=s[2]-s[0]+2*i,l=s[3]-s[1]+2*i,c=s[0]-i,h=s[1]-i;let f=r?-1/0:1/0,p=1/0;const y=g(this,Rf).at(r?-1:-2),x=[y[0],y[2]];for(const v of g(this,Rf)){const[_,E,w,A]=v;!A&&r?E<p?(p=E,f=_):E===p&&(f=Math.max(f,_)):A&&!r&&(E<p?(p=E,f=_):E===p&&(f=Math.min(f,_))),v[0]=(_-c)/o,v[1]=(E-h)/l,v[2]=(w-h)/l}V(this,IT,new Float32Array([c,h,o,l])),V(this,RT,[f,p]),V(this,NT,x)}getOutlines(){g(this,Rf).sort((t,i)=>t[0]-i[0]||t[1]-i[1]||t[2]-i[2]);const e=[];for(const t of g(this,Rf))t[3]?(e.push(...Q(this,da,SU).call(this,t)),Q(this,da,iJ).call(this,t)):(Q(this,da,rJ).call(this,t),e.push(...Q(this,da,SU).call(this,t)));return Q(this,da,nJ).call(this,e)}}IT=new WeakMap,RT=new WeakMap,NT=new WeakMap,Rf=new WeakMap,Gl=new WeakMap,da=new WeakSet,nJ=function(e){const t=[],i=new Set;for(const a of e){const[o,l,c]=a;t.push([o,l,a],[o,c,a])}t.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=t.length;a<o;a+=2){const l=t[a][2],c=t[a+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const r=[];let s;for(;i.size>0;){const a=i.values().next().value;let[o,l,c,h,f]=a;i.delete(a);let p=o,y=l;for(s=[o,c],r.push(s);;){let x;if(i.has(h))x=h;else if(i.has(f))x=f;else break;i.delete(x),[o,l,c,h,f]=x,p!==o&&(s.push(p,y,o,y===l?l:c),p=o),y=y===l?c:l}s.push(p,y)}return new jxe(r,g(this,IT),g(this,RT),g(this,NT))},mS=function(e){const t=g(this,Gl);let i=0,r=t.length-1;for(;i<=r;){const s=i+r>>1,a=t[s][0];if(a===e)return s;a<e?i=s+1:r=s-1}return r+1},iJ=function([,e,t]){const i=Q(this,da,mS).call(this,e);g(this,Gl).splice(i,0,[e,t])},rJ=function([,e,t]){const i=Q(this,da,mS).call(this,e);for(let r=i;r<g(this,Gl).length;r++){const[s,a]=g(this,Gl)[r];if(s!==e)break;if(s===e&&a===t){g(this,Gl).splice(r,1);return}}for(let r=i-1;r>=0;r--){const[s,a]=g(this,Gl)[r];if(s!==e)break;if(s===e&&a===t){g(this,Gl).splice(r,1);return}}},SU=function(e){const[t,i,r]=e,s=[[t,i,r]],a=Q(this,da,mS).call(this,r);for(let o=0;o<a;o++){const[l,c]=g(this,Gl)[o];for(let h=0,f=s.length;h<f;h++){const[,p,y]=s[h];if(!(c<=p||y<=l)){if(p>=l){if(y>c)s[h][1]=c;else{if(f===1)return[];s.splice(h,1),h--,f--}continue}s[h][2]=l,y>c&&s.push([t,c,y])}}}return s};var kT,s1;class jxe extends Rt{constructor(t,i,r,s){super();Y(this,kT);Y(this,s1);V(this,s1,t),V(this,kT,i),this.firstPoint=r,this.lastPoint=s}toSVGPath(){const t=[];for(const i of g(this,s1)){let[r,s]=i;t.push(`M${r} ${s}`);for(let a=2;a<i.length;a+=2){const o=i[a],l=i[a+1];o===r?(t.push(`V${l}`),s=l):l===s&&(t.push(`H${o}`),r=o)}t.push("Z")}return t.join(" ")}serialize([t,i,r,s],a){const o=[],l=r-t,c=s-i;for(const h of g(this,s1)){const f=new Array(h.length);for(let p=0;p<h.length;p+=2)f[p]=t+h[p]*l,f[p+1]=s-h[p+1]*c;o.push(f)}return o}get box(){return g(this,kT)}get classNamesForOutlining(){return["highlightOutline"]}}kT=new WeakMap,s1=new WeakMap;class DU extends OD{newFreeDrawOutline(e,t,i,r,s,a){return new Xxe(e,t,i,r,s,a)}}class Xxe extends eJ{newOutliner(e,t,i,r,s,a=0){return new DU(e,t,i,r,s,a)}}var a1,MT,vh,mm,FT,Ra,UT,PT,ym,co,uo,vs,o1,l1,Ws,c1,il,LT,dn,CU,yS,sJ,aJ,oJ,IU,og,ol,uy,lJ,vS,_S,cJ,uJ,hJ,dJ,fJ;const Bn=class Bn extends Ei{constructor(t){super({...t,name:"highlightEditor"});Y(this,dn);Y(this,a1,null);Y(this,MT,0);Y(this,vh);Y(this,mm,null);Y(this,FT,null);Y(this,Ra,null);Y(this,UT,null);Y(this,PT,0);Y(this,ym,null);Y(this,co,null);Y(this,uo,null);Y(this,vs,!1);Y(this,o1,null);Y(this,l1,null);Y(this,Ws,null);Y(this,c1,"");Y(this,il);Y(this,LT,"");this.color=t.color||Bn._defaultColor,V(this,il,t.thickness||Bn._defaultThickness),this.opacity=t.opacity||Bn._defaultOpacity,V(this,vh,t.boxes||null),V(this,LT,t.methodOfCreation||""),V(this,c1,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(V(this,vs,!0),Q(this,dn,yS).call(this,t),Q(this,dn,og).call(this)):g(this,vh)&&(V(this,a1,t.anchorNode),V(this,MT,t.anchorOffset),V(this,UT,t.focusNode),V(this,PT,t.focusOffset),Q(this,dn,CU).call(this),Q(this,dn,og).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const t=Bn.prototype;return tn(this,"_keyboardManager",new JT([[["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]}]]))}get telemetryInitialData(){return{action:"added",type:g(this,vs)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:g(this,il),methodOfCreation:g(this,LT)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,i){var r;Ei.initialize(t,i),Bn._defaultColor||(Bn._defaultColor=((r=i.highlightColors)==null?void 0:r.values().next().value)||"#fff066")}static updateDefaultParams(t,i){switch(t){case Dn.HIGHLIGHT_COLOR:Bn._defaultColor=i;break;case Dn.HIGHLIGHT_THICKNESS:Bn._defaultThickness=i;break}}translateInPage(t,i){}get toolbarPosition(){return g(this,l1)}get commentButtonPosition(){return g(this,o1)}updateParams(t,i){switch(t){case Dn.HIGHLIGHT_COLOR:Q(this,dn,sJ).call(this,i);break;case Dn.HIGHLIGHT_THICKNESS:Q(this,dn,aJ).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[Dn.HIGHLIGHT_COLOR,Bn._defaultColor],[Dn.HIGHLIGHT_THICKNESS,Bn._defaultThickness]]}get propertiesToUpdate(){return[[Dn.HIGHLIGHT_COLOR,this.color||Bn._defaultColor],[Dn.HIGHLIGHT_THICKNESS,g(this,il)||Bn._defaultThickness],[Dn.HIGHLIGHT_FREE,g(this,vs)]]}onUpdatedColor(){var t,i;(t=this.parent)==null||t.drawLayer.updateProperties(g(this,uo),{root:{fill:this.color,"fill-opacity":this.opacity}}),(i=g(this,FT))==null||i.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",V(this,FT,new UD({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(Q(this,dn,_S).call(this))}getBaseTranslation(){return[0,0]}getRect(t,i){return super.getRect(t,i,Q(this,dn,_S).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){Q(this,dn,IU).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(Q(this,dn,og).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var r;let i=!1;this.parent&&!t?Q(this,dn,IU).call(this):t&&(Q(this,dn,og).call(this,t),i=!this.parent&&((r=this.div)==null?void 0:r.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),i&&this.select()}rotate(t){var s,a,o;const{drawLayer:i}=this.parent;let r;g(this,vs)?(t=(t-this.rotation+360)%360,r=Q(s=Bn,ol,uy).call(s,g(this,co).box,t)):r=Q(a=Bn,ol,uy).call(a,[this.x,this.y,this.width,this.height],t),i.updateProperties(g(this,uo),{bbox:r,root:{"data-main-rotation":t}}),i.updateProperties(g(this,Ws),{bbox:Q(o=Bn,ol,uy).call(o,g(this,Ra).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();g(this,c1)&&(t.setAttribute("aria-label",g(this,c1)),t.setAttribute("role","mark")),g(this,vs)?t.classList.add("free"):this.div.addEventListener("keydown",Q(this,dn,lJ).bind(this),{signal:this._uiManager._signal});const i=V(this,ym,document.createElement("div"));return t.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=g(this,mm),this.setDims(),bK(this,g(this,ym),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(g(this,Ws),{rootClass:{hovered:!0}})}pointerleave(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(g(this,Ws),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:Q(this,dn,vS).call(this,!0);break;case 1:case 3:Q(this,dn,vS).call(this,!1);break}}select(){var t;super.select(),g(this,Ws)&&((t=this.parent)==null||t.drawLayer.updateProperties(g(this,Ws),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),g(this,Ws)&&((t=this.parent)==null||t.drawLayer.updateProperties(g(this,Ws),{rootClass:{selected:!1}}),g(this,vs)||Q(this,dn,vS).call(this,!1))}get _mustFixPosition(){return!g(this,vs)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(g(this,uo),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(g(this,Ws),{rootClass:{hidden:!t}}))}static startHighlighting(t,i,{target:r,x:s,y:a}){const{x:o,y:l,width:c,height:h}=r.getBoundingClientRect(),f=new AbortController,p=t.combinedSignal(f),y=x=>{f.abort(),Q(this,ol,dJ).call(this,t,x)};window.addEventListener("blur",y,{signal:p}),window.addEventListener("pointerup",y,{signal:p}),window.addEventListener("pointerdown",Yi,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",gl,{signal:p}),r.addEventListener("pointermove",Q(this,ol,hJ).bind(this,t),{signal:p}),this._freeHighlight=new DU({x:s,y:a},[o,l,c,h],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 async deserialize(t,i,r){var v,_,E,w;let s=null;if(t instanceof WY){const{data:{quadPoints:A,rect:N,rotation:k,id:F,color:C,opacity:M,popupRef:R,richText:L,contentsObj:H,creationDate:P,modificationDate:O},parent:{page:{pageNumber:B}}}=t;s=t={annotationType:sn.HIGHLIGHT,color:Array.from(C),opacity:M,quadPoints:A,boxes:null,pageIndex:B-1,rect:N.slice(0),rotation:k,annotationElementId:F,id:F,deleted:!1,popupRef:R,richText:L,comment:(H==null?void 0:H.str)||null,creationDate:P,modificationDate:O}}else if(t instanceof D4){const{data:{inkLists:A,rect:N,rotation:k,id:F,color:C,borderStyle:{rawWidth:M},popupRef:R,richText:L,contentsObj:H,creationDate:P,modificationDate:O},parent:{page:{pageNumber:B}}}=t;s=t={annotationType:sn.HIGHLIGHT,color:Array.from(C),thickness:M,inkLists:A,boxes:null,pageIndex:B-1,rect:N.slice(0),rotation:k,annotationElementId:F,id:F,deleted:!1,popupRef:R,richText:L,comment:(H==null?void 0:H.str)||null,creationDate:P,modificationDate:O}}const{color:a,quadPoints:o,inkLists:l,opacity:c}=t,h=await super.deserialize(t,i,r);h.color=St.makeHexColor(...a),h.opacity=c||1,l&&V(h,il,t.thickness),h._initialData=s,t.comment&&h.setCommentData(t);const[f,p]=h.pageDimensions,[y,x]=h.pageTranslation;if(o){const A=V(h,vh,[]);for(let N=0;N<o.length;N+=8)A.push({x:(o[N]-y)/f,y:1-(o[N+1]-x)/p,width:(o[N+2]-o[N])/f,height:(o[N+1]-o[N+5])/p});Q(v=h,dn,CU).call(v),Q(_=h,dn,og).call(_),h.rotate(h.rotation)}else if(l){V(h,vs,!0);const A=l[0],N={x:A[0]-y,y:p-(A[1]-x)},k=new DU(N,[0,0,f,p],1,g(h,il)/2,!0,.001);for(let M=0,R=A.length;M<R;M+=2)N.x=A[M]-y,N.y=p-(A[M+1]-x),k.add(N);const{id:F,clipPathId:C}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:h.color,"fill-opacity":h._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:k.toSVGPath()}},!0,!0);Q(E=h,dn,yS).call(E,{highlightOutlines:k.getOutlines(),highlightId:F,clipPathId:C}),Q(w=h,dn,og).call(w),h.rotate(h.parentRotation)}return h}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const i=Ei._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),r=super.serialize(t);return Object.assign(r,{color:i,opacity:this.opacity,thickness:g(this,il),quadPoints:Q(this,dn,cJ).call(this),outlines:Q(this,dn,uJ).call(this,r.rect)}),this.addComment(r),this.annotationElementId&&!Q(this,dn,fJ).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};a1=new WeakMap,MT=new WeakMap,vh=new WeakMap,mm=new WeakMap,FT=new WeakMap,Ra=new WeakMap,UT=new WeakMap,PT=new WeakMap,ym=new WeakMap,co=new WeakMap,uo=new WeakMap,vs=new WeakMap,o1=new WeakMap,l1=new WeakMap,Ws=new WeakMap,c1=new WeakMap,il=new WeakMap,LT=new WeakMap,dn=new WeakSet,CU=function(){const t=new AU(g(this,vh),.001);V(this,co,t.getOutlines()),[this.x,this.y,this.width,this.height]=g(this,co).box;const i=new AU(g(this,vh),.0025,.001,this._uiManager.direction==="ltr");V(this,Ra,i.getOutlines());const{firstPoint:r}=g(this,co);V(this,o1,[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]);const{lastPoint:s}=g(this,Ra);V(this,l1,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},yS=function({highlightOutlines:t,highlightId:i,clipPathId:r}){var p,y;if(V(this,co,t),V(this,Ra,t.getNewOutline(g(this,il)/2+1.5,.0025)),i>=0)V(this,uo,i),V(this,mm,r),this.parent.drawLayer.finalizeDraw(i,{bbox:t.box,path:{d:t.toSVGPath()}}),V(this,Ws,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:g(this,Ra).box,path:{d:g(this,Ra).toSVGPath()}},!0));else if(this.parent){const x=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(g(this,uo),{bbox:Q(p=Bn,ol,uy).call(p,g(this,co).box,(x-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(g(this,Ws),{bbox:Q(y=Bn,ol,uy).call(y,g(this,Ra).box,x),path:{d:g(this,Ra).toSVGPath()}})}const[a,o,l,c]=t.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[x,v]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*v/x,this.height=c*x/v;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[x,v]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*v/x,this.height=c*x/v;break}}const{firstPoint:h}=t;V(this,o1,[(h[0]-a)/l,(h[1]-o)/c]);const{lastPoint:f}=g(this,Ra);V(this,l1,[(f[0]-a)/l,(f[1]-o)/c])},sJ=function(t){const i=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},r=this.color,s=this.opacity;this.addCommands({cmd:i.bind(this,t,Bn._defaultOpacity),undo:i.bind(this,r,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Dn.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},aJ=function(t){const i=g(this,il),r=s=>{V(this,il,s),Q(this,dn,oJ).call(this,s)};this.addCommands({cmd:r.bind(this,t),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Dn.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},oJ=function(t){g(this,vs)&&(Q(this,dn,yS).call(this,{highlightOutlines:g(this,co).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())},IU=function(){g(this,uo)===null||!this.parent||(this.parent.drawLayer.remove(g(this,uo)),V(this,uo,null),this.parent.drawLayer.remove(g(this,Ws)),V(this,Ws,null))},og=function(t=this.parent){g(this,uo)===null&&({id:Dr(this,uo)._,clipPathId:Dr(this,mm)._}=t.drawLayer.draw({bbox:g(this,co).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:g(this,vs)},path:{d:g(this,co).toSVGPath()}},!1,!0),V(this,Ws,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:g(this,vs)},bbox:g(this,Ra).box,path:{d:g(this,Ra).toSVGPath()}},g(this,vs))),g(this,ym)&&(g(this,ym).style.clipPath=g(this,mm)))},ol=new WeakSet,uy=function([t,i,r,s],a){switch(a){case 90:return[1-i-s,t,s,r];case 180:return[1-t-r,1-i-s,r,s];case 270:return[i,1-t-r,s,r]}return[t,i,r,s]},lJ=function(t){Bn._keyboardManager.exec(this,t)},vS=function(t){if(!g(this,a1))return;const i=window.getSelection();t?i.setPosition(g(this,a1),g(this,MT)):i.setPosition(g(this,UT),g(this,PT))},_S=function(){return g(this,vs)?this.rotation:0},cJ=function(){if(g(this,vs))return null;const[t,i]=this.pageDimensions,[r,s]=this.pageTranslation,a=g(this,vh),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:h,width:f,height:p}of a){const y=c*t+r,x=(1-h)*i+s;o[l]=o[l+4]=y,o[l+1]=o[l+3]=x,o[l+2]=o[l+6]=y+f*t,o[l+5]=o[l+7]=x-p*i,l+=8}return o},uJ=function(t){return g(this,co).serialize(t,Q(this,dn,_S).call(this))},hJ=function(t,i){this._freeHighlight.add(i)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},dJ=function(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=""},fJ=function(t){const{color:i}=this._initialData;return this.hasEditedComment||t.color.some((r,s)=>r!==i[s])},Y(Bn,ol),Ze(Bn,"_defaultColor",null),Ze(Bn,"_defaultOpacity",1),Ze(Bn,"_defaultThickness",12),Ze(Bn,"_type","highlight"),Ze(Bn,"_editorType",sn.HIGHLIGHT),Ze(Bn,"_freeHighlightId",-1),Ze(Bn,"_freeHighlight",null),Ze(Bn,"_freeHighlightClipId","");let BD=Bn;var vm;class pJ{constructor(){Y(this,vm,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,i]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,i)}updateSVGProperty(e,t){g(this,vm)[e]=t}toSVGProperties(){const e=g(this,vm);return V(this,vm,Object.create(null)),{root:e}}reset(){V(this,vm,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Wn("Not implemented")}}vm=new WeakMap;var ho,u1,qr,_m,xm,In,RU,NU,kU,Hx,gJ,xS,zx,hy;const Tn=class Tn extends Ei{constructor(t){super(t);Y(this,In);Y(this,ho,null);Y(this,u1);Ze(this,"_colorPicker",null);Ze(this,"_drawId",null);V(this,u1,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){var t;(t=this._colorPicker)==null||t.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(Q(this,In,RU).call(this,t),Q(this,In,Hx).call(this))}static _mergeSVGProperties(t,i){const r=new Set(Object.keys(t));for(const[s,a]of Object.entries(i))r.has(s)?Object.assign(t[s],a):t[s]=a;return t}static getDefaultDrawingOptions(t){Wn("Not implemented")}static get typesMap(){Wn("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,i){const r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,i),this._currentParent&&(g(Tn,qr).updateProperty(r,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,i){const r=this.constructor.typesMap.get(t);r&&this._updateProperty(t,r,i)}static get defaultPropertiesToUpdate(){const t=[],i=this._defaultDrawingOptions;for(const[r,s]of this.typesMap)t.push([r,i[s]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:i}=this;for(const[r,s]of this.constructor.typesMap)t.push([r,i[s]]);return t}_updateProperty(t,i,r){const s=this._drawingOptions,a=s[i],o=l=>{var h;s.updateProperty(i,l);const c=g(this,ho).updateProperty(i,l);c&&Q(this,In,zx).call(this,c),(h=this.parent)==null||h.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:o.bind(this,r),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tn._mergeSVGProperties(g(this,ho).getPathResizingSVGProperties(Q(this,In,xS).call(this)),{bbox:Q(this,In,hy).call(this)}))}_onResized(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tn._mergeSVGProperties(g(this,ho).getPathResizedSVGProperties(Q(this,In,xS).call(this)),{bbox:Q(this,In,hy).call(this)}))}_onTranslating(t,i){var r;(r=this.parent)==null||r.drawLayer.updateProperties(this._drawId,{bbox:Q(this,In,hy).call(this)})}_onTranslated(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tn._mergeSVGProperties(g(this,ho).getPathTranslatedSVGProperties(Q(this,In,xS).call(this),this.parentDimensions),{bbox:Q(this,In,hy).call(this)}))}_onStartDragging(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var t;(t=this.parent)==null||t.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,g(this,u1)&&(V(this,u1,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){Q(this,In,kU).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(Q(this,In,Hx).call(this),Q(this,In,zx).call(this,g(this,ho).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var r;let i=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),Q(this,In,kU).call(this)):t&&(this._uiManager.addShouldRescale(this),Q(this,In,Hx).call(this,t),i=!this.parent&&((r=this.div)==null?void 0:r.classList.contains("selectedEditor"))),super.setParent(t),i&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Tn._mergeSVGProperties({bbox:Q(this,In,hy).call(this)},g(this,ho).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&Q(this,In,zx).call(this,g(this,ho).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 r=super.render();r.classList.add("draw");const s=document.createElement("div");return r.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,i),r}static createDrawerInstance(t,i,r,s,a){Wn("Not implemented")}static startDrawing(t,i,r,s){var _;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=s;if(Ps.isInitializedAndDifferentPointerType(h))return;const{viewport:{rotation:f}}=t,{width:p,height:y}=a.getBoundingClientRect(),x=V(Tn,_m,new AbortController),v=t.combinedSignal(x);if(Ps.setPointer(h,c),window.addEventListener("pointerup",E=>{Ps.isSamePointerIdOrRemove(E.pointerId)&&this._endDraw(E)},{signal:v}),window.addEventListener("pointercancel",E=>{Ps.isSamePointerIdOrRemove(E.pointerId)&&this._currentParent.endDrawingSession()},{signal:v}),window.addEventListener("pointerdown",E=>{Ps.isSamePointerType(E.pointerType)&&(Ps.initializeAndAddPointerId(E.pointerId),g(Tn,qr).isCancellable()&&(g(Tn,qr).removeLastElement(),g(Tn,qr).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",gl,{signal:v}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),a.addEventListener("touchmove",E=>{Ps.isSameTimeStamp(E.timeStamp)&&Yi(E)},{signal:v}),t.toggleDrawing(),(_=i._editorUndoBar)==null||_.hide(),g(Tn,qr)){t.drawLayer.updateProperties(this._currentDrawId,g(Tn,qr).startNew(o,l,p,y,f));return}i.updateUIForDefaultProperties(this),V(Tn,qr,this.createDrawerInstance(o,l,p,y,f)),V(Tn,xm,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(g(Tn,xm).toSVGProperties(),g(Tn,qr).defaultSVGProperties),!0,!1)}static _drawMove(t){if(Ps.isSameTimeStamp(t.timeStamp),!g(Tn,qr))return;const{offsetX:i,offsetY:r,pointerId:s}=t;if(Ps.isSamePointerId(s)){if(Ps.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,g(Tn,qr).add(i,r)),Ps.setTimeStamp(t.timeStamp),Yi(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,V(Tn,qr,null),V(Tn,xm,null),Ps.clearTimeStamp()),g(Tn,_m)&&(g(Tn,_m).abort(),V(Tn,_m,null),Ps.clearPointerIds())}static _endDraw(t){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),(t==null?void 0:t.target)===i.div&&i.drawLayer.updateProperties(this._currentDrawId,g(Tn,qr).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const r=g(Tn,qr),s=this._currentDrawId,a=r.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(s,r.setLastElement(a))},undo:()=>{i.drawLayer.updateProperties(s,r.removeLastElement())},mustExec:!1,type:Dn.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(Dn.DRAW_STEP),!g(Tn,qr).isEmpty()){const{pageDimensions:[r,s],scale:a}=i,o=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:g(Tn,qr).getOutlines(r*a,s*a,a,this._INNER_MARGIN),drawingOptions:g(Tn,xm),mustBeCommitted:!t});return this._cleanup(!0),o}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,i,r,s,a,o){Wn("Not implemented")}static async deserialize(t,i,r){var f,p;const{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}=i.viewport,c=this.deserializeDraw(o,l,s,a,this._INNER_MARGIN,t),h=await super.deserialize(t,i,r);return h.createDrawingOptions(t),Q(f=h,In,RU).call(f,{drawOutlines:c}),Q(p=h,In,Hx).call(p),h.onScaleChanging(),h.rotate(),h}serializeDraw(t){const[i,r]=this.pageTranslation,[s,a]=this.pageDimensions;return g(this,ho).serialize([i,r,s,a],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};ho=new WeakMap,u1=new WeakMap,qr=new WeakMap,_m=new WeakMap,xm=new WeakMap,In=new WeakSet,RU=function({drawOutlines:t,drawId:i,drawingOptions:r}){V(this,ho,t),this._drawingOptions||(this._drawingOptions=r),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=Q(this,In,NU).call(this,t,this.parent),Q(this,In,zx).call(this,t.box)},NU=function(t,i){const{id:r}=i.drawLayer.draw(Tn._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return r},kU=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Hx=function(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=Q(this,In,NU).call(this,g(this,ho),t)}},gJ=function([t,i,r,s]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[i,1-t,r*(o/a),s*(a/o)];case 180:return[1-t,1-i,r,s];case 270:return[1-i,t,r*(o/a),s*(a/o)];default:return[t,i,r,s]}},xS=function(){const{x:t,y:i,width:r,height:s,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-i,t,r*(a/o),s*(o/a)];case 180:return[1-t,1-i,r,s];case 270:return[i,1-t,r*(a/o),s*(o/a)];default:return[t,i,r,s]}},zx=function(t){[this.x,this.y,this.width,this.height]=Q(this,In,gJ).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},hy=function(){const{x:t,y:i,width:r,height:s,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-i-s,t,s,r];case 2:return[1-t-r,1-i-s,r,s];case 3:return[i,1-t-r,s,r];case 4:return[t,i-r*(l/c),s*(c/l),r*(l/c)];case 5:return[1-i,t,r*(l/c),s*(c/l)];case 6:return[1-t-s*(c/l),1-i,s*(c/l),r*(l/c)];case 7:return[i-r*(l/c),1-t-s*(c/l),r*(l/c),s*(c/l)];case 8:return[t-r,i-s,r,s];case 9:return[1-i,t-r,s,r];case 10:return[1-t,1-i,r,s];case 11:return[i-s,1-t,s,r];case 12:return[t-s*(c/l),i,s*(c/l),r*(l/c)];case 13:return[1-i-r*(l/c),t-s*(c/l),r*(l/c),s*(c/l)];case 14:return[1-t,1-i-r*(l/c),s*(c/l),r*(l/c)];case 15:return[i,1-t,r*(l/c),s*(c/l)];default:return[t,i,r,s]}},Ze(Tn,"_currentDrawId",-1),Ze(Tn,"_currentParent",null),Y(Tn,qr,null),Y(Tn,_m,null),Y(Tn,xm,null),Ze(Tn,"_INNER_MARGIN",3);let VD=Tn;var Yc,$r,jr,bm,h1,ta,_s,rl,Tm,Em,wm,d1,bS;class Kxe{constructor(e,t,i,r,s,a){Y(this,d1);Y(this,Yc,new Float64Array(6));Y(this,$r);Y(this,jr);Y(this,bm);Y(this,h1);Y(this,ta);Y(this,_s,"");Y(this,rl,0);Y(this,Tm,new QT);Y(this,Em);Y(this,wm);V(this,Em,i),V(this,wm,r),V(this,bm,s),V(this,h1,a),[e,t]=Q(this,d1,bS).call(this,e,t);const o=V(this,$r,[NaN,NaN,NaN,NaN,e,t]);V(this,ta,[e,t]),V(this,jr,[{line:o,points:g(this,ta)}]),g(this,Yc).set(o,0)}updateProperty(e,t){e==="stroke-width"&&V(this,h1,t)}isEmpty(){return!g(this,jr)||g(this,jr).length===0}isCancellable(){return g(this,ta).length<=10}add(e,t){[e,t]=Q(this,d1,bS).call(this,e,t);const[i,r,s,a]=g(this,Yc).subarray(2,6),o=e-s,l=t-a;return Math.hypot(g(this,Em)*o,g(this,wm)*l)<=2?null:(g(this,ta).push(e,t),isNaN(i)?(g(this,Yc).set([s,a,e,t],2),g(this,$r).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(g(this,Yc)[0])&&g(this,$r).splice(6,6),g(this,Yc).set([i,r,s,a,e,t],0),g(this,$r).push(...Rt.createBezierPoints(i,r,s,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const i=this.add(e,t);return i||(g(this,ta).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,i,r,s){V(this,Em,i),V(this,wm,r),V(this,bm,s),[e,t]=Q(this,d1,bS).call(this,e,t);const a=V(this,$r,[NaN,NaN,NaN,NaN,e,t]);V(this,ta,[e,t]);const o=g(this,jr).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),g(this,jr).push({line:a,points:g(this,ta)}),g(this,Yc).set(a,0),V(this,rl,0),this.toSVGPath(),null}getLastElement(){return g(this,jr).at(-1)}setLastElement(e){return g(this,jr)?(g(this,jr).push(e),V(this,$r,e.line),V(this,ta,e.points),V(this,rl,0),{path:{d:this.toSVGPath()}}):g(this,Tm).setLastElement(e)}removeLastElement(){if(!g(this,jr))return g(this,Tm).removeLastElement();g(this,jr).pop(),V(this,_s,"");for(let e=0,t=g(this,jr).length;e<t;e++){const{line:i,points:r}=g(this,jr)[e];V(this,$r,i),V(this,ta,r),V(this,rl,0),this.toSVGPath()}return{path:{d:g(this,_s)}}}toSVGPath(){const e=Rt.svgRound(g(this,$r)[4]),t=Rt.svgRound(g(this,$r)[5]);if(g(this,ta).length===2)return V(this,_s,`${g(this,_s)} M ${e} ${t} Z`),g(this,_s);if(g(this,ta).length<=6){const r=g(this,_s).lastIndexOf("M");V(this,_s,`${g(this,_s).slice(0,r)} M ${e} ${t}`),V(this,rl,6)}if(g(this,ta).length===4){const r=Rt.svgRound(g(this,$r)[10]),s=Rt.svgRound(g(this,$r)[11]);return V(this,_s,`${g(this,_s)} L ${r} ${s}`),V(this,rl,12),g(this,_s)}const i=[];g(this,rl)===0&&(i.push(`M ${e} ${t}`),V(this,rl,6));for(let r=g(this,rl),s=g(this,$r).length;r<s;r+=6){const[a,o,l,c,h,f]=g(this,$r).slice(r,r+6).map(Rt.svgRound);i.push(`C${a} ${o} ${l} ${c} ${h} ${f}`)}return V(this,_s,g(this,_s)+i.join(" ")),V(this,rl,g(this,$r).length),g(this,_s)}getOutlines(e,t,i,r){const s=g(this,jr).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),g(this,Tm).build(g(this,jr),e,t,i,g(this,bm),g(this,h1),r),V(this,Yc,null),V(this,$r,null),V(this,jr,null),V(this,_s,null),g(this,Tm)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Yc=new WeakMap,$r=new WeakMap,jr=new WeakMap,bm=new WeakMap,h1=new WeakMap,ta=new WeakMap,_s=new WeakMap,rl=new WeakMap,Tm=new WeakMap,Em=new WeakMap,wm=new WeakMap,d1=new WeakSet,bS=function(e,t){return Rt._normalizePoint(e,t,g(this,Em),g(this,wm),g(this,bm))};var na,OT,BT,fo,Jc,Qc,f1,p1,Am,ws,Vu,mJ,yJ,vJ;class QT extends Rt{constructor(){super(...arguments);Y(this,ws);Y(this,na);Y(this,OT,0);Y(this,BT);Y(this,fo);Y(this,Jc);Y(this,Qc);Y(this,f1);Y(this,p1);Y(this,Am)}build(t,i,r,s,a,o,l){V(this,Jc,i),V(this,Qc,r),V(this,f1,s),V(this,p1,a),V(this,Am,o),V(this,BT,l??0),V(this,fo,t),Q(this,ws,yJ).call(this)}get thickness(){return g(this,Am)}setLastElement(t){return g(this,fo).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return g(this,fo).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:i}of g(this,fo)){if(t.push(`M${Rt.svgRound(i[4])} ${Rt.svgRound(i[5])}`),i.length===6){t.push("Z");continue}if(i.length===12&&isNaN(i[6])){t.push(`L${Rt.svgRound(i[10])} ${Rt.svgRound(i[11])}`);continue}for(let r=6,s=i.length;r<s;r+=6){const[a,o,l,c,h,f]=i.subarray(r,r+6).map(Rt.svgRound);t.push(`C${a} ${o} ${l} ${c} ${h} ${f}`)}}return t.join("")}serialize([t,i,r,s],a){const o=[],l=[],[c,h,f,p]=Q(this,ws,mJ).call(this);let y,x,v,_,E,w,A,N,k;switch(g(this,p1)){case 0:k=Rt._rescale,y=t,x=i+s,v=r,_=-s,E=t+c*r,w=i+(1-h-p)*s,A=t+(c+f)*r,N=i+(1-h)*s;break;case 90:k=Rt._rescaleAndSwap,y=t,x=i,v=r,_=s,E=t+h*r,w=i+c*s,A=t+(h+p)*r,N=i+(c+f)*s;break;case 180:k=Rt._rescale,y=t+r,x=i,v=-r,_=s,E=t+(1-c-f)*r,w=i+h*s,A=t+(1-c)*r,N=i+(h+p)*s;break;case 270:k=Rt._rescaleAndSwap,y=t+r,x=i+s,v=-r,_=-s,E=t+(1-h-p)*r,w=i+(1-c-f)*s,A=t+(1-h)*r,N=i+(1-c)*s;break}for(const{line:F,points:C}of g(this,fo))o.push(k(F,y,x,v,_,a?new Array(F.length):null)),l.push(k(C,y,x,v,_,a?new Array(C.length):null));return{lines:o,points:l,rect:[E,w,A,N]}}static deserialize(t,i,r,s,a,{paths:{lines:o,points:l},rotation:c,thickness:h}){const f=[];let p,y,x,v,_;switch(c){case 0:_=Rt._rescale,p=-t/r,y=i/s+1,x=1/r,v=-1/s;break;case 90:_=Rt._rescaleAndSwap,p=-i/s,y=-t/r,x=1/s,v=1/r;break;case 180:_=Rt._rescale,p=t/r+1,y=-i/s,x=-1/r,v=1/s;break;case 270:_=Rt._rescaleAndSwap,p=i/s+1,y=t/r+1,x=-1/s,v=-1/r;break}if(!o){o=[];for(const w of l){const A=w.length;if(A===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1]]));continue}if(A===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1],NaN,NaN,NaN,NaN,w[2],w[3]]));continue}const N=new Float32Array(3*(A-2));o.push(N);let[k,F,C,M]=w.subarray(0,4);N.set([NaN,NaN,NaN,NaN,k,F],0);for(let R=4;R<A;R+=2){const L=w[R],H=w[R+1];N.set(Rt.createBezierPoints(k,F,C,M,L,H),(R-2)*3),[k,F,C,M]=[C,M,L,H]}}}for(let w=0,A=o.length;w<A;w++)f.push({line:_(o[w].map(N=>N??NaN),p,y,x,v),points:_(l[w].map(N=>N??NaN),p,y,x,v)});const E=new this.prototype.constructor;return E.build(f,r,s,1,c,h,a),E}get box(){return g(this,na)}updateProperty(t,i){return t==="stroke-width"?Q(this,ws,vJ).call(this,i):null}updateParentDimensions([t,i],r){const[s,a]=Q(this,ws,Vu).call(this);V(this,Jc,t),V(this,Qc,i),V(this,f1,r);const[o,l]=Q(this,ws,Vu).call(this),c=o-s,h=l-a,f=g(this,na);return f[0]-=c,f[1]-=h,f[2]+=2*c,f[3]+=2*h,f}updateRotation(t){return V(this,OT,t),{path:{transform:this.rotationTransform}}}get viewBox(){return g(this,na).map(Rt.svgRound).join(" ")}get defaultProperties(){const[t,i]=g(this,na);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Rt.svgRound(t)} ${Rt.svgRound(i)}`}}}get rotationTransform(){const[,,t,i]=g(this,na);let r=0,s=0,a=0,o=0,l=0,c=0;switch(g(this,OT)){case 90:s=i/t,a=-t/i,l=t;break;case 180:r=-1,o=-1,l=t,c=i;break;case 270:s=-i/t,a=t/i,c=i;break;default:return""}return`matrix(${r} ${s} ${a} ${o} ${Rt.svgRound(l)} ${Rt.svgRound(c)})`}getPathResizingSVGProperties([t,i,r,s]){const[a,o]=Q(this,ws,Vu).call(this),[l,c,h,f]=g(this,na);if(Math.abs(h-a)<=Rt.PRECISION||Math.abs(f-o)<=Rt.PRECISION){const _=t+r/2-(l+h/2),E=i+s/2-(c+f/2);return{path:{"transform-origin":`${Rt.svgRound(t)} ${Rt.svgRound(i)}`,transform:`${this.rotationTransform} translate(${_} ${E})`}}}const p=(r-2*a)/(h-2*a),y=(s-2*o)/(f-2*o),x=h/r,v=f/s;return{path:{"transform-origin":`${Rt.svgRound(l)} ${Rt.svgRound(c)}`,transform:`${this.rotationTransform} scale(${x} ${v}) translate(${Rt.svgRound(a)} ${Rt.svgRound(o)}) scale(${p} ${y}) translate(${Rt.svgRound(-a)} ${Rt.svgRound(-o)})`}}}getPathResizedSVGProperties([t,i,r,s]){const[a,o]=Q(this,ws,Vu).call(this),l=g(this,na),[c,h,f,p]=l;if(l[0]=t,l[1]=i,l[2]=r,l[3]=s,Math.abs(f-a)<=Rt.PRECISION||Math.abs(p-o)<=Rt.PRECISION){const E=t+r/2-(c+f/2),w=i+s/2-(h+p/2);for(const{line:A,points:N}of g(this,fo))Rt._translate(A,E,w,A),Rt._translate(N,E,w,N);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Rt.svgRound(t)} ${Rt.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const y=(r-2*a)/(f-2*a),x=(s-2*o)/(p-2*o),v=-y*(c+a)+t+a,_=-x*(h+o)+i+o;if(y!==1||x!==1||v!==0||_!==0)for(const{line:E,points:w}of g(this,fo))Rt._rescale(E,v,_,y,x,E),Rt._rescale(w,v,_,y,x,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Rt.svgRound(t)} ${Rt.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,i],r){const[s,a]=r,o=g(this,na),l=t-o[0],c=i-o[1];if(g(this,Jc)===s&&g(this,Qc)===a)for(const{line:h,points:f}of g(this,fo))Rt._translate(h,l,c,h),Rt._translate(f,l,c,f);else{const h=g(this,Jc)/s,f=g(this,Qc)/a;V(this,Jc,s),V(this,Qc,a);for(const{line:p,points:y}of g(this,fo))Rt._rescale(p,l,c,h,f,p),Rt._rescale(y,l,c,h,f,y);o[2]*=h,o[3]*=f}return o[0]=t,o[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Rt.svgRound(t)} ${Rt.svgRound(i)}`}}}get defaultSVGProperties(){const t=g(this,na);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Rt.svgRound(t[0])} ${Rt.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}na=new WeakMap,OT=new WeakMap,BT=new WeakMap,fo=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,f1=new WeakMap,p1=new WeakMap,Am=new WeakMap,ws=new WeakSet,Vu=function(t=g(this,Am)){const i=g(this,BT)+t/2*g(this,f1);return g(this,p1)%180===0?[i/g(this,Jc),i/g(this,Qc)]:[i/g(this,Qc),i/g(this,Jc)]},mJ=function(){const[t,i,r,s]=g(this,na),[a,o]=Q(this,ws,Vu).call(this,0);return[t+a,i+o,r-2*a,s-2*o]},yJ=function(){const t=V(this,na,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:s}of g(this,fo)){if(s.length<=12){for(let l=4,c=s.length;l<c;l+=6)St.pointBoundingBox(s[l],s[l+1],t);continue}let a=s[4],o=s[5];for(let l=6,c=s.length;l<c;l+=6){const[h,f,p,y,x,v]=s.subarray(l,l+6);St.bezierBoundingBox(a,o,h,f,p,y,x,v,t),a=x,o=v}}const[i,r]=Q(this,ws,Vu).call(this);t[0]=Yr(t[0]-i,0,1),t[1]=Yr(t[1]-r,0,1),t[2]=Yr(t[2]+i,0,1),t[3]=Yr(t[3]+r,0,1),t[2]-=t[0],t[3]-=t[1]},vJ=function(t){const[i,r]=Q(this,ws,Vu).call(this);V(this,Am,t);const[s,a]=Q(this,ws,Vu).call(this),[o,l]=[s-i,a-r],c=g(this,na);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class _I extends pJ{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:Ei._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??(t=this["stroke-width"]),t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new _I(this._viewParameters);return e.updateAll(this),e}}var GC,_J;const Ry=class Ry extends VD{constructor(t){super({...t,name:"inkEditor"});Y(this,GC);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,i){Ei.initialize(t,i),this._defaultDrawingOptions=new _I(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return tn(this,"typesMap",new Map([[Dn.INK_THICKNESS,"stroke-width"],[Dn.INK_COLOR,"stroke"],[Dn.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,i,r,s,a){return new Kxe(t,i,r,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,i,r,s,a,o){return QT.deserialize(t,i,r,s,a,o)}static async deserialize(t,i,r){let s=null;if(t instanceof D4){const{data:{inkLists:o,rect:l,rotation:c,id:h,color:f,opacity:p,borderStyle:{rawWidth:y},popupRef:x,richText:v,contentsObj:_,creationDate:E,modificationDate:w},parent:{page:{pageNumber:A}}}=t;s=t={annotationType:sn.INK,color:Array.from(f),thickness:y,opacity:p,paths:{points:o},boxes:null,pageIndex:A-1,rect:l.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:x,richText:v,comment:(_==null?void 0:_.str)||null,creationDate:E,modificationDate:w}}const a=await super.deserialize(t,i,r);return a._initialData=s,t.comment&&a.setCommentData(t),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new PD(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Dn.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:i,parent:r}=this;i.updateSVGProperty("stroke-width"),r.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:r}){this._drawingOptions=Ry.getDefaultDrawingOptions({stroke:St.makeHexColor(...t),"stroke-width":i,"stroke-opacity":r})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:r}=this.serializeDraw(t),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":o}}=this,l=Object.assign(super.serialize(t),{color:Ei._colorManager.convert(s),opacity:a,thickness:o,paths:{lines:i,points:r}});return this.addComment(l),t?(l.isCopy=!0,l):this.annotationElementId&&!Q(this,GC,_J).call(this,l)?null:(l.id=this.annotationElementId,l)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:i,rect:r}=this.serializeDraw(!1);return t.updateEdited({rect:r,thickness:this._drawingOptions["stroke-width"],points:i,popup:this.comment}),null}};GC=new WeakSet,_J=function(t){const{color:i,thickness:r,opacity:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((o,l)=>o!==i[l])||t.thickness!==r||t.opacity!==s||t.pageIndex!==a},Ze(Ry,"_type","ink"),Ze(Ry,"_editorType",sn.INK),Ze(Ry,"_defaultDrawingOptions",null);let MU=Ry;class FU extends QT{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const sA=8,ox=3;var Sm,Gn,UU,ql,xJ,bJ,PU,TS,TJ,EJ,wJ,LU,OU,AJ;class wh{static extractContoursFromText(e,{fontFamily:t,fontStyle:i,fontWeight:r},s,a,o,l){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const f=200,p=h.font=`${i} ${r} ${f}px ${t}`,{actualBoundingBoxLeft:y,actualBoundingBoxRight:x,actualBoundingBoxAscent:v,actualBoundingBoxDescent:_,fontBoundingBoxAscent:E,fontBoundingBoxDescent:w,width:A}=h.measureText(e),N=1.5,k=Math.ceil(Math.max(Math.abs(y)+Math.abs(x)||0,A)*N),F=Math.ceil(Math.max(Math.abs(v)+Math.abs(_)||f,Math.abs(E)+Math.abs(w)||f)*N);c=new OffscreenCanvas(k,F),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=p,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,k,F),h.fillStyle="black",h.fillText(e,k*(N-1)/2,F*(3-N)/2);const C=Q(this,Gn,LU).call(this,h.getImageData(0,0,k,F).data),M=Q(this,Gn,wJ).call(this,C),R=Q(this,Gn,OU).call(this,M),L=Q(this,Gn,PU).call(this,C,k,F,R);return this.processDrawnLines({lines:{curves:L,width:k,height:F},pageWidth:s,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,t,i,r,s){const[a,o,l]=Q(this,Gn,AJ).call(this,e),[c,h]=Q(this,Gn,EJ).call(this,a,o,l,Math.hypot(o,l)*g(this,Sm).sigmaSFactor,g(this,Sm).sigmaR,g(this,Sm).kernelSize),f=Q(this,Gn,OU).call(this,h),p=Q(this,Gn,PU).call(this,c,o,l,f);return this.processDrawnLines({lines:{curves:p,width:o,height:l},pageWidth:t,pageHeight:i,rotation:r,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:i,rotation:r,innerMargin:s,mustSmooth:a,areContours:o}){r%180!==0&&([t,i]=[i,t]);const{curves:l,width:c,height:h}=e,f=e.thickness??0,p=[],y=Math.min(t/c,i/h),x=y/t,v=y/i,_=[];for(const{points:w}of l){const A=a?Q(this,Gn,TJ).call(this,w):w;if(!A)continue;_.push(A);const N=A.length,k=new Float32Array(N),F=new Float32Array(3*(N===2?2:N-2));if(p.push({line:F,points:k}),N===2){k[0]=A[0]*x,k[1]=A[1]*v,F.set([NaN,NaN,NaN,NaN,k[0],k[1]],0);continue}let[C,M,R,L]=A;C*=x,M*=v,R*=x,L*=v,k.set([C,M,R,L],0),F.set([NaN,NaN,NaN,NaN,C,M],0);for(let H=4;H<N;H+=2){const P=k[H]=A[H]*x,O=k[H+1]=A[H+1]*v;F.set(Rt.createBezierPoints(C,M,R,L,P,O),(H-2)*3),[C,M,R,L]=[R,L,P,O]}}if(p.length===0)return null;const E=o?new FU:new QT;return E.build(p,t,i,1,r,o?0:f,s),{outline:E,newCurves:_,areContours:o,thickness:f,width:c,height:h}}static async compressSignature({outlines:e,areContours:t,thickness:i,width:r,height:s}){let a=1/0,o=-1/0,l=0;for(const A of e){l+=A.length;for(let N=2,k=A.length;N<k;N++){const F=A[N]-A[N-2];a=Math.min(a,F),o=Math.max(o,F)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const h=e.length,f=sA+ox*h,p=new Uint32Array(f);let y=0;p[y++]=f*Uint32Array.BYTES_PER_ELEMENT+(l-2*h)*c.BYTES_PER_ELEMENT,p[y++]=0,p[y++]=r,p[y++]=s,p[y++]=t?0:1,p[y++]=Math.max(0,Math.floor(i??0)),p[y++]=h,p[y++]=c.BYTES_PER_ELEMENT;for(const A of e)p[y++]=A.length-2,p[y++]=A[0],p[y++]=A[1];const x=new CompressionStream("deflate-raw"),v=x.writable.getWriter();await v.ready,v.write(p);const _=c.prototype.constructor;for(const A of e){const N=new _(A.length-2);for(let k=2,F=A.length;k<F;k++)N[k-2]=A[k]-A[k-2];v.write(N)}v.close();const E=await new Response(x.readable).arrayBuffer();return new Uint8Array(E).toBase64()}static async decompressSignature(e){try{const t=Uint8Array.fromBase64(e),{readable:i,writable:r}=new DecompressionStream("deflate-raw"),s=r.getWriter();await s.ready,s.write(t).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(const A of i)a||(a=new Uint8Array(new Uint32Array(A.buffer,0,4)[0])),a.set(A,o),o+=A.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const h=l[2],f=l[3],p=l[4]===0,y=l[5],x=l[6],v=l[7],_=[],E=(sA+ox*x)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(v){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(a.buffer,E);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(a.buffer,E);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(a.buffer,E);break}o=0;for(let A=0;A<x;A++){const N=l[ox*A+sA],k=new Float32Array(N+2);_.push(k);for(let F=0;F<ox-1;F++)k[F]=l[ox*A+sA+F+1];for(let F=0;F<N;F++)k[F+2]=k[F]+w[o++]}return{areContours:p,thickness:y,outlines:_,width:h,height:f}}catch(t){return an(`decompressSignature: ${t}`),null}}}Sm=new WeakMap,Gn=new WeakSet,UU=function(e,t,i,r){return i-=e,r-=t,i===0?r>0?0:4:i===1?r+6:2-r},ql=new WeakMap,xJ=function(e,t,i,r,s,a,o){const l=Q(this,Gn,UU).call(this,i,r,s,a);for(let c=0;c<8;c++){const h=(-c+l-o+16)%8,f=g(this,ql)[2*h],p=g(this,ql)[2*h+1];if(e[(i+f)*t+(r+p)]!==0)return h}return-1},bJ=function(e,t,i,r,s,a,o){const l=Q(this,Gn,UU).call(this,i,r,s,a);for(let c=0;c<8;c++){const h=(c+l+o+16)%8,f=g(this,ql)[2*h],p=g(this,ql)[2*h+1];if(e[(i+f)*t+(r+p)]!==0)return h}return-1},PU=function(e,t,i,r){const s=e.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=e[h]<=r?1:0;for(let h=1;h<i-1;h++)a[h*t]=a[h*t+t-1]=0;for(let h=0;h<t;h++)a[h]=a[t*i-1-h]=0;let o=1,l;const c=[];for(let h=1;h<i-1;h++){l=1;for(let f=1;f<t-1;f++){const p=h*t+f,y=a[p];if(y===0)continue;let x=h,v=f;if(y===1&&a[p-1]===0)o+=1,v-=1;else if(y>=1&&a[p+1]===0)o+=1,v+=1,y>1&&(l=y);else{y!==1&&(l=Math.abs(y));continue}const _=[f,h],E=v===f+1,w={isHole:E,points:_,id:o,parent:0};c.push(w);let A;for(const H of c)if(H.id===l){A=H;break}A?A.isHole?w.parent=E?A.parent:l:w.parent=E?l:A.parent:w.parent=E?l:0;const N=Q(this,Gn,xJ).call(this,a,t,h,f,x,v,0);if(N===-1){a[p]=-o,a[p]!==1&&(l=Math.abs(a[p]));continue}let k=g(this,ql)[2*N],F=g(this,ql)[2*N+1];const C=h+k,M=f+F;x=C,v=M;let R=h,L=f;for(;;){const H=Q(this,Gn,bJ).call(this,a,t,R,L,x,v,1);k=g(this,ql)[2*H],F=g(this,ql)[2*H+1];const P=R+k,O=L+F;_.push(O,P);const B=R*t+L;if(a[B+1]===0?a[B]=-o:a[B]===1&&(a[B]=o),P===h&&O===f&&R===C&&L===M){a[p]!==1&&(l=Math.abs(a[p]));break}else x=R,v=L,R=P,L=O}}}return c},TS=function(e,t,i,r){if(i-t<=4){for(let C=t;C<i-2;C+=2)r.push(e[C],e[C+1]);return}const s=e[t],a=e[t+1],o=e[i-4]-s,l=e[i-3]-a,c=Math.hypot(o,l),h=o/c,f=l/c,p=h*a-f*s,y=l/o,x=1/c,v=Math.atan(y),_=Math.cos(v),E=Math.sin(v),w=x*(Math.abs(_)+Math.abs(E)),A=x*(1-w+w**2),N=Math.max(Math.atan(Math.abs(E+_)*A),Math.atan(Math.abs(E-_)*A));let k=0,F=t;for(let C=t+2;C<i-2;C+=2){const M=Math.abs(p-h*e[C+1]+f*e[C]);M>k&&(F=C,k=M)}k>(c*N)**2?(Q(this,Gn,TS).call(this,e,t,F+2,r),Q(this,Gn,TS).call(this,e,F,i,r)):r.push(s,a)},TJ=function(e){const t=[],i=e.length;return Q(this,Gn,TS).call(this,e,0,i,t),t.push(e[i-2],e[i-1]),t.length<=4?null:t},EJ=function(e,t,i,r,s,a){const o=new Float32Array(a**2),l=-2*r**2,c=a>>1;for(let v=0;v<a;v++){const _=(v-c)**2;for(let E=0;E<a;E++)o[v*a+E]=Math.exp((_+(E-c)**2)/l)}const h=new Float32Array(256),f=-2*s**2;for(let v=0;v<256;v++)h[v]=Math.exp(v**2/f);const p=e.length,y=new Uint8Array(p),x=new Uint32Array(256);for(let v=0;v<i;v++)for(let _=0;_<t;_++){const E=v*t+_,w=e[E];let A=0,N=0;for(let F=0;F<a;F++){const C=v+F-c;if(!(C<0||C>=i))for(let M=0;M<a;M++){const R=_+M-c;if(R<0||R>=t)continue;const L=e[C*t+R],H=o[F*a+M]*h[Math.abs(L-w)];A+=L*H,N+=H}}const k=y[E]=Math.round(A/N);x[k]++}return[y,x]},wJ=function(e){const t=new Uint32Array(256);for(const i of e)t[i]++;return t},LU=function(e){const t=e.length,i=new Uint8ClampedArray(t>>2);let r=-1/0,s=1/0;for(let o=0,l=i.length;o<l;o++){const c=i[o]=e[o<<2];r=Math.max(r,c),s=Math.min(s,c)}const a=255/(r-s);for(let o=0,l=i.length;o<l;o++)i[o]=(i[o]-s)*a;return i},OU=function(e){let t,i=-1/0,r=-1/0;const s=e.findIndex(l=>l!==0);let a=s,o=s;for(t=s;t<256;t++){const l=e[t];l>i&&(t-a>r&&(r=t-a,o=t-1),i=l,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t},AJ=function(e){const t=e,{width:i,height:r}=e,{maxDim:s}=g(this,Sm);let a=i,o=r;if(i>s||r>s){let p=i,y=r,x=Math.log2(Math.max(i,r)/s);const v=Math.floor(x);x=x===v?v-1:v;for(let E=0;E<x;E++){a=Math.ceil(p/2),o=Math.ceil(y/2);const w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(e,0,0,p,y,0,0,a,o),p=a,y=o,e!==t&&e.close(),e=w.transferToImageBitmap()}const _=Math.min(s/a,s/o);a=Math.round(a*_),o=Math.round(o*_)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,a,o),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,a,o);const h=c.getImageData(0,0,a,o).data;return[Q(this,Gn,LU).call(this,h),a,o]},Y(wh,Gn),Y(wh,Sm,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),Y(wh,ql,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class C4 extends pJ{constructor(){super(),super.updateProperties({fill:Ei._defaultLineColor,"stroke-width":0})}clone(){const e=new C4;return e.updateAll(this),e}}class I4 extends _I{constructor(e){super(e),super.updateProperties({stroke:Ei._defaultLineColor,"stroke-width":1})}clone(){const e=new I4(this._viewParameters);return e.updateAll(this),e}}var Nf,Zc,kf,Dm;const Ka=class Ka extends VD{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});Y(this,Nf,!1);Y(this,Zc,null);Y(this,kf,null);Y(this,Dm,null);this._willKeepAspectRatio=!0,V(this,kf,t.signatureData||null),V(this,Zc,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,i){Ei.initialize(t,i),this._defaultDrawingOptions=new C4,this._defaultDrawnSignatureOptions=new I4(i.viewParameters)}static getDefaultDrawingOptions(t){const i=this._defaultDrawingOptions.clone();return i.updateProperties(t),i}static get supportMultipleDrawings(){return!1}static get typesMap(){return tn(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!g(this,Zc)}}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:r}=this;if(r&&(this._isCopy=!1,t=this.x,i=this.y),super.render(),this._drawId===null)if(g(this,kf)){const{lines:s,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:h}=g(this,kf),{rawDims:{pageWidth:f,pageHeight:p},rotation:y}=this.parent.viewport,x=wh.processDrawnLines({lines:s,pageWidth:f,pageHeight:p,rotation:y,innerMargin:Ka._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(x,h,l,c)}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:g(this,Zc)||""}));return r&&(this._isCopy=!0,this._moveAfterPaste(t,i)),this.div}setUuid(t){V(this,Dm,t),this.addEditToolbar()}getUuid(){return g(this,Dm)}get description(){return g(this,Zc)}set description(t){V(this,Zc,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(i=>{i==null||i.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:i,thickness:r,width:s,height:a}=g(this,kf),o=Math.max(s,a),l=wh.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:r,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:i});return{areContours:i,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,i,r,s){const{x:a,y:o}=this,{outline:l}=V(this,kf,t);V(this,Nf,l instanceof FU),this.description=r;let c;g(this,Nf)?c=Ka.getDefaultDrawingOptions():(c=Ka._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[,h]=this.pageDimensions;let f=i/h;f=f>=1?.5:f,this.width*=f/this.height,this.width>=1&&(f*=.9/this.width,this.width=.9),this.height=f,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:i,pageHeight:r},rotation:s}=this.parent.viewport;return wh.process(t,i,r,s,Ka._INNER_MARGIN)}getFromText(t,i){const{rawDims:{pageWidth:r,pageHeight:s},rotation:a}=this.parent.viewport;return wh.extractContoursFromText(t,i,r,s,a,Ka._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:i,pageHeight:r},rotation:s}=this.parent.viewport;return wh.processDrawnLines({lines:t,pageWidth:i,pageHeight:r,rotation:s,innerMargin:Ka._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:i}){t?this._drawingOptions=Ka.getDefaultDrawingOptions():(this._drawingOptions=Ka._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":i}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:i,points:r}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":s}}=this,a=Object.assign(super.serialize(t),{isSignature:!0,areContours:g(this,Nf),color:[0,0,0],thickness:g(this,Nf)?0:s});return this.addComment(a),t?(a.paths={lines:i,points:r},a.uuid=g(this,Dm),a.isCopy=!0):a.lines=i,g(this,Zc)&&(a.accessibilityData={type:"Figure",alt:g(this,Zc)}),a}static deserializeDraw(t,i,r,s,a,o){return o.areContours?FU.deserialize(t,i,r,s,a,o):QT.deserialize(t,i,r,s,a,o)}static async deserialize(t,i,r){var a;const s=await super.deserialize(t,i,r);return V(s,Nf,t.areContours),s.description=((a=t.accessibilityData)==null?void 0:a.alt)||"",V(s,Dm,t.uuid),s}};Nf=new WeakMap,Zc=new WeakMap,kf=new WeakMap,Dm=new WeakMap,Ze(Ka,"_type","signature"),Ze(Ka,"_editorType",sn.SIGNATURE),Ze(Ka,"_defaultDrawingOptions",null);let BU=Ka;var Li,Xr,Mf,_h,Ff,g1,xh,Cm,eu,po,m1,Rn,Gx,qx,ES,wS,AS,WU,SS,SJ;class VU extends Ei{constructor(t){super({...t,name:"stampEditor"});Y(this,Rn);Y(this,Li,null);Y(this,Xr,null);Y(this,Mf,null);Y(this,_h,null);Y(this,Ff,null);Y(this,g1,"");Y(this,xh,null);Y(this,Cm,!1);Y(this,eu,null);Y(this,po,!1);Y(this,m1,!1);V(this,_h,t.bitmapUrl),V(this,Ff,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,i){Ei.initialize(t,i)}static isHandlingMimeForPasting(t){return EF.includes(t)}static paste(t,i){i.pasteEditor({mode:sn.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var t;return{type:"stamp",hasAltText:!!((t=this.altTextData)!=null&&t.altText)}}static computeTelemetryFinalData(t){const i=t.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}async mlGuessAltText(t=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:r}=this._uiManager;if(!r)throw new Error("No ML.");if(!await r.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:a,height:o}=t||this.copyCanvas(null,null,!0).imageData,l=await r.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),i&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var t;g(this,Xr)&&(V(this,Li,null),this._uiManager.imageManager.deleteId(g(this,Xr)),(t=g(this,xh))==null||t.remove(),V(this,xh,null),g(this,eu)&&(clearTimeout(g(this,eu)),V(this,eu,null))),super.remove()}rebuild(){if(!this.parent){g(this,Xr)&&Q(this,Rn,ES).call(this);return}super.rebuild(),this.div!==null&&(g(this,Xr)&&g(this,xh)===null&&Q(this,Rn,ES).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(g(this,Mf)||g(this,Li)||g(this,_h)||g(this,Ff)||g(this,Xr)||g(this,Cm))}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(),g(this,Cm)||(g(this,Li)?Q(this,Rn,wS).call(this):Q(this,Rn,ES).call(this)),this._isCopy&&this._moveAfterPaste(t,i),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,i){const{id:r,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,i);i.remove(),r&&this._uiManager.imageManager.isValidId(r)&&(V(this,Xr,r),s&&V(this,Li,s),V(this,Cm,!1),Q(this,Rn,wS).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;g(this,eu)!==null&&clearTimeout(g(this,eu)),V(this,eu,setTimeout(()=>{V(this,eu,null),Q(this,Rn,WU).call(this)},200))}copyCanvas(t,i,r=!1){t||(t=224);const{width:s,height:a}=g(this,Li),o=new uu;let l=g(this,Li),c=s,h=a,f=null;if(i){if(s>i||a>i){const C=Math.min(i/s,i/a);c=Math.floor(s*C),h=Math.floor(a*C)}f=document.createElement("canvas");const y=f.width=Math.ceil(c*o.sx),x=f.height=Math.ceil(h*o.sy);g(this,po)||(l=Q(this,Rn,AS).call(this,y,x));const v=f.getContext("2d");v.filter=this._uiManager.hcmFilter;let _="white",E="#cfcfd8";this._uiManager.hcmFilter!=="none"?E="black":y_e.isDarkMode&&(_="#8f8f9d",E="#42414d");const w=15,A=w*o.sx,N=w*o.sy,k=new OffscreenCanvas(A*2,N*2),F=k.getContext("2d");F.fillStyle=_,F.fillRect(0,0,A*2,N*2),F.fillStyle=E,F.fillRect(0,0,A,N),F.fillRect(A,N,A,N),v.fillStyle=v.createPattern(k,"repeat"),v.fillRect(0,0,y,x),v.drawImage(l,0,0,l.width,l.height,0,0,y,x)}let p=null;if(r){let y,x;if(o.symmetric&&l.width<t&&l.height<t)y=l.width,x=l.height;else if(l=g(this,Li),s>t||a>t){const E=Math.min(t/s,t/a);y=Math.floor(s*E),x=Math.floor(a*E),g(this,po)||(l=Q(this,Rn,AS).call(this,y,x))}const _=new OffscreenCanvas(y,x).getContext("2d",{willReadFrequently:!0});_.drawImage(l,0,0,l.width,l.height,0,0,y,x),p={width:y,height:x,data:_.getImageData(0,0,y,x).data}}return{canvas:f,width:c,height:h,imageData:p}}static async deserialize(t,i,r){var _;let s=null,a=!1;if(t instanceof HY){const{data:{rect:E,rotation:w,id:A,structParent:N,popupRef:k,richText:F,contentsObj:C,creationDate:M,modificationDate:R},container:L,parent:{page:{pageNumber:H}},canvas:P}=t;let O,B;P?(delete t.canvas,{id:O,bitmap:B}=r.imageManager.getFromCanvas(L.id,P),P.remove()):(a=!0,t._hasNoCanvas=!0);const re=((_=await i._structTree.getAriaAttributes(`${Ey}${A}`))==null?void 0:_.get("aria-label"))||"";s=t={annotationType:sn.STAMP,bitmapId:O,bitmap:B,pageIndex:H-1,rect:E.slice(0),rotation:w,annotationElementId:A,id:A,deleted:!1,accessibilityData:{decorative:!1,altText:re},isSvg:!1,structParent:N,popupRef:k,richText:F,comment:(C==null?void 0:C.str)||null,creationDate:M,modificationDate:R}}const o=await super.deserialize(t,i,r),{rect:l,bitmap:c,bitmapUrl:h,bitmapId:f,isSvg:p,accessibilityData:y}=t;a?(r.addMissingCanvas(t.id,o),V(o,Cm,!0)):f&&r.imageManager.isValidId(f)?(V(o,Xr,f),c&&V(o,Li,c)):V(o,_h,h),V(o,po,p);const[x,v]=o.pageDimensions;return o.width=(l[2]-l[0])/x,o.height=(l[3]-l[1])/v,y&&(o.altTextData=y),o._initialData=s,t.comment&&o.setCommentData(t),V(o,m1,!!s),o}serialize(t=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=Object.assign(super.serialize(t),{bitmapId:g(this,Xr),isSvg:g(this,po)});if(this.addComment(r),t)return r.bitmapUrl=Q(this,Rn,SS).call(this,!0),r.accessibilityData=this.serializeAltText(!0),r.isCopy=!0,r;const{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(r.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=Q(this,Rn,SJ).call(this,r);return l.isSame?null:(l.isSameAltText?delete r.accessibilityData:r.accessibilityData.structParent=this._initialData.structParent??-1,r.id=this.annotationElementId,delete r.bitmapId,r)}if(i===null)return r;i.stamps||(i.stamps=new Map);const o=g(this,po)?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(!i.stamps.has(g(this,Xr)))i.stamps.set(g(this,Xr),{area:o,serialized:r}),r.bitmap=Q(this,Rn,SS).call(this,!1);else if(g(this,po)){const l=i.stamps.get(g(this,Xr));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=Q(this,Rn,SS).call(this,!1))}return r}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}Li=new WeakMap,Xr=new WeakMap,Mf=new WeakMap,_h=new WeakMap,Ff=new WeakMap,g1=new WeakMap,xh=new WeakMap,Cm=new WeakMap,eu=new WeakMap,po=new WeakMap,m1=new WeakMap,Rn=new WeakSet,Gx=function(t,i=!1){if(!t){this.remove();return}V(this,Li,t.bitmap),i||(V(this,Xr,t.id),V(this,po,t.isSvg)),t.file&&V(this,g1,t.file.name),Q(this,Rn,wS).call(this)},qx=function(){if(V(this,Mf,null),this._uiManager.enableWaiting(!1),!!g(this,xh)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,Li)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,Li)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},ES=function(){if(g(this,Xr)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(g(this,Xr)).then(r=>Q(this,Rn,Gx).call(this,r,!0)).finally(()=>Q(this,Rn,qx).call(this));return}if(g(this,_h)){const r=g(this,_h);V(this,_h,null),this._uiManager.enableWaiting(!0),V(this,Mf,this._uiManager.imageManager.getFromUrl(r).then(s=>Q(this,Rn,Gx).call(this,s)).finally(()=>Q(this,Rn,qx).call(this)));return}if(g(this,Ff)){const r=g(this,Ff);V(this,Ff,null),this._uiManager.enableWaiting(!0),V(this,Mf,this._uiManager.imageManager.getFromFile(r).then(s=>Q(this,Rn,Gx).call(this,s)).finally(()=>Q(this,Rn,qx).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=EF.join(",");const i=this._uiManager._signal;V(this,Mf,new Promise(r=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const s=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),Q(this,Rn,Gx).call(this,s)}r()},{signal:i}),t.addEventListener("cancel",()=>{this.remove(),r()},{signal:i})}).finally(()=>Q(this,Rn,qx).call(this))),t.click()},wS=function(){var c;const{div:t}=this;let{width:i,height:r}=g(this,Li);const[s,a]=this.pageDimensions,o=.75;if(this.width)i=this.width*s,r=this.height*a;else if(i>o*s||r>o*a){const h=Math.min(o*s/i,o*a/r);i*=h,r*=h}this._uiManager.enableWaiting(!1);const l=V(this,xh,document.createElement("canvas"));l.setAttribute("role","img"),this.addContainer(l),this.width=i/s,this.height=r/a,this.setDims(),(c=this._initialOptions)!=null&&c.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),Q(this,Rn,WU).call(this),g(this,m1)||(this.parent.addUndoableEditor(this),V(this,m1,!0)),this._reportTelemetry({action:"inserted_image"}),g(this,g1)&&this.div.setAttribute("aria-description",g(this,g1)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},AS=function(t,i){const{width:r,height:s}=g(this,Li);let a=r,o=s,l=g(this,Li);for(;a>2*t||o>2*i;){const c=a,h=o;a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*i&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(l,0,0,c,h,0,0,a,o),l=f.transferToImageBitmap()}return l},WU=function(){const[t,i]=this.parentDimensions,{width:r,height:s}=this,a=new uu,o=Math.ceil(r*t*a.sx),l=Math.ceil(s*i*a.sy),c=g(this,xh);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const h=g(this,po)?g(this,Li):Q(this,Rn,AS).call(this,o,l),f=c.getContext("2d");f.filter=this._uiManager.hcmFilter,f.drawImage(h,0,0,h.width,h.height,0,0,o,l)},SS=function(t){if(t){if(g(this,po)){const s=this._uiManager.imageManager.getSvgUrl(g(this,Xr));if(s)return s}const i=document.createElement("canvas");return{width:i.width,height:i.height}=g(this,Li),i.getContext("2d").drawImage(g(this,Li),0,0),i.toDataURL()}if(g(this,po)){const[i,r]=this.pageDimensions,s=Math.round(this.width*i*tp.PDF_TO_CSS_UNITS),a=Math.round(this.height*r*tp.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(g(this,Li),0,0,g(this,Li).width,g(this,Li).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(g(this,Li))},SJ=function(t){var o;const{pageIndex:i,accessibilityData:{altText:r}}=this._initialData,s=t.pageIndex===i,a=(((o=t.accessibilityData)==null?void 0:o.alt)||"")===r;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},Ze(VU,"_type","stamp"),Ze(VU,"_editorType",sn.STAMP);var Im,y1,Uf,Pf,bh,Na,Lf,v1,_1,$l,Th,Kr,Eh,Of,x1,Ot,Bf,ti,$x,DJ,wc,zU,GU,DS;const Ul=class Ul{constructor({uiManager:e,pageIndex:t,div:i,structTreeLayer:r,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}){Y(this,ti);Y(this,Im);Y(this,y1,!1);Y(this,Uf,null);Y(this,Pf,null);Y(this,bh,null);Y(this,Na,new Map);Y(this,Lf,!1);Y(this,v1,!1);Y(this,_1,!1);Y(this,$l,null);Y(this,Th,null);Y(this,Kr,null);Y(this,Eh,null);Y(this,Of,null);Y(this,x1,-1);Y(this,Ot);const f=[...g(Ul,Bf).values()];if(!Ul._initialized){Ul._initialized=!0;for(const p of f)p.initialize(h,e)}e.registerEditorTypes(f),V(this,Ot,e),this.pageIndex=t,this.div=i,V(this,Im,s),V(this,Uf,a),this.viewport=c,V(this,Kr,l),this.drawLayer=o,this._structTree=r,g(this,Ot).addLayer(this)}updatePageIndex(e){for(const t of g(this,ti,$x))t.updatePageIndex(e);this.pageIndex=e,g(this,Ot).addLayer(this)}async setClonedFrom(e){if(!e)return;const t=[];for(const i of g(e,ti,$x)){const r=i.serialize(!0);r&&(r.isCopy=!1,t.push(this.deserialize(r).then(s=>{s&&this.addOrRebuild(s)})))}await Promise.all(t)}get isEmpty(){return g(this,Na).size===0}get isInvisible(){return this.isEmpty&&g(this,Ot).getMode()===sn.NONE}updateToolbar(e){g(this,Ot).updateToolbar(e)}updateMode(e=g(this,Ot).getMode()){switch(Q(this,ti,DS).call(this),e){case sn.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case sn.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case sn.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;if(t.toggle("nonEditing",!1),e===sn.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(const i of g(Ul,Bf).values())t.toggle(`${i._type}Editing`,e===i._editorType)}this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=g(this,Kr))==null?void 0:t.div)}setEditingState(e){g(this,Ot).setEditingState(e)}addCommands(e){g(this,Ot).addCommands(e)}cleanUndoStack(e){g(this,Ot).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var t;(t=g(this,Uf))==null||t.togglePointerEvents(e)}async enable(){var i;V(this,_1,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),(i=g(this,Of))==null||i.abort(),V(this,Of,null);const e=new Set;for(const r of g(this,ti,$x))r.enableEditing(),r.show(!0),r.annotationElementId&&(g(this,Ot).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));const t=g(this,Uf);if(t)for(const r of t.getEditableAnnotations()){if(r.hide(),g(this,Ot).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const s=await this.deserialize(r);s&&(this.addOrRebuild(s),s.enableEditing())}V(this,_1,!1),g(this,Ot)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){var r;if(V(this,v1,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),g(this,Kr)&&!g(this,Of)){V(this,Of,new AbortController);const s=g(this,Ot).combinedSignal(g(this,Of));g(this,Kr).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:h}=a,f=g(this,x1);if(h-f>500){V(this,x1,h);return}V(this,x1,-1);const{classList:p}=this.div;p.toggle("getElements",!0);const y=document.elementsFromPoint(l,c);if(p.toggle("getElements",!1),!this.div.contains(y[0]))return;let x;const v=new RegExp(`^${vb}[0-9]+$`);for(const E of y)if(v.test(E.id)){x=E.id;break}if(!x)return;const _=g(this,Na).get(x);(_==null?void 0:_.annotationElementId)===null&&(a.stopPropagation(),a.preventDefault(),_.dblclick(a))},{signal:s,capture:!0})}const e=g(this,Uf),t=[];if(e){const s=new Map,a=new Map;for(const l of g(this,ti,$x)){if(l.disableEditing(),!l.annotationElementId){t.push(l);continue}if(l.serialize()!==null){s.set(l.annotationElementId,l);continue}else a.set(l.annotationElementId,l);(r=this.getEditableAnnotation(l.annotationElementId))==null||r.show(),l.remove()}const o=e.getEditableAnnotations();for(const l of o){const{id:c}=l.data;if(g(this,Ot).isDeletedAnnotationElement(c)){l.updateEdited({deleted:!0});continue}let h=a.get(c);if(h){h.resetAnnotationElement(l),h.show(!1),l.show();continue}h=s.get(c),h&&(g(this,Ot).addChangedExistingAnnotation(h),h.renderAnnotationElement(l)&&h.show(!1)),l.show()}}Q(this,ti,DS).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const s of g(Ul,Bf).values())i.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e==null||e.updateFakeAnnotations(t),V(this,v1,!1)}getEditableAnnotation(e){var t;return((t=g(this,Uf))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){g(this,Ot).getActive()!==e&&g(this,Ot).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=g(this,Kr))!=null&&e.div&&!g(this,Eh)){V(this,Eh,new AbortController);const t=g(this,Ot).combinedSignal(g(this,Eh));g(this,Kr).div.addEventListener("pointerdown",Q(this,ti,DJ).bind(this),{signal:t}),g(this,Kr).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=g(this,Kr))!=null&&e.div&&g(this,Eh)&&(g(this,Eh).abort(),V(this,Eh,null),g(this,Kr).div.classList.remove("highlighting"))}enableClick(){if(g(this,Pf))return;V(this,Pf,new AbortController);const e=g(this,Ot).combinedSignal(g(this,Pf));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){var e;(e=g(this,Pf))==null||e.abort(),V(this,Pf,null)}attach(e){g(this,Na).set(e.id,e);const{annotationElementId:t}=e;t&&g(this,Ot).isDeletedAnnotationElement(t)&&g(this,Ot).removeDeletedAnnotationElement(e)}detach(e){var t;g(this,Na).delete(e.id),(t=g(this,Im))==null||t.removePointerInTextLayer(e.contentDiv),!g(this,v1)&&e.annotationElementId&&g(this,Ot).addDeletedAnnotationElement(e)}remove(e){this.detach(e),g(this,Ot).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(g(this,Ot).addDeletedAnnotationElement(e),Ei.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(t=e.parent)==null||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),g(this,Ot).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!g(this,_1)),g(this,Ot).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var i;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!g(this,bh)&&(e._focusEventsAllowed=!1,V(this,bh,setTimeout(()=>{V(this,bh,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:g(this,Ot)._signal}),t.focus())},0))),e._structTreeParentId=(i=g(this,Im))==null?void 0:i.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const t=()=>e._uiManager.rebuild(e),i=()=>{e.remove()};this.addCommands({cmd:t,undo:i,mustExec:!1})}getEditorByUID(e){for(const t of g(this,Na).values())if(t.uid===e)return t;return null}getNextId(){return g(this,Ot).getId()}combinedSignal(e){return g(this,Ot).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=g(this,ti,wc))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await g(this,Ot).updateMode(e.mode);const{offsetX:i,offsetY:r}=Q(this,ti,GU).call(this),s=this.getNextId(),a=Q(this,ti,zU).call(this,{parent:this,id:s,x:i,y:r,uiManager:g(this,Ot),isCentered:!0,...t});a&&this.add(a)}async deserialize(e){var t;return await((t=g(Ul,Bf).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,g(this,Ot)))||null}createAndAddNewEditor(e,t,i={}){const r=this.getNextId(),s=Q(this,ti,zU).call(this,{parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:g(this,Ot),isCentered:t,...i});return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(Q(this,ti,GU).call(this),!0,e)}setSelected(e){g(this,Ot).setSelected(e)}toggleSelected(e){g(this,Ot).toggleSelected(e)}unselect(e){g(this,Ot).unselect(e)}pointerup(e){var r;const{isMac:t}=Pr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!g(this,Lf)||(V(this,Lf,!1),(r=g(this,ti,wc))!=null&&r.isDrawer&&g(this,ti,wc).supportMultipleDrawings))return;if(!g(this,y1)){V(this,y1,!0);return}const i=g(this,Ot).getMode();if(i===sn.STAMP||i===sn.SIGNATURE){g(this,Ot).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var r;if(g(this,Ot).getMode()===sn.HIGHLIGHT&&this.enableTextSelection(),g(this,Lf)){V(this,Lf,!1);return}const{isMac:t}=Pr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(V(this,Lf,!0),(r=g(this,ti,wc))!=null&&r.isDrawer){this.startDrawingSession(e);return}const i=g(this,Ot).getActive();V(this,y1,!i||i.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),g(this,$l)){g(this,ti,wc).startDrawing(this,g(this,Ot),!1,e);return}g(this,Ot).setCurrentDrawingSession(this),V(this,$l,new AbortController);const t=g(this,Ot).combinedSignal(g(this,$l));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(V(this,Th,null),this.commitOrRemove())},{signal:t}),g(this,ti,wc).startDrawing(this,g(this,Ot),!1,e)}pause(e){if(e){const{activeElement:t}=document;this.div.contains(t)&&V(this,Th,t);return}g(this,Th)&&setTimeout(()=>{var t;(t=g(this,Th))==null||t.focus(),V(this,Th,null)},0)}endDrawingSession(e=!1){return g(this,$l)?(g(this,Ot).setCurrentDrawingSession(null),g(this,$l).abort(),V(this,$l,null),V(this,Th,null),g(this,ti,wc).endDrawing(e)):null}findNewParent(e,t,i){const r=g(this,Ot).findParent(t,i);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return g(this,$l)?(this.endDrawingSession(),!0):!1}onScaleChanging(){g(this,$l)&&g(this,ti,wc).onScaleChangingWhenDrawing(this)}destroy(){var e,t;this.commitOrRemove(),((e=g(this,Ot).getActive())==null?void 0:e.parent)===this&&(g(this,Ot).commitOrRemove(),g(this,Ot).setActiveEditor(null)),g(this,bh)&&(clearTimeout(g(this,bh)),V(this,bh,null));for(const i of g(this,Na).values())(t=g(this,Im))==null||t.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,g(this,Na).clear(),g(this,Ot).removeLayer(this)}render({viewport:e}){this.viewport=e,Lm(this.div,e);for(const t of g(this,Ot).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){g(this,Ot).commitOrRemove(),Q(this,ti,DS).call(this);const t=this.viewport.rotation,i=e.rotation;if(this.viewport=e,Lm(this.div,{rotation:i}),t!==i)for(const r of g(this,Na).values())r.rotate(i)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return g(this,Ot).viewParameters.realScale}};Im=new WeakMap,y1=new WeakMap,Uf=new WeakMap,Pf=new WeakMap,bh=new WeakMap,Na=new WeakMap,Lf=new WeakMap,v1=new WeakMap,_1=new WeakMap,$l=new WeakMap,Th=new WeakMap,Kr=new WeakMap,Eh=new WeakMap,Of=new WeakMap,x1=new WeakMap,Ot=new WeakMap,Bf=new WeakMap,ti=new WeakSet,$x=function(){return g(this,Na).size!==0?g(this,Na).values():g(this,Ot).getEditors(this.pageIndex)},DJ=function(e){g(this,Ot).unselectAll();const{target:t}=e;if(t===g(this,Kr).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&g(this,Kr).div.contains(t)){const{isMac:i}=Pr.platform;if(e.button!==0||e.ctrlKey&&i)return;g(this,Ot).showAllEditors("highlight",!0,!0),g(this,Kr).div.classList.add("free"),this.toggleDrawing(),BD.startHighlighting(this,g(this,Ot).direction==="ltr",{target:g(this,Kr).div,x:e.x,y:e.y}),g(this,Kr).div.addEventListener("pointerup",()=>{g(this,Kr).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:g(this,Ot)._signal}),e.preventDefault()}},wc=function(){return g(Ul,Bf).get(g(this,Ot).getMode())},zU=function(e){const t=g(this,ti,wc);return t?new t.prototype.constructor(e):null},GU=function(){const{x:e,y:t,width:i,height:r}=this.boundingClientRect,s=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+i),l=Math.min(window.innerHeight,t+r),c=(s+o)/2-e,h=(a+l)/2-t,[f,p]=this.viewport.rotation%180===0?[c,h]:[h,c];return{offsetX:f,offsetY:p}},DS=function(){for(const e of g(this,Na).values())e.isEmpty()&&e.remove()},Ze(Ul,"_initialized",!1),Y(Ul,Bf,new Map([EU,MU,VU,BD,BU].map(e=>[e._editorType,e])));let HU=Ul;var jl,ia,Rm,VT,qC,CJ,gu,$U,IJ,jU;const Rr=class Rr{constructor(){Y(this,gu);Y(this,jl,null);Y(this,ia,new Map);Y(this,Rm,new Map)}setParent(e){if(!g(this,jl)){V(this,jl,e);return}if(g(this,jl)!==e){if(g(this,ia).size>0)for(const t of g(this,ia).values())t.remove(),e.append(t);V(this,jl,e)}}static get _svgFactory(){return tn(this,"_svgFactory",new LD)}draw(e,t=!1,i=!1){const r=Dr(Rr,VT)._++,s=Q(this,gu,$U).call(this),a=Rr._svgFactory.createElement("defs");s.append(a);const o=Rr._svgFactory.createElement("path");a.append(o);const l=`path_${r}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&g(this,Rm).set(r,o);const c=i?Q(this,gu,IJ).call(this,a,l):null,h=Rr._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(s,e),g(this,ia).set(r,s),{id:r,clipPathId:`url(#${c})`}}drawOutline(e,t){const i=Dr(Rr,VT)._++,r=Q(this,gu,$U).call(this),s=Rr._svgFactory.createElement("defs");r.append(s);const a=Rr._svgFactory.createElement("path");s.append(a);const o=`path_${i}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){const f=Rr._svgFactory.createElement("mask");s.append(f),l=`mask_${i}`,f.setAttribute("id",l),f.setAttribute("maskUnits","objectBoundingBox");const p=Rr._svgFactory.createElement("rect");f.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");const y=Rr._svgFactory.createElement("use");f.append(y),y.setAttribute("href",`#${o}`),y.setAttribute("stroke","none"),y.setAttribute("fill","black"),y.setAttribute("fill-rule","nonzero"),y.classList.add("mask")}const c=Rr._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const h=c.cloneNode();return r.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(r,e),g(this,ia).set(i,r),i}finalizeDraw(e,t){g(this,Rm).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var l;if(!t)return;const{root:i,bbox:r,rootClass:s,path:a}=t,o=typeof e=="number"?g(this,ia).get(e):e;if(o){if(i&&Q(this,gu,jU).call(this,o,i),r&&Q(l=Rr,qC,CJ).call(l,o,r),s){const{classList:c}=o;for(const[h,f]of Object.entries(s))c.toggle(h,f)}if(a){const h=o.firstElementChild.firstElementChild;Q(this,gu,jU).call(this,h,a)}}}updateParent(e,t){if(t===this)return;const i=g(this,ia).get(e);i&&(g(t,jl).append(i),g(this,ia).delete(e),g(t,ia).set(e,i))}remove(e){g(this,Rm).delete(e),g(this,jl)!==null&&(g(this,ia).get(e).remove(),g(this,ia).delete(e))}destroy(){V(this,jl,null);for(const e of g(this,ia).values())e.remove();g(this,ia).clear(),g(this,Rm).clear()}};jl=new WeakMap,ia=new WeakMap,Rm=new WeakMap,VT=new WeakMap,qC=new WeakSet,CJ=function(e,[t,i,r,s]){const{style:a}=e;a.top=`${100*i}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*s}%`},gu=new WeakSet,$U=function(){const e=Rr._svgFactory.create(1,1,!0);return g(this,jl).append(e),e.setAttribute("aria-hidden",!0),e},IJ=function(e,t){const i=Rr._svgFactory.createElement("clipPath");e.append(i);const r=`clip_${t}`;i.setAttribute("id",r),i.setAttribute("clipPathUnits","objectBoundingBox");const s=Rr._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),r},jU=function(e,t){for(const[i,r]of Object.entries(t))r===null?e.removeAttribute(i):e.setAttribute(i,r)},Y(Rr,qC),Y(Rr,VT,0);let qU=Rr;globalThis._pdfjsTestingUtils={HighlightOutliner:AU};globalThis.pdfjsLib={AbortException:ep,AnnotationEditorLayer:HU,AnnotationEditorParamsType:Dn,AnnotationEditorType:sn,AnnotationEditorUIManager:Om,AnnotationLayer:bU,AnnotationMode:Hd,AnnotationType:fr,applyOpacity:__e,build:Sxe,ColorPicker:UD,createValidAbsoluteUrl:lK,CSSConstants:v_e,DOMSVGFactory:LD,DrawLayer:qU,FeatureTest:Pr,fetchData:XT,findContrastColor:x_e,getDocument:SY,getFilenameFromUrl:f_e,getPdfFilenameFromUrl:p_e,getRGB:YT,getUuid:uK,getXfaPageViewport:g_e,GlobalWorkerOptions:nu,ImageKind:qA,InvalidPDFException:xF,isDataScheme:hI,isPdfFile:T4,isValidExplicitDest:k_e,makeArr:hK,makeMap:x4,makeObj:TF,MathClamp:Yr,noContextMenu:gl,normalizeUnicode:h_e,OPS:_b,OutputScale:uu,PasswordResponses:t_e,PDFDataRangeTransport:DY,PDFDateString:ID,PDFWorker:Eb,PermissionFlag:e_e,PixelsPerInch:tp,RenderingCancelledException:b4,renderRichText:pK,ResponseException:CD,setLayerDimensions:Lm,shadow:tn,SignatureExtractor:wh,stopEvent:Yi,SupportedImageMimeTypes:EF,TextLayer:Tb,TouchManager:ND,updateUrlHash:cK,Util:St,VerbosityLevel:oI,version:Axe,XfaLayer:dK};const Yxe=""+new URL("pdf.worker-CliDBb4N.mjs",import.meta.url).href;var Ho={},R4="1.13.8",uW=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},xI=Array.prototype,N4=Object.prototype,hW=typeof Symbol<"u"?Symbol.prototype:null,Jxe=xI.push,ZT=xI.slice,wb=N4.toString,Qxe=N4.hasOwnProperty,RJ=typeof ArrayBuffer<"u",Zxe=typeof DataView<"u",ebe=Array.isArray,dW=Object.keys,fW=Object.create,pW=RJ&&ArrayBuffer.isView,tbe=isNaN,nbe=isFinite,NJ=!{toString:null}.propertyIsEnumerable("toString"),gW=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ibe=Math.pow(2,53)-1;function pa(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),i=Array(t),r=0;r<t;r++)i[r]=arguments[r+e];switch(e){case 0:return n.call(this,i);case 1:return n.call(this,arguments[0],i);case 2:return n.call(this,arguments[0],arguments[1],i)}var s=Array(e+1);for(r=0;r<e;r++)s[r]=arguments[r];return s[e]=i,n.apply(this,s)}}function _p(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function kJ(n){return n===null}function k4(n){return n===void 0}function M4(n){return n===!0||n===!1||wb.call(n)==="[object Boolean]"}function MJ(n){return!!(n&&n.nodeType===1)}function Ks(n){var e="[object "+n+"]";return function(t){return wb.call(t)===e}}const bI=Ks("String"),F4=Ks("Number"),FJ=Ks("Date"),UJ=Ks("RegExp"),PJ=Ks("Error"),U4=Ks("Symbol"),P4=Ks("ArrayBuffer");var LJ=Ks("Function"),rbe=uW.document&&uW.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof rbe!="function"&&(LJ=function(n){return typeof n=="function"||!1});const js=LJ,OJ=Ks("Object");var BJ=Zxe&&(!/\[native code\]/.test(String(DataView))||OJ(new DataView(new ArrayBuffer(8)))),L4=typeof Map<"u"&&OJ(new Map),sbe=Ks("DataView");function abe(n){return n!=null&&js(n.getInt8)&&P4(n.buffer)}const Ab=BJ?abe:sbe,xp=ebe||Ks("Array");function bp(n,e){return n!=null&&Qxe.call(n,e)}var XU=Ks("Arguments");(function(){XU(arguments)||(XU=function(n){return bp(n,"callee")})})();const TI=XU;function VJ(n){return!U4(n)&&nbe(n)&&!isNaN(parseFloat(n))}function O4(n){return F4(n)&&tbe(n)}function B4(n){return function(){return n}}function WJ(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=ibe}}function HJ(n){return function(e){return e==null?void 0:e[n]}}const WD=HJ("byteLength"),obe=WJ(WD);var lbe=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function cbe(n){return pW?pW(n)&&!Ab(n):obe(n)&&lbe.test(wb.call(n))}const V4=RJ?cbe:B4(!1),Gs=HJ("length");function ube(n){for(var e={},t=n.length,i=0;i<t;++i)e[n[i]]=!0;return{contains:function(r){return e[r]===!0},push:function(r){return e[r]=!0,n.push(r)}}}function zJ(n,e){e=ube(e);var t=gW.length,i=n.constructor,r=js(i)&&i.prototype||N4,s="constructor";for(bp(n,s)&&!e.contains(s)&&e.push(s);t--;)s=gW[t],s in n&&n[s]!==r[s]&&!e.contains(s)&&e.push(s)}function Or(n){if(!_p(n))return[];if(dW)return dW(n);var e=[];for(var t in n)bp(n,t)&&e.push(t);return NJ&&zJ(n,e),e}function GJ(n){if(n==null)return!0;var e=Gs(n);return typeof e=="number"&&(xp(n)||bI(n)||TI(n))?e===0:Gs(Or(n))===0}function W4(n,e){var t=Or(e),i=t.length;if(n==null)return!i;for(var r=Object(n),s=0;s<i;s++){var a=t[s];if(e[a]!==r[a]||!(a in r))return!1}return!0}function Hn(n){if(n instanceof Hn)return n;if(!(this instanceof Hn))return new Hn(n);this._wrapped=n}Hn.VERSION=R4;Hn.prototype.value=function(){return this._wrapped};Hn.prototype.valueOf=Hn.prototype.toJSON=Hn.prototype.value;Hn.prototype.toString=function(){return String(this._wrapped)};function mW(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,WD(n))}var yW="[object DataView]";function qJ(n,e){for(var t=[{a:n,b:e}],i=[],r=[];t.length;){var s=t.pop();if(s===!0){i.pop(),r.pop();continue}if(n=s.a,e=s.b,n===e){if(n!==0||1/n===1/e)continue;return!1}if(n==null||e==null)return!1;if(n!==n){if(e!==e)continue;return!1}var a=typeof n;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;n instanceof Hn&&(n=n._wrapped),e instanceof Hn&&(e=e._wrapped);var o=wb.call(n);if(o!==wb.call(e))return!1;if(BJ&&o=="[object Object]"&&Ab(n)){if(!Ab(e))return!1;o=yW}switch(o){case"[object RegExp]":case"[object String]":if(""+n==""+e)continue;return!1;case"[object Number]":t.push({a:+n,b:+e});continue;case"[object Date]":case"[object Boolean]":if(+n==+e)continue;return!1;case"[object Symbol]":if(hW.valueOf.call(n)===hW.valueOf.call(e))continue;return!1;case"[object ArrayBuffer]":case yW:t.push({a:mW(n),b:mW(e)});continue}var l=o==="[object Array]";if(!l&&V4(n)){var c=WD(n);if(c!==WD(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)continue;l=!0}if(!l){if(typeof n!="object"||typeof e!="object")return!1;var h=n.constructor,f=e.constructor;if(h!==f&&!(js(h)&&h instanceof h&&js(f)&&f instanceof f)&&"constructor"in n&&"constructor"in e)return!1}for(var p=i.length;p--;)if(i[p]===n){if(r[p]===e)break;return!1}if(!(p>=0))if(i.push(n),r.push(e),t.push(!0),l){if(p=n.length,p!==e.length)return!1;for(;p--;)t.push({a:n[p],b:e[p]})}else{var y=Or(n),x;if(p=y.length,Or(e).length!==p)return!1;for(;p--;){if(x=y[p],!bp(e,x))return!1;t.push({a:n[x],b:e[x]})}}}return!0}function G1(n){if(!_p(n))return[];var e=[];for(var t in n)e.push(t);return NJ&&zJ(n,e),e}function H4(n){var e=Gs(n);return function(t){if(t==null)return!1;var i=G1(t);if(Gs(i))return!1;for(var r=0;r<e;r++)if(!js(t[n[r]]))return!1;return n!==XJ||!js(t[z4])}}var z4="forEach",$J="has",G4=["clear","delete"],jJ=["get",$J,"set"],hbe=G4.concat(z4,jJ),XJ=G4.concat(jJ),dbe=["add"].concat(G4,z4,$J);const KJ=L4?H4(hbe):Ks("Map"),YJ=L4?H4(XJ):Ks("WeakMap"),JJ=L4?H4(dbe):Ks("Set"),QJ=Ks("WeakSet");function Zm(n){for(var e=Or(n),t=e.length,i=Array(t),r=0;r<t;r++)i[r]=n[e[r]];return i}function ZJ(n){for(var e=Or(n),t=e.length,i=Array(t),r=0;r<t;r++)i[r]=[e[r],n[e[r]]];return i}function q4(n){for(var e={},t=Or(n),i=0,r=t.length;i<r;i++)e[n[t[i]]]=t[i];return e}function Sb(n){var e=[];for(var t in n)js(n[t])&&e.push(t);return e.sort()}function $4(n,e){return function(t){var i=arguments.length;if(e&&(t=Object(t)),i<2||t==null)return t;for(var r=1;r<i;r++)for(var s=arguments[r],a=n(s),o=a.length,l=0;l<o;l++){var c=a[l];(!e||t[c]===void 0)&&(t[c]=s[c])}return t}}const j4=$4(G1),E1=$4(Or),X4=$4(G1,!0);function fbe(){return function(){}}function eQ(n){if(!_p(n))return{};if(fW)return fW(n);var e=fbe();e.prototype=n;var t=new e;return e.prototype=null,t}function tQ(n,e){var t=eQ(n);return e&&E1(t,e),t}function nQ(n){return _p(n)?xp(n)?n.slice():j4({},n):n}function iQ(n,e){return e(n),n}function K4(n){return xp(n)?n:[n]}Hn.toPath=K4;function eE(n){return Hn.toPath(n)}function Y4(n,e){for(var t=e.length,i=0;i<t;i++){if(n==null)return;n=n[e[i]]}return t?n:void 0}function J4(n,e,t){var i=Y4(n,eE(e));return k4(i)?t:i}function rQ(n,e){e=eE(e);for(var t=e.length,i=0;i<t;i++){var r=e[i];if(!bp(n,r))return!1;n=n[r]}return!!t}function EI(n){return n}function Vm(n){return n=E1({},n),function(e){return W4(e,n)}}function wI(n){return n=eE(n),function(e){return Y4(e,n)}}function tE(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(i){return n.call(e,i)};case 3:return function(i,r,s){return n.call(e,i,r,s)};case 4:return function(i,r,s,a){return n.call(e,i,r,s,a)}}return function(){return n.apply(e,arguments)}}function sQ(n,e,t){return n==null?EI:js(n)?tE(n,e,t):_p(n)&&!xp(n)?Vm(n):wI(n)}function AI(n,e){return sQ(n,e,1/0)}Hn.iteratee=AI;function Oa(n,e,t){return Hn.iteratee!==AI?Hn.iteratee(n,e):sQ(n,e,t)}function aQ(n,e,t){e=Oa(e,t);for(var i=Or(n),r=i.length,s={},a=0;a<r;a++){var o=i[a];s[o]=e(n[o],o,n)}return s}function Q4(){}function oQ(n){return n==null?Q4:function(e){return J4(n,e)}}function lQ(n,e,t){var i=Array(Math.max(0,n));e=tE(e,t,1);for(var r=0;r<n;r++)i[r]=e(r);return i}function HD(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const w1=Date.now||function(){return new Date().getTime()};function cQ(n){var e=function(s){return n[s]},t="(?:"+Or(n).join("|")+")",i=RegExp(t),r=RegExp(t,"g");return function(s){return s=s==null?"":""+s,i.test(s)?s.replace(r,e):s}}const uQ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},hQ=cQ(uQ),pbe=q4(uQ),dQ=cQ(pbe),fQ=Hn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t3=/(.)^/,gbe={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},mbe=/\\|'|\r|\n|\u2028|\u2029/g;function ybe(n){return"\\"+gbe[n]}var vbe=/^\s*(\w|\$)+\s*$/;function pQ(n,e,t){!e&&t&&(e=t),e=X4({},e,Hn.templateSettings);var i=RegExp([(e.escape||t3).source,(e.interpolate||t3).source,(e.evaluate||t3).source].join("|")+"|$","g"),r=0,s="__p+='";n.replace(i,function(c,h,f,p,y){return s+=n.slice(r,y).replace(mbe,ybe),r=y+c.length,h?s+=`'+
((__t=(`+h+`))==null?'':_.escape(__t))+
'`:f?s+=`'+
((__t=(`+f+`))==null?'':__t)+
'`:p&&(s+=`';
`+p+`
__p+='`),c}),s+=`';
`;var a=e.variable;if(a){if(!vbe.test(a))throw new Error("variable is not a bare identifier: "+a)}else s=`with(obj||{}){
`+s+`}
`,a="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
`+s+`return __p;
`;var o;try{o=new Function(a,"_",s)}catch(c){throw c.source=s,c}var l=function(c){return o.call(this,c,Hn)};return l.source="function("+a+`){
`+s+"}",l}function gQ(n,e,t){e=eE(e);var i=e.length;if(!i)return js(t)?t.call(n):t;for(var r=0;r<i;r++){var s=n==null?void 0:n[e[r]];s===void 0&&(s=t,r=i),n=js(s)?s.call(n):s}return n}var _be=0;function mQ(n){var e=++_be+"";return n?n+e:e}function yQ(n){var e=Hn(n);return e._chain=!0,e}function vQ(n,e,t,i,r){if(!(i instanceof e))return n.apply(t,r);var s=eQ(n.prototype),a=n.apply(s,r);return _p(a)?a:s}var e0=pa(function(n,e){var t=e0.placeholder,i=function(){for(var r=0,s=e.length,a=Array(s),o=0;o<s;o++)a[o]=e[o]===t?arguments[r++]:e[o];for(;r<arguments.length;)a.push(arguments[r++]);return vQ(n,i,this,this,a)};return i});e0.placeholder=Hn;const Z4=pa(function(n,e,t){if(!js(n))throw new TypeError("Bind must be called on a function");var i=pa(function(r){return vQ(n,i,e,this,t.concat(r))});return i}),Co=WJ(Gs);function q1(n,e,t){!e&&e!==0&&(e=1/0);for(var i=[],r=0,s=0,a=Gs(n)||0,o=[];;){if(s>=a){if(!o.length)break;var l=o.pop();s=l.i,n=l.v,a=Gs(n);continue}var c=n[s++];o.length>=e?i[r++]=c:Co(c)&&(xp(c)||TI(c))?(o.push({i:s,v:n}),s=0,n=c,a=Gs(n)):t||(i[r++]=c)}return i}const _Q=pa(function(n,e){e=q1(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var i=e[t];n[i]=Z4(n[i],n)}return n});function xQ(n,e){var t=function(i){var r=t.cache,s=""+(e?e.apply(this,arguments):i);return bp(r,s)||(r[s]=n.apply(this,arguments)),r[s]};return t.cache={},t}const eL=pa(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),bQ=e0(eL,Hn,1);function TQ(n,e,t){var i,r,s,a,o=0;t||(t={});var l=function(){o=t.leading===!1?0:w1(),i=null,a=n.apply(r,s),i||(r=s=null)},c=function(){var h=w1();!o&&t.leading===!1&&(o=h);var f=e-(h-o);return r=this,s=arguments,f<=0||f>e?(i&&(clearTimeout(i),i=null),o=h,a=n.apply(r,s),i||(r=s=null)):!i&&t.trailing!==!1&&(i=setTimeout(l,f)),a};return c.cancel=function(){clearTimeout(i),o=0,i=r=s=null},c}function EQ(n,e,t){var i,r,s,a,o,l=function(){var h=w1()-r;e>h?i=setTimeout(l,e-h):(i=null,t||(a=n.apply(o,s)),i||(s=o=null))},c=pa(function(h){return o=this,s=h,r=w1(),i||(i=setTimeout(l,e),t&&(a=n.apply(o,s))),a});return c.cancel=function(){clearTimeout(i),i=s=o=null},c}function wQ(n,e){return e0(e,n)}function SI(n){return function(){return!n.apply(this,arguments)}}function AQ(){var n=arguments,e=n.length-1;return function(){for(var t=e,i=n[e].apply(this,arguments);t--;)i=n[t].call(this,i);return i}}function SQ(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function tL(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const DQ=e0(tL,2);function nL(n,e,t){e=Oa(e,t);for(var i=Or(n),r,s=0,a=i.length;s<a;s++)if(r=i[s],e(n[r],r,n))return r}function CQ(n){return function(e,t,i){t=Oa(t,i);for(var r=Gs(e),s=n>0?0:r-1;s>=0&&s<r;s+=n)if(t(e[s],s,e))return s;return-1}}const DI=CQ(1),iL=CQ(-1);function rL(n,e,t,i){t=Oa(t,i,1);for(var r=t(e),s=0,a=Gs(n);s<a;){var o=Math.floor((s+a)/2);t(n[o])<r?s=o+1:a=o}return s}function IQ(n,e,t){return function(i,r,s){var a=0,o=Gs(i);if(typeof s=="number")n>0?a=s>=0?s:Math.max(s+o,a):o=s>=0?Math.min(s+1,o):s+o+1;else if(t&&s&&o)return s=t(i,r),i[s]===r?s:-1;if(r!==r)return s=e(ZT.call(i,a,o),O4),s>=0?s+a:-1;for(s=n>0?a:o-1;s>=0&&s<o;s+=n)if(i[s]===r)return s;return-1}}const sL=IQ(1,DI,rL),RQ=IQ(-1,iL);function Db(n,e,t){var i=Co(n)?DI:nL,r=i(n,e,t);if(r!==void 0&&r!==-1)return n[r]}function NQ(n,e){return Db(n,Vm(e))}function ac(n,e,t){e=tE(e,t);var i,r;if(Co(n))for(i=0,r=n.length;i<r;i++)e(n[i],i,n);else{var s=Or(n);for(i=0,r=s.length;i<r;i++)e(n[s[i]],s[i],n)}return n}function Oh(n,e,t){e=Oa(e,t);for(var i=!Co(n)&&Or(n),r=(i||n).length,s=Array(r),a=0;a<r;a++){var o=i?i[a]:a;s[a]=e(n[o],o,n)}return s}function kQ(n){var e=function(t,i,r,s){var a=!Co(t)&&Or(t),o=(a||t).length,l=n>0?0:o-1;for(s||(r=t[a?a[l]:l],l+=n);l>=0&&l<o;l+=n){var c=a?a[l]:l;r=i(r,t[c],c,t)}return r};return function(t,i,r,s){var a=arguments.length>=3;return e(t,tE(i,s,4),r,a)}}const Uy=kQ(1),zD=kQ(-1);function np(n,e,t){var i=[];return e=Oa(e,t),ac(n,function(r,s,a){e(r,s,a)&&i.push(r)}),i}function MQ(n,e,t){return np(n,SI(Oa(e)),t)}function GD(n,e,t){e=Oa(e,t);for(var i=!Co(n)&&Or(n),r=(i||n).length,s=0;s<r;s++){var a=i?i[s]:s;if(!e(n[a],a,n))return!1}return!0}function qD(n,e,t){e=Oa(e,t);for(var i=!Co(n)&&Or(n),r=(i||n).length,s=0;s<r;s++){var a=i?i[s]:s;if(e(n[a],a,n))return!0}return!1}function ul(n,e,t,i){return Co(n)||(n=Zm(n)),(typeof t!="number"||i)&&(t=0),sL(n,e,t)>=0}const FQ=pa(function(n,e,t){var i,r;return js(e)?r=e:(e=eE(e),i=e.slice(0,-1),e=e[e.length-1]),Oh(n,function(s){var a=r;if(!a){if(i&&i.length&&(s=Y4(s,i)),s==null)return;a=s[e]}return a==null?a:a.apply(s,t)})});function CI(n,e){return Oh(n,wI(e))}function UQ(n,e){return np(n,Vm(e))}function aL(n,e,t){var i=-1/0,r=-1/0,s,a;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Co(n)?n:Zm(n);for(var o=0,l=n.length;o<l;o++)s=n[o],s!=null&&s>i&&(i=s)}else e=Oa(e,t),ac(n,function(c,h,f){a=e(c,h,f),(a>r||a===-1/0&&i===-1/0)&&(i=c,r=a)});return i}function PQ(n,e,t){var i=1/0,r=1/0,s,a;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Co(n)?n:Zm(n);for(var o=0,l=n.length;o<l;o++)s=n[o],s!=null&&s<i&&(i=s)}else e=Oa(e,t),ac(n,function(c,h,f){a=e(c,h,f),(a<r||a===1/0&&i===1/0)&&(i=c,r=a)});return i}var xbe=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function oL(n){return n?xp(n)?ZT.call(n):bI(n)?n.match(xbe):Co(n)?Oh(n,EI):Zm(n):[]}function lL(n,e,t){if(e==null||t)return Co(n)||(n=Zm(n)),n[HD(n.length-1)];var i=oL(n),r=Gs(i);e=Math.max(Math.min(e,r),0);for(var s=r-1,a=0;a<e;a++){var o=HD(a,s),l=i[a];i[a]=i[o],i[o]=l}return i.slice(0,e)}function LQ(n){return lL(n,1/0)}function OQ(n,e,t){var i=0;return e=Oa(e,t),CI(Oh(n,function(r,s,a){return{value:r,index:i++,criteria:e(r,s,a)}}).sort(function(r,s){var a=r.criteria,o=s.criteria;if(a!==o){if(a>o||a===void 0)return 1;if(a<o||o===void 0)return-1}return r.index-s.index}),"value")}function II(n,e){return function(t,i,r){var s=e?[[],[]]:{};return i=Oa(i,r),ac(t,function(a,o){var l=i(a,o,t);n(s,a,l)}),s}}const BQ=II(function(n,e,t){bp(n,t)?n[t].push(e):n[t]=[e]}),VQ=II(function(n,e,t){n[t]=e}),WQ=II(function(n,e,t){bp(n,t)?n[t]++:n[t]=1}),HQ=II(function(n,e,t){n[t?0:1].push(e)},!0);function zQ(n){return n==null?0:Co(n)?n.length:Or(n).length}function bbe(n,e,t){return e in t}const cL=pa(function(n,e){var t={},i=e[0];if(n==null)return t;js(i)?(e.length>1&&(i=tE(i,e[1])),e=G1(n)):(i=bbe,e=q1(e,!1,!1),n=Object(n));for(var r=0,s=e.length;r<s;r++){var a=e[r],o=n[a];i(o,a,n)&&(t[a]=o)}return t}),GQ=pa(function(n,e){var t=e[0],i;return js(t)?(t=SI(t),e.length>1&&(i=e[1])):(e=Oh(q1(e,!1,!1),String),t=function(r,s){return!ul(e,s)}),cL(n,t,i)});function uL(n,e,t){return ZT.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function Py(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:uL(n,n.length-e)}function Mm(n,e,t){return ZT.call(n,e==null||t?1:e)}function qQ(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:Mm(n,Math.max(0,n.length-e))}function $Q(n){return np(n,Boolean)}function jQ(n,e){return q1(n,e,!1)}const hL=pa(function(n,e){return e=q1(e,!0,!0),np(n,function(t){return!ul(e,t)})}),XQ=pa(function(n,e){return hL(n,e)});function Cb(n,e,t,i){M4(e)||(i=t,t=e,e=!1),t!=null&&(t=Oa(t,i));for(var r=[],s=[],a=0,o=Gs(n);a<o;a++){var l=n[a],c=t?t(l,a,n):l;e&&!t?((!a||s!==c)&&r.push(l),s=c):t?ul(s,c)||(s.push(c),r.push(l)):ul(r,l)||r.push(l)}return r}const KQ=pa(function(n){return Cb(q1(n,!0,!0))});function YQ(n){for(var e=[],t=arguments.length,i=0,r=Gs(n);i<r;i++){var s=n[i];if(!ul(e,s)){var a;for(a=1;a<t&&ul(arguments[a],s);a++);a===t&&e.push(s)}}return e}function Ib(n){for(var e=n&&aL(n,Gs).length||0,t=Array(e),i=0;i<e;i++)t[i]=CI(n,i);return t}const JQ=pa(Ib);function QQ(n,e){for(var t={},i=0,r=Gs(n);i<r;i++)e?t[n[i]]=e[i]:t[n[i][0]]=n[i][1];return t}function ZQ(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var i=Math.max(Math.ceil((e-n)/t),0),r=Array(i),s=0;s<i;s++,n+=t)r[s]=n;return r}function eZ(n,e){if(e==null||e<1)return[];for(var t=[],i=0,r=n.length;i<r;)t.push(ZT.call(n,i,i+=e));return t}function dL(n,e){return n._chain?Hn(e).chain():e}function fL(n){return ac(Sb(n),function(e){var t=Hn[e]=n[e];Hn.prototype[e]=function(){var i=[this._wrapped];return Jxe.apply(i,arguments),dL(this,t.apply(Hn,i))}}),Hn}ac(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=xI[n];Hn.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),dL(this,t)}});ac(["concat","join","slice"],function(n){var e=xI[n];Hn.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),dL(this,t)}});const Tbe=Object.freeze(Object.defineProperty({__proto__:null,VERSION:R4,after:SQ,all:GD,allKeys:G1,any:qD,assign:E1,before:tL,bind:Z4,bindAll:_Q,chain:yQ,chunk:eZ,clone:nQ,collect:Oh,compact:$Q,compose:AQ,constant:B4,contains:ul,countBy:WQ,create:tQ,debounce:EQ,default:Hn,defaults:X4,defer:bQ,delay:eL,detect:Db,difference:hL,drop:Mm,each:ac,escape:hQ,every:GD,extend:j4,extendOwn:E1,filter:np,find:Db,findIndex:DI,findKey:nL,findLastIndex:iL,findWhere:NQ,first:Py,flatten:jQ,foldl:Uy,foldr:zD,forEach:ac,functions:Sb,get:J4,groupBy:BQ,has:rQ,head:Py,identity:EI,include:ul,includes:ul,indexBy:VQ,indexOf:sL,initial:uL,inject:Uy,intersection:YQ,invert:q4,invoke:FQ,isArguments:TI,isArray:xp,isArrayBuffer:P4,isBoolean:M4,isDataView:Ab,isDate:FJ,isElement:MJ,isEmpty:GJ,isEqual:qJ,isError:PJ,isFinite:VJ,isFunction:js,isMap:KJ,isMatch:W4,isNaN:O4,isNull:kJ,isNumber:F4,isObject:_p,isRegExp:UJ,isSet:JJ,isString:bI,isSymbol:U4,isTypedArray:V4,isUndefined:k4,isWeakMap:YJ,isWeakSet:QJ,iteratee:AI,keys:Or,last:qQ,lastIndexOf:RQ,map:Oh,mapObject:aQ,matcher:Vm,matches:Vm,max:aL,memoize:xQ,methods:Sb,min:PQ,mixin:fL,negate:SI,noop:Q4,now:w1,object:QQ,omit:GQ,once:DQ,pairs:ZJ,partial:e0,partition:HQ,pick:cL,pluck:CI,property:wI,propertyOf:oQ,random:HD,range:ZQ,reduce:Uy,reduceRight:zD,reject:MQ,rest:Mm,restArguments:pa,result:gQ,sample:lL,select:np,shuffle:LQ,size:zQ,some:qD,sortBy:OQ,sortedIndex:rL,tail:Mm,take:Py,tap:iQ,template:pQ,templateSettings:fQ,throttle:TQ,times:lQ,toArray:oL,toPath:K4,transpose:Ib,unescape:dQ,union:KQ,uniq:Cb,unique:Cb,uniqueId:mQ,unzip:Ib,values:Zm,where:UQ,without:XQ,wrap:wQ,zip:JQ},Symbol.toStringTag,{value:"Module"}));var KU=fL(Tbe);KU._=KU;const Ebe=Object.freeze(Object.defineProperty({__proto__:null,VERSION:R4,after:SQ,all:GD,allKeys:G1,any:qD,assign:E1,before:tL,bind:Z4,bindAll:_Q,chain:yQ,chunk:eZ,clone:nQ,collect:Oh,compact:$Q,compose:AQ,constant:B4,contains:ul,countBy:WQ,create:tQ,debounce:EQ,default:KU,defaults:X4,defer:bQ,delay:eL,detect:Db,difference:hL,drop:Mm,each:ac,escape:hQ,every:GD,extend:j4,extendOwn:E1,filter:np,find:Db,findIndex:DI,findKey:nL,findLastIndex:iL,findWhere:NQ,first:Py,flatten:jQ,foldl:Uy,foldr:zD,forEach:ac,functions:Sb,get:J4,groupBy:BQ,has:rQ,head:Py,identity:EI,include:ul,includes:ul,indexBy:VQ,indexOf:sL,initial:uL,inject:Uy,intersection:YQ,invert:q4,invoke:FQ,isArguments:TI,isArray:xp,isArrayBuffer:P4,isBoolean:M4,isDataView:Ab,isDate:FJ,isElement:MJ,isEmpty:GJ,isEqual:qJ,isError:PJ,isFinite:VJ,isFunction:js,isMap:KJ,isMatch:W4,isNaN:O4,isNull:kJ,isNumber:F4,isObject:_p,isRegExp:UJ,isSet:JJ,isString:bI,isSymbol:U4,isTypedArray:V4,isUndefined:k4,isWeakMap:YJ,isWeakSet:QJ,iteratee:AI,keys:Or,last:qQ,lastIndexOf:RQ,map:Oh,mapObject:aQ,matcher:Vm,matches:Vm,max:aL,memoize:xQ,methods:Sb,min:PQ,mixin:fL,negate:SI,noop:Q4,now:w1,object:QQ,omit:GQ,once:DQ,pairs:ZJ,partial:e0,partition:HQ,pick:cL,pluck:CI,property:wI,propertyOf:oQ,random:HD,range:ZQ,reduce:Uy,reduceRight:zD,reject:MQ,rest:Mm,restArguments:pa,result:gQ,sample:lL,select:np,shuffle:LQ,size:zQ,some:qD,sortBy:OQ,sortedIndex:rL,tail:Mm,take:Py,tap:iQ,template:pQ,templateSettings:fQ,throttle:TQ,times:lQ,toArray:oL,toPath:K4,transpose:Ib,unescape:dQ,union:KQ,uniq:Cb,unique:Cb,uniqueId:mQ,unzip:Ib,values:Zm,where:UQ,without:XQ,wrap:wQ,zip:JQ},Symbol.toStringTag,{value:"Module"})),sr=rse(Ebe);var aA={},zo={},n3={exports:{}},oA={exports:{}},vW;function $1(){if(vW)return oA.exports;vW=1;var n=(function(){return this===void 0})();if(n)oA.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(h,f){var p=Object.getOwnPropertyDescriptor(h,f);return!!(!p||p.writable||p.set)}};else{var e={}.hasOwnProperty,t={}.toString,i={}.constructor.prototype,r=function(h){var f=[];for(var p in h)e.call(h,p)&&f.push(p);return f},s=function(h,f){return{value:h[f]}},a=function(h,f,p){return h[f]=p.value,h},o=function(h){return h},l=function(h){try{return Object(h).constructor.prototype}catch{return i}},c=function(h){try{return t.call(h)==="[object Array]"}catch{return!1}};oA.exports={isArray:c,keys:r,names:r,defineProperty:a,getDescriptor:s,freeze:o,getPrototypeOf:l,isES5:n,propertyIsWritable:function(){return!0}}}return oA.exports}var lx,_W;function wi(){if(_W)return lx;_W=1;var n={},e=$1(),t=typeof navigator>"u",i={e:{}},r,s=typeof self<"u"?self:typeof window<"u"?window:typeof Vf<"u"?Vf:lx!==void 0?lx:null;function a(){try{var Z=r;return r=null,Z.apply(this,arguments)}catch(te){return i.e=te,i}}function o(Z){return r=Z,a}var l=function(Z,te){var ie={}.hasOwnProperty;function _e(){this.constructor=Z,this.constructor$=te;for(var Ie in te.prototype)ie.call(te.prototype,Ie)&&Ie.charAt(Ie.length-1)!=="$"&&(this[Ie+"$"]=te.prototype[Ie])}return _e.prototype=te.prototype,Z.prototype=new _e,Z.prototype};function c(Z){return Z==null||Z===!0||Z===!1||typeof Z=="string"||typeof Z=="number"}function h(Z){return typeof Z=="function"||typeof Z=="object"&&Z!==null}function f(Z){return c(Z)?new Error(C(Z)):Z}function p(Z,te){var ie=Z.length,_e=new Array(ie+1),Ie;for(Ie=0;Ie<ie;++Ie)_e[Ie]=Z[Ie];return _e[Ie]=te,_e}function y(Z,te,ie){if(e.isES5){var _e=Object.getOwnPropertyDescriptor(Z,te);if(_e!=null)return _e.get==null&&_e.set==null?_e.value:ie}else return{}.hasOwnProperty.call(Z,te)?Z[te]:void 0}function x(Z,te,ie){if(c(Z))return Z;var _e={value:ie,configurable:!0,enumerable:!1,writable:!0};return e.defineProperty(Z,te,_e),Z}function v(Z){throw Z}var _=(function(){var Z=[Array.prototype,Object.prototype,Function.prototype],te=function(Ie){for(var Pe=0;Pe<Z.length;++Pe)if(Z[Pe]===Ie)return!0;return!1};if(e.isES5){var ie=Object.getOwnPropertyNames;return function(Ie){for(var Pe=[],Fe=Object.create(null);Ie!=null&&!te(Ie);){var Ge;try{Ge=ie(Ie)}catch{return Pe}for(var ct=0;ct<Ge.length;++ct){var gt=Ge[ct];if(!Fe[gt]){Fe[gt]=!0;var Mt=Object.getOwnPropertyDescriptor(Ie,gt);Mt!=null&&Mt.get==null&&Mt.set==null&&Pe.push(gt)}}Ie=e.getPrototypeOf(Ie)}return Pe}}else{var _e={}.hasOwnProperty;return function(Ie){if(te(Ie))return[];var Pe=[];e:for(var Fe in Ie)if(_e.call(Ie,Fe))Pe.push(Fe);else{for(var Ge=0;Ge<Z.length;++Ge)if(_e.call(Z[Ge],Fe))continue e;Pe.push(Fe)}return Pe}}})(),E=/this\s*\.\s*\S+\s*=/;function w(Z){try{if(typeof Z=="function"){var te=e.names(Z.prototype),ie=e.isES5&&te.length>1,_e=te.length>0&&!(te.length===1&&te[0]==="constructor"),Ie=E.test(Z+"")&&e.names(Z).length>0;if(ie||_e||Ie)return!0}return!1}catch{return!1}}function A(Z){return Z}var N=/^[a-z$_][a-z$_0-9]*$/i;function k(Z){return N.test(Z)}function F(Z,te,ie){for(var _e=new Array(Z),Ie=0;Ie<Z;++Ie)_e[Ie]=te+Ie+ie;return _e}function C(Z){try{return Z+""}catch{return"[no string representation]"}}function M(Z){return Z!==null&&typeof Z=="object"&&typeof Z.message=="string"&&typeof Z.name=="string"}function R(Z){try{x(Z,"isOperational",!0)}catch{}}function L(Z){return Z==null?!1:Z instanceof Error.__BluebirdErrorTypes__.OperationalError||Z.isOperational===!0}function H(Z){return M(Z)&&e.propertyIsWritable(Z,"stack")}var P=(function(){return"stack"in new Error?function(Z){return H(Z)?Z:new Error(C(Z))}:function(Z){if(H(Z))return Z;try{throw new Error(C(Z))}catch(te){return te}}})();function O(Z){return{}.toString.call(Z)}function B(Z,te,ie){for(var _e=e.names(Z),Ie=0;Ie<_e.length;++Ie){var Pe=_e[Ie];if(ie(Pe))try{e.defineProperty(te,Pe,e.getDescriptor(Z,Pe))}catch{}}}var re=function(Z){return e.isArray(Z)?Z:null};if(typeof Symbol<"u"&&Symbol.iterator){var q=typeof Array.from=="function"?function(Z){return Array.from(Z)}:function(Z){for(var te=[],ie=Z[Symbol.iterator](),_e;!(_e=ie.next()).done;)te.push(_e.value);return te};re=function(Z){return e.isArray(Z)?Z:Z!=null&&typeof Z[Symbol.iterator]=="function"?q(Z):null}}var X=typeof process<"u"&&O(process).toLowerCase()==="[object process]",oe=typeof process<"u"&&typeof n<"u";function ue(Z){return oe?n[Z]:void 0}function ge(){if(typeof Promise=="function")try{var Z=new Promise(function(){});if({}.toString.call(Z)==="[object Promise]")return Promise}catch{}}function j(Z,te){return Z.bind(te)}var G={isClass:w,isIdentifier:k,inheritedDataKeys:_,getDataPropertyOrDefault:y,thrower:v,isArray:e.isArray,asArray:re,notEnumerableProp:x,isPrimitive:c,isObject:h,isError:M,canEvaluate:t,errorObj:i,tryCatch:o,inherits:l,withAppended:p,maybeWrapAsError:f,toFastProperties:A,filledRange:F,toString:C,canAttachTrace:H,ensureErrorObject:P,originatesFromRejection:L,markAsOriginatingFromRejection:R,classString:O,copyDescriptors:B,hasDevTools:typeof chrome<"u"&&chrome&&typeof chrome.loadTimes=="function",isNode:X,hasEnvVariables:oe,env:ue,global:s,getNativePromise:ge,domainBind:j};G.isRecentNode=G.isNode&&(function(){var Z=process.versions.node.split(".").map(Number);return Z[0]===0&&Z[1]>10||Z[0]>0})(),G.isNode&&G.toFastProperties(process);try{throw new Error}catch(Z){G.lastLineError=Z}return lx=G,lx}var lA={exports:{}},i3,xW;function wbe(){if(xW)return i3;xW=1;var n=wi(),e,t=function(){throw new Error(`No async scheduler available

    See http://goo.gl/MqrFmX
`)},i=n.getNativePromise();if(n.isNode&&typeof MutationObserver>"u"){var r=Vf.setImmediate,s=process.nextTick;e=n.isRecentNode?function(o){r.call(Vf,o)}:function(o){s.call(process,o)}}else if(typeof i=="function"&&typeof i.resolve=="function"){var a=i.resolve();e=function(o){a.then(o)}}else typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))?e=(function(){var o=document.createElement("div"),l={attributes:!0},c=!1,h=document.createElement("div"),f=new MutationObserver(function(){o.classList.toggle("foo"),c=!1});f.observe(h,l);var p=function(){c||(c=!0,h.classList.toggle("foo"))};return function(x){var v=new MutationObserver(function(){v.disconnect(),x()});v.observe(o,l),p()}})():typeof setImmediate<"u"?e=function(o){setImmediate(o)}:typeof setTimeout<"u"?e=function(o){setTimeout(o,0)}:e=t;return i3=e,i3}var r3,bW;function Abe(){if(bW)return r3;bW=1;function n(t,i,r,s,a){for(var o=0;o<a;++o)r[o+s]=t[o+i],t[o+i]=void 0}function e(t){this._capacity=t,this._length=0,this._front=0}return e.prototype._willBeOverCapacity=function(t){return this._capacity<t},e.prototype._pushOne=function(t){var i=this.length();this._checkCapacity(i+1);var r=this._front+i&this._capacity-1;this[r]=t,this._length=i+1},e.prototype.push=function(t,i,r){var s=this.length()+3;if(this._willBeOverCapacity(s)){this._pushOne(t),this._pushOne(i),this._pushOne(r);return}var a=this._front+s-3;this._checkCapacity(s);var o=this._capacity-1;this[a+0&o]=t,this[a+1&o]=i,this[a+2&o]=r,this._length=s},e.prototype.shift=function(){var t=this._front,i=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,i},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(t){var i=this._capacity;this._capacity=t;var r=this._front,s=this._length,a=r+s&i-1;n(this,0,this,i,a)},r3=e,r3}var TW;function Sbe(){if(TW)return lA.exports;TW=1;var n;try{throw new Error}catch(l){n=l}var e=wbe(),t=Abe(),i=wi();function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new t(16),this._normalQueue=new t(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var l=this;this.drainQueues=function(){l._drainQueues()},this._schedule=e}r.prototype.setScheduler=function(l){var c=this._schedule;return this._schedule=l,this._customScheduler=!0,c},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){i.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(l,c){c?(process.stderr.write("Fatal "+(l instanceof Error?l.stack:l)+`
`),process.exit(2)):this.throwLater(l)},r.prototype.throwLater=function(l,c){if(arguments.length===1&&(c=l,l=function(){throw c}),typeof setTimeout<"u")setTimeout(function(){l(c)},0);else try{this._schedule(function(){l(c)})}catch{throw new Error(`No async scheduler available

    See http://goo.gl/MqrFmX
`)}};function s(l,c,h){this._lateQueue.push(l,c,h),this._queueTick()}function a(l,c,h){this._normalQueue.push(l,c,h),this._queueTick()}function o(l){this._normalQueue._pushOne(l),this._queueTick()}return i.hasDevTools?(r.prototype.invokeLater=function(l,c,h){this._trampolineEnabled?s.call(this,l,c,h):this._schedule(function(){setTimeout(function(){l.call(c,h)},100)})},r.prototype.invoke=function(l,c,h){this._trampolineEnabled?a.call(this,l,c,h):this._schedule(function(){l.call(c,h)})},r.prototype.settlePromises=function(l){this._trampolineEnabled?o.call(this,l):this._schedule(function(){l._settlePromises()})}):(r.prototype.invokeLater=s,r.prototype.invoke=a,r.prototype.settlePromises=o),r.prototype._drainQueue=function(l){for(;l.length()>0;){var c=l.shift();if(typeof c!="function"){c._settlePromises();continue}var h=l.shift(),f=l.shift();c.call(h,f)}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},lA.exports=r,lA.exports.firstLineError=n,lA.exports}var s3,EW;function ip(){if(EW)return s3;EW=1;var n=$1(),e=n.freeze,t=wi(),i=t.inherits,r=t.notEnumerableProp;function s(E,w){function A(N){if(!(this instanceof A))return new A(N);r(this,"message",typeof N=="string"?N:w),r(this,"name",E),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return i(A,Error),A}var a,o,l=s("Warning","warning"),c=s("CancellationError","cancellation error"),h=s("TimeoutError","timeout error"),f=s("AggregateError","aggregate error");try{a=TypeError,o=RangeError}catch{a=s("TypeError","type error"),o=s("RangeError","range error")}for(var p="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<p.length;++y)typeof Array.prototype[p[y]]=="function"&&(f.prototype[p[y]]=Array.prototype[p[y]]);n.defineProperty(f.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),f.prototype.isOperational=!0;var x=0;f.prototype.toString=function(){var E=Array(x*4+1).join(" "),w=`
`+E+`AggregateError of:
`;x++,E=Array(x*4+1).join(" ");for(var A=0;A<this.length;++A){for(var N=this[A]===this?"[Circular AggregateError]":this[A]+"",k=N.split(`
`),F=0;F<k.length;++F)k[F]=E+k[F];N=k.join(`
`),w+=N+`
`}return x--,w};function v(E){if(!(this instanceof v))return new v(E);r(this,"name","OperationalError"),r(this,"message",E),this.cause=E,this.isOperational=!0,E instanceof Error?(r(this,"message",E.message),r(this,"stack",E.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}i(v,Error);var _=Error.__BluebirdErrorTypes__;return _||(_=e({CancellationError:c,TimeoutError:h,OperationalError:v,RejectionError:v,AggregateError:f}),n.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),s3={Error,TypeError:a,RangeError:o,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:l},s3}var a3,wW;function Dbe(){return wW||(wW=1,a3=function(n,e){var t=wi(),i=t.errorObj,r=t.isObject;function s(f,p){if(r(f)){if(f instanceof n)return f;var y=o(f);if(y===i){p&&p._pushContext();var x=n.reject(y.e);return p&&p._popContext(),x}else if(typeof y=="function"){if(c(f)){var x=new n(e);return f._then(x._fulfill,x._reject,void 0,x,null),x}return h(f,y,p)}}return f}function a(f){return f.then}function o(f){try{return a(f)}catch(p){return i.e=p,i}}var l={}.hasOwnProperty;function c(f){try{return l.call(f,"_promise0")}catch{return!1}}function h(f,p,y){var x=new n(e),v=x;y&&y._pushContext(),x._captureStackTrace(),y&&y._popContext();var _=!0,E=t.tryCatch(p).call(f,w,A);_=!1,x&&E===i&&(x._rejectCallback(E.e,!0,!0),x=null);function w(N){x&&(x._resolveCallback(N),x=null)}function A(N){x&&(x._rejectCallback(N,_,!0),x=null)}return v}return s}),a3}var o3,AW;function Cbe(){return AW||(AW=1,o3=function(n,e,t,i,r){var s=wi();s.isArray;function a(l){switch(l){case-2:return[];case-3:return{}}}function o(l){var c=this._promise=new n(e);l instanceof n&&c._propagateFrom(l,3),c._setOnCancel(this),this._values=l,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return s.inherits(o,r),o.prototype.length=function(){return this._length},o.prototype.promise=function(){return this._promise},o.prototype._init=function l(c,h){var f=t(this._values,this._promise);if(f instanceof n){f=f._target();var p=f._bitField;if(this._values=f,(p&50397184)===0)return this._promise._setAsyncGuaranteed(),f._then(l,this._reject,void 0,this,h);if((p&33554432)!==0)f=f._value();else return(p&16777216)!==0?this._reject(f._reason()):this._cancel()}if(f=s.asArray(f),f===null){var y=i("expecting an array or an iterable object but got "+s.classString(f)).reason();this._promise._rejectCallback(y,!1);return}if(f.length===0){h===-5?this._resolveEmptyArray():this._resolve(a(h));return}this._iterate(f)},o.prototype._iterate=function(l){var c=this.getActualLength(l.length);this._length=c,this._values=this.shouldCopyValues()?new Array(c):this._values;for(var h=this._promise,f=!1,p=null,y=0;y<c;++y){var x=t(l[y],h);x instanceof n?(x=x._target(),p=x._bitField):p=null,f?p!==null&&x.suppressUnhandledRejections():p!==null?(p&50397184)===0?(x._proxy(this,y),this._values[y]=x):(p&33554432)!==0?f=this._promiseFulfilled(x._value(),y):(p&16777216)!==0?f=this._promiseRejected(x._reason(),y):f=this._promiseCancelled(y):f=this._promiseFulfilled(x,y)}f||h._setAsyncGuaranteed()},o.prototype._isResolved=function(){return this._values===null},o.prototype._resolve=function(l){this._values=null,this._promise._fulfill(l)},o.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},o.prototype._reject=function(l){this._values=null,this._promise._rejectCallback(l,!1)},o.prototype._promiseFulfilled=function(l,c){this._values[c]=l;var h=++this._totalResolved;return h>=this._length?(this._resolve(this._values),!0):!1},o.prototype._promiseCancelled=function(){return this._cancel(),!0},o.prototype._promiseRejected=function(l){return this._totalResolved++,this._reject(l),!0},o.prototype._resultCancelled=function(){if(!this._isResolved()){var l=this._values;if(this._cancel(),l instanceof n)l.cancel();else for(var c=0;c<l.length;++c)l[c]instanceof n&&l[c].cancel()}},o.prototype.shouldCopyValues=function(){return!0},o.prototype.getActualLength=function(l){return l},o}),o3}var l3,SW;function Ibe(){return SW||(SW=1,l3=function(n){var e=!1,t=[];n.prototype._promiseCreated=function(){},n.prototype._pushContext=function(){},n.prototype._popContext=function(){return null},n._peekContext=n.prototype._peekContext=function(){};function i(){this._trace=new i.CapturedTrace(s())}i.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,t.push(this._trace))},i.prototype._popContext=function(){if(this._trace!==void 0){var a=t.pop(),o=a._promiseCreated;return a._promiseCreated=null,o}return null};function r(){if(e)return new i}function s(){var a=t.length-1;if(a>=0)return t[a]}return i.CapturedTrace=null,i.create=r,i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var a=n.prototype._pushContext,o=n.prototype._popContext,l=n._peekContext,c=n.prototype._peekContext,h=n.prototype._promiseCreated;i.deactivateLongStackTraces=function(){n.prototype._pushContext=a,n.prototype._popContext=o,n._peekContext=l,n.prototype._peekContext=c,n.prototype._promiseCreated=h,e=!1},e=!0,n.prototype._pushContext=i.prototype._pushContext,n.prototype._popContext=i.prototype._popContext,n._peekContext=n.prototype._peekContext=s,n.prototype._promiseCreated=function(){var f=this._peekContext();f&&f._promiseCreated==null&&(f._promiseCreated=this)}},i}),l3}var c3,DW;function Rbe(){return DW||(DW=1,c3=function(n,e){var t=n._getDomain,i=n._async,r=ip().Warning,s=wi(),a=s.canAttachTrace,o,l,c=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,h=/\((?:timers\.js):\d+:\d+\)/,f=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,p=null,y=null,x=!1,v,_=!!(s.env("BLUEBIRD_DEBUG")!=0&&(s.env("BLUEBIRD_DEBUG")||s.env("NODE_ENV")==="development")),E=!!(s.env("BLUEBIRD_WARNINGS")!=0&&(_||s.env("BLUEBIRD_WARNINGS"))),w=!!(s.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(_||s.env("BLUEBIRD_LONG_STACK_TRACES"))),A=s.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(E||!!s.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var be=this._target();be._bitField=be._bitField&-1048577|524288},n.prototype._ensurePossibleRejectionHandled=function(){(this._bitField&524288)===0&&(this._setRejectionIsUnhandled(),i.invokeLater(this._notifyUnhandledRejection,this,void 0))},n.prototype._notifyUnhandledRejectionIsHandled=function(){gt("rejectionHandled",o,void 0,this)},n.prototype._setReturnedNonUndefined=function(){this._bitField=this._bitField|268435456},n.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!==0},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var be=this._settledValue();this._setUnhandledRejectionIsNotified(),gt("unhandledRejection",l,be,this)}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|262144},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},n.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},n.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},n.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},n.prototype._warn=function(be,Ee,Me){return te(be,Ee,Me||this)},n.onPossiblyUnhandledRejection=function(be){var Ee=t();l=typeof be=="function"?Ee===null?be:s.domainBind(Ee,be):void 0},n.onUnhandledRejectionHandled=function(be){var Ee=t();o=typeof be=="function"?Ee===null?be:s.domainBind(Ee,be):void 0};var N=function(){};n.longStackTraces=function(){if(i.haveItemsQueued()&&!Ce.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created

    See http://goo.gl/MqrFmX
`);if(!Ce.longStackTraces&&Re()){var be=n.prototype._captureStackTrace,Ee=n.prototype._attachExtraTrace;Ce.longStackTraces=!0,N=function(){if(i.haveItemsQueued()&&!Ce.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created

    See http://goo.gl/MqrFmX
`);n.prototype._captureStackTrace=be,n.prototype._attachExtraTrace=Ee,e.deactivateLongStackTraces(),i.enableTrampoline(),Ce.longStackTraces=!1},n.prototype._captureStackTrace=ge,n.prototype._attachExtraTrace=j,e.activateLongStackTraces(),i.disableTrampolineIfNecessary()}},n.hasLongStackTraces=function(){return Ce.longStackTraces&&Re()};var k=(function(){try{if(typeof CustomEvent=="function"){var be=new CustomEvent("CustomEvent");return s.global.dispatchEvent(be),function(Ee,Me){var Xe=new CustomEvent(Ee.toLowerCase(),{detail:Me,cancelable:!0});return!s.global.dispatchEvent(Xe)}}else if(typeof Event=="function"){var be=new Event("CustomEvent");return s.global.dispatchEvent(be),function(Me,Xe){var dt=new Event(Me.toLowerCase(),{cancelable:!0});return dt.detail=Xe,!s.global.dispatchEvent(dt)}}else{var be=document.createEvent("CustomEvent");return be.initCustomEvent("testingtheevent",!1,!0,{}),s.global.dispatchEvent(be),function(Me,Xe){var dt=document.createEvent("CustomEvent");return dt.initCustomEvent(Me.toLowerCase(),!1,!0,Xe),!s.global.dispatchEvent(dt)}}}catch{}return function(){return!1}})(),F=(function(){return s.isNode?function(){return process.emit.apply(process,arguments)}:s.global?function(be){var Ee="on"+be.toLowerCase(),Me=s.global[Ee];return Me?(Me.apply(s.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}})();function C(be,Ee){return{promise:Ee}}var M={promiseCreated:C,promiseFulfilled:C,promiseRejected:C,promiseResolved:C,promiseCancelled:C,promiseChained:function(be,Ee,Me){return{promise:Ee,child:Me}},warning:function(be,Ee){return{warning:Ee}},unhandledRejection:function(be,Ee,Me){return{reason:Ee,promise:Me}},rejectionHandled:C},R=function(be){var Ee=!1;try{Ee=F.apply(null,arguments)}catch(Xe){i.throwLater(Xe),Ee=!0}var Me=!1;try{Me=k(be,M[be].apply(null,arguments))}catch(Xe){i.throwLater(Xe),Me=!0}return Me||Ee};n.config=function(be){if(be=Object(be),"longStackTraces"in be&&(be.longStackTraces?n.longStackTraces():!be.longStackTraces&&n.hasLongStackTraces()&&N()),"warnings"in be){var Ee=be.warnings;Ce.warnings=!!Ee,A=Ce.warnings,s.isObject(Ee)&&"wForgottenReturn"in Ee&&(A=!!Ee.wForgottenReturn)}if("cancellation"in be&&be.cancellation&&!Ce.cancellation){if(i.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=re,n.prototype._propagateFrom=q,n.prototype._onCancel=O,n.prototype._setOnCancel=B,n.prototype._attachCancellationCallback=P,n.prototype._execute=H,oe=q,Ce.cancellation=!0}return"monitoring"in be&&(be.monitoring&&!Ce.monitoring?(Ce.monitoring=!0,n.prototype._fireEvent=R):!be.monitoring&&Ce.monitoring&&(Ce.monitoring=!1,n.prototype._fireEvent=L)),n};function L(){return!1}n.prototype._fireEvent=L,n.prototype._execute=function(be,Ee,Me){try{be(Ee,Me)}catch(Xe){return Xe}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(be){},n.prototype._attachCancellationCallback=function(be){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(be,Ee){};function H(be,Ee,Me){var Xe=this;try{be(Ee,Me,function(dt){if(typeof dt!="function")throw new TypeError("onCancel must be a function, got: "+s.toString(dt));Xe._attachCancellationCallback(dt)})}catch(dt){return dt}}function P(be){if(!this._isCancellable())return this;var Ee=this._onCancel();Ee!==void 0?s.isArray(Ee)?Ee.push(be):this._setOnCancel([Ee,be]):this._setOnCancel(be)}function O(){return this._onCancelField}function B(be){this._onCancelField=be}function re(){this._cancellationParent=void 0,this._onCancelField=void 0}function q(be,Ee){if((Ee&1)!==0){this._cancellationParent=be;var Me=be._branchesRemainingToCancel;Me===void 0&&(Me=0),be._branchesRemainingToCancel=Me+1}(Ee&2)!==0&&be._isBound()&&this._setBoundTo(be._boundTo)}function X(be,Ee){(Ee&2)!==0&&be._isBound()&&this._setBoundTo(be._boundTo)}var oe=X;function ue(){var be=this._boundTo;return be!==void 0&&be instanceof n?be.isFulfilled()?be.value():void 0:be}function ge(){this._trace=new Le(this._peekContext())}function j(be,Ee){if(a(be)){var Me=this._trace;if(Me!==void 0&&Ee&&(Me=Me._parent),Me!==void 0)Me.attachExtraTrace(be);else if(!be.__stackCleaned__){var Xe=Ge(be);s.notEnumerableProp(be,"stack",Xe.message+`
`+Xe.stack.join(`
`)),s.notEnumerableProp(be,"__stackCleaned__",!0)}}}function G(be,Ee,Me,Xe,dt){if(be===void 0&&Ee!==null&&A){if(dt!==void 0&&dt._returnedNonUndefined()||(Xe._bitField&65535)===0)return;Me&&(Me=Me+" ");var bt="",zt="";if(Ee._trace){for(var Nt=Ee._trace.stack.split(`
`),Gt=Pe(Nt),on=Gt.length-1;on>=0;--on){var ke=Gt[on];if(!h.test(ke)){var xe=ke.match(f);xe&&(bt="at "+xe[1]+":"+xe[2]+":"+xe[3]+" ");break}}if(Gt.length>0){for(var Ye=Gt[0],on=0;on<Nt.length;++on)if(Nt[on]===Ye){on>0&&(zt=`
`+Nt[on-1]);break}}}var Je="a promise was created in a "+Me+"handler "+bt+"but was not returned from it, see http://goo.gl/rRqMUw"+zt;Xe._warn(Je,!0,Ee)}}function Z(be,Ee){var Me=be+" is deprecated and will be removed in a future version.";return Ee&&(Me+=" Use "+Ee+" instead."),te(Me)}function te(be,Ee,Me){if(Ce.warnings){var Xe=new r(be),dt;if(Ee)Me._attachExtraTrace(Xe);else if(Ce.longStackTraces&&(dt=n._peekContext()))dt.attachExtraTrace(Xe);else{var bt=Ge(Xe);Xe.stack=bt.message+`
`+bt.stack.join(`
`)}R("warning",Xe)||ct(Xe,"",!0)}}function ie(be,Ee){for(var Me=0;Me<Ee.length-1;++Me)Ee[Me].push("From previous event:"),Ee[Me]=Ee[Me].join(`
`);return Me<Ee.length&&(Ee[Me]=Ee[Me].join(`
`)),be+`
`+Ee.join(`
`)}function _e(be){for(var Ee=0;Ee<be.length;++Ee)(be[Ee].length===0||Ee+1<be.length&&be[Ee][0]===be[Ee+1][0])&&(be.splice(Ee,1),Ee--)}function Ie(be){for(var Ee=be[0],Me=1;Me<be.length;++Me){for(var Xe=be[Me],dt=Ee.length-1,bt=Ee[dt],zt=-1,Nt=Xe.length-1;Nt>=0;--Nt)if(Xe[Nt]===bt){zt=Nt;break}for(var Nt=zt;Nt>=0;--Nt){var Gt=Xe[Nt];if(Ee[dt]===Gt)Ee.pop(),dt--;else break}Ee=Xe}}function Pe(be){for(var Ee=[],Me=0;Me<be.length;++Me){var Xe=be[Me],dt=Xe==="    (No stack trace)"||p.test(Xe),bt=dt&&Te(Xe);dt&&!bt&&(x&&Xe.charAt(0)!==" "&&(Xe="    "+Xe),Ee.push(Xe))}return Ee}function Fe(be){for(var Ee=be.stack.replace(/\s+$/g,"").split(`
`),Me=0;Me<Ee.length;++Me){var Xe=Ee[Me];if(Xe==="    (No stack trace)"||p.test(Xe))break}return Me>0&&be.name!="SyntaxError"&&(Ee=Ee.slice(Me)),Ee}function Ge(be){var Ee=be.stack,Me=be.toString();return Ee=typeof Ee=="string"&&Ee.length>0?Fe(be):["    (No stack trace)"],{message:Me,stack:be.name=="SyntaxError"?Ee:Pe(Ee)}}function ct(be,Ee,Me){if(typeof console<"u"){var Xe;if(s.isObject(be)){var dt=be.stack;Xe=Ee+y(dt,be)}else Xe=Ee+String(be);typeof v=="function"?v(Xe,Me):(typeof console.log=="function"||typeof console.log=="object")&&console.log(Xe)}}function gt(be,Ee,Me,Xe){var dt=!1;try{typeof Ee=="function"&&(dt=!0,be==="rejectionHandled"?Ee(Xe):Ee(Me,Xe))}catch(bt){i.throwLater(bt)}be==="unhandledRejection"?!R(be,Me,Xe)&&!dt&&ct(Me,"Unhandled rejection "):R(be,Xe)}function Mt(be){var Ee;if(typeof be=="function")Ee="[function "+(be.name||"anonymous")+"]";else{Ee=be&&typeof be.toString=="function"?be.toString():s.toString(be);var Me=/\[object [a-zA-Z0-9$_]+\]/;if(Me.test(Ee))try{var Xe=JSON.stringify(be);Ee=Xe}catch{}Ee.length===0&&(Ee="(empty array)")}return"(<"+W(Ee)+">, no stack trace)"}function W(be){var Ee=41;return be.length<Ee?be:be.substr(0,Ee-3)+"..."}function Re(){return typeof $e=="function"}var Te=function(){return!1},ae=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function he(be){var Ee=be.match(ae);if(Ee)return{fileName:Ee[1],line:parseInt(Ee[2],10)}}function we(be,Ee){if(Re()){for(var Me=be.stack.split(`
`),Xe=Ee.stack.split(`
`),dt=-1,bt=-1,zt,Nt,Gt=0;Gt<Me.length;++Gt){var on=he(Me[Gt]);if(on){zt=on.fileName,dt=on.line;break}}for(var Gt=0;Gt<Xe.length;++Gt){var on=he(Xe[Gt]);if(on){Nt=on.fileName,bt=on.line;break}}dt<0||bt<0||!zt||!Nt||zt!==Nt||dt>=bt||(Te=function(ke){if(c.test(ke))return!0;var xe=he(ke);return!!(xe&&xe.fileName===zt&&dt<=xe.line&&xe.line<=bt)})}}function Le(be){this._parent=be,this._promisesCreated=0;var Ee=this._length=1+(be===void 0?0:be._length);$e(this,Le),Ee>32&&this.uncycle()}s.inherits(Le,Error),e.CapturedTrace=Le,Le.prototype.uncycle=function(){var be=this._length;if(!(be<2)){for(var Ee=[],Me={},Xe=0,dt=this;dt!==void 0;++Xe)Ee.push(dt),dt=dt._parent;be=this._length=Xe;for(var Xe=be-1;Xe>=0;--Xe){var bt=Ee[Xe].stack;Me[bt]===void 0&&(Me[bt]=Xe)}for(var Xe=0;Xe<be;++Xe){var zt=Ee[Xe].stack,Nt=Me[zt];if(Nt!==void 0&&Nt!==Xe){Nt>0&&(Ee[Nt-1]._parent=void 0,Ee[Nt-1]._length=1),Ee[Xe]._parent=void 0,Ee[Xe]._length=1;var Gt=Xe>0?Ee[Xe-1]:this;Nt<be-1?(Gt._parent=Ee[Nt+1],Gt._parent.uncycle(),Gt._length=Gt._parent._length+1):(Gt._parent=void 0,Gt._length=1);for(var on=Gt._length+1,ke=Xe-2;ke>=0;--ke)Ee[ke]._length=on,on++;return}}}},Le.prototype.attachExtraTrace=function(be){if(!be.__stackCleaned__){this.uncycle();for(var Ee=Ge(be),Me=Ee.message,Xe=[Ee.stack],dt=this;dt!==void 0;)Xe.push(Pe(dt.stack.split(`
`))),dt=dt._parent;Ie(Xe),_e(Xe),s.notEnumerableProp(be,"stack",ie(Me,Xe)),s.notEnumerableProp(be,"__stackCleaned__",!0)}};var $e=(function(){var Ee=/^\s*at\s*/,Me=function(zt,Nt){return typeof zt=="string"?zt:Nt.name!==void 0&&Nt.message!==void 0?Nt.toString():Mt(Nt)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,p=Ee,y=Me;var Xe=Error.captureStackTrace;return Te=function(zt){return c.test(zt)},function(zt,Nt){Error.stackTraceLimit+=6,Xe(zt,Nt),Error.stackTraceLimit-=6}}var dt=new Error;if(typeof dt.stack=="string"&&dt.stack.split(`
`)[0].indexOf("stackDetection@")>=0)return p=/@/,y=Me,x=!0,function(Nt){Nt.stack=new Error().stack};var bt;try{throw new Error}catch(zt){bt="stack"in zt}return!("stack"in dt)&&bt&&typeof Error.stackTraceLimit=="number"?(p=Ee,y=Me,function(Nt){Error.stackTraceLimit+=6;try{throw new Error}catch(Gt){Nt.stack=Gt.stack}Error.stackTraceLimit-=6}):(y=function(zt,Nt){return typeof zt=="string"?zt:(typeof Nt=="object"||typeof Nt=="function")&&Nt.name!==void 0&&Nt.message!==void 0?Nt.toString():Mt(Nt)},null)})();typeof console<"u"&&typeof console.warn<"u"&&(v=function(be){console.warn(be)},s.isNode&&process.stderr.isTTY?v=function(be,Ee){var Me=Ee?"\x1B[33m":"\x1B[31m";console.warn(Me+be+`\x1B[0m
`)}:!s.isNode&&typeof new Error().stack=="string"&&(v=function(be,Ee){console.warn("%c"+be,Ee?"color: darkorange":"color: red")}));var Ce={warnings:E,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&n.longStackTraces(),{longStackTraces:function(){return Ce.longStackTraces},warnings:function(){return Ce.warnings},cancellation:function(){return Ce.cancellation},monitoring:function(){return Ce.monitoring},propagateFromFunction:function(){return oe},boundValueFunction:function(){return ue},checkForgottenReturns:G,setBounds:we,warn:te,deprecated:Z,CapturedTrace:Le,fireDomEvent:k,fireGlobalEvent:F}}),c3}var u3,CW;function Nbe(){return CW||(CW=1,u3=function(n,e){var t=wi(),i=n.CancellationError,r=t.errorObj;function s(f,p,y){this.promise=f,this.type=p,this.handler=y,this.called=!1,this.cancelPromise=null}s.prototype.isFinallyHandler=function(){return this.type===0};function a(f){this.finallyHandler=f}a.prototype._resultCancelled=function(){o(this.finallyHandler)};function o(f,p){return f.cancelPromise!=null?(arguments.length>1?f.cancelPromise._reject(p):f.cancelPromise._cancel(),f.cancelPromise=null,!0):!1}function l(){return h.call(this,this.promise._target()._settledValue())}function c(f){if(!o(this,f))return r.e=f,r}function h(f){var p=this.promise,y=this.handler;if(!this.called){this.called=!0;var x=this.isFinallyHandler()?y.call(p._boundValue()):y.call(p._boundValue(),f);if(x!==void 0){p._setReturnedNonUndefined();var v=e(x,p);if(v instanceof n){if(this.cancelPromise!=null)if(v._isCancelled()){var _=new i("late cancellation observer");return p._attachExtraTrace(_),r.e=_,r}else v.isPending()&&v._attachCancellationCallback(new a(this));return v._then(l,c,void 0,this,void 0)}}}return p.isRejected()?(o(this),r.e=f,r):(o(this),f)}return n.prototype._passThrough=function(f,p,y,x){return typeof f!="function"?this.then():this._then(y,x,void 0,new s(this,p,f),void 0)},n.prototype.lastly=n.prototype.finally=function(f){return this._passThrough(f,0,h,h)},n.prototype.tap=function(f){return this._passThrough(f,1,h)},s}),u3}var h3,IW;function kbe(){return IW||(IW=1,h3=function(n){var e=wi(),t=$1().keys,i=e.tryCatch,r=e.errorObj;function s(a,o,l){return function(c){var h=l._boundValue();e:for(var f=0;f<a.length;++f){var p=a[f];if(p===Error||p!=null&&p.prototype instanceof Error){if(c instanceof p)return i(o).call(h,c)}else if(typeof p=="function"){var y=i(p).call(h,c);if(y===r)return y;if(y)return i(o).call(h,c)}else if(e.isObject(c)){for(var x=t(p),v=0;v<x.length;++v){var _=x[v];if(p[_]!=c[_])continue e}return i(o).call(h,c)}}return n}}return s}),h3}var d3,RW;function tZ(){if(RW)return d3;RW=1;var n=wi(),e=n.maybeWrapAsError,t=ip(),i=t.OperationalError,r=$1();function s(c){return c instanceof Error&&r.getPrototypeOf(c)===Error.prototype}var a=/^(?:name|message|stack|cause)$/;function o(c){var h;if(s(c)){h=new i(c),h.name=c.name,h.message=c.message,h.stack=c.stack;for(var f=r.keys(c),p=0;p<f.length;++p){var y=f[p];a.test(y)||(h[y]=c[y])}return h}return n.markAsOriginatingFromRejection(c),c}function l(c,h){return function(f,p){if(c!==null){if(f){var y=o(e(f));c._attachExtraTrace(y),c._reject(y)}else if(!h)c._fulfill(p);else{for(var x=arguments.length,v=new Array(Math.max(x-1,0)),_=1;_<x;++_)v[_-1]=arguments[_];c._fulfill(v)}c=null}}}return d3=l,d3}var f3,NW;function Mbe(){return NW||(NW=1,f3=function(n,e,t,i,r){var s=wi(),a=s.tryCatch;n.method=function(o){if(typeof o!="function")throw new n.TypeError("expecting a function but got "+s.classString(o));return function(){var l=new n(e);l._captureStackTrace(),l._pushContext();var c=a(o).apply(this,arguments),h=l._popContext();return r.checkForgottenReturns(c,h,"Promise.method",l),l._resolveFromSyncValue(c),l}},n.attempt=n.try=function(o){if(typeof o!="function")return i("expecting a function but got "+s.classString(o));var l=new n(e);l._captureStackTrace(),l._pushContext();var c;if(arguments.length>1){r.deprecated("calling Promise.try with more than 1 argument");var h=arguments[1],f=arguments[2];c=s.isArray(h)?a(o).apply(f,h):a(o).call(f,h)}else c=a(o)();var p=l._popContext();return r.checkForgottenReturns(c,p,"Promise.try",l),l._resolveFromSyncValue(c),l},n.prototype._resolveFromSyncValue=function(o){o===s.errorObj?this._rejectCallback(o.e,!1):this._resolveCallback(o,!0)}}),f3}var p3,kW;function Fbe(){return kW||(kW=1,p3=function(n,e,t,i){var r=!1,s=function(c,h){this._reject(h)},a=function(c,h){h.promiseRejectionQueued=!0,h.bindingPromise._then(s,s,null,this,c)},o=function(c,h){(this._bitField&50397184)===0&&this._resolveCallback(h.target)},l=function(c,h){h.promiseRejectionQueued||this._reject(c)};n.prototype.bind=function(c){r||(r=!0,n.prototype._propagateFrom=i.propagateFromFunction(),n.prototype._boundValue=i.boundValueFunction());var h=t(c),f=new n(e);f._propagateFrom(this,1);var p=this._target();if(f._setBoundTo(h),h instanceof n){var y={promiseRejectionQueued:!1,promise:f,target:p,bindingPromise:h};p._then(e,a,void 0,f,y),h._then(o,l,void 0,f,y),f._setOnCancel(h)}else f._resolveCallback(p);return f},n.prototype._setBoundTo=function(c){c!==void 0?(this._bitField=this._bitField|2097152,this._boundTo=c):this._bitField=this._bitField&-2097153},n.prototype._isBound=function(){return(this._bitField&2097152)===2097152},n.bind=function(c,h){return n.resolve(h).bind(c)}}),p3}var g3,MW;function Ube(){return MW||(MW=1,g3=function(n,e,t,i){var r=wi(),s=r.tryCatch,a=r.errorObj,o=n._async;n.prototype.break=n.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var l=this,c=l;l._isCancellable();){if(!l._cancelBy(c)){c._isFollowing()?c._followee().cancel():c._cancelBranched();break}var h=l._cancellationParent;if(h==null||!h._isCancellable()){l._isFollowing()?l._followee().cancel():l._cancelBranched();break}else l._isFollowing()&&l._followee().cancel(),l._setWillBeCancelled(),c=l,l=h}},n.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},n.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},n.prototype._cancelBy=function(l){return l===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},n.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},n.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),o.invoke(this._cancelPromises,this,void 0))},n.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},n.prototype._unsetOnCancel=function(){this._onCancelField=void 0},n.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},n.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},n.prototype._doInvokeOnCancel=function(l,c){if(r.isArray(l))for(var h=0;h<l.length;++h)this._doInvokeOnCancel(l[h],c);else if(l!==void 0)if(typeof l=="function"){if(!c){var f=s(l).call(this._boundValue());f===a&&(this._attachExtraTrace(f.e),o.throwLater(f.e))}}else l._resultCancelled(this)},n.prototype._invokeOnCancel=function(){var l=this._onCancel();this._unsetOnCancel(),o.invoke(this._doInvokeOnCancel,this,l)},n.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},n.prototype._resultCancelled=function(){this.cancel()}}),g3}var m3,FW;function Pbe(){return FW||(FW=1,m3=function(n){function e(){return this.value}function t(){throw this.reason}n.prototype.return=n.prototype.thenReturn=function(i){return i instanceof n&&i.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:i},void 0)},n.prototype.throw=n.prototype.thenThrow=function(i){return this._then(t,void 0,void 0,{reason:i},void 0)},n.prototype.catchThrow=function(i){if(arguments.length<=1)return this._then(void 0,t,void 0,{reason:i},void 0);var r=arguments[1],s=function(){throw r};return this.caught(i,s)},n.prototype.catchReturn=function(i){if(arguments.length<=1)return i instanceof n&&i.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:i},void 0);var r=arguments[1];r instanceof n&&r.suppressUnhandledRejections();var s=function(){return r};return this.caught(i,s)}}),m3}var y3,UW;function Lbe(){return UW||(UW=1,y3=function(n){function e(l){l!==void 0?(l=l._target(),this._bitField=l._bitField,this._settledValueField=l._isFateSealed()?l._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var t=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError(`cannot get fulfillment value of a non-fulfilled promise

    See http://goo.gl/MqrFmX
`);return this._settledValue()},i=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError(`cannot get rejection reason of a non-rejected promise

    See http://goo.gl/MqrFmX
`);return this._settledValue()},r=e.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},s=e.prototype.isRejected=function(){return(this._bitField&16777216)!==0},a=e.prototype.isPending=function(){return(this._bitField&50397184)===0},o=e.prototype.isResolved=function(){return(this._bitField&50331648)!==0};e.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},n.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},n.prototype._isCancelled=function(){return this._target().__isCancelled()},n.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},n.prototype.isPending=function(){return a.call(this._target())},n.prototype.isRejected=function(){return s.call(this._target())},n.prototype.isFulfilled=function(){return r.call(this._target())},n.prototype.isResolved=function(){return o.call(this._target())},n.prototype.value=function(){return t.call(this._target())},n.prototype.reason=function(){var l=this._target();return l._unsetRejectionIsUnhandled(),i.call(l)},n.prototype._value=function(){return this._settledValue()},n.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},n.PromiseInspection=e}),y3}var v3,PW;function Obe(){return PW||(PW=1,v3=function(n,e,t,i,r,s){var a=wi(),o=a.canEvaluate,l=a.tryCatch,c=a.errorObj,h;if(o){for(var f=function(w){return new Function("value","holder",`                             
	            'use strict';                                                    
	            holder.pIndex = value;                                           
	            holder.checkFulfillment(this);                                   
	            `.replace(/Index/g,w))},p=function(w){return new Function("promise","holder",`                           
	            'use strict';                                                    
	            holder.pIndex = promise;                                         
	            `.replace(/Index/g,w))},y=function(w){for(var A=new Array(w),N=0;N<A.length;++N)A[N]="this.p"+(N+1);var k=A.join(" = ")+" = null;",F=`var promise;
`+A.map(function(L){return`                                                         
	                promise = `+L+`;                                      
	                if (promise instanceof Promise) {                            
	                    promise.cancel();                                        
	                }                                                            
	            `}).join(`
`),C=A.join(", "),M="Holder$"+w,R=`return function(tryCatch, errorObj, Promise, async) {    
	            'use strict';                                                    
	            function [TheName](fn) {                                         
	                [TheProperties]                                              
	                this.fn = fn;                                                
	                this.asyncNeeded = true;                                     
	                this.now = 0;                                                
	            }                                                                
	                                                                             
	            [TheName].prototype._callFunction = function(promise) {          
	                promise._pushContext();                                      
	                var ret = tryCatch(this.fn)([ThePassedArguments]);           
	                promise._popContext();                                       
	                if (ret === errorObj) {                                      
	                    promise._rejectCallback(ret.e, false);                   
	                } else {                                                     
	                    promise._resolveCallback(ret);                           
	                }                                                            
	            };                                                               
	                                                                             
	            [TheName].prototype.checkFulfillment = function(promise) {       
	                var now = ++this.now;                                        
	                if (now === [TheTotal]) {                                    
	                    if (this.asyncNeeded) {                                  
	                        async.invoke(this._callFunction, this, promise);     
	                    } else {                                                 
	                        this._callFunction(promise);                         
	                    }                                                        
	                                                                             
	                }                                                            
	            };                                                               
	                                                                             
	            [TheName].prototype._resultCancelled = function() {              
	                [CancellationCode]                                           
	            };                                                               
	                                                                             
	            return [TheName];                                                
	        }(tryCatch, errorObj, Promise, async);                               
	        `;return R=R.replace(/\[TheName\]/g,M).replace(/\[TheTotal\]/g,w).replace(/\[ThePassedArguments\]/g,C).replace(/\[TheProperties\]/g,k).replace(/\[CancellationCode\]/g,F),new Function("tryCatch","errorObj","Promise","async",R)(l,c,n,r)},x=[],v=[],_=[],E=0;E<8;++E)x.push(y(E+1)),v.push(f(E+1)),_.push(p(E+1));h=function(w){this._reject(w)}}n.join=function(){var w=arguments.length-1,A;if(w>0&&typeof arguments[w]=="function"&&(A=arguments[w],w<=8&&o)){var B=new n(i);B._captureStackTrace();for(var N=x[w-1],k=new N(A),F=v,C=0;C<w;++C){var M=t(arguments[C],B);if(M instanceof n){M=M._target();var R=M._bitField;(R&50397184)===0?(M._then(F[C],h,void 0,B,k),_[C](M,k),k.asyncNeeded=!1):(R&33554432)!==0?F[C].call(B,M._value(),k):(R&16777216)!==0?B._reject(M._reason()):B._cancel()}else F[C].call(B,M,k)}if(!B._isFateSealed()){if(k.asyncNeeded){var L=s();L!==null&&(k.fn=a.domainBind(L,k.fn))}B._setAsyncGuaranteed(),B._setOnCancel(k)}return B}for(var H=arguments.length,P=new Array(H),O=0;O<H;++O)P[O]=arguments[O];A&&P.pop();var B=new e(P).promise();return A!==void 0?B.spread(A):B}}),v3}var _3,LW;function Bbe(){return LW||(LW=1,_3=function(n,e,t,i,r,s){var a=n._getDomain,o=wi(),l=o.tryCatch,c=o.errorObj,h=n._async;function f(y,x,v,_){this.constructor$(y),this._promise._captureStackTrace();var E=a();this._callback=E===null?x:o.domainBind(E,x),this._preservedValues=_===r?new Array(this.length()):null,this._limit=v,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}o.inherits(f,e),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(y,x){var v=this._values,_=this.length(),E=this._preservedValues,w=this._limit;if(x<0){if(x=x*-1-1,v[x]=y,w>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(w>=1&&this._inFlight>=w)return v[x]=y,this._queue.push(x),!1;E!==null&&(E[x]=y);var A=this._promise,N=this._callback,k=A._boundValue();A._pushContext();var F=l(N).call(k,y,x,_),C=A._popContext();if(s.checkForgottenReturns(F,C,E!==null?"Promise.filter":"Promise.map",A),F===c)return this._reject(F.e),!0;var M=i(F,this._promise);if(M instanceof n){M=M._target();var R=M._bitField;if((R&50397184)===0)return w>=1&&this._inFlight++,v[x]=M,M._proxy(this,(x+1)*-1),!1;if((R&33554432)!==0)F=M._value();else return(R&16777216)!==0?(this._reject(M._reason()),!0):(this._cancel(),!0)}v[x]=F}var L=++this._totalResolved;return L>=_?(E!==null?this._filter(v,E):this._resolve(v),!0):!1},f.prototype._drainQueue=function(){for(var y=this._queue,x=this._limit,v=this._values;y.length>0&&this._inFlight<x;){if(this._isResolved())return;var _=y.pop();this._promiseFulfilled(v[_],_)}},f.prototype._filter=function(y,x){for(var v=x.length,_=new Array(v),E=0,w=0;w<v;++w)y[w]&&(_[E++]=x[w]);_.length=E,this._resolve(_)},f.prototype.preservedValues=function(){return this._preservedValues};function p(y,x,v,_){if(typeof x!="function")return t("expecting a function but got "+o.classString(x));var E=0;if(v!==void 0)if(typeof v=="object"&&v!==null){if(typeof v.concurrency!="number")return n.reject(new TypeError("'concurrency' must be a number but it is "+o.classString(v.concurrency)));E=v.concurrency}else return n.reject(new TypeError("options argument must be an object but it is "+o.classString(v)));return E=typeof E=="number"&&isFinite(E)&&E>=1?E:0,new f(y,x,E,_).promise()}n.prototype.map=function(y,x){return p(this,y,x,null)},n.map=function(y,x,v,_){return p(y,x,v,_)}}),_3}var x3,OW;function Vbe(){if(OW)return x3;OW=1;var n=Object.create;if(n){var e=n(null),t=n(null);e[" size"]=t[" size"]=0}return x3=function(i){var r=wi(),s=r.canEvaluate,a=r.isIdentifier,o,l;{var c=function(_){return new Function("ensureMethod",`                                    
	        return function(obj) {                                               
	            'use strict'                                                     
	            var len = this.length;                                           
	            ensureMethod(obj, 'methodName');                                 
	            switch(len) {                                                    
	                case 1: return obj.methodName(this[0]);                      
	                case 2: return obj.methodName(this[0], this[1]);             
	                case 3: return obj.methodName(this[0], this[1], this[2]);    
	                case 0: return obj.methodName();                             
	                default:                                                     
	                    return obj.methodName.apply(obj, this);                  
	            }                                                                
	        };                                                                   
	        `.replace(/methodName/g,_))(p)},h=function(_){return new Function("obj",`                                             
	        'use strict';                                                        
	        return obj.propertyName;                                             
	        `.replace("propertyName",_))},f=function(_,E,w){var A=w[_];if(typeof A!="function"){if(!a(_))return null;if(A=E(_),w[_]=A,w[" size"]++,w[" size"]>512){for(var N=Object.keys(w),k=0;k<256;++k)delete w[N[k]];w[" size"]=N.length-256}}return A};o=function(_){return f(_,c,e)},l=function(_){return f(_,h,t)}}function p(_,E){var w;if(_!=null&&(w=_[E]),typeof w!="function"){var A="Object "+r.classString(_)+" has no method '"+r.toString(E)+"'";throw new i.TypeError(A)}return w}function y(_){var E=this.pop(),w=p(_,E);return w.apply(_,this)}i.prototype.call=function(_){for(var E=arguments.length,w=new Array(Math.max(E-1,0)),A=1;A<E;++A)w[A-1]=arguments[A];if(s){var N=o(_);if(N!==null)return this._then(N,void 0,void 0,w,void 0)}return w.push(_),this._then(y,void 0,void 0,w,void 0)};function x(_){return _[this]}function v(_){var E=+this;return E<0&&(E=Math.max(0,E+_.length)),_[E]}i.prototype.get=function(_){var E=typeof _=="number",w;if(E)w=v;else if(s){var A=l(_);w=A!==null?A:x}else w=x;return this._then(w,void 0,void 0,_,void 0)}},x3}var b3,BW;function Wbe(){return BW||(BW=1,b3=function(n,e,t,i,r,s){var a=wi(),o=ip().TypeError,l=wi().inherits,c=a.errorObj,h=a.tryCatch,f={};function p(A){setTimeout(function(){throw A},0)}function y(A){var N=t(A);return N!==A&&typeof A._isDisposable=="function"&&typeof A._getDisposer=="function"&&A._isDisposable()&&N._setDisposable(A._getDisposer()),N}function x(A,N){var k=0,F=A.length,C=new n(r);function M(){if(k>=F)return C._fulfill();var R=y(A[k++]);if(R instanceof n&&R._isDisposable()){try{R=t(R._getDisposer().tryDispose(N),A.promise)}catch(L){return p(L)}if(R instanceof n)return R._then(M,p,null,null,null)}M()}return M(),C}function v(A,N,k){this._data=A,this._promise=N,this._context=k}v.prototype.data=function(){return this._data},v.prototype.promise=function(){return this._promise},v.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},v.prototype.tryDispose=function(A){var N=this.resource(),k=this._context;k!==void 0&&k._pushContext();var F=N!==f?this.doDispose(N,A):null;return k!==void 0&&k._popContext(),this._promise._unsetDisposable(),this._data=null,F},v.isDisposer=function(A){return A!=null&&typeof A.resource=="function"&&typeof A.tryDispose=="function"};function _(A,N,k){this.constructor$(A,N,k)}l(_,v),_.prototype.doDispose=function(A,N){var k=this.data();return k.call(A,A,N)};function E(A){return v.isDisposer(A)?(this.resources[this.index]._setDisposable(A),A.promise()):A}function w(A){this.length=A,this.promise=null,this[A-1]=null}w.prototype._resultCancelled=function(){for(var A=this.length,N=0;N<A;++N){var k=this[N];k instanceof n&&k.cancel()}},n.using=function(){var A=arguments.length;if(A<2)return e("you must pass at least 2 arguments to Promise.using");var N=arguments[A-1];if(typeof N!="function")return e("expecting a function but got "+a.classString(N));var k,F=!0;A===2&&Array.isArray(arguments[0])?(k=arguments[0],A=k.length,F=!1):(k=arguments,A--);for(var C=new w(A),M=0;M<A;++M){var R=k[M];if(v.isDisposer(R)){var L=R;R=R.promise(),R._setDisposable(L)}else{var H=t(R);H instanceof n&&(R=H._then(E,null,null,{resources:C,index:M},void 0))}C[M]=R}for(var P=new Array(C.length),M=0;M<P.length;++M)P[M]=n.resolve(C[M]).reflect();var O=n.all(P).then(function(re){for(var q=0;q<re.length;++q){var X=re[q];if(X.isRejected())return c.e=X.error(),c;if(!X.isFulfilled()){O.cancel();return}re[q]=X.value()}B._pushContext(),N=h(N);var oe=F?N.apply(void 0,re):N(re),ue=B._popContext();return s.checkForgottenReturns(oe,ue,"Promise.using",B),oe}),B=O.lastly(function(){var re=new n.PromiseInspection(O);return x(C,re)});return C.promise=B,B._setOnCancel(C),B},n.prototype._setDisposable=function(A){this._bitField=this._bitField|131072,this._disposer=A},n.prototype._isDisposable=function(){return(this._bitField&131072)>0},n.prototype._getDisposer=function(){return this._disposer},n.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},n.prototype.disposer=function(A){if(typeof A=="function")return new _(A,this,i());throw new o}}),b3}var T3,VW;function Hbe(){return VW||(VW=1,T3=function(n,e,t){var i=wi(),r=n.TimeoutError;function s(f){this.handle=f}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(f){return o(+this).thenReturn(f)},o=n.delay=function(f,p){var y,x;return p!==void 0?(y=n.resolve(p)._then(a,null,null,f,void 0),t.cancellation()&&p instanceof n&&y._setOnCancel(p)):(y=new n(e),x=setTimeout(function(){y._fulfill()},+f),t.cancellation()&&y._setOnCancel(new s(x)),y._captureStackTrace()),y._setAsyncGuaranteed(),y};n.prototype.delay=function(f){return o(f,this)};var l=function(f,p,y){var x;typeof p!="string"?p instanceof Error?x=p:x=new r("operation timed out"):x=new r(p),i.markAsOriginatingFromRejection(x),f._attachExtraTrace(x),f._reject(x),y!=null&&y.cancel()};function c(f){return clearTimeout(this.handle),f}function h(f){throw clearTimeout(this.handle),f}n.prototype.timeout=function(f,p){f=+f;var y,x,v=new s(setTimeout(function(){y.isPending()&&l(y,p,x)},f));return t.cancellation()?(x=this.then(),y=x._then(c,h,void 0,v,void 0),y._setOnCancel(v)):y=this._then(c,h,void 0,v,void 0),y}}),T3}var E3,WW;function zbe(){return WW||(WW=1,E3=function(n,e,t,i,r,s){var a=ip(),o=a.TypeError,l=wi(),c=l.errorObj,h=l.tryCatch,f=[];function p(x,v,_){for(var E=0;E<v.length;++E){_._pushContext();var w=h(v[E])(x);if(_._popContext(),w===c){_._pushContext();var A=n.reject(c.e);return _._popContext(),A}var N=i(w,_);if(N instanceof n)return N}return null}function y(x,v,_,E){if(s.cancellation()){var w=new n(t),A=this._finallyPromise=new n(t);this._promise=w.lastly(function(){return A}),w._captureStackTrace(),w._setOnCancel(this)}else{var N=this._promise=new n(t);N._captureStackTrace()}this._stack=E,this._generatorFunction=x,this._receiver=v,this._generator=void 0,this._yieldHandlers=typeof _=="function"?[_].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}l.inherits(y,r),y.prototype._isResolved=function(){return this._promise===null},y.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&this._finallyPromise!==null&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},y.prototype._promiseCancelled=function(){if(!this._isResolved()){var x=typeof this._generator.return<"u",v;if(x)this._promise._pushContext(),v=h(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var _=new n.CancellationError("generator .return() sentinel");n.coroutine.returnSentinel=_,this._promise._attachExtraTrace(_),this._promise._pushContext(),v=h(this._generator.throw).call(this._generator,_),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(v)}},y.prototype._promiseFulfilled=function(x){this._yieldedPromise=null,this._promise._pushContext();var v=h(this._generator.next).call(this._generator,x);this._promise._popContext(),this._continue(v)},y.prototype._promiseRejected=function(x){this._yieldedPromise=null,this._promise._attachExtraTrace(x),this._promise._pushContext();var v=h(this._generator.throw).call(this._generator,x);this._promise._popContext(),this._continue(v)},y.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof n){var x=this._yieldedPromise;this._yieldedPromise=null,x.cancel()}},y.prototype.promise=function(){return this._promise},y.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},y.prototype._continue=function(x){var v=this._promise;if(x===c)return this._cleanup(),this._cancellationPhase?v.cancel():v._rejectCallback(x.e,!1);var _=x.value;if(x.done===!0)return this._cleanup(),this._cancellationPhase?v.cancel():v._resolveCallback(_);var E=i(_,this._promise);if(!(E instanceof n)&&(E=p(E,this._yieldHandlers,this._promise),E===null)){this._promiseRejected(new o(`A value %s was yielded that could not be treated as a promise

    See http://goo.gl/MqrFmX

`.replace("%s",_)+`From coroutine:
`+this._stack.split(`
`).slice(1,-7).join(`
`)));return}E=E._target();var w=E._bitField;(w&50397184)===0?(this._yieldedPromise=E,E._proxy(this,null)):(w&33554432)!==0?n._async.invoke(this._promiseFulfilled,this,E._value()):(w&16777216)!==0?n._async.invoke(this._promiseRejected,this,E._reason()):this._promiseCancelled()},n.coroutine=function(x,v){if(typeof x!="function")throw new o(`generatorFunction must be a function

    See http://goo.gl/MqrFmX
`);var _=Object(v).yieldHandler,E=y,w=new Error().stack;return function(){var A=x.apply(this,arguments),N=new E(void 0,void 0,_,w),k=N.promise();return N._generator=A,N._promiseFulfilled(void 0),k}},n.coroutine.addYieldHandler=function(x){if(typeof x!="function")throw new o("expecting a function but got "+l.classString(x));f.push(x)},n.spawn=function(x){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),typeof x!="function")return e(`generatorFunction must be a function

    See http://goo.gl/MqrFmX
`);var v=new y(x,this),_=v.promise();return v._run(n.spawn),_}}),E3}var w3,HW;function Gbe(){return HW||(HW=1,w3=function(n){var e=wi(),t=n._async,i=e.tryCatch,r=e.errorObj;function s(l,c){var h=this;if(!e.isArray(l))return a.call(h,l,c);var f=i(c).apply(h._boundValue(),[null].concat(l));f===r&&t.throwLater(f.e)}function a(l,c){var h=this,f=h._boundValue(),p=l===void 0?i(c).call(f,null):i(c).call(f,null,l);p===r&&t.throwLater(p.e)}function o(l,c){var h=this;if(!l){var f=new Error(l+"");f.cause=l,l=f}var p=i(c).call(h._boundValue(),l);p===r&&t.throwLater(p.e)}n.prototype.asCallback=n.prototype.nodeify=function(l,c){if(typeof l=="function"){var h=a;c!==void 0&&Object(c).spread&&(h=s),this._then(h,o,void 0,this,l)}return this}}),w3}var A3,zW;function qbe(){return zW||(zW=1,A3=function(n,e){var t={},i=wi(),r=tZ(),s=i.withAppended,a=i.maybeWrapAsError,o=i.canEvaluate,l=ip().TypeError,c="Async",h={__isPromisified__:!0},f=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],p=new RegExp("^(?:"+f.join("|")+")$"),y=function(O){return i.isIdentifier(O)&&O.charAt(0)!=="_"&&O!=="constructor"};function x(O){return!p.test(O)}function v(O){try{return O.__isPromisified__===!0}catch{return!1}}function _(O,B,re){var q=i.getDataPropertyOrDefault(O,B+re,h);return q?v(q):!1}function E(O,B,re){for(var q=0;q<O.length;q+=2){var X=O[q];if(re.test(X)){for(var oe=X.replace(re,""),ue=0;ue<O.length;ue+=2)if(O[ue]===oe)throw new l(`Cannot promisify an API that has normal methods with '%s'-suffix

    See http://goo.gl/MqrFmX
`.replace("%s",B))}}}function w(O,B,re,q){for(var X=i.inheritedDataKeys(O),oe=[],ue=0;ue<X.length;++ue){var ge=X[ue],j=O[ge],G=q===y?!0:y(ge);typeof j=="function"&&!v(j)&&!_(O,ge,B)&&q(ge,j,O,G)&&oe.push(ge,j)}return E(oe,B,re),oe}var A=function(O){return O.replace(/([$])/,"\\$")},N;{var k=function(O){for(var B=[O],re=Math.max(0,O-1-3),q=O-1;q>=re;--q)B.push(q);for(var q=O+1;q<=3;++q)B.push(q);return B},F=function(O){return i.filledRange(O,"_arg","")},C=function(O){return i.filledRange(Math.max(O,3),"_arg","")},M=function(O){return typeof O.length=="number"?Math.max(Math.min(O.length,1024),0):0};N=function(O,B,re,q,X,oe){var ue=Math.max(0,M(q)-1),ge=k(ue),j=typeof O=="string"||B===t;function G(_e){var Ie=F(_e).join(", "),Pe=_e>0?", ":"",Fe;return j?Fe=`ret = callback.call(this, {{args}}, nodeback); break;
`:Fe=B===void 0?`ret = callback({{args}}, nodeback); break;
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
`,Fe.replace("{{args}}",Ie).replace(", ",Pe)}function Z(){for(var _e="",Ie=0;Ie<ge.length;++Ie)_e+="case "+ge[Ie]+":"+G(ge[Ie]);return _e+=`                                                             
	        default:                                                             
	            var args = new Array(len + 1);                                   
	            var i = 0;                                                       
	            for (var i = 0; i < len; ++i) {                                  
	               args[i] = arguments[i];                                       
	            }                                                                
	            args[i] = nodeback;                                              
	            [CodeForCall]                                                    
	            break;                                                           
	        `.replace("[CodeForCall]",j?`ret = callback.apply(this, args);
`:`ret = callback.apply(receiver, args);
`),_e}var te=typeof O=="string"?"this != null ? this['"+O+"'] : fn":"fn",ie=`'use strict';                                                
	        var ret = function (Parameters) {                                    
	            'use strict';                                                    
	            var len = arguments.length;                                      
	            var promise = new Promise(INTERNAL);                             
	            promise._captureStackTrace();                                    
	            var nodeback = nodebackForPromise(promise, `+oe+`);   
	            var ret;                                                         
	            var callback = tryCatch([GetFunctionCode]);                      
	            switch(len) {                                                    
	                [CodeForSwitchCase]                                          
	            }                                                                
	            if (ret === errorObj) {                                          
	                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);
	            }                                                                
	            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     
	            return promise;                                                  
	        };                                                                   
	        notEnumerableProp(ret, '__isPromisified__', true);                   
	        return ret;                                                          
	    `.replace("[CodeForSwitchCase]",Z()).replace("[GetFunctionCode]",te);return ie=ie.replace("Parameters",C(ue)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",ie)(n,q,B,s,a,r,i.tryCatch,i.errorObj,i.notEnumerableProp,e)}}function R(O,B,re,q,X,oe){var ue=(function(){return this})(),ge=O;typeof ge=="string"&&(O=q);function j(){var G=B;B===t&&(G=this);var Z=new n(e);Z._captureStackTrace();var te=typeof ge=="string"&&this!==ue?this[ge]:O,ie=r(Z,oe);try{te.apply(G,s(arguments,ie))}catch(_e){Z._rejectCallback(a(_e),!0,!0)}return Z._isFateSealed()||Z._setAsyncGuaranteed(),Z}return i.notEnumerableProp(j,"__isPromisified__",!0),j}var L=o?N:R;function H(O,B,re,q,X){for(var oe=new RegExp(A(B)+"$"),ue=w(O,B,oe,re),ge=0,j=ue.length;ge<j;ge+=2){var G=ue[ge],Z=ue[ge+1],te=G+B;if(q===L)O[te]=L(G,t,G,Z,B,X);else{var ie=q(Z,function(){return L(G,t,G,Z,B,X)});i.notEnumerableProp(ie,"__isPromisified__",!0),O[te]=ie}}return i.toFastProperties(O),O}function P(O,B,re){return L(O,B,void 0,O,null,re)}n.promisify=function(O,B){if(typeof O!="function")throw new l("expecting a function but got "+i.classString(O));if(v(O))return O;B=Object(B);var re=B.context===void 0?t:B.context,q=!!B.multiArgs,X=P(O,re,q);return i.copyDescriptors(O,X,x),X},n.promisifyAll=function(O,B){if(typeof O!="function"&&typeof O!="object")throw new l(`the target of promisifyAll must be an object or a function

    See http://goo.gl/MqrFmX
`);B=Object(B);var re=!!B.multiArgs,q=B.suffix;typeof q!="string"&&(q=c);var X=B.filter;typeof X!="function"&&(X=y);var oe=B.promisifier;if(typeof oe!="function"&&(oe=L),!i.isIdentifier(q))throw new RangeError(`suffix must be a valid identifier

    See http://goo.gl/MqrFmX
`);for(var ue=i.inheritedDataKeys(O),ge=0;ge<ue.length;++ge){var j=O[ue[ge]];ue[ge]!=="constructor"&&i.isClass(j)&&(H(j.prototype,q,X,oe,re),H(j,q,X,oe,re))}return H(O,q,X,oe,re)}}),A3}var S3,GW;function $be(){return GW||(GW=1,S3=function(n,e,t,i){var r=wi(),s=r.isObject,a=$1(),o;typeof Map=="function"&&(o=Map);var l=(function(){var p=0,y=0;function x(v,_){this[p]=v,this[p+y]=_,p++}return function(_){y=_.size,p=0;var E=new Array(_.size*2);return _.forEach(x,E),E}})(),c=function(p){for(var y=new o,x=p.length/2|0,v=0;v<x;++v){var _=p[x+v],E=p[v];y.set(_,E)}return y};function h(p){var y=!1,x;if(o!==void 0&&p instanceof o)x=l(p),y=!0;else{var v=a.keys(p),_=v.length;x=new Array(_*2);for(var E=0;E<_;++E){var w=v[E];x[E]=p[w],x[E+_]=w}}this.constructor$(x),this._isMap=y,this._init$(void 0,-3)}r.inherits(h,e),h.prototype._init=function(){},h.prototype._promiseFulfilled=function(p,y){this._values[y]=p;var x=++this._totalResolved;if(x>=this._length){var v;if(this._isMap)v=c(this._values);else{v={};for(var _=this.length(),E=0,w=this.length();E<w;++E)v[this._values[E+_]]=this._values[E]}return this._resolve(v),!0}return!1},h.prototype.shouldCopyValues=function(){return!1},h.prototype.getActualLength=function(p){return p>>1};function f(p){var y,x=t(p);if(s(x))x instanceof n?y=x._then(n.props,void 0,void 0,void 0,void 0):y=new h(x).promise();else return i(`cannot await properties of a non-object

    See http://goo.gl/MqrFmX
`);return x instanceof n&&y._propagateFrom(x,2),y}n.prototype.props=function(){return f(this)},n.props=function(p){return f(p)}}),S3}var D3,qW;function jbe(){return qW||(qW=1,D3=function(n,e,t,i){var r=wi(),s=function(o){return o.then(function(l){return a(l,o)})};function a(o,l){var c=t(o);if(c instanceof n)return s(c);if(o=r.asArray(o),o===null)return i("expecting an array or an iterable object but got "+r.classString(o));var h=new n(e);l!==void 0&&h._propagateFrom(l,3);for(var f=h._fulfill,p=h._reject,y=0,x=o.length;y<x;++y){var v=o[y];v===void 0&&!(y in o)||n.cast(v)._then(f,p,void 0,h,null)}return h}n.race=function(o){return a(o,void 0)},n.prototype.race=function(){return a(this,void 0)}}),D3}var C3,$W;function Xbe(){return $W||($W=1,C3=function(n,e,t,i,r,s){var a=n._getDomain,o=wi(),l=o.tryCatch;function c(x,v,_,E){this.constructor$(x);var w=a();this._fn=w===null?v:o.domainBind(w,v),_!==void 0&&(_=n.resolve(_),_._attachCancellationCallback(this)),this._initialValue=_,this._currentCancellable=null,E===r?this._eachValues=Array(this._length):E===0?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}o.inherits(c,e),c.prototype._gotAccum=function(x){this._eachValues!==void 0&&this._eachValues!==null&&x!==r&&this._eachValues.push(x)},c.prototype._eachComplete=function(x){return this._eachValues!==null&&this._eachValues.push(x),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(x){this._promise._resolveCallback(x),this._values=null},c.prototype._resultCancelled=function(x){if(x===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof n&&this._currentCancellable.cancel(),this._initialValue instanceof n&&this._initialValue.cancel())},c.prototype._iterate=function(x){this._values=x;var v,_,E=x.length;if(this._initialValue!==void 0?(v=this._initialValue,_=0):(v=n.resolve(x[0]),_=1),this._currentCancellable=v,!v.isRejected())for(;_<E;++_){var w={accum:null,value:x[_],index:_,length:E,array:this};v=v._then(p,void 0,void 0,w,void 0)}this._eachValues!==void 0&&(v=v._then(this._eachComplete,void 0,void 0,this,void 0)),v._then(h,h,void 0,v,this)},n.prototype.reduce=function(x,v){return f(this,x,v,null)},n.reduce=function(x,v,_,E){return f(x,v,_,E)};function h(x,v){this.isFulfilled()?v._resolve(x):v._reject(x)}function f(x,v,_,E){if(typeof v!="function")return t("expecting a function but got "+o.classString(v));var w=new c(x,v,_,E);return w.promise()}function p(x){this.accum=x,this.array._gotAccum(x);var v=i(this.value,this.array._promise);return v instanceof n?(this.array._currentCancellable=v,v._then(y,void 0,void 0,this,void 0)):y.call(this,v)}function y(x){var v=this.array,_=v._promise,E=l(v._fn);_._pushContext();var w;v._eachValues!==void 0?w=E.call(_._boundValue(),x,this.index,this.length):w=E.call(_._boundValue(),this.accum,x,this.index,this.length),w instanceof n&&(v._currentCancellable=w);var A=_._popContext();return s.checkForgottenReturns(w,A,v._eachValues!==void 0?"Promise.each":"Promise.reduce",_),w}}),C3}var I3,jW;function Kbe(){return jW||(jW=1,I3=function(n,e,t){var i=n.PromiseInspection,r=wi();function s(a){this.constructor$(a)}r.inherits(s,e),s.prototype._promiseResolved=function(a,o){this._values[a]=o;var l=++this._totalResolved;return l>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseFulfilled=function(a,o){var l=new i;return l._bitField=33554432,l._settledValueField=a,this._promiseResolved(o,l)},s.prototype._promiseRejected=function(a,o){var l=new i;return l._bitField=16777216,l._settledValueField=a,this._promiseResolved(o,l)},n.settle=function(a){return t.deprecated(".settle()",".reflect()"),new s(a).promise()},n.prototype.settle=function(){return n.settle(this)}}),I3}var R3,XW;function Ybe(){return XW||(XW=1,R3=function(n,e,t){var i=wi(),r=ip().RangeError,s=ip().AggregateError,a=i.isArray,o={};function l(h){this.constructor$(h),this._howMany=0,this._unwrap=!1,this._initialized=!1}i.inherits(l,e),l.prototype._init=function(){if(this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var h=a(this._values);!this._isResolved()&&h&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(h){this._howMany=h},l.prototype._promiseFulfilled=function(h){return this._addFulfilled(h),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},l.prototype._promiseRejected=function(h){return this._addRejected(h),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof n||this._values==null?this._cancel():(this._addRejected(o),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var h=new s,f=this.length();f<this._values.length;++f)this._values[f]!==o&&h.push(this._values[f]);return h.length>0?this._reject(h):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(h){this._values.push(h)},l.prototype._addFulfilled=function(h){this._values[this._totalResolved++]=h},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(h){var f="Input array must contain at least "+this._howMany+" items but contains only "+h+" items";return new r(f)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function c(h,f){if((f|0)!==f||f<0)return t(`expecting a positive integer

    See http://goo.gl/MqrFmX
`);var p=new l(h),y=p.promise();return p.setHowMany(f),p.init(),y}n.some=function(h,f){return c(h,f)},n.prototype.some=function(h){return c(this,h)},n._SomePromiseArray=l}),R3}var N3,KW;function Jbe(){return KW||(KW=1,N3=function(n,e){var t=n.map;n.prototype.filter=function(i,r){return t(this,i,r,e)},n.filter=function(i,r,s){return t(i,r,s,e)}}),N3}var k3,YW;function Qbe(){return YW||(YW=1,k3=function(n,e){var t=n.reduce,i=n.all;function r(){return i(this)}function s(a,o){return t(a,o,e,e)}n.prototype.each=function(a){return t(this,a,e,0)._then(r,void 0,void 0,this,void 0)},n.prototype.mapSeries=function(a){return t(this,a,e,e)},n.each=function(a,o){return t(a,o,e,0)._then(r,void 0,void 0,a,void 0)},n.mapSeries=s}),k3}var M3,JW;function Zbe(){return JW||(JW=1,M3=function(n){var e=n._SomePromiseArray;function t(i){var r=new e(i),s=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),s}n.any=function(i){return t(i)},n.prototype.any=function(){return t(this)}}),M3}var QW;function e2e(){return QW||(QW=1,(function(n){n.exports=function(){var e=function(){return new p(`circular promise resolution chain

    See http://goo.gl/MqrFmX
`)},t=function(){return new P.PromiseInspection(this._target())},i=function(q){return P.reject(new p(q))};function r(){}var s={},a=wi(),o;a.isNode?o=function(){var q=process.domain;return q===void 0&&(q=null),q}:o=function(){return null},a.notEnumerableProp(P,"_getDomain",o);var l=$1(),c=Sbe(),h=new c;l.defineProperty(P,"_async",{value:h});var f=ip(),p=P.TypeError=f.TypeError;P.RangeError=f.RangeError;var y=P.CancellationError=f.CancellationError;P.TimeoutError=f.TimeoutError,P.OperationalError=f.OperationalError,P.RejectionError=f.OperationalError,P.AggregateError=f.AggregateError;var x=function(){},v={},_={},E=Dbe()(P,x),w=Cbe()(P,x,E,i,r),A=Ibe()(P),N=A.create,k=Rbe()(P,A);k.CapturedTrace;var F=Nbe()(P,E),C=kbe()(_),M=tZ(),R=a.errorObj,L=a.tryCatch;function H(q,X){if(typeof X!="function")throw new p("expecting a function but got "+a.classString(X));if(q.constructor!==P)throw new p(`the promise constructor cannot be invoked directly

    See http://goo.gl/MqrFmX
`)}function P(q){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,q!==x&&(H(this,q),this._resolveFromExecutor(q)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}P.prototype.toString=function(){return"[object Promise]"},P.prototype.caught=P.prototype.catch=function(q){var X=arguments.length;if(X>1){var oe=new Array(X-1),ue=0,ge;for(ge=0;ge<X-1;++ge){var j=arguments[ge];if(a.isObject(j))oe[ue++]=j;else return i("expecting an object but got A catch statement predicate "+a.classString(j))}return oe.length=ue,q=arguments[ge],this.then(void 0,C(oe,q,this))}return this.then(void 0,q)},P.prototype.reflect=function(){return this._then(t,t,void 0,this,void 0)},P.prototype.then=function(q,X){if(k.warnings()&&arguments.length>0&&typeof q!="function"&&typeof X!="function"){var oe=".then() only accepts functions but was passed: "+a.classString(q);arguments.length>1&&(oe+=", "+a.classString(X)),this._warn(oe)}return this._then(q,X,void 0,void 0,void 0)},P.prototype.done=function(q,X){var oe=this._then(q,X,void 0,void 0,void 0);oe._setIsFinal()},P.prototype.spread=function(q){return typeof q!="function"?i("expecting a function but got "+a.classString(q)):this.all()._then(q,void 0,void 0,v,void 0)},P.prototype.toJSON=function(){var q={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(q.fulfillmentValue=this.value(),q.isFulfilled=!0):this.isRejected()&&(q.rejectionReason=this.reason(),q.isRejected=!0),q},P.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new w(this).promise()},P.prototype.error=function(q){return this.caught(a.originatesFromRejection,q)},P.getNewLibraryCopy=n.exports,P.is=function(q){return q instanceof P},P.fromNode=P.fromCallback=function(q){var X=new P(x);X._captureStackTrace();var oe=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,ue=L(q)(M(X,oe));return ue===R&&X._rejectCallback(ue.e,!0),X._isFateSealed()||X._setAsyncGuaranteed(),X},P.all=function(q){return new w(q).promise()},P.cast=function(q){var X=E(q);return X instanceof P||(X=new P(x),X._captureStackTrace(),X._setFulfilled(),X._rejectionHandler0=q),X},P.resolve=P.fulfilled=P.cast,P.reject=P.rejected=function(q){var X=new P(x);return X._captureStackTrace(),X._rejectCallback(q,!0),X},P.setScheduler=function(q){if(typeof q!="function")throw new p("expecting a function but got "+a.classString(q));return h.setScheduler(q)},P.prototype._then=function(q,X,oe,ue,ge){var j=ge!==void 0,G=j?ge:new P(x),Z=this._target(),te=Z._bitField;j||(G._propagateFrom(this,3),G._captureStackTrace(),ue===void 0&&(this._bitField&2097152)!==0&&((te&50397184)!==0?ue=this._boundValue():ue=Z===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,G));var ie=o();if((te&50397184)!==0){var _e,Ie,Pe=Z._settlePromiseCtx;(te&33554432)!==0?(Ie=Z._rejectionHandler0,_e=q):(te&16777216)!==0?(Ie=Z._fulfillmentHandler0,_e=X,Z._unsetRejectionIsUnhandled()):(Pe=Z._settlePromiseLateCancellationObserver,Ie=new y("late cancellation observer"),Z._attachExtraTrace(Ie),_e=X),h.invoke(Pe,Z,{handler:ie===null?_e:typeof _e=="function"&&a.domainBind(ie,_e),promise:G,receiver:ue,value:Ie})}else Z._addCallbacks(q,X,G,ue,ie);return G},P.prototype._length=function(){return this._bitField&65535},P.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},P.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},P.prototype._setLength=function(q){this._bitField=this._bitField&-65536|q&65535},P.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},P.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},P.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},P.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},P.prototype._isFinal=function(){return(this._bitField&4194304)>0},P.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},P.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},P.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},P.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=this._bitField|134217728)},P.prototype._receiverAt=function(q){var X=q===0?this._receiver0:this[q*4-4+3];if(X!==s)return X===void 0&&this._isBound()?this._boundValue():X},P.prototype._promiseAt=function(q){return this[q*4-4+2]},P.prototype._fulfillmentHandlerAt=function(q){return this[q*4-4+0]},P.prototype._rejectionHandlerAt=function(q){return this[q*4-4+1]},P.prototype._boundValue=function(){},P.prototype._migrateCallback0=function(q){q._bitField;var X=q._fulfillmentHandler0,oe=q._rejectionHandler0,ue=q._promise0,ge=q._receiverAt(0);ge===void 0&&(ge=s),this._addCallbacks(X,oe,ue,ge,null)},P.prototype._migrateCallbackAt=function(q,X){var oe=q._fulfillmentHandlerAt(X),ue=q._rejectionHandlerAt(X),ge=q._promiseAt(X),j=q._receiverAt(X);j===void 0&&(j=s),this._addCallbacks(oe,ue,ge,j,null)},P.prototype._addCallbacks=function(q,X,oe,ue,ge){var j=this._length();if(j>=65531&&(j=0,this._setLength(0)),j===0)this._promise0=oe,this._receiver0=ue,typeof q=="function"&&(this._fulfillmentHandler0=ge===null?q:a.domainBind(ge,q)),typeof X=="function"&&(this._rejectionHandler0=ge===null?X:a.domainBind(ge,X));else{var G=j*4-4;this[G+2]=oe,this[G+3]=ue,typeof q=="function"&&(this[G+0]=ge===null?q:a.domainBind(ge,q)),typeof X=="function"&&(this[G+1]=ge===null?X:a.domainBind(ge,X))}return this._setLength(j+1),j},P.prototype._proxy=function(q,X){this._addCallbacks(void 0,void 0,X,q,null)},P.prototype._resolveCallback=function(q,X){if((this._bitField&117506048)===0){if(q===this)return this._rejectCallback(e(),!1);var oe=E(q,this);if(!(oe instanceof P))return this._fulfill(q);X&&this._propagateFrom(oe,2);var ue=oe._target();if(ue===this){this._reject(e());return}var ge=ue._bitField;if((ge&50397184)===0){var j=this._length();j>0&&ue._migrateCallback0(this);for(var G=1;G<j;++G)ue._migrateCallbackAt(this,G);this._setFollowing(),this._setLength(0),this._setFollowee(ue)}else if((ge&33554432)!==0)this._fulfill(ue._value());else if((ge&16777216)!==0)this._reject(ue._reason());else{var Z=new y("late cancellation observer");ue._attachExtraTrace(Z),this._reject(Z)}}},P.prototype._rejectCallback=function(q,X,oe){var ue=a.ensureErrorObject(q),ge=ue===q;if(!ge&&!oe&&k.warnings()){var j="a promise was rejected with a non-error: "+a.classString(q);this._warn(j,!0)}this._attachExtraTrace(ue,X?ge:!1),this._reject(q)},P.prototype._resolveFromExecutor=function(q){var X=this;this._captureStackTrace(),this._pushContext();var oe=!0,ue=this._execute(q,function(ge){X._resolveCallback(ge)},function(ge){X._rejectCallback(ge,oe)});oe=!1,this._popContext(),ue!==void 0&&X._rejectCallback(ue,!0)},P.prototype._settlePromiseFromHandler=function(q,X,oe,ue){var ge=ue._bitField;if((ge&65536)===0){ue._pushContext();var j;X===v?!oe||typeof oe.length!="number"?(j=R,j.e=new p("cannot .spread() a non-array: "+a.classString(oe))):j=L(q).apply(this._boundValue(),oe):j=L(q).call(X,oe);var G=ue._popContext();ge=ue._bitField,(ge&65536)===0&&(j===_?ue._reject(oe):j===R?ue._rejectCallback(j.e,!1):(k.checkForgottenReturns(j,G,"",ue,this),ue._resolveCallback(j)))}},P.prototype._target=function(){for(var q=this;q._isFollowing();)q=q._followee();return q},P.prototype._followee=function(){return this._rejectionHandler0},P.prototype._setFollowee=function(q){this._rejectionHandler0=q},P.prototype._settlePromise=function(q,X,oe,ue){var ge=q instanceof P,j=this._bitField,G=(j&134217728)!==0;(j&65536)!==0?(ge&&q._invokeInternalOnCancel(),oe instanceof F&&oe.isFinallyHandler()?(oe.cancelPromise=q,L(X).call(oe,ue)===R&&q._reject(R.e)):X===t?q._fulfill(t.call(oe)):oe instanceof r?oe._promiseCancelled(q):ge||q instanceof w?q._cancel():oe.cancel()):typeof X=="function"?ge?(G&&q._setAsyncGuaranteed(),this._settlePromiseFromHandler(X,oe,ue,q)):X.call(oe,ue,q):oe instanceof r?oe._isResolved()||((j&33554432)!==0?oe._promiseFulfilled(ue,q):oe._promiseRejected(ue,q)):ge&&(G&&q._setAsyncGuaranteed(),(j&33554432)!==0?q._fulfill(ue):q._reject(ue))},P.prototype._settlePromiseLateCancellationObserver=function(q){var X=q.handler,oe=q.promise,ue=q.receiver,ge=q.value;typeof X=="function"?oe instanceof P?this._settlePromiseFromHandler(X,ue,ge,oe):X.call(ue,ge,oe):oe instanceof P&&oe._reject(ge)},P.prototype._settlePromiseCtx=function(q){this._settlePromise(q.promise,q.handler,q.receiver,q.value)},P.prototype._settlePromise0=function(q,X,oe){var ue=this._promise0,ge=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(ue,q,ge,X)},P.prototype._clearCallbackDataAtIndex=function(q){var X=q*4-4;this[X+2]=this[X+3]=this[X+0]=this[X+1]=void 0},P.prototype._fulfill=function(q){var X=this._bitField;if(!((X&117506048)>>>16)){if(q===this){var oe=e();return this._attachExtraTrace(oe),this._reject(oe)}this._setFulfilled(),this._rejectionHandler0=q,(X&65535)>0&&((X&134217728)!==0?this._settlePromises():h.settlePromises(this))}},P.prototype._reject=function(q){var X=this._bitField;if(!((X&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=q,this._isFinal())return h.fatalError(q,a.isNode);(X&65535)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},P.prototype._fulfillPromises=function(q,X){for(var oe=1;oe<q;oe++){var ue=this._fulfillmentHandlerAt(oe),ge=this._promiseAt(oe),j=this._receiverAt(oe);this._clearCallbackDataAtIndex(oe),this._settlePromise(ge,ue,j,X)}},P.prototype._rejectPromises=function(q,X){for(var oe=1;oe<q;oe++){var ue=this._rejectionHandlerAt(oe),ge=this._promiseAt(oe),j=this._receiverAt(oe);this._clearCallbackDataAtIndex(oe),this._settlePromise(ge,ue,j,X)}},P.prototype._settlePromises=function(){var q=this._bitField,X=q&65535;if(X>0){if((q&16842752)!==0){var oe=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,oe,q),this._rejectPromises(X,oe)}else{var ue=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,ue,q),this._fulfillPromises(X,ue)}this._setLength(0)}this._clearCancellationData()},P.prototype._settledValue=function(){var q=this._bitField;if((q&33554432)!==0)return this._rejectionHandler0;if((q&16777216)!==0)return this._fulfillmentHandler0};function O(q){this.promise._resolveCallback(q)}function B(q){this.promise._rejectCallback(q,!1)}P.defer=P.pending=function(){k.deprecated("Promise.defer","new Promise");var q=new P(x);return{promise:q,resolve:O,reject:B}},a.notEnumerableProp(P,"_makeSelfResolutionError",e),Mbe()(P,x,E,i,k),Fbe()(P,x,E,k),Ube()(P,w,i,k),Pbe()(P),Lbe()(P),Obe()(P,w,E,x,h,o),P.Promise=P,P.version="3.4.7",Bbe()(P,w,i,E,x,k),Vbe()(P),Wbe()(P,i,E,N,x,k),Hbe()(P,x,k),zbe()(P,i,x,E,r,k),Gbe()(P),qbe()(P,x),$be()(P,w,E,i),jbe()(P,x,E,i),Xbe()(P,w,i,E,x,k),Kbe()(P,w,k),Ybe()(P,w,i),Jbe()(P,x),Qbe()(P,x),Zbe()(P),a.toFastProperties(P),a.toFastProperties(P.prototype);function re(q){var X=new P(x);X._fulfillmentHandler0=q,X._rejectionHandler0=q,X._promise0=q,X._receiver0=q}return re({a:1}),re({b:2}),re({c:3}),re(1),re(function(){}),re(void 0),re(!1),re(new P(x)),k.setBounds(c.firstLineError,a.lastLineError),P}})(n3)),n3.exports}var ZW;function Tp(){if(ZW)return zo;ZW=1;var n=sr,e=e2e()();zo.defer=t,zo.when=e.resolve,zo.resolve=e.resolve,zo.all=e.all,zo.props=e.props,zo.reject=e.reject,zo.promisify=e.promisify,zo.mapSeries=e.mapSeries,zo.attempt=e.attempt,zo.nfcall=function(i){var r=Array.prototype.slice.call(arguments,1),s=e.promisify(i);return s.apply(null,r)},e.prototype.fail=e.prototype.caught,e.prototype.also=function(i){return this.then(function(r){var s=n.extend({},r,i(r));return e.props(s)})};function t(){var i,r,s=new e.Promise(function(a,o){i=a,r=o});return{resolve:i,reject:r,promise:s}}return zo}var On={},eH;function t0(){if(eH)return On;eH=1;var n=sr,e=On.types={document:"document",paragraph:"paragraph",run:"run",text:"text",tab:"tab",checkbox:"checkbox",hyperlink:"hyperlink",noteReference:"noteReference",image:"image",note:"note",commentReference:"commentReference",comment:"comment",table:"table",tableRow:"tableRow",tableCell:"tableCell",break:"break",bookmarkStart:"bookmarkStart"};function t(F,C){return C=C||{},{type:e.document,children:F,notes:C.notes||new f({}),comments:C.comments||[]}}function i(F,C){C=C||{};var M=C.indent||{};return{type:e.paragraph,children:F,styleId:C.styleId||null,styleName:C.styleName||null,numbering:C.numbering||null,alignment:C.alignment||null,indent:{start:M.start||null,end:M.end||null,firstLine:M.firstLine||null,hanging:M.hanging||null}}}function r(F,C){return C=C||{},{type:e.run,children:F,styleId:C.styleId||null,styleName:C.styleName||null,isBold:!!C.isBold,isUnderline:!!C.isUnderline,isItalic:!!C.isItalic,isStrikethrough:!!C.isStrikethrough,isAllCaps:!!C.isAllCaps,isSmallCaps:!!C.isSmallCaps,verticalAlignment:C.verticalAlignment||s.baseline,font:C.font||null,fontSize:C.fontSize||null,highlight:C.highlight||null}}var s={baseline:"baseline",superscript:"superscript",subscript:"subscript"};function a(F){return{type:e.text,value:F}}function o(){return{type:e.tab}}function l(F){return{type:e.checkbox,checked:F.checked}}function c(F,C){return{type:e.hyperlink,children:F,href:C.href,anchor:C.anchor,targetFrame:C.targetFrame}}function h(F){return{type:e.noteReference,noteType:F.noteType,noteId:F.noteId}}function f(F){this._notes=n.indexBy(F,function(C){return v(C.noteType,C.noteId)})}f.prototype.resolve=function(F){return this.findNoteByKey(v(F.noteType,F.noteId))},f.prototype.findNoteByKey=function(F){return this._notes[F]||null};function p(F){return{type:e.note,noteType:F.noteType,noteId:F.noteId,body:F.body}}function y(F){return{type:e.commentReference,commentId:F.commentId}}function x(F){return{type:e.comment,commentId:F.commentId,body:F.body,authorName:F.authorName,authorInitials:F.authorInitials}}function v(F,C){return F+"-"+C}function _(F){return{type:e.image,read:function(C){return C?F.readImage(C):F.readImage().then(function(M){return Buffer.from(M)})},readAsArrayBuffer:function(){return F.readImage()},readAsBase64String:function(){return F.readImage("base64")},readAsBuffer:function(){return F.readImage().then(function(C){return Buffer.from(C)})},altText:F.altText,contentType:F.contentType}}function E(F,C){return C=C||{},{type:e.table,children:F,styleId:C.styleId||null,styleName:C.styleName||null}}function w(F,C){return C=C||{},{type:e.tableRow,children:F,isHeader:C.isHeader||!1}}function A(F,C){return C=C||{},{type:e.tableCell,children:F,colSpan:C.colSpan==null?1:C.colSpan,rowSpan:C.rowSpan==null?1:C.rowSpan}}function N(F){return{type:e.break,breakType:F}}function k(F){return{type:e.bookmarkStart,name:F.name}}return On.document=On.Document=t,On.paragraph=On.Paragraph=i,On.run=On.Run=r,On.text=On.Text=a,On.tab=On.Tab=o,On.checkbox=On.Checkbox=l,On.Hyperlink=c,On.noteReference=On.NoteReference=h,On.Notes=f,On.Note=p,On.commentReference=y,On.comment=x,On.Image=_,On.Table=E,On.TableRow=w,On.TableCell=A,On.lineBreak=N("line"),On.pageBreak=N("page"),On.columnBreak=N("column"),On.BookmarkStart=k,On.verticalAlignment=s,On}var Y0={},tH;function Bh(){if(tH)return Y0;tH=1;var n=sr;Y0.Result=e,Y0.success=t,Y0.warning=i,Y0.error=r;function e(l,c){this.value=l,this.messages=c||[]}e.prototype.map=function(l){return new e(l(this.value),this.messages)},e.prototype.flatMap=function(l){var c=l(this.value);return new e(c.value,s([this,c]))},e.prototype.flatMapThen=function(l){var c=this;return l(this.value).then(function(h){return new e(h.value,s([c,h]))})},e.combine=function(l){var c=n.flatten(n.pluck(l,"value")),h=s(l);return new e(c,h)};function t(l){return new e(l,[])}function i(l){return{type:"warning",message:l}}function r(l){return{type:"error",message:l.message,error:l}}function s(l){var c=[];return n.flatten(n.pluck(l,"messages"),!0).forEach(function(h){a(c,h)||c.push(h)}),c}function a(l,c){return n.find(l,o.bind(null,c))!==void 0}function o(l,c){return l.type===c.type&&l.message===c.message}return Y0}var cx={},ux={},nH;function t2e(){if(nH)return ux;nH=1,ux.byteLength=o,ux.toByteArray=c,ux.fromByteArray=p;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=i.length;r<s;++r)n[r]=i[r],e[i.charCodeAt(r)]=r;e[45]=62,e[95]=63;function a(y){var x=y.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=y.indexOf("=");v===-1&&(v=x);var _=v===x?0:4-v%4;return[v,_]}function o(y){var x=a(y),v=x[0],_=x[1];return(v+_)*3/4-_}function l(y,x,v){return(x+v)*3/4-v}function c(y){var x,v=a(y),_=v[0],E=v[1],w=new t(l(y,_,E)),A=0,N=E>0?_-4:_,k;for(k=0;k<N;k+=4)x=e[y.charCodeAt(k)]<<18|e[y.charCodeAt(k+1)]<<12|e[y.charCodeAt(k+2)]<<6|e[y.charCodeAt(k+3)],w[A++]=x>>16&255,w[A++]=x>>8&255,w[A++]=x&255;return E===2&&(x=e[y.charCodeAt(k)]<<2|e[y.charCodeAt(k+1)]>>4,w[A++]=x&255),E===1&&(x=e[y.charCodeAt(k)]<<10|e[y.charCodeAt(k+1)]<<4|e[y.charCodeAt(k+2)]>>2,w[A++]=x>>8&255,w[A++]=x&255),w}function h(y){return n[y>>18&63]+n[y>>12&63]+n[y>>6&63]+n[y&63]}function f(y,x,v){for(var _,E=[],w=x;w<v;w+=3)_=(y[w]<<16&16711680)+(y[w+1]<<8&65280)+(y[w+2]&255),E.push(h(_));return E.join("")}function p(y){for(var x,v=y.length,_=v%3,E=[],w=16383,A=0,N=v-_;A<N;A+=w)E.push(f(y,A,A+w>N?N:A+w));return _===1?(x=y[v-1],E.push(n[x>>2]+n[x<<4&63]+"==")):_===2&&(x=(y[v-2]<<8)+y[v-1],E.push(n[x>>10]+n[x>>4&63]+n[x<<2&63]+"=")),E.join("")}return ux}function cA(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F3={exports:{}};/*!

JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.

JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/var iH;function n2e(){return iH||(iH=1,(function(n,e){(function(t){n.exports=t()})(function(){return(function t(i,r,s){function a(c,h){if(!r[c]){if(!i[c]){var f=typeof cA=="function"&&cA;if(!h&&f)return f(c,!0);if(o)return o(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var y=r[c]={exports:{}};i[c][0].call(y.exports,function(x){var v=i[c][1][x];return a(v||x)},y,y.exports,t,i,r,s)}return r[c].exports}for(var o=typeof cA=="function"&&cA,l=0;l<s.length;l++)a(s[l]);return a})({1:[function(t,i,r){var s=t("./utils"),a=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(l){for(var c,h,f,p,y,x,v,_=[],E=0,w=l.length,A=w,N=s.getTypeOf(l)!=="string";E<l.length;)A=w-E,f=N?(c=l[E++],h=E<w?l[E++]:0,E<w?l[E++]:0):(c=l.charCodeAt(E++),h=E<w?l.charCodeAt(E++):0,E<w?l.charCodeAt(E++):0),p=c>>2,y=(3&c)<<4|h>>4,x=1<A?(15&h)<<2|f>>6:64,v=2<A?63&f:64,_.push(o.charAt(p)+o.charAt(y)+o.charAt(x)+o.charAt(v));return _.join("")},r.decode=function(l){var c,h,f,p,y,x,v=0,_=0,E="data:";if(l.substr(0,E.length)===E)throw new Error("Invalid base64 input, it looks like a data url.");var w,A=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===o.charAt(64)&&A--,l.charAt(l.length-2)===o.charAt(64)&&A--,A%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=a.uint8array?new Uint8Array(0|A):new Array(0|A);v<l.length;)c=o.indexOf(l.charAt(v++))<<2|(p=o.indexOf(l.charAt(v++)))>>4,h=(15&p)<<4|(y=o.indexOf(l.charAt(v++)))>>2,f=(3&y)<<6|(x=o.indexOf(l.charAt(v++))),w[_++]=c,y!==64&&(w[_++]=h),x!==64&&(w[_++]=f);return w}},{"./support":30,"./utils":32}],2:[function(t,i,r){var s=t("./external"),a=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function c(h,f,p,y,x){this.compressedSize=h,this.uncompressedSize=f,this.crc32=p,this.compression=y,this.compressedContent=x}c.prototype={getContentWorker:function(){var h=new a(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return h.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new a(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(h,f,p){return h.pipe(new o).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},i.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,r){var s=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i,r){var s=t("./utils"),a=(function(){for(var o,l=[],c=0;c<256;c++){o=c;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;l[c]=o}return l})();i.exports=function(o,l){return o!==void 0&&o.length?s.getTypeOf(o)!=="string"?(function(c,h,f,p){var y=a,x=p+f;c^=-1;for(var v=p;v<x;v++)c=c>>>8^y[255&(c^h[v])];return-1^c})(0|l,o,o.length,0):(function(c,h,f,p){var y=a,x=p+f;c^=-1;for(var v=p;v<x;v++)c=c>>>8^y[255&(c^h.charCodeAt(v))];return-1^c})(0|l,o,o.length,0):0}},{"./utils":32}],5:[function(t,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,i,r){var s=null;s=typeof Promise<"u"?Promise:t("lie"),i.exports={Promise:s}},{lie:37}],7:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=t("pako"),o=t("./utils"),l=t("./stream/GenericWorker"),c=s?"uint8array":"array";function h(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}r.magic="\b\0",o.inherits(h,l),h.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(c,f.data),!1)},h.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},r.compressWorker=function(f){return new h("Deflate",f)},r.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i,r){function s(y,x){var v,_="";for(v=0;v<x;v++)_+=String.fromCharCode(255&y),y>>>=8;return _}function a(y,x,v,_,E,w){var A,N,k=y.file,F=y.compression,C=w!==c.utf8encode,M=o.transformTo("string",w(k.name)),R=o.transformTo("string",c.utf8encode(k.name)),L=k.comment,H=o.transformTo("string",w(L)),P=o.transformTo("string",c.utf8encode(L)),O=R.length!==k.name.length,B=P.length!==L.length,re="",q="",X="",oe=k.dir,ue=k.date,ge={crc32:0,compressedSize:0,uncompressedSize:0};x&&!v||(ge.crc32=y.crc32,ge.compressedSize=y.compressedSize,ge.uncompressedSize=y.uncompressedSize);var j=0;x&&(j|=8),C||!O&&!B||(j|=2048);var G=0,Z=0;oe&&(G|=16),E==="UNIX"?(Z=798,G|=(function(ie,_e){var Ie=ie;return ie||(Ie=_e?16893:33204),(65535&Ie)<<16})(k.unixPermissions,oe)):(Z=20,G|=(function(ie){return 63&(ie||0)})(k.dosPermissions)),A=ue.getUTCHours(),A<<=6,A|=ue.getUTCMinutes(),A<<=5,A|=ue.getUTCSeconds()/2,N=ue.getUTCFullYear()-1980,N<<=4,N|=ue.getUTCMonth()+1,N<<=5,N|=ue.getUTCDate(),O&&(q=s(1,1)+s(h(M),4)+R,re+="up"+s(q.length,2)+q),B&&(X=s(1,1)+s(h(H),4)+P,re+="uc"+s(X.length,2)+X);var te="";return te+=`
\0`,te+=s(j,2),te+=F.magic,te+=s(A,2),te+=s(N,2),te+=s(ge.crc32,4),te+=s(ge.compressedSize,4),te+=s(ge.uncompressedSize,4),te+=s(M.length,2),te+=s(re.length,2),{fileRecord:f.LOCAL_FILE_HEADER+te+M+re,dirRecord:f.CENTRAL_FILE_HEADER+s(Z,2)+te+s(H.length,2)+"\0\0\0\0"+s(G,4)+s(_,4)+M+re+H}}var o=t("../utils"),l=t("../stream/GenericWorker"),c=t("../utf8"),h=t("../crc32"),f=t("../signature");function p(y,x,v,_){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=v,this.encodeFileName=_,this.streamFiles=y,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(p,l),p.prototype.push=function(y){var x=y.meta.percent||0,v=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(y):(this.bytesWritten+=y.data.length,l.prototype.push.call(this,{data:y.data,meta:{currentFile:this.currentFile,percent:v?(x+100*(v-_-1))/v:100}}))},p.prototype.openedSource=function(y){this.currentSourceOffset=this.bytesWritten,this.currentFile=y.file.name;var x=this.streamFiles&&!y.file.dir;if(x){var v=a(y,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:v.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(y){this.accumulate=!1;var x=this.streamFiles&&!y.file.dir,v=a(y,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(v.dirRecord),x)this.push({data:(function(_){return f.DATA_DESCRIPTOR+s(_.crc32,4)+s(_.compressedSize,4)+s(_.uncompressedSize,4)})(y),meta:{percent:100}});else for(this.push({data:v.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var y=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var v=this.bytesWritten-y,_=(function(E,w,A,N,k){var F=o.transformTo("string",k(N));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(E,2)+s(E,2)+s(w,4)+s(A,4)+s(F.length,2)+F})(this.dirRecords.length,v,y,this.zipComment,this.encodeFileName);this.push({data:_,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(y){this._sources.push(y);var x=this;return y.on("data",function(v){x.processChunk(v)}),y.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),y.on("error",function(v){x.error(v)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(y){var x=this._sources;if(!l.prototype.error.call(this,y))return!1;for(var v=0;v<x.length;v++)try{x[v].error(y)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var y=this._sources,x=0;x<y.length;x++)y[x].lock()},i.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,r){var s=t("../compressions"),a=t("./ZipFileWorker");r.generateWorker=function(o,l,c){var h=new a(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{o.forEach(function(p,y){f++;var x=(function(w,A){var N=w||A,k=s[N];if(!k)throw new Error(N+" is not a valid compression method !");return k})(y.options.compression,l.compression),v=y.options.compressionOptions||l.compressionOptions||{},_=y.dir,E=y.date;y._compressWorker(x,v).withStreamInfo("file",{name:p,dir:_,date:E,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(h)}),h.entriesCount=f}catch(p){h.error(p)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i,r){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new s;for(var o in this)typeof this[o]!="function"&&(a[o]=this[o]);return a}}(s.prototype=t("./object")).loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(a,o){return new s().loadAsync(a,o)},s.external=t("./external"),i.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i,r){var s=t("./utils"),a=t("./external"),o=t("./utf8"),l=t("./zipEntries"),c=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function f(p){return new a.Promise(function(y,x){var v=p.decompressed.getContentWorker().pipe(new c);v.on("error",function(_){x(_)}).on("end",function(){v.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):y()}).resume()})}i.exports=function(p,y){var x=this;return y=s.extend(y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(p)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,y.optimizedBinaryString,y.base64).then(function(v){var _=new l(y);return _.load(v),_}).then(function(v){var _=[a.Promise.resolve(v)],E=v.files;if(y.checkCRC32)for(var w=0;w<E.length;w++)_.push(f(E[w]));return a.Promise.all(_)}).then(function(v){for(var _=v.shift(),E=_.files,w=0;w<E.length;w++){var A=E[w],N=A.fileNameStr,k=s.resolve(A.fileNameStr);x.file(k,A.decompressed,{binary:!0,optimizedBinaryString:!0,date:A.date,dir:A.dir,comment:A.fileCommentStr.length?A.fileCommentStr:null,unixPermissions:A.unixPermissions,dosPermissions:A.dosPermissions,createFolders:y.createFolders}),A.dir||(x.file(k).unsafeOriginalName=N)}return _.zipComment.length&&(x.comment=_.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i,r){var s=t("../utils"),a=t("../stream/GenericWorker");function o(l,c){a.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}s.inherits(o,a),o.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(h){c.push({data:h,meta:{percent:0}})}).on("error",function(h){c.isPaused?this.generatedError=h:c.error(h)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},o.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i,r){var s=t("readable-stream").Readable;function a(o,l,c){s.call(this,l),this._helper=o;var h=this;o.on("data",function(f,p){h.push(f)||h._helper.pause(),c&&c(p)}).on("error",function(f){h.emit("error",f)}).on("end",function(){h.push(null)})}t("../utils").inherits(a,s),a.prototype._read=function(){this._helper.resume()},i.exports=a},{"../utils":32,"readable-stream":16}],14:[function(t,i,r){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,a);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,a)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var a=new Buffer(s);return a.fill(0),a},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,i,r){function s(k,F,C){var M,R=o.getTypeOf(F),L=o.extend(C||{},h);L.date=L.date||new Date,L.compression!==null&&(L.compression=L.compression.toUpperCase()),typeof L.unixPermissions=="string"&&(L.unixPermissions=parseInt(L.unixPermissions,8)),L.unixPermissions&&16384&L.unixPermissions&&(L.dir=!0),L.dosPermissions&&16&L.dosPermissions&&(L.dir=!0),L.dir&&(k=E(k)),L.createFolders&&(M=_(k))&&w.call(this,M,!0);var H=R==="string"&&L.binary===!1&&L.base64===!1;C&&C.binary!==void 0||(L.binary=!H),(F instanceof f&&F.uncompressedSize===0||L.dir||!F||F.length===0)&&(L.base64=!1,L.binary=!0,F="",L.compression="STORE",R="string");var P=null;P=F instanceof f||F instanceof l?F:x.isNode&&x.isStream(F)?new v(k,F):o.prepareContent(k,F,L.binary,L.optimizedBinaryString,L.base64);var O=new p(k,P,L);this.files[k]=O}var a=t("./utf8"),o=t("./utils"),l=t("./stream/GenericWorker"),c=t("./stream/StreamHelper"),h=t("./defaults"),f=t("./compressedObject"),p=t("./zipObject"),y=t("./generate"),x=t("./nodejsUtils"),v=t("./nodejs/NodejsStreamInputAdapter"),_=function(k){k.slice(-1)==="/"&&(k=k.substring(0,k.length-1));var F=k.lastIndexOf("/");return 0<F?k.substring(0,F):""},E=function(k){return k.slice(-1)!=="/"&&(k+="/"),k},w=function(k,F){return F=F!==void 0?F:h.createFolders,k=E(k),this.files[k]||s.call(this,k,null,{dir:!0,createFolders:F}),this.files[k]};function A(k){return Object.prototype.toString.call(k)==="[object RegExp]"}var N={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(k){var F,C,M;for(F in this.files)M=this.files[F],(C=F.slice(this.root.length,F.length))&&F.slice(0,this.root.length)===this.root&&k(C,M)},filter:function(k){var F=[];return this.forEach(function(C,M){k(C,M)&&F.push(M)}),F},file:function(k,F,C){if(arguments.length!==1)return k=this.root+k,s.call(this,k,F,C),this;if(A(k)){var M=k;return this.filter(function(L,H){return!H.dir&&M.test(L)})}var R=this.files[this.root+k];return R&&!R.dir?R:null},folder:function(k){if(!k)return this;if(A(k))return this.filter(function(R,L){return L.dir&&k.test(R)});var F=this.root+k,C=w.call(this,F),M=this.clone();return M.root=C.name,M},remove:function(k){k=this.root+k;var F=this.files[k];if(F||(k.slice(-1)!=="/"&&(k+="/"),F=this.files[k]),F&&!F.dir)delete this.files[k];else for(var C=this.filter(function(R,L){return L.name.slice(0,k.length)===k}),M=0;M<C.length;M++)delete this.files[C[M].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(k){var F,C={};try{if((C=o.extend(k||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=C.type.toLowerCase(),C.compression=C.compression.toUpperCase(),C.type==="binarystring"&&(C.type="string"),!C.type)throw new Error("No output type specified.");o.checkSupport(C.type),C.platform!=="darwin"&&C.platform!=="freebsd"&&C.platform!=="linux"&&C.platform!=="sunos"||(C.platform="UNIX"),C.platform==="win32"&&(C.platform="DOS");var M=C.comment||this.comment||"";F=y.generateWorker(this,C,M)}catch(R){(F=new l("error")).error(R)}return new c(F,C.type||"string",C.mimeType)},generateAsync:function(k,F){return this.generateInternalStream(k).accumulate(F)},generateNodeStream:function(k,F){return(k=k||{}).type||(k.type="nodebuffer"),this.generateInternalStream(k).toNodejsStream(F)}};i.exports=N},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i,r){i.exports=t("stream")},{stream:void 0}],17:[function(t,i,r){var s=t("./DataReader");function a(o){s.call(this,o);for(var l=0;l<this.data.length;l++)o[l]=255&o[l]}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data[this.zero+o]},a.prototype.lastIndexOfSignature=function(o){for(var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===h&&this.data[p+3]===f)return p-this.zero;return-1},a.prototype.readAndCheckSignature=function(o){var l=o.charCodeAt(0),c=o.charCodeAt(1),h=o.charCodeAt(2),f=o.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&h===p[2]&&f===p[3]},a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},i.exports=a},{"../utils":32,"./DataReader":18}],18:[function(t,i,r){var s=t("../utils");function a(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var l,c=0;for(this.checkOffset(o),l=this.index+o-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=o,c},readString:function(o){return s.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},i.exports=a},{"../utils":32}],19:[function(t,i,r){var s=t("./Uint8ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},i.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i,r){var s=t("./DataReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},a.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},a.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},a.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},i.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,i,r){var s=t("./ArrayReader");function a(o){s.call(this,o)}t("../utils").inherits(a,s),a.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},i.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,i,r){var s=t("../utils"),a=t("../support"),o=t("./ArrayReader"),l=t("./StringReader"),c=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");i.exports=function(f){var p=s.getTypeOf(f);return s.checkSupport(p),p!=="string"||a.uint8array?p==="nodebuffer"?new c(f):a.uint8array?new h(s.transformTo("uint8array",f)):new o(s.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,i,r){var s=t("./GenericWorker"),a=t("../utils");function o(l){s.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(o,s),o.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},i.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,i,r){var s=t("./GenericWorker"),a=t("../crc32");function o(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,s),o.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i,r){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(o,a),o.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},i.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,i,r){var s=t("../utils"),a=t("./GenericWorker");function o(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){c.dataIsReady=!0,c.data=h,c.max=h&&h.length||0,c.type=s.getTypeOf(h),c.isPaused||c._tickAndRepeat()},function(h){c.error(h)})}s.inherits(o,a),o.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,i,r){function s(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,o){return this._listeners[a].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,o){if(this._listeners[a])for(var l=0;l<this._listeners[a].length;l++)this._listeners[a][l].call(this,o)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var o=this;return a.on("data",function(l){o.processChunk(l)}),a.on("end",function(){o.end()}),a.on("error",function(l){o.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,o){return this.extraStreamInfo[a]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},i.exports=s},{}],29:[function(t,i,r){var s=t("../utils"),a=t("./ConvertWorker"),o=t("./GenericWorker"),l=t("../base64"),c=t("../support"),h=t("../external"),f=null;if(c.nodestream)try{f=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,v){return new h.Promise(function(_,E){var w=[],A=x._internalType,N=x._outputType,k=x._mimeType;x.on("data",function(F,C){w.push(F),v&&v(C)}).on("error",function(F){w=[],E(F)}).on("end",function(){try{var F=(function(C,M,R){switch(C){case"blob":return s.newBlob(s.transformTo("arraybuffer",M),R);case"base64":return l.encode(M);default:return s.transformTo(C,M)}})(N,(function(C,M){var R,L=0,H=null,P=0;for(R=0;R<M.length;R++)P+=M[R].length;switch(C){case"string":return M.join("");case"array":return Array.prototype.concat.apply([],M);case"uint8array":for(H=new Uint8Array(P),R=0;R<M.length;R++)H.set(M[R],L),L+=M[R].length;return H;case"nodebuffer":return Buffer.concat(M);default:throw new Error("concat : unsupported type '"+C+"'")}})(A,w),k);_(F)}catch(C){E(C)}w=[]}).resume()})}function y(x,v,_){var E=v;switch(v){case"blob":case"arraybuffer":E="uint8array";break;case"base64":E="string"}try{this._internalType=E,this._outputType=v,this._mimeType=_,s.checkSupport(E),this._worker=x.pipe(new a(E)),x.lock()}catch(w){this._worker=new o("error"),this._worker.error(w)}}y.prototype={accumulate:function(x){return p(this,x)},on:function(x,v){var _=this;return x==="data"?this._worker.on(x,function(E){v.call(_,E.data,E.meta)}):this._worker.on(x,function(){s.delay(v,arguments,_)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},x)}},i.exports=y},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var s=new ArrayBuffer(0);try{r.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(s),r.blob=a.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,r){for(var s=t("./utils"),a=t("./support"),o=t("./nodejsUtils"),l=t("./stream/GenericWorker"),c=new Array(256),h=0;h<256;h++)c[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}r.utf8encode=function(y){return a.nodebuffer?o.newBufferFrom(y,"utf-8"):(function(x){var v,_,E,w,A,N=x.length,k=0;for(w=0;w<N;w++)(64512&(_=x.charCodeAt(w)))==55296&&w+1<N&&(64512&(E=x.charCodeAt(w+1)))==56320&&(_=65536+(_-55296<<10)+(E-56320),w++),k+=_<128?1:_<2048?2:_<65536?3:4;for(v=a.uint8array?new Uint8Array(k):new Array(k),w=A=0;A<k;w++)(64512&(_=x.charCodeAt(w)))==55296&&w+1<N&&(64512&(E=x.charCodeAt(w+1)))==56320&&(_=65536+(_-55296<<10)+(E-56320),w++),_<128?v[A++]=_:(_<2048?v[A++]=192|_>>>6:(_<65536?v[A++]=224|_>>>12:(v[A++]=240|_>>>18,v[A++]=128|_>>>12&63),v[A++]=128|_>>>6&63),v[A++]=128|63&_);return v})(y)},r.utf8decode=function(y){return a.nodebuffer?s.transformTo("nodebuffer",y).toString("utf-8"):(function(x){var v,_,E,w,A=x.length,N=new Array(2*A);for(v=_=0;v<A;)if((E=x[v++])<128)N[_++]=E;else if(4<(w=c[E]))N[_++]=65533,v+=w-1;else{for(E&=w===2?31:w===3?15:7;1<w&&v<A;)E=E<<6|63&x[v++],w--;1<w?N[_++]=65533:E<65536?N[_++]=E:(E-=65536,N[_++]=55296|E>>10&1023,N[_++]=56320|1023&E)}return N.length!==_&&(N.subarray?N=N.subarray(0,_):N.length=_),s.applyFromCharCode(N)})(y=s.transformTo(a.uint8array?"uint8array":"array",y))},s.inherits(f,l),f.prototype.processChunk=function(y){var x=s.transformTo(a.uint8array?"uint8array":"array",y.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var v=x;(x=new Uint8Array(v.length+this.leftOver.length)).set(this.leftOver,0),x.set(v,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var _=(function(w,A){var N;for((A=A||w.length)>w.length&&(A=w.length),N=A-1;0<=N&&(192&w[N])==128;)N--;return N<0||N===0?A:N+c[w[N]]>A?N:A})(x),E=x;_!==x.length&&(a.uint8array?(E=x.subarray(0,_),this.leftOver=x.subarray(_,x.length)):(E=x.slice(0,_),this.leftOver=x.slice(_,x.length))),this.push({data:r.utf8decode(E),meta:y.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=f,s.inherits(p,l),p.prototype.processChunk=function(y){this.push({data:r.utf8encode(y.data),meta:y.meta})},r.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,r){var s=t("./support"),a=t("./base64"),o=t("./nodejsUtils"),l=t("./external");function c(v){return v}function h(v,_){for(var E=0;E<v.length;++E)_[E]=255&v.charCodeAt(E);return _}t("setimmediate"),r.newBlob=function(v,_){r.checkSupport("blob");try{return new Blob([v],{type:_})}catch{try{var E=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return E.append(v),E.getBlob(_)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(v,_,E){var w=[],A=0,N=v.length;if(N<=E)return String.fromCharCode.apply(null,v);for(;A<N;)_==="array"||_==="nodebuffer"?w.push(String.fromCharCode.apply(null,v.slice(A,Math.min(A+E,N)))):w.push(String.fromCharCode.apply(null,v.subarray(A,Math.min(A+E,N)))),A+=E;return w.join("")},stringifyByChar:function(v){for(var _="",E=0;E<v.length;E++)_+=String.fromCharCode(v[E]);return _},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}})()}};function p(v){var _=65536,E=r.getTypeOf(v),w=!0;if(E==="uint8array"?w=f.applyCanBeUsed.uint8array:E==="nodebuffer"&&(w=f.applyCanBeUsed.nodebuffer),w)for(;1<_;)try{return f.stringifyByChunk(v,E,_)}catch{_=Math.floor(_/2)}return f.stringifyByChar(v)}function y(v,_){for(var E=0;E<v.length;E++)_[E]=v[E];return _}r.applyFromCharCode=p;var x={};x.string={string:c,array:function(v){return h(v,new Array(v.length))},arraybuffer:function(v){return x.string.uint8array(v).buffer},uint8array:function(v){return h(v,new Uint8Array(v.length))},nodebuffer:function(v){return h(v,o.allocBuffer(v.length))}},x.array={string:p,array:c,arraybuffer:function(v){return new Uint8Array(v).buffer},uint8array:function(v){return new Uint8Array(v)},nodebuffer:function(v){return o.newBufferFrom(v)}},x.arraybuffer={string:function(v){return p(new Uint8Array(v))},array:function(v){return y(new Uint8Array(v),new Array(v.byteLength))},arraybuffer:c,uint8array:function(v){return new Uint8Array(v)},nodebuffer:function(v){return o.newBufferFrom(new Uint8Array(v))}},x.uint8array={string:p,array:function(v){return y(v,new Array(v.length))},arraybuffer:function(v){return v.buffer},uint8array:c,nodebuffer:function(v){return o.newBufferFrom(v)}},x.nodebuffer={string:p,array:function(v){return y(v,new Array(v.length))},arraybuffer:function(v){return x.nodebuffer.uint8array(v).buffer},uint8array:function(v){return y(v,new Uint8Array(v.length))},nodebuffer:c},r.transformTo=function(v,_){if(_=_||"",!v)return _;r.checkSupport(v);var E=r.getTypeOf(_);return x[E][v](_)},r.resolve=function(v){for(var _=v.split("/"),E=[],w=0;w<_.length;w++){var A=_[w];A==="."||A===""&&w!==0&&w!==_.length-1||(A===".."?E.pop():E.push(A))}return E.join("/")},r.getTypeOf=function(v){return typeof v=="string"?"string":Object.prototype.toString.call(v)==="[object Array]"?"array":s.nodebuffer&&o.isBuffer(v)?"nodebuffer":s.uint8array&&v instanceof Uint8Array?"uint8array":s.arraybuffer&&v instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(v){if(!s[v.toLowerCase()])throw new Error(v+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(v){var _,E,w="";for(E=0;E<(v||"").length;E++)w+="\\x"+((_=v.charCodeAt(E))<16?"0":"")+_.toString(16).toUpperCase();return w},r.delay=function(v,_,E){setImmediate(function(){v.apply(E||null,_||[])})},r.inherits=function(v,_){function E(){}E.prototype=_.prototype,v.prototype=new E},r.extend=function(){var v,_,E={};for(v=0;v<arguments.length;v++)for(_ in arguments[v])Object.prototype.hasOwnProperty.call(arguments[v],_)&&E[_]===void 0&&(E[_]=arguments[v][_]);return E},r.prepareContent=function(v,_,E,w,A){return l.Promise.resolve(_).then(function(N){return s.blob&&(N instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(N))!==-1)&&typeof FileReader<"u"?new l.Promise(function(k,F){var C=new FileReader;C.onload=function(M){k(M.target.result)},C.onerror=function(M){F(M.target.error)},C.readAsArrayBuffer(N)}):N}).then(function(N){var k=r.getTypeOf(N);return k?(k==="arraybuffer"?N=r.transformTo("uint8array",N):k==="string"&&(A?N=a.decode(N):E&&w!==!0&&(N=(function(F){return h(F,s.uint8array?new Uint8Array(F.length):new Array(F.length))})(N))),N):l.Promise.reject(new Error("Can't read the data of '"+v+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i,r){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./signature"),l=t("./zipEntry"),c=t("./support");function h(f){this.files=[],this.loadOptions=f}h.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(p)+", expected "+a.pretty(f)+")")}},isSignature:function(f,p){var y=this.reader.index;this.reader.setIndex(f);var x=this.reader.readString(4)===p;return this.reader.setIndex(y),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",y=a.transformTo(p,f);this.zipComment=this.loadOptions.decodeFileName(y)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,p,y,x=this.zip64EndOfCentralSize-44;0<x;)f=this.reader.readInt(2),p=this.reader.readInt(4),y=this.reader.readData(p),this.zip64ExtensibleData[f]={id:f,length:p,value:y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,p;for(f=0;f<this.files.length;f++)p=this.files[f],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var p=f;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var y=this.centralDirOffset+this.centralDirSize;this.zip64&&(y+=20,y+=12+this.zip64EndOfCentralSize);var x=p-y;if(0<x)this.isSignature(p,o.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(f){this.reader=s(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i,r){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./compressedObject"),l=t("./crc32"),c=t("./utf8"),h=t("./compressions"),f=t("./support");function p(y,x){this.options=y,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(y){var x,v;if(y.skip(22),this.fileNameLength=y.readInt(2),v=y.readInt(2),this.fileName=y.readData(this.fileNameLength),y.skip(v),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(_){for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)&&h[E].magic===_)return h[E];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,x,y.readData(this.compressedSize))},readCentralPart:function(y){this.versionMadeBy=y.readInt(2),y.skip(2),this.bitFlag=y.readInt(2),this.compressionMethod=y.readString(2),this.date=y.readDate(),this.crc32=y.readInt(4),this.compressedSize=y.readInt(4),this.uncompressedSize=y.readInt(4);var x=y.readInt(2);if(this.extraFieldsLength=y.readInt(2),this.fileCommentLength=y.readInt(2),this.diskNumberStart=y.readInt(2),this.internalFileAttributes=y.readInt(2),this.externalFileAttributes=y.readInt(4),this.localHeaderOffset=y.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");y.skip(x),this.readExtraFields(y),this.parseZIP64ExtraField(y),this.fileComment=y.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var y=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),y==0&&(this.dosPermissions=63&this.externalFileAttributes),y==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var y=s(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=y.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=y.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=y.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=y.readInt(4))}},readExtraFields:function(y){var x,v,_,E=y.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});y.index+4<E;)x=y.readInt(2),v=y.readInt(2),_=y.readData(v),this.extraFields[x]={id:x,length:v,value:_};y.setIndex(E)},handleUTF8:function(){var y=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var v=a.transformTo(y,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(v)}var _=this.findExtraFieldUnicodeComment();if(_!==null)this.fileCommentStr=_;else{var E=a.transformTo(y,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(E)}}},findExtraFieldUnicodePath:function(){var y=this.extraFields[28789];if(y){var x=s(y.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(y.length-5))}return null},findExtraFieldUnicodeComment:function(){var y=this.extraFields[25461];if(y){var x=s(y.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(y.length-5))}return null}},i.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i,r){function s(x,v,_){this.name=x,this.dir=_.dir,this.date=_.date,this.comment=_.comment,this.unixPermissions=_.unixPermissions,this.dosPermissions=_.dosPermissions,this._data=v,this._dataBinary=_.binary,this.options={compression:_.compression,compressionOptions:_.compressionOptions}}var a=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),l=t("./utf8"),c=t("./compressedObject"),h=t("./stream/GenericWorker");s.prototype={internalStream:function(x){var v=null,_="string";try{if(!x)throw new Error("No output type specified.");var E=(_=x.toLowerCase())==="string"||_==="text";_!=="binarystring"&&_!=="text"||(_="string"),v=this._decompressWorker();var w=!this._dataBinary;w&&!E&&(v=v.pipe(new l.Utf8EncodeWorker)),!w&&E&&(v=v.pipe(new l.Utf8DecodeWorker))}catch(A){(v=new h("error")).error(A)}return new a(v,_,"")},async:function(x,v){return this.internalStream(x).accumulate(v)},nodeStream:function(x,v){return this.internalStream(x||"nodebuffer").toNodejsStream(v)},_compressWorker:function(x,v){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var _=this._decompressWorker();return this._dataBinary||(_=_.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(_,x,v)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},y=0;y<f.length;y++)s.prototype[f[y]]=p;i.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i,r){(function(s){var a,o,l=s.MutationObserver||s.WebKitMutationObserver;if(l){var c=0,h=new l(x),f=s.document.createTextNode("");h.observe(f,{characterData:!0}),a=function(){f.data=c=++c%2}}else if(s.setImmediate||s.MessageChannel===void 0)a="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var v=s.document.createElement("script");v.onreadystatechange=function(){x(),v.onreadystatechange=null,v.parentNode.removeChild(v),v=null},s.document.documentElement.appendChild(v)}:function(){setTimeout(x,0)};else{var p=new s.MessageChannel;p.port1.onmessage=x,a=function(){p.port2.postMessage(0)}}var y=[];function x(){var v,_;o=!0;for(var E=y.length;E;){for(_=y,y=[],v=-1;++v<E;)_[v]();E=y.length}o=!1}i.exports=function(v){y.push(v)!==1||o||a()}}).call(this,typeof Vf<"u"?Vf:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,i,r){var s=t("immediate");function a(){}var o={},l=["REJECTED"],c=["FULFILLED"],h=["PENDING"];function f(E){if(typeof E!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,E!==a&&v(this,E)}function p(E,w,A){this.promise=E,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof A=="function"&&(this.onRejected=A,this.callRejected=this.otherCallRejected)}function y(E,w,A){s(function(){var N;try{N=w(A)}catch(k){return o.reject(E,k)}N===E?o.reject(E,new TypeError("Cannot resolve promise with itself")):o.resolve(E,N)})}function x(E){var w=E&&E.then;if(E&&(typeof E=="object"||typeof E=="function")&&typeof w=="function")return function(){w.apply(E,arguments)}}function v(E,w){var A=!1;function N(C){A||(A=!0,o.reject(E,C))}function k(C){A||(A=!0,o.resolve(E,C))}var F=_(function(){w(k,N)});F.status==="error"&&N(F.value)}function _(E,w){var A={};try{A.value=E(w),A.status="success"}catch(N){A.status="error",A.value=N}return A}(i.exports=f).prototype.finally=function(E){if(typeof E!="function")return this;var w=this.constructor;return this.then(function(A){return w.resolve(E()).then(function(){return A})},function(A){return w.resolve(E()).then(function(){throw A})})},f.prototype.catch=function(E){return this.then(null,E)},f.prototype.then=function(E,w){if(typeof E!="function"&&this.state===c||typeof w!="function"&&this.state===l)return this;var A=new this.constructor(a);return this.state!==h?y(A,this.state===c?E:w,this.outcome):this.queue.push(new p(A,E,w)),A},p.prototype.callFulfilled=function(E){o.resolve(this.promise,E)},p.prototype.otherCallFulfilled=function(E){y(this.promise,this.onFulfilled,E)},p.prototype.callRejected=function(E){o.reject(this.promise,E)},p.prototype.otherCallRejected=function(E){y(this.promise,this.onRejected,E)},o.resolve=function(E,w){var A=_(x,w);if(A.status==="error")return o.reject(E,A.value);var N=A.value;if(N)v(E,N);else{E.state=c,E.outcome=w;for(var k=-1,F=E.queue.length;++k<F;)E.queue[k].callFulfilled(w)}return E},o.reject=function(E,w){E.state=l,E.outcome=w;for(var A=-1,N=E.queue.length;++A<N;)E.queue[A].callRejected(w);return E},f.resolve=function(E){return E instanceof this?E:o.resolve(new this(a),E)},f.reject=function(E){var w=new this(a);return o.reject(w,E)},f.all=function(E){var w=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=E.length,N=!1;if(!A)return this.resolve([]);for(var k=new Array(A),F=0,C=-1,M=new this(a);++C<A;)R(E[C],C);return M;function R(L,H){w.resolve(L).then(function(P){k[H]=P,++F!==A||N||(N=!0,o.resolve(M,k))},function(P){N||(N=!0,o.reject(M,P))})}},f.race=function(E){var w=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=E.length,N=!1;if(!A)return this.resolve([]);for(var k=-1,F=new this(a);++k<A;)C=E[k],w.resolve(C).then(function(M){N||(N=!0,o.resolve(F,M))},function(M){N||(N=!0,o.reject(F,M))});var C;return F}},{immediate:36}],38:[function(t,i,r){var s={};(0,t("./lib/utils/common").assign)(s,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),i.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,r){var s=t("./zlib/deflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),c=t("./zlib/zstream"),h=Object.prototype.toString,f=0,p=-1,y=0,x=8;function v(E){if(!(this instanceof v))return new v(E);this.options=a.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:y,to:""},E||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var A=s.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(A!==f)throw new Error(l[A]);if(w.header&&s.deflateSetHeader(this.strm,w.header),w.dictionary){var N;if(N=typeof w.dictionary=="string"?o.string2buf(w.dictionary):h.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(A=s.deflateSetDictionary(this.strm,N))!==f)throw new Error(l[A]);this._dict_set=!0}}function _(E,w){var A=new v(w);if(A.push(E,!0),A.err)throw A.msg||l[A.err];return A.result}v.prototype.push=function(E,w){var A,N,k=this.strm,F=this.options.chunkSize;if(this.ended)return!1;N=w===~~w?w:w===!0?4:0,typeof E=="string"?k.input=o.string2buf(E):h.call(E)==="[object ArrayBuffer]"?k.input=new Uint8Array(E):k.input=E,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new a.Buf8(F),k.next_out=0,k.avail_out=F),(A=s.deflate(k,N))!==1&&A!==f)return this.onEnd(A),!(this.ended=!0);k.avail_out!==0&&(k.avail_in!==0||N!==4&&N!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(a.shrinkBuf(k.output,k.next_out))):this.onData(a.shrinkBuf(k.output,k.next_out)))}while((0<k.avail_in||k.avail_out===0)&&A!==1);return N===4?(A=s.deflateEnd(this.strm),this.onEnd(A),this.ended=!0,A===f):N!==2||(this.onEnd(f),!(k.avail_out=0))},v.prototype.onData=function(E){this.chunks.push(E)},v.prototype.onEnd=function(E){E===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},r.Deflate=v,r.deflate=_,r.deflateRaw=function(E,w){return(w=w||{}).raw=!0,_(E,w)},r.gzip=function(E,w){return(w=w||{}).gzip=!0,_(E,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,r){var s=t("./zlib/inflate"),a=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),c=t("./zlib/messages"),h=t("./zlib/zstream"),f=t("./zlib/gzheader"),p=Object.prototype.toString;function y(v){if(!(this instanceof y))return new y(v);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},v||{});var _=this.options;_.raw&&0<=_.windowBits&&_.windowBits<16&&(_.windowBits=-_.windowBits,_.windowBits===0&&(_.windowBits=-15)),!(0<=_.windowBits&&_.windowBits<16)||v&&v.windowBits||(_.windowBits+=32),15<_.windowBits&&_.windowBits<48&&(15&_.windowBits)==0&&(_.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var E=s.inflateInit2(this.strm,_.windowBits);if(E!==l.Z_OK)throw new Error(c[E]);this.header=new f,s.inflateGetHeader(this.strm,this.header)}function x(v,_){var E=new y(_);if(E.push(v,!0),E.err)throw E.msg||c[E.err];return E.result}y.prototype.push=function(v,_){var E,w,A,N,k,F,C=this.strm,M=this.options.chunkSize,R=this.options.dictionary,L=!1;if(this.ended)return!1;w=_===~~_?_:_===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof v=="string"?C.input=o.binstring2buf(v):p.call(v)==="[object ArrayBuffer]"?C.input=new Uint8Array(v):C.input=v,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new a.Buf8(M),C.next_out=0,C.avail_out=M),(E=s.inflate(C,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(F=typeof R=="string"?o.string2buf(R):p.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,E=s.inflateSetDictionary(this.strm,F)),E===l.Z_BUF_ERROR&&L===!0&&(E=l.Z_OK,L=!1),E!==l.Z_STREAM_END&&E!==l.Z_OK)return this.onEnd(E),!(this.ended=!0);C.next_out&&(C.avail_out!==0&&E!==l.Z_STREAM_END&&(C.avail_in!==0||w!==l.Z_FINISH&&w!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(A=o.utf8border(C.output,C.next_out),N=C.next_out-A,k=o.buf2string(C.output,A),C.next_out=N,C.avail_out=M-N,N&&a.arraySet(C.output,C.output,A,N,0),this.onData(k)):this.onData(a.shrinkBuf(C.output,C.next_out)))),C.avail_in===0&&C.avail_out===0&&(L=!0)}while((0<C.avail_in||C.avail_out===0)&&E!==l.Z_STREAM_END);return E===l.Z_STREAM_END&&(w=l.Z_FINISH),w===l.Z_FINISH?(E=s.inflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===l.Z_OK):w!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(C.avail_out=0))},y.prototype.onData=function(v){this.chunks.push(v)},y.prototype.onEnd=function(v){v===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},r.Inflate=y,r.inflate=x,r.inflateRaw=function(v,_){return(_=_||{}).raw=!0,x(v,_)},r.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var h=c.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var f in h)h.hasOwnProperty(f)&&(l[f]=h[f])}}return l},r.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var a={arraySet:function(l,c,h,f,p){if(c.subarray&&l.subarray)l.set(c.subarray(h,h+f),p);else for(var y=0;y<f;y++)l[p+y]=c[h+y]},flattenChunks:function(l){var c,h,f,p,y,x;for(c=f=0,h=l.length;c<h;c++)f+=l[c].length;for(x=new Uint8Array(f),c=p=0,h=l.length;c<h;c++)y=l[c],x.set(y,p),p+=y.length;return x}},o={arraySet:function(l,c,h,f,p){for(var y=0;y<f;y++)l[p+y]=c[h+y]},flattenChunks:function(l){return[].concat.apply([],l)}};r.setTyped=function(l){l?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,a)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(s)},{}],42:[function(t,i,r){var s=t("./common"),a=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var l=new s.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function h(f,p){if(p<65537&&(f.subarray&&o||!f.subarray&&a))return String.fromCharCode.apply(null,s.shrinkBuf(f,p));for(var y="",x=0;x<p;x++)y+=String.fromCharCode(f[x]);return y}l[254]=l[254]=1,r.string2buf=function(f){var p,y,x,v,_,E=f.length,w=0;for(v=0;v<E;v++)(64512&(y=f.charCodeAt(v)))==55296&&v+1<E&&(64512&(x=f.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),v++),w+=y<128?1:y<2048?2:y<65536?3:4;for(p=new s.Buf8(w),v=_=0;_<w;v++)(64512&(y=f.charCodeAt(v)))==55296&&v+1<E&&(64512&(x=f.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),v++),y<128?p[_++]=y:(y<2048?p[_++]=192|y>>>6:(y<65536?p[_++]=224|y>>>12:(p[_++]=240|y>>>18,p[_++]=128|y>>>12&63),p[_++]=128|y>>>6&63),p[_++]=128|63&y);return p},r.buf2binstring=function(f){return h(f,f.length)},r.binstring2buf=function(f){for(var p=new s.Buf8(f.length),y=0,x=p.length;y<x;y++)p[y]=f.charCodeAt(y);return p},r.buf2string=function(f,p){var y,x,v,_,E=p||f.length,w=new Array(2*E);for(y=x=0;y<E;)if((v=f[y++])<128)w[x++]=v;else if(4<(_=l[v]))w[x++]=65533,y+=_-1;else{for(v&=_===2?31:_===3?15:7;1<_&&y<E;)v=v<<6|63&f[y++],_--;1<_?w[x++]=65533:v<65536?w[x++]=v:(v-=65536,w[x++]=55296|v>>10&1023,w[x++]=56320|1023&v)}return h(w,x)},r.utf8border=function(f,p){var y;for((p=p||f.length)>f.length&&(p=f.length),y=p-1;0<=y&&(192&f[y])==128;)y--;return y<0||y===0?p:y+l[f[y]]>p?y:p}},{"./common":41}],43:[function(t,i,r){i.exports=function(s,a,o,l){for(var c=65535&s|0,h=s>>>16&65535|0,f=0;o!==0;){for(o-=f=2e3<o?2e3:o;h=h+(c=c+a[l++]|0)|0,--f;);c%=65521,h%=65521}return c|h<<16|0}},{}],44:[function(t,i,r){i.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,i,r){var s=(function(){for(var a,o=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;o[l]=a}return o})();i.exports=function(a,o,l,c){var h=s,f=c+l;a^=-1;for(var p=c;p<f;p++)a=a>>>8^h[255&(a^o[p])];return-1^a}},{}],46:[function(t,i,r){var s,a=t("../utils/common"),o=t("./trees"),l=t("./adler32"),c=t("./crc32"),h=t("./messages"),f=0,p=4,y=0,x=-2,v=-1,_=4,E=2,w=8,A=9,N=286,k=30,F=19,C=2*N+1,M=15,R=3,L=258,H=L+R+1,P=42,O=113,B=1,re=2,q=3,X=4;function oe(W,Re){return W.msg=h[Re],Re}function ue(W){return(W<<1)-(4<W?9:0)}function ge(W){for(var Re=W.length;0<=--Re;)W[Re]=0}function j(W){var Re=W.state,Te=Re.pending;Te>W.avail_out&&(Te=W.avail_out),Te!==0&&(a.arraySet(W.output,Re.pending_buf,Re.pending_out,Te,W.next_out),W.next_out+=Te,Re.pending_out+=Te,W.total_out+=Te,W.avail_out-=Te,Re.pending-=Te,Re.pending===0&&(Re.pending_out=0))}function G(W,Re){o._tr_flush_block(W,0<=W.block_start?W.block_start:-1,W.strstart-W.block_start,Re),W.block_start=W.strstart,j(W.strm)}function Z(W,Re){W.pending_buf[W.pending++]=Re}function te(W,Re){W.pending_buf[W.pending++]=Re>>>8&255,W.pending_buf[W.pending++]=255&Re}function ie(W,Re){var Te,ae,he=W.max_chain_length,we=W.strstart,Le=W.prev_length,$e=W.nice_match,Ce=W.strstart>W.w_size-H?W.strstart-(W.w_size-H):0,be=W.window,Ee=W.w_mask,Me=W.prev,Xe=W.strstart+L,dt=be[we+Le-1],bt=be[we+Le];W.prev_length>=W.good_match&&(he>>=2),$e>W.lookahead&&($e=W.lookahead);do if(be[(Te=Re)+Le]===bt&&be[Te+Le-1]===dt&&be[Te]===be[we]&&be[++Te]===be[we+1]){we+=2,Te++;do;while(be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&be[++we]===be[++Te]&&we<Xe);if(ae=L-(Xe-we),we=Xe-L,Le<ae){if(W.match_start=Re,$e<=(Le=ae))break;dt=be[we+Le-1],bt=be[we+Le]}}while((Re=Me[Re&Ee])>Ce&&--he!=0);return Le<=W.lookahead?Le:W.lookahead}function _e(W){var Re,Te,ae,he,we,Le,$e,Ce,be,Ee,Me=W.w_size;do{if(he=W.window_size-W.lookahead-W.strstart,W.strstart>=Me+(Me-H)){for(a.arraySet(W.window,W.window,Me,Me,0),W.match_start-=Me,W.strstart-=Me,W.block_start-=Me,Re=Te=W.hash_size;ae=W.head[--Re],W.head[Re]=Me<=ae?ae-Me:0,--Te;);for(Re=Te=Me;ae=W.prev[--Re],W.prev[Re]=Me<=ae?ae-Me:0,--Te;);he+=Me}if(W.strm.avail_in===0)break;if(Le=W.strm,$e=W.window,Ce=W.strstart+W.lookahead,be=he,Ee=void 0,Ee=Le.avail_in,be<Ee&&(Ee=be),Te=Ee===0?0:(Le.avail_in-=Ee,a.arraySet($e,Le.input,Le.next_in,Ee,Ce),Le.state.wrap===1?Le.adler=l(Le.adler,$e,Ee,Ce):Le.state.wrap===2&&(Le.adler=c(Le.adler,$e,Ee,Ce)),Le.next_in+=Ee,Le.total_in+=Ee,Ee),W.lookahead+=Te,W.lookahead+W.insert>=R)for(we=W.strstart-W.insert,W.ins_h=W.window[we],W.ins_h=(W.ins_h<<W.hash_shift^W.window[we+1])&W.hash_mask;W.insert&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[we+R-1])&W.hash_mask,W.prev[we&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=we,we++,W.insert--,!(W.lookahead+W.insert<R)););}while(W.lookahead<H&&W.strm.avail_in!==0)}function Ie(W,Re){for(var Te,ae;;){if(W.lookahead<H){if(_e(W),W.lookahead<H&&Re===f)return B;if(W.lookahead===0)break}if(Te=0,W.lookahead>=R&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+R-1])&W.hash_mask,Te=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),Te!==0&&W.strstart-Te<=W.w_size-H&&(W.match_length=ie(W,Te)),W.match_length>=R)if(ae=o._tr_tally(W,W.strstart-W.match_start,W.match_length-R),W.lookahead-=W.match_length,W.match_length<=W.max_lazy_match&&W.lookahead>=R){for(W.match_length--;W.strstart++,W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+R-1])&W.hash_mask,Te=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart,--W.match_length!=0;);W.strstart++}else W.strstart+=W.match_length,W.match_length=0,W.ins_h=W.window[W.strstart],W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+1])&W.hash_mask;else ae=o._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(ae&&(G(W,!1),W.strm.avail_out===0))return B}return W.insert=W.strstart<R-1?W.strstart:R-1,Re===p?(G(W,!0),W.strm.avail_out===0?q:X):W.last_lit&&(G(W,!1),W.strm.avail_out===0)?B:re}function Pe(W,Re){for(var Te,ae,he;;){if(W.lookahead<H){if(_e(W),W.lookahead<H&&Re===f)return B;if(W.lookahead===0)break}if(Te=0,W.lookahead>=R&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+R-1])&W.hash_mask,Te=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),W.prev_length=W.match_length,W.prev_match=W.match_start,W.match_length=R-1,Te!==0&&W.prev_length<W.max_lazy_match&&W.strstart-Te<=W.w_size-H&&(W.match_length=ie(W,Te),W.match_length<=5&&(W.strategy===1||W.match_length===R&&4096<W.strstart-W.match_start)&&(W.match_length=R-1)),W.prev_length>=R&&W.match_length<=W.prev_length){for(he=W.strstart+W.lookahead-R,ae=o._tr_tally(W,W.strstart-1-W.prev_match,W.prev_length-R),W.lookahead-=W.prev_length-1,W.prev_length-=2;++W.strstart<=he&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+R-1])&W.hash_mask,Te=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),--W.prev_length!=0;);if(W.match_available=0,W.match_length=R-1,W.strstart++,ae&&(G(W,!1),W.strm.avail_out===0))return B}else if(W.match_available){if((ae=o._tr_tally(W,0,W.window[W.strstart-1]))&&G(W,!1),W.strstart++,W.lookahead--,W.strm.avail_out===0)return B}else W.match_available=1,W.strstart++,W.lookahead--}return W.match_available&&(ae=o._tr_tally(W,0,W.window[W.strstart-1]),W.match_available=0),W.insert=W.strstart<R-1?W.strstart:R-1,Re===p?(G(W,!0),W.strm.avail_out===0?q:X):W.last_lit&&(G(W,!1),W.strm.avail_out===0)?B:re}function Fe(W,Re,Te,ae,he){this.good_length=W,this.max_lazy=Re,this.nice_length=Te,this.max_chain=ae,this.func=he}function Ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*C),this.dyn_dtree=new a.Buf16(2*(2*k+1)),this.bl_tree=new a.Buf16(2*(2*F+1)),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(M+1),this.heap=new a.Buf16(2*N+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*N+1),ge(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ct(W){var Re;return W&&W.state?(W.total_in=W.total_out=0,W.data_type=E,(Re=W.state).pending=0,Re.pending_out=0,Re.wrap<0&&(Re.wrap=-Re.wrap),Re.status=Re.wrap?P:O,W.adler=Re.wrap===2?0:1,Re.last_flush=f,o._tr_init(Re),y):oe(W,x)}function gt(W){var Re=ct(W);return Re===y&&(function(Te){Te.window_size=2*Te.w_size,ge(Te.head),Te.max_lazy_match=s[Te.level].max_lazy,Te.good_match=s[Te.level].good_length,Te.nice_match=s[Te.level].nice_length,Te.max_chain_length=s[Te.level].max_chain,Te.strstart=0,Te.block_start=0,Te.lookahead=0,Te.insert=0,Te.match_length=Te.prev_length=R-1,Te.match_available=0,Te.ins_h=0})(W.state),Re}function Mt(W,Re,Te,ae,he,we){if(!W)return x;var Le=1;if(Re===v&&(Re=6),ae<0?(Le=0,ae=-ae):15<ae&&(Le=2,ae-=16),he<1||A<he||Te!==w||ae<8||15<ae||Re<0||9<Re||we<0||_<we)return oe(W,x);ae===8&&(ae=9);var $e=new Ge;return(W.state=$e).strm=W,$e.wrap=Le,$e.gzhead=null,$e.w_bits=ae,$e.w_size=1<<$e.w_bits,$e.w_mask=$e.w_size-1,$e.hash_bits=he+7,$e.hash_size=1<<$e.hash_bits,$e.hash_mask=$e.hash_size-1,$e.hash_shift=~~(($e.hash_bits+R-1)/R),$e.window=new a.Buf8(2*$e.w_size),$e.head=new a.Buf16($e.hash_size),$e.prev=new a.Buf16($e.w_size),$e.lit_bufsize=1<<he+6,$e.pending_buf_size=4*$e.lit_bufsize,$e.pending_buf=new a.Buf8($e.pending_buf_size),$e.d_buf=1*$e.lit_bufsize,$e.l_buf=3*$e.lit_bufsize,$e.level=Re,$e.strategy=we,$e.method=Te,gt(W)}s=[new Fe(0,0,0,0,function(W,Re){var Te=65535;for(Te>W.pending_buf_size-5&&(Te=W.pending_buf_size-5);;){if(W.lookahead<=1){if(_e(W),W.lookahead===0&&Re===f)return B;if(W.lookahead===0)break}W.strstart+=W.lookahead,W.lookahead=0;var ae=W.block_start+Te;if((W.strstart===0||W.strstart>=ae)&&(W.lookahead=W.strstart-ae,W.strstart=ae,G(W,!1),W.strm.avail_out===0)||W.strstart-W.block_start>=W.w_size-H&&(G(W,!1),W.strm.avail_out===0))return B}return W.insert=0,Re===p?(G(W,!0),W.strm.avail_out===0?q:X):(W.strstart>W.block_start&&(G(W,!1),W.strm.avail_out),B)}),new Fe(4,4,8,4,Ie),new Fe(4,5,16,8,Ie),new Fe(4,6,32,32,Ie),new Fe(4,4,16,16,Pe),new Fe(8,16,32,32,Pe),new Fe(8,16,128,128,Pe),new Fe(8,32,128,256,Pe),new Fe(32,128,258,1024,Pe),new Fe(32,258,258,4096,Pe)],r.deflateInit=function(W,Re){return Mt(W,Re,w,15,8,0)},r.deflateInit2=Mt,r.deflateReset=gt,r.deflateResetKeep=ct,r.deflateSetHeader=function(W,Re){return W&&W.state?W.state.wrap!==2?x:(W.state.gzhead=Re,y):x},r.deflate=function(W,Re){var Te,ae,he,we;if(!W||!W.state||5<Re||Re<0)return W?oe(W,x):x;if(ae=W.state,!W.output||!W.input&&W.avail_in!==0||ae.status===666&&Re!==p)return oe(W,W.avail_out===0?-5:x);if(ae.strm=W,Te=ae.last_flush,ae.last_flush=Re,ae.status===P)if(ae.wrap===2)W.adler=0,Z(ae,31),Z(ae,139),Z(ae,8),ae.gzhead?(Z(ae,(ae.gzhead.text?1:0)+(ae.gzhead.hcrc?2:0)+(ae.gzhead.extra?4:0)+(ae.gzhead.name?8:0)+(ae.gzhead.comment?16:0)),Z(ae,255&ae.gzhead.time),Z(ae,ae.gzhead.time>>8&255),Z(ae,ae.gzhead.time>>16&255),Z(ae,ae.gzhead.time>>24&255),Z(ae,ae.level===9?2:2<=ae.strategy||ae.level<2?4:0),Z(ae,255&ae.gzhead.os),ae.gzhead.extra&&ae.gzhead.extra.length&&(Z(ae,255&ae.gzhead.extra.length),Z(ae,ae.gzhead.extra.length>>8&255)),ae.gzhead.hcrc&&(W.adler=c(W.adler,ae.pending_buf,ae.pending,0)),ae.gzindex=0,ae.status=69):(Z(ae,0),Z(ae,0),Z(ae,0),Z(ae,0),Z(ae,0),Z(ae,ae.level===9?2:2<=ae.strategy||ae.level<2?4:0),Z(ae,3),ae.status=O);else{var Le=w+(ae.w_bits-8<<4)<<8;Le|=(2<=ae.strategy||ae.level<2?0:ae.level<6?1:ae.level===6?2:3)<<6,ae.strstart!==0&&(Le|=32),Le+=31-Le%31,ae.status=O,te(ae,Le),ae.strstart!==0&&(te(ae,W.adler>>>16),te(ae,65535&W.adler)),W.adler=1}if(ae.status===69)if(ae.gzhead.extra){for(he=ae.pending;ae.gzindex<(65535&ae.gzhead.extra.length)&&(ae.pending!==ae.pending_buf_size||(ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),j(W),he=ae.pending,ae.pending!==ae.pending_buf_size));)Z(ae,255&ae.gzhead.extra[ae.gzindex]),ae.gzindex++;ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),ae.gzindex===ae.gzhead.extra.length&&(ae.gzindex=0,ae.status=73)}else ae.status=73;if(ae.status===73)if(ae.gzhead.name){he=ae.pending;do{if(ae.pending===ae.pending_buf_size&&(ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),j(W),he=ae.pending,ae.pending===ae.pending_buf_size)){we=1;break}we=ae.gzindex<ae.gzhead.name.length?255&ae.gzhead.name.charCodeAt(ae.gzindex++):0,Z(ae,we)}while(we!==0);ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),we===0&&(ae.gzindex=0,ae.status=91)}else ae.status=91;if(ae.status===91)if(ae.gzhead.comment){he=ae.pending;do{if(ae.pending===ae.pending_buf_size&&(ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),j(W),he=ae.pending,ae.pending===ae.pending_buf_size)){we=1;break}we=ae.gzindex<ae.gzhead.comment.length?255&ae.gzhead.comment.charCodeAt(ae.gzindex++):0,Z(ae,we)}while(we!==0);ae.gzhead.hcrc&&ae.pending>he&&(W.adler=c(W.adler,ae.pending_buf,ae.pending-he,he)),we===0&&(ae.status=103)}else ae.status=103;if(ae.status===103&&(ae.gzhead.hcrc?(ae.pending+2>ae.pending_buf_size&&j(W),ae.pending+2<=ae.pending_buf_size&&(Z(ae,255&W.adler),Z(ae,W.adler>>8&255),W.adler=0,ae.status=O)):ae.status=O),ae.pending!==0){if(j(W),W.avail_out===0)return ae.last_flush=-1,y}else if(W.avail_in===0&&ue(Re)<=ue(Te)&&Re!==p)return oe(W,-5);if(ae.status===666&&W.avail_in!==0)return oe(W,-5);if(W.avail_in!==0||ae.lookahead!==0||Re!==f&&ae.status!==666){var $e=ae.strategy===2?(function(Ce,be){for(var Ee;;){if(Ce.lookahead===0&&(_e(Ce),Ce.lookahead===0)){if(be===f)return B;break}if(Ce.match_length=0,Ee=o._tr_tally(Ce,0,Ce.window[Ce.strstart]),Ce.lookahead--,Ce.strstart++,Ee&&(G(Ce,!1),Ce.strm.avail_out===0))return B}return Ce.insert=0,be===p?(G(Ce,!0),Ce.strm.avail_out===0?q:X):Ce.last_lit&&(G(Ce,!1),Ce.strm.avail_out===0)?B:re})(ae,Re):ae.strategy===3?(function(Ce,be){for(var Ee,Me,Xe,dt,bt=Ce.window;;){if(Ce.lookahead<=L){if(_e(Ce),Ce.lookahead<=L&&be===f)return B;if(Ce.lookahead===0)break}if(Ce.match_length=0,Ce.lookahead>=R&&0<Ce.strstart&&(Me=bt[Xe=Ce.strstart-1])===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]){dt=Ce.strstart+L;do;while(Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Me===bt[++Xe]&&Xe<dt);Ce.match_length=L-(dt-Xe),Ce.match_length>Ce.lookahead&&(Ce.match_length=Ce.lookahead)}if(Ce.match_length>=R?(Ee=o._tr_tally(Ce,1,Ce.match_length-R),Ce.lookahead-=Ce.match_length,Ce.strstart+=Ce.match_length,Ce.match_length=0):(Ee=o._tr_tally(Ce,0,Ce.window[Ce.strstart]),Ce.lookahead--,Ce.strstart++),Ee&&(G(Ce,!1),Ce.strm.avail_out===0))return B}return Ce.insert=0,be===p?(G(Ce,!0),Ce.strm.avail_out===0?q:X):Ce.last_lit&&(G(Ce,!1),Ce.strm.avail_out===0)?B:re})(ae,Re):s[ae.level].func(ae,Re);if($e!==q&&$e!==X||(ae.status=666),$e===B||$e===q)return W.avail_out===0&&(ae.last_flush=-1),y;if($e===re&&(Re===1?o._tr_align(ae):Re!==5&&(o._tr_stored_block(ae,0,0,!1),Re===3&&(ge(ae.head),ae.lookahead===0&&(ae.strstart=0,ae.block_start=0,ae.insert=0))),j(W),W.avail_out===0))return ae.last_flush=-1,y}return Re!==p?y:ae.wrap<=0?1:(ae.wrap===2?(Z(ae,255&W.adler),Z(ae,W.adler>>8&255),Z(ae,W.adler>>16&255),Z(ae,W.adler>>24&255),Z(ae,255&W.total_in),Z(ae,W.total_in>>8&255),Z(ae,W.total_in>>16&255),Z(ae,W.total_in>>24&255)):(te(ae,W.adler>>>16),te(ae,65535&W.adler)),j(W),0<ae.wrap&&(ae.wrap=-ae.wrap),ae.pending!==0?y:1)},r.deflateEnd=function(W){var Re;return W&&W.state?(Re=W.state.status)!==P&&Re!==69&&Re!==73&&Re!==91&&Re!==103&&Re!==O&&Re!==666?oe(W,x):(W.state=null,Re===O?oe(W,-3):y):x},r.deflateSetDictionary=function(W,Re){var Te,ae,he,we,Le,$e,Ce,be,Ee=Re.length;if(!W||!W.state||(we=(Te=W.state).wrap)===2||we===1&&Te.status!==P||Te.lookahead)return x;for(we===1&&(W.adler=l(W.adler,Re,Ee,0)),Te.wrap=0,Ee>=Te.w_size&&(we===0&&(ge(Te.head),Te.strstart=0,Te.block_start=0,Te.insert=0),be=new a.Buf8(Te.w_size),a.arraySet(be,Re,Ee-Te.w_size,Te.w_size,0),Re=be,Ee=Te.w_size),Le=W.avail_in,$e=W.next_in,Ce=W.input,W.avail_in=Ee,W.next_in=0,W.input=Re,_e(Te);Te.lookahead>=R;){for(ae=Te.strstart,he=Te.lookahead-(R-1);Te.ins_h=(Te.ins_h<<Te.hash_shift^Te.window[ae+R-1])&Te.hash_mask,Te.prev[ae&Te.w_mask]=Te.head[Te.ins_h],Te.head[Te.ins_h]=ae,ae++,--he;);Te.strstart=ae,Te.lookahead=R-1,_e(Te)}return Te.strstart+=Te.lookahead,Te.block_start=Te.strstart,Te.insert=Te.lookahead,Te.lookahead=0,Te.match_length=Te.prev_length=R-1,Te.match_available=0,W.next_in=$e,W.input=Ce,W.avail_in=Le,Te.wrap=we,y},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i,r){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,i,r){i.exports=function(s,a){var o,l,c,h,f,p,y,x,v,_,E,w,A,N,k,F,C,M,R,L,H,P,O,B,re;o=s.state,l=s.next_in,B=s.input,c=l+(s.avail_in-5),h=s.next_out,re=s.output,f=h-(a-s.avail_out),p=h+(s.avail_out-257),y=o.dmax,x=o.wsize,v=o.whave,_=o.wnext,E=o.window,w=o.hold,A=o.bits,N=o.lencode,k=o.distcode,F=(1<<o.lenbits)-1,C=(1<<o.distbits)-1;e:do{A<15&&(w+=B[l++]<<A,A+=8,w+=B[l++]<<A,A+=8),M=N[w&F];t:for(;;){if(w>>>=R=M>>>24,A-=R,(R=M>>>16&255)===0)re[h++]=65535&M;else{if(!(16&R)){if((64&R)==0){M=N[(65535&M)+(w&(1<<R)-1)];continue t}if(32&R){o.mode=12;break e}s.msg="invalid literal/length code",o.mode=30;break e}L=65535&M,(R&=15)&&(A<R&&(w+=B[l++]<<A,A+=8),L+=w&(1<<R)-1,w>>>=R,A-=R),A<15&&(w+=B[l++]<<A,A+=8,w+=B[l++]<<A,A+=8),M=k[w&C];n:for(;;){if(w>>>=R=M>>>24,A-=R,!(16&(R=M>>>16&255))){if((64&R)==0){M=k[(65535&M)+(w&(1<<R)-1)];continue n}s.msg="invalid distance code",o.mode=30;break e}if(H=65535&M,A<(R&=15)&&(w+=B[l++]<<A,(A+=8)<R&&(w+=B[l++]<<A,A+=8)),y<(H+=w&(1<<R)-1)){s.msg="invalid distance too far back",o.mode=30;break e}if(w>>>=R,A-=R,(R=h-f)<H){if(v<(R=H-R)&&o.sane){s.msg="invalid distance too far back",o.mode=30;break e}if(O=E,(P=0)===_){if(P+=x-R,R<L){for(L-=R;re[h++]=E[P++],--R;);P=h-H,O=re}}else if(_<R){if(P+=x+_-R,(R-=_)<L){for(L-=R;re[h++]=E[P++],--R;);if(P=0,_<L){for(L-=R=_;re[h++]=E[P++],--R;);P=h-H,O=re}}}else if(P+=_-R,R<L){for(L-=R;re[h++]=E[P++],--R;);P=h-H,O=re}for(;2<L;)re[h++]=O[P++],re[h++]=O[P++],re[h++]=O[P++],L-=3;L&&(re[h++]=O[P++],1<L&&(re[h++]=O[P++]))}else{for(P=h-H;re[h++]=re[P++],re[h++]=re[P++],re[h++]=re[P++],2<(L-=3););L&&(re[h++]=re[P++],1<L&&(re[h++]=re[P++]))}break}}break}}while(l<c&&h<p);l-=L=A>>3,w&=(1<<(A-=L<<3))-1,s.next_in=l,s.next_out=h,s.avail_in=l<c?c-l+5:5-(l-c),s.avail_out=h<p?p-h+257:257-(h-p),o.hold=w,o.bits=A}},{}],49:[function(t,i,r){var s=t("../utils/common"),a=t("./adler32"),o=t("./crc32"),l=t("./inffast"),c=t("./inftrees"),h=1,f=2,p=0,y=-2,x=1,v=852,_=592;function E(P){return(P>>>24&255)+(P>>>8&65280)+((65280&P)<<8)+((255&P)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function A(P){var O;return P&&P.state?(O=P.state,P.total_in=P.total_out=O.total=0,P.msg="",O.wrap&&(P.adler=1&O.wrap),O.mode=x,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new s.Buf32(v),O.distcode=O.distdyn=new s.Buf32(_),O.sane=1,O.back=-1,p):y}function N(P){var O;return P&&P.state?((O=P.state).wsize=0,O.whave=0,O.wnext=0,A(P)):y}function k(P,O){var B,re;return P&&P.state?(re=P.state,O<0?(B=0,O=-O):(B=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15<O)?y:(re.window!==null&&re.wbits!==O&&(re.window=null),re.wrap=B,re.wbits=O,N(P))):y}function F(P,O){var B,re;return P?(re=new w,(P.state=re).window=null,(B=k(P,O))!==p&&(P.state=null),B):y}var C,M,R=!0;function L(P){if(R){var O;for(C=new s.Buf32(512),M=new s.Buf32(32),O=0;O<144;)P.lens[O++]=8;for(;O<256;)P.lens[O++]=9;for(;O<280;)P.lens[O++]=7;for(;O<288;)P.lens[O++]=8;for(c(h,P.lens,0,288,C,0,P.work,{bits:9}),O=0;O<32;)P.lens[O++]=5;c(f,P.lens,0,32,M,0,P.work,{bits:5}),R=!1}P.lencode=C,P.lenbits=9,P.distcode=M,P.distbits=5}function H(P,O,B,re){var q,X=P.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new s.Buf8(X.wsize)),re>=X.wsize?(s.arraySet(X.window,O,B-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(re<(q=X.wsize-X.wnext)&&(q=re),s.arraySet(X.window,O,B-re,q,X.wnext),(re-=q)?(s.arraySet(X.window,O,B-re,re,0),X.wnext=re,X.whave=X.wsize):(X.wnext+=q,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=q))),0}r.inflateReset=N,r.inflateReset2=k,r.inflateResetKeep=A,r.inflateInit=function(P){return F(P,15)},r.inflateInit2=F,r.inflate=function(P,O){var B,re,q,X,oe,ue,ge,j,G,Z,te,ie,_e,Ie,Pe,Fe,Ge,ct,gt,Mt,W,Re,Te,ae,he=0,we=new s.Buf8(4),Le=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!P||!P.state||!P.output||!P.input&&P.avail_in!==0)return y;(B=P.state).mode===12&&(B.mode=13),oe=P.next_out,q=P.output,ge=P.avail_out,X=P.next_in,re=P.input,ue=P.avail_in,j=B.hold,G=B.bits,Z=ue,te=ge,Re=p;e:for(;;)switch(B.mode){case x:if(B.wrap===0){B.mode=13;break}for(;G<16;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(2&B.wrap&&j===35615){we[B.check=0]=255&j,we[1]=j>>>8&255,B.check=o(B.check,we,2,0),G=j=0,B.mode=2;break}if(B.flags=0,B.head&&(B.head.done=!1),!(1&B.wrap)||(((255&j)<<8)+(j>>8))%31){P.msg="incorrect header check",B.mode=30;break}if((15&j)!=8){P.msg="unknown compression method",B.mode=30;break}if(G-=4,W=8+(15&(j>>>=4)),B.wbits===0)B.wbits=W;else if(W>B.wbits){P.msg="invalid window size",B.mode=30;break}B.dmax=1<<W,P.adler=B.check=1,B.mode=512&j?10:12,G=j=0;break;case 2:for(;G<16;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(B.flags=j,(255&B.flags)!=8){P.msg="unknown compression method",B.mode=30;break}if(57344&B.flags){P.msg="unknown header flags set",B.mode=30;break}B.head&&(B.head.text=j>>8&1),512&B.flags&&(we[0]=255&j,we[1]=j>>>8&255,B.check=o(B.check,we,2,0)),G=j=0,B.mode=3;case 3:for(;G<32;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.head&&(B.head.time=j),512&B.flags&&(we[0]=255&j,we[1]=j>>>8&255,we[2]=j>>>16&255,we[3]=j>>>24&255,B.check=o(B.check,we,4,0)),G=j=0,B.mode=4;case 4:for(;G<16;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.head&&(B.head.xflags=255&j,B.head.os=j>>8),512&B.flags&&(we[0]=255&j,we[1]=j>>>8&255,B.check=o(B.check,we,2,0)),G=j=0,B.mode=5;case 5:if(1024&B.flags){for(;G<16;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.length=j,B.head&&(B.head.extra_len=j),512&B.flags&&(we[0]=255&j,we[1]=j>>>8&255,B.check=o(B.check,we,2,0)),G=j=0}else B.head&&(B.head.extra=null);B.mode=6;case 6:if(1024&B.flags&&(ue<(ie=B.length)&&(ie=ue),ie&&(B.head&&(W=B.head.extra_len-B.length,B.head.extra||(B.head.extra=new Array(B.head.extra_len)),s.arraySet(B.head.extra,re,X,ie,W)),512&B.flags&&(B.check=o(B.check,re,ie,X)),ue-=ie,X+=ie,B.length-=ie),B.length))break e;B.length=0,B.mode=7;case 7:if(2048&B.flags){if(ue===0)break e;for(ie=0;W=re[X+ie++],B.head&&W&&B.length<65536&&(B.head.name+=String.fromCharCode(W)),W&&ie<ue;);if(512&B.flags&&(B.check=o(B.check,re,ie,X)),ue-=ie,X+=ie,W)break e}else B.head&&(B.head.name=null);B.length=0,B.mode=8;case 8:if(4096&B.flags){if(ue===0)break e;for(ie=0;W=re[X+ie++],B.head&&W&&B.length<65536&&(B.head.comment+=String.fromCharCode(W)),W&&ie<ue;);if(512&B.flags&&(B.check=o(B.check,re,ie,X)),ue-=ie,X+=ie,W)break e}else B.head&&(B.head.comment=null);B.mode=9;case 9:if(512&B.flags){for(;G<16;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(j!==(65535&B.check)){P.msg="header crc mismatch",B.mode=30;break}G=j=0}B.head&&(B.head.hcrc=B.flags>>9&1,B.head.done=!0),P.adler=B.check=0,B.mode=12;break;case 10:for(;G<32;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}P.adler=B.check=E(j),G=j=0,B.mode=11;case 11:if(B.havedict===0)return P.next_out=oe,P.avail_out=ge,P.next_in=X,P.avail_in=ue,B.hold=j,B.bits=G,2;P.adler=B.check=1,B.mode=12;case 12:if(O===5||O===6)break e;case 13:if(B.last){j>>>=7&G,G-=7&G,B.mode=27;break}for(;G<3;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}switch(B.last=1&j,G-=1,3&(j>>>=1)){case 0:B.mode=14;break;case 1:if(L(B),B.mode=20,O!==6)break;j>>>=2,G-=2;break e;case 2:B.mode=17;break;case 3:P.msg="invalid block type",B.mode=30}j>>>=2,G-=2;break;case 14:for(j>>>=7&G,G-=7&G;G<32;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if((65535&j)!=(j>>>16^65535)){P.msg="invalid stored block lengths",B.mode=30;break}if(B.length=65535&j,G=j=0,B.mode=15,O===6)break e;case 15:B.mode=16;case 16:if(ie=B.length){if(ue<ie&&(ie=ue),ge<ie&&(ie=ge),ie===0)break e;s.arraySet(q,re,X,ie,oe),ue-=ie,X+=ie,ge-=ie,oe+=ie,B.length-=ie;break}B.mode=12;break;case 17:for(;G<14;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(B.nlen=257+(31&j),j>>>=5,G-=5,B.ndist=1+(31&j),j>>>=5,G-=5,B.ncode=4+(15&j),j>>>=4,G-=4,286<B.nlen||30<B.ndist){P.msg="too many length or distance symbols",B.mode=30;break}B.have=0,B.mode=18;case 18:for(;B.have<B.ncode;){for(;G<3;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.lens[Le[B.have++]]=7&j,j>>>=3,G-=3}for(;B.have<19;)B.lens[Le[B.have++]]=0;if(B.lencode=B.lendyn,B.lenbits=7,Te={bits:B.lenbits},Re=c(0,B.lens,0,19,B.lencode,0,B.work,Te),B.lenbits=Te.bits,Re){P.msg="invalid code lengths set",B.mode=30;break}B.have=0,B.mode=19;case 19:for(;B.have<B.nlen+B.ndist;){for(;Fe=(he=B.lencode[j&(1<<B.lenbits)-1])>>>16&255,Ge=65535&he,!((Pe=he>>>24)<=G);){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(Ge<16)j>>>=Pe,G-=Pe,B.lens[B.have++]=Ge;else{if(Ge===16){for(ae=Pe+2;G<ae;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(j>>>=Pe,G-=Pe,B.have===0){P.msg="invalid bit length repeat",B.mode=30;break}W=B.lens[B.have-1],ie=3+(3&j),j>>>=2,G-=2}else if(Ge===17){for(ae=Pe+3;G<ae;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}G-=Pe,W=0,ie=3+(7&(j>>>=Pe)),j>>>=3,G-=3}else{for(ae=Pe+7;G<ae;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}G-=Pe,W=0,ie=11+(127&(j>>>=Pe)),j>>>=7,G-=7}if(B.have+ie>B.nlen+B.ndist){P.msg="invalid bit length repeat",B.mode=30;break}for(;ie--;)B.lens[B.have++]=W}}if(B.mode===30)break;if(B.lens[256]===0){P.msg="invalid code -- missing end-of-block",B.mode=30;break}if(B.lenbits=9,Te={bits:B.lenbits},Re=c(h,B.lens,0,B.nlen,B.lencode,0,B.work,Te),B.lenbits=Te.bits,Re){P.msg="invalid literal/lengths set",B.mode=30;break}if(B.distbits=6,B.distcode=B.distdyn,Te={bits:B.distbits},Re=c(f,B.lens,B.nlen,B.ndist,B.distcode,0,B.work,Te),B.distbits=Te.bits,Re){P.msg="invalid distances set",B.mode=30;break}if(B.mode=20,O===6)break e;case 20:B.mode=21;case 21:if(6<=ue&&258<=ge){P.next_out=oe,P.avail_out=ge,P.next_in=X,P.avail_in=ue,B.hold=j,B.bits=G,l(P,te),oe=P.next_out,q=P.output,ge=P.avail_out,X=P.next_in,re=P.input,ue=P.avail_in,j=B.hold,G=B.bits,B.mode===12&&(B.back=-1);break}for(B.back=0;Fe=(he=B.lencode[j&(1<<B.lenbits)-1])>>>16&255,Ge=65535&he,!((Pe=he>>>24)<=G);){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(Fe&&(240&Fe)==0){for(ct=Pe,gt=Fe,Mt=Ge;Fe=(he=B.lencode[Mt+((j&(1<<ct+gt)-1)>>ct)])>>>16&255,Ge=65535&he,!(ct+(Pe=he>>>24)<=G);){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}j>>>=ct,G-=ct,B.back+=ct}if(j>>>=Pe,G-=Pe,B.back+=Pe,B.length=Ge,Fe===0){B.mode=26;break}if(32&Fe){B.back=-1,B.mode=12;break}if(64&Fe){P.msg="invalid literal/length code",B.mode=30;break}B.extra=15&Fe,B.mode=22;case 22:if(B.extra){for(ae=B.extra;G<ae;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.length+=j&(1<<B.extra)-1,j>>>=B.extra,G-=B.extra,B.back+=B.extra}B.was=B.length,B.mode=23;case 23:for(;Fe=(he=B.distcode[j&(1<<B.distbits)-1])>>>16&255,Ge=65535&he,!((Pe=he>>>24)<=G);){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if((240&Fe)==0){for(ct=Pe,gt=Fe,Mt=Ge;Fe=(he=B.distcode[Mt+((j&(1<<ct+gt)-1)>>ct)])>>>16&255,Ge=65535&he,!(ct+(Pe=he>>>24)<=G);){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}j>>>=ct,G-=ct,B.back+=ct}if(j>>>=Pe,G-=Pe,B.back+=Pe,64&Fe){P.msg="invalid distance code",B.mode=30;break}B.offset=Ge,B.extra=15&Fe,B.mode=24;case 24:if(B.extra){for(ae=B.extra;G<ae;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}B.offset+=j&(1<<B.extra)-1,j>>>=B.extra,G-=B.extra,B.back+=B.extra}if(B.offset>B.dmax){P.msg="invalid distance too far back",B.mode=30;break}B.mode=25;case 25:if(ge===0)break e;if(ie=te-ge,B.offset>ie){if((ie=B.offset-ie)>B.whave&&B.sane){P.msg="invalid distance too far back",B.mode=30;break}_e=ie>B.wnext?(ie-=B.wnext,B.wsize-ie):B.wnext-ie,ie>B.length&&(ie=B.length),Ie=B.window}else Ie=q,_e=oe-B.offset,ie=B.length;for(ge<ie&&(ie=ge),ge-=ie,B.length-=ie;q[oe++]=Ie[_e++],--ie;);B.length===0&&(B.mode=21);break;case 26:if(ge===0)break e;q[oe++]=B.length,ge--,B.mode=21;break;case 27:if(B.wrap){for(;G<32;){if(ue===0)break e;ue--,j|=re[X++]<<G,G+=8}if(te-=ge,P.total_out+=te,B.total+=te,te&&(P.adler=B.check=B.flags?o(B.check,q,te,oe-te):a(B.check,q,te,oe-te)),te=ge,(B.flags?j:E(j))!==B.check){P.msg="incorrect data check",B.mode=30;break}G=j=0}B.mode=28;case 28:if(B.wrap&&B.flags){for(;G<32;){if(ue===0)break e;ue--,j+=re[X++]<<G,G+=8}if(j!==(4294967295&B.total)){P.msg="incorrect length check",B.mode=30;break}G=j=0}B.mode=29;case 29:Re=1;break e;case 30:Re=-3;break e;case 31:return-4;case 32:default:return y}return P.next_out=oe,P.avail_out=ge,P.next_in=X,P.avail_in=ue,B.hold=j,B.bits=G,(B.wsize||te!==P.avail_out&&B.mode<30&&(B.mode<27||O!==4))&&H(P,P.output,P.next_out,te-P.avail_out)?(B.mode=31,-4):(Z-=P.avail_in,te-=P.avail_out,P.total_in+=Z,P.total_out+=te,B.total+=te,B.wrap&&te&&(P.adler=B.check=B.flags?o(B.check,q,te,P.next_out-te):a(B.check,q,te,P.next_out-te)),P.data_type=B.bits+(B.last?64:0)+(B.mode===12?128:0)+(B.mode===20||B.mode===15?256:0),(Z==0&&te===0||O===4)&&Re===p&&(Re=-5),Re)},r.inflateEnd=function(P){if(!P||!P.state)return y;var O=P.state;return O.window&&(O.window=null),P.state=null,p},r.inflateGetHeader=function(P,O){var B;return P&&P.state?(2&(B=P.state).wrap)==0?y:((B.head=O).done=!1,p):y},r.inflateSetDictionary=function(P,O){var B,re=O.length;return P&&P.state?(B=P.state).wrap!==0&&B.mode!==11?y:B.mode===11&&a(1,O,re,0)!==B.check?-3:H(P,O,re,re)?(B.mode=31,-4):(B.havedict=1,p):y},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i,r){var s=t("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(h,f,p,y,x,v,_,E){var w,A,N,k,F,C,M,R,L,H=E.bits,P=0,O=0,B=0,re=0,q=0,X=0,oe=0,ue=0,ge=0,j=0,G=null,Z=0,te=new s.Buf16(16),ie=new s.Buf16(16),_e=null,Ie=0;for(P=0;P<=15;P++)te[P]=0;for(O=0;O<y;O++)te[f[p+O]]++;for(q=H,re=15;1<=re&&te[re]===0;re--);if(re<q&&(q=re),re===0)return x[v++]=20971520,x[v++]=20971520,E.bits=1,0;for(B=1;B<re&&te[B]===0;B++);for(q<B&&(q=B),P=ue=1;P<=15;P++)if(ue<<=1,(ue-=te[P])<0)return-1;if(0<ue&&(h===0||re!==1))return-1;for(ie[1]=0,P=1;P<15;P++)ie[P+1]=ie[P]+te[P];for(O=0;O<y;O++)f[p+O]!==0&&(_[ie[f[p+O]]++]=O);if(C=h===0?(G=_e=_,19):h===1?(G=a,Z-=257,_e=o,Ie-=257,256):(G=l,_e=c,-1),P=B,F=v,oe=O=j=0,N=-1,k=(ge=1<<(X=q))-1,h===1&&852<ge||h===2&&592<ge)return 1;for(;;){for(M=P-oe,L=_[O]<C?(R=0,_[O]):_[O]>C?(R=_e[Ie+_[O]],G[Z+_[O]]):(R=96,0),w=1<<P-oe,B=A=1<<X;x[F+(j>>oe)+(A-=w)]=M<<24|R<<16|L|0,A!==0;);for(w=1<<P-1;j&w;)w>>=1;if(w!==0?(j&=w-1,j+=w):j=0,O++,--te[P]==0){if(P===re)break;P=f[p+_[O]]}if(q<P&&(j&k)!==N){for(oe===0&&(oe=q),F+=B,ue=1<<(X=P-oe);X+oe<re&&!((ue-=te[X+oe])<=0);)X++,ue<<=1;if(ge+=1<<X,h===1&&852<ge||h===2&&592<ge)return 1;x[N=j&k]=q<<24|X<<16|F-v|0}}return j!==0&&(x[F+j]=P-oe<<24|64<<16|0),E.bits=q,0}},{"../utils/common":41}],51:[function(t,i,r){i.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,i,r){var s=t("../utils/common"),a=0,o=1;function l(he){for(var we=he.length;0<=--we;)he[we]=0}var c=0,h=29,f=256,p=f+1+h,y=30,x=19,v=2*p+1,_=15,E=16,w=7,A=256,N=16,k=17,F=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],M=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H=new Array(2*(p+2));l(H);var P=new Array(2*y);l(P);var O=new Array(512);l(O);var B=new Array(256);l(B);var re=new Array(h);l(re);var q,X,oe,ue=new Array(y);function ge(he,we,Le,$e,Ce){this.static_tree=he,this.extra_bits=we,this.extra_base=Le,this.elems=$e,this.max_length=Ce,this.has_stree=he&&he.length}function j(he,we){this.dyn_tree=he,this.max_code=0,this.stat_desc=we}function G(he){return he<256?O[he]:O[256+(he>>>7)]}function Z(he,we){he.pending_buf[he.pending++]=255&we,he.pending_buf[he.pending++]=we>>>8&255}function te(he,we,Le){he.bi_valid>E-Le?(he.bi_buf|=we<<he.bi_valid&65535,Z(he,he.bi_buf),he.bi_buf=we>>E-he.bi_valid,he.bi_valid+=Le-E):(he.bi_buf|=we<<he.bi_valid&65535,he.bi_valid+=Le)}function ie(he,we,Le){te(he,Le[2*we],Le[2*we+1])}function _e(he,we){for(var Le=0;Le|=1&he,he>>>=1,Le<<=1,0<--we;);return Le>>>1}function Ie(he,we,Le){var $e,Ce,be=new Array(_+1),Ee=0;for($e=1;$e<=_;$e++)be[$e]=Ee=Ee+Le[$e-1]<<1;for(Ce=0;Ce<=we;Ce++){var Me=he[2*Ce+1];Me!==0&&(he[2*Ce]=_e(be[Me]++,Me))}}function Pe(he){var we;for(we=0;we<p;we++)he.dyn_ltree[2*we]=0;for(we=0;we<y;we++)he.dyn_dtree[2*we]=0;for(we=0;we<x;we++)he.bl_tree[2*we]=0;he.dyn_ltree[2*A]=1,he.opt_len=he.static_len=0,he.last_lit=he.matches=0}function Fe(he){8<he.bi_valid?Z(he,he.bi_buf):0<he.bi_valid&&(he.pending_buf[he.pending++]=he.bi_buf),he.bi_buf=0,he.bi_valid=0}function Ge(he,we,Le,$e){var Ce=2*we,be=2*Le;return he[Ce]<he[be]||he[Ce]===he[be]&&$e[we]<=$e[Le]}function ct(he,we,Le){for(var $e=he.heap[Le],Ce=Le<<1;Ce<=he.heap_len&&(Ce<he.heap_len&&Ge(we,he.heap[Ce+1],he.heap[Ce],he.depth)&&Ce++,!Ge(we,$e,he.heap[Ce],he.depth));)he.heap[Le]=he.heap[Ce],Le=Ce,Ce<<=1;he.heap[Le]=$e}function gt(he,we,Le){var $e,Ce,be,Ee,Me=0;if(he.last_lit!==0)for(;$e=he.pending_buf[he.d_buf+2*Me]<<8|he.pending_buf[he.d_buf+2*Me+1],Ce=he.pending_buf[he.l_buf+Me],Me++,$e===0?ie(he,Ce,we):(ie(he,(be=B[Ce])+f+1,we),(Ee=C[be])!==0&&te(he,Ce-=re[be],Ee),ie(he,be=G(--$e),Le),(Ee=M[be])!==0&&te(he,$e-=ue[be],Ee)),Me<he.last_lit;);ie(he,A,we)}function Mt(he,we){var Le,$e,Ce,be=we.dyn_tree,Ee=we.stat_desc.static_tree,Me=we.stat_desc.has_stree,Xe=we.stat_desc.elems,dt=-1;for(he.heap_len=0,he.heap_max=v,Le=0;Le<Xe;Le++)be[2*Le]!==0?(he.heap[++he.heap_len]=dt=Le,he.depth[Le]=0):be[2*Le+1]=0;for(;he.heap_len<2;)be[2*(Ce=he.heap[++he.heap_len]=dt<2?++dt:0)]=1,he.depth[Ce]=0,he.opt_len--,Me&&(he.static_len-=Ee[2*Ce+1]);for(we.max_code=dt,Le=he.heap_len>>1;1<=Le;Le--)ct(he,be,Le);for(Ce=Xe;Le=he.heap[1],he.heap[1]=he.heap[he.heap_len--],ct(he,be,1),$e=he.heap[1],he.heap[--he.heap_max]=Le,he.heap[--he.heap_max]=$e,be[2*Ce]=be[2*Le]+be[2*$e],he.depth[Ce]=(he.depth[Le]>=he.depth[$e]?he.depth[Le]:he.depth[$e])+1,be[2*Le+1]=be[2*$e+1]=Ce,he.heap[1]=Ce++,ct(he,be,1),2<=he.heap_len;);he.heap[--he.heap_max]=he.heap[1],(function(bt,zt){var Nt,Gt,on,ke,xe,Ye,Je=zt.dyn_tree,pt=zt.max_code,mt=zt.stat_desc.static_tree,Yt=zt.stat_desc.has_stree,Kt=zt.stat_desc.extra_bits,jt=zt.stat_desc.extra_base,ne=zt.stat_desc.max_length,le=0;for(ke=0;ke<=_;ke++)bt.bl_count[ke]=0;for(Je[2*bt.heap[bt.heap_max]+1]=0,Nt=bt.heap_max+1;Nt<v;Nt++)ne<(ke=Je[2*Je[2*(Gt=bt.heap[Nt])+1]+1]+1)&&(ke=ne,le++),Je[2*Gt+1]=ke,pt<Gt||(bt.bl_count[ke]++,xe=0,jt<=Gt&&(xe=Kt[Gt-jt]),Ye=Je[2*Gt],bt.opt_len+=Ye*(ke+xe),Yt&&(bt.static_len+=Ye*(mt[2*Gt+1]+xe)));if(le!==0){do{for(ke=ne-1;bt.bl_count[ke]===0;)ke--;bt.bl_count[ke]--,bt.bl_count[ke+1]+=2,bt.bl_count[ne]--,le-=2}while(0<le);for(ke=ne;ke!==0;ke--)for(Gt=bt.bl_count[ke];Gt!==0;)pt<(on=bt.heap[--Nt])||(Je[2*on+1]!==ke&&(bt.opt_len+=(ke-Je[2*on+1])*Je[2*on],Je[2*on+1]=ke),Gt--)}})(he,we),Ie(be,dt,he.bl_count)}function W(he,we,Le){var $e,Ce,be=-1,Ee=we[1],Me=0,Xe=7,dt=4;for(Ee===0&&(Xe=138,dt=3),we[2*(Le+1)+1]=65535,$e=0;$e<=Le;$e++)Ce=Ee,Ee=we[2*($e+1)+1],++Me<Xe&&Ce===Ee||(Me<dt?he.bl_tree[2*Ce]+=Me:Ce!==0?(Ce!==be&&he.bl_tree[2*Ce]++,he.bl_tree[2*N]++):Me<=10?he.bl_tree[2*k]++:he.bl_tree[2*F]++,be=Ce,dt=(Me=0)===Ee?(Xe=138,3):Ce===Ee?(Xe=6,3):(Xe=7,4))}function Re(he,we,Le){var $e,Ce,be=-1,Ee=we[1],Me=0,Xe=7,dt=4;for(Ee===0&&(Xe=138,dt=3),$e=0;$e<=Le;$e++)if(Ce=Ee,Ee=we[2*($e+1)+1],!(++Me<Xe&&Ce===Ee)){if(Me<dt)for(;ie(he,Ce,he.bl_tree),--Me!=0;);else Ce!==0?(Ce!==be&&(ie(he,Ce,he.bl_tree),Me--),ie(he,N,he.bl_tree),te(he,Me-3,2)):Me<=10?(ie(he,k,he.bl_tree),te(he,Me-3,3)):(ie(he,F,he.bl_tree),te(he,Me-11,7));be=Ce,dt=(Me=0)===Ee?(Xe=138,3):Ce===Ee?(Xe=6,3):(Xe=7,4)}}l(ue);var Te=!1;function ae(he,we,Le,$e){te(he,(c<<1)+($e?1:0),3),(function(Ce,be,Ee,Me){Fe(Ce),Z(Ce,Ee),Z(Ce,~Ee),s.arraySet(Ce.pending_buf,Ce.window,be,Ee,Ce.pending),Ce.pending+=Ee})(he,we,Le)}r._tr_init=function(he){Te||((function(){var we,Le,$e,Ce,be,Ee=new Array(_+1);for(Ce=$e=0;Ce<h-1;Ce++)for(re[Ce]=$e,we=0;we<1<<C[Ce];we++)B[$e++]=Ce;for(B[$e-1]=Ce,Ce=be=0;Ce<16;Ce++)for(ue[Ce]=be,we=0;we<1<<M[Ce];we++)O[be++]=Ce;for(be>>=7;Ce<y;Ce++)for(ue[Ce]=be<<7,we=0;we<1<<M[Ce]-7;we++)O[256+be++]=Ce;for(Le=0;Le<=_;Le++)Ee[Le]=0;for(we=0;we<=143;)H[2*we+1]=8,we++,Ee[8]++;for(;we<=255;)H[2*we+1]=9,we++,Ee[9]++;for(;we<=279;)H[2*we+1]=7,we++,Ee[7]++;for(;we<=287;)H[2*we+1]=8,we++,Ee[8]++;for(Ie(H,p+1,Ee),we=0;we<y;we++)P[2*we+1]=5,P[2*we]=_e(we,5);q=new ge(H,C,f+1,p,_),X=new ge(P,M,0,y,_),oe=new ge(new Array(0),R,0,x,w)})(),Te=!0),he.l_desc=new j(he.dyn_ltree,q),he.d_desc=new j(he.dyn_dtree,X),he.bl_desc=new j(he.bl_tree,oe),he.bi_buf=0,he.bi_valid=0,Pe(he)},r._tr_stored_block=ae,r._tr_flush_block=function(he,we,Le,$e){var Ce,be,Ee=0;0<he.level?(he.strm.data_type===2&&(he.strm.data_type=(function(Me){var Xe,dt=4093624447;for(Xe=0;Xe<=31;Xe++,dt>>>=1)if(1&dt&&Me.dyn_ltree[2*Xe]!==0)return a;if(Me.dyn_ltree[18]!==0||Me.dyn_ltree[20]!==0||Me.dyn_ltree[26]!==0)return o;for(Xe=32;Xe<f;Xe++)if(Me.dyn_ltree[2*Xe]!==0)return o;return a})(he)),Mt(he,he.l_desc),Mt(he,he.d_desc),Ee=(function(Me){var Xe;for(W(Me,Me.dyn_ltree,Me.l_desc.max_code),W(Me,Me.dyn_dtree,Me.d_desc.max_code),Mt(Me,Me.bl_desc),Xe=x-1;3<=Xe&&Me.bl_tree[2*L[Xe]+1]===0;Xe--);return Me.opt_len+=3*(Xe+1)+5+5+4,Xe})(he),Ce=he.opt_len+3+7>>>3,(be=he.static_len+3+7>>>3)<=Ce&&(Ce=be)):Ce=be=Le+5,Le+4<=Ce&&we!==-1?ae(he,we,Le,$e):he.strategy===4||be===Ce?(te(he,2+($e?1:0),3),gt(he,H,P)):(te(he,4+($e?1:0),3),(function(Me,Xe,dt,bt){var zt;for(te(Me,Xe-257,5),te(Me,dt-1,5),te(Me,bt-4,4),zt=0;zt<bt;zt++)te(Me,Me.bl_tree[2*L[zt]+1],3);Re(Me,Me.dyn_ltree,Xe-1),Re(Me,Me.dyn_dtree,dt-1)})(he,he.l_desc.max_code+1,he.d_desc.max_code+1,Ee+1),gt(he,he.dyn_ltree,he.dyn_dtree)),Pe(he),$e&&Fe(he)},r._tr_tally=function(he,we,Le){return he.pending_buf[he.d_buf+2*he.last_lit]=we>>>8&255,he.pending_buf[he.d_buf+2*he.last_lit+1]=255&we,he.pending_buf[he.l_buf+he.last_lit]=255&Le,he.last_lit++,we===0?he.dyn_ltree[2*Le]++:(he.matches++,we--,he.dyn_ltree[2*(B[Le]+f+1)]++,he.dyn_dtree[2*G(we)]++),he.last_lit===he.lit_bufsize-1},r._tr_align=function(he){te(he,2,3),ie(he,A,H),(function(we){we.bi_valid===16?(Z(we,we.bi_buf),we.bi_buf=0,we.bi_valid=0):8<=we.bi_valid&&(we.pending_buf[we.pending++]=255&we.bi_buf,we.bi_buf>>=8,we.bi_valid-=8)})(he)}},{"../utils/common":41}],53:[function(t,i,r){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,i,r){(function(s){(function(a,o){if(!a.setImmediate){var l,c,h,f,p=1,y={},x=!1,v=a.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(a);_=_&&_.setTimeout?_:a,l={}.toString.call(a.process)==="[object process]"?function(N){process.nextTick(function(){w(N)})}:(function(){if(a.postMessage&&!a.importScripts){var N=!0,k=a.onmessage;return a.onmessage=function(){N=!1},a.postMessage("","*"),a.onmessage=k,N}})()?(f="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",A,!1):a.attachEvent("onmessage",A),function(N){a.postMessage(f+N,"*")}):a.MessageChannel?((h=new MessageChannel).port1.onmessage=function(N){w(N.data)},function(N){h.port2.postMessage(N)}):v&&"onreadystatechange"in v.createElement("script")?(c=v.documentElement,function(N){var k=v.createElement("script");k.onreadystatechange=function(){w(N),k.onreadystatechange=null,c.removeChild(k),k=null},c.appendChild(k)}):function(N){setTimeout(w,0,N)},_.setImmediate=function(N){typeof N!="function"&&(N=new Function(""+N));for(var k=new Array(arguments.length-1),F=0;F<k.length;F++)k[F]=arguments[F+1];var C={callback:N,args:k};return y[p]=C,l(p),p++},_.clearImmediate=E}function E(N){delete y[N]}function w(N){if(x)setTimeout(w,0,N);else{var k=y[N];if(k){x=!0;try{(function(F){var C=F.callback,M=F.args;switch(M.length){case 0:C();break;case 1:C(M[0]);break;case 2:C(M[0],M[1]);break;case 3:C(M[0],M[1],M[2]);break;default:C.apply(o,M)}})(k)}finally{E(N),x=!1}}}}function A(N){N.source===a&&typeof N.data=="string"&&N.data.indexOf(f)===0&&w(+N.data.slice(f.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof Vf<"u"?Vf:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(F3)),F3.exports}var rH;function nZ(){if(rH)return cx;rH=1;var n=t2e(),e=n2e();cx.openArrayBuffer=t,cx.splitPath=i,cx.joinPath=r;function t(s){return e.loadAsync(s).then(function(a){function o(f){return a.file(f)!==null}function l(f,p){return a.file(f).async("uint8array").then(function(y){if(p==="base64")return n.fromByteArray(y);if(p){var x=new TextDecoder(p);return x.decode(y)}else return y})}function c(f,p){a.file(f,p)}function h(){return a.generateAsync({type:"arraybuffer"})}return{exists:o,read:l,write:c,toArrayBuffer:h}})}function i(s){var a=s.lastIndexOf("/");return a===-1?{dirname:"",basename:s}:{dirname:s.substring(0,a),basename:s.substring(a+1)}}function r(){var s=Array.prototype.filter.call(arguments,function(o){return o}),a=[];return s.forEach(function(o){/^\//.test(o)?a=[o]:a.push(o)}),a.join("/")}return cx}var uA={},Fd={},J0={},sH;function iZ(){if(sH)return J0;sH=1;var n=sr;J0.Element=t,J0.element=function(s,a,o){return new t(s,a,o)},J0.text=function(s){return{type:"text",value:s}};var e=J0.emptyElement={first:function(){return null},firstOrEmpty:function(){return e},attributes:{},children:[]};function t(s,a,o){this.type="element",this.name=s,this.attributes=a||{},this.children=o||[]}t.prototype.first=function(s){return n.find(this.children,function(a){return a.name===s})},t.prototype.firstOrEmpty=function(s){return this.first(s)||e},t.prototype.getElementsByTagName=function(s){var a=n.filter(this.children,function(o){return o.name===s});return r(a)},t.prototype.text=function(){if(this.children.length===0)return"";if(this.children.length!==1||this.children[0].type!=="text")throw new Error("Not implemented");return this.children[0].value};var i={getElementsByTagName:function(s){return r(n.flatten(this.map(function(a){return a.getElementsByTagName(s)},!0)))}};function r(s){return n.extend(s,i)}return J0}var U3={},hA={},hx={},Pu={},Zp={},aH;function RI(){if(aH)return Zp;aH=1;function n(s,a,o){if(o===void 0&&(o=Array.prototype),s&&typeof o.find=="function")return o.find.call(s,a);for(var l=0;l<s.length;l++)if(Object.prototype.hasOwnProperty.call(s,l)){var c=s[l];if(a.call(void 0,c,l,s))return c}}function e(s,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(s):s}function t(s,a){if(s===null||typeof s!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(s[o]=a[o]);return s}var i=e({HTML:"text/html",isHTML:function(s){return s===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(s){return s===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Zp.assign=t,Zp.find=n,Zp.freeze=e,Zp.MIME_TYPE=i,Zp.NAMESPACE=r,Zp}var oH;function pL(){if(oH)return Pu;oH=1;var n=RI(),e=n.find,t=n.NAMESPACE;function i(ne){return ne!==""}function r(ne){return ne?ne.split(/[\t\n\f\r ]+/).filter(i):[]}function s(ne,le){return ne.hasOwnProperty(le)||(ne[le]=!0),ne}function a(ne){if(!ne)return[];var le=r(ne);return Object.keys(le.reduce(s,{}))}function o(ne){return function(le){return ne&&ne.indexOf(le)!==-1}}function l(ne,le){for(var Ae in ne)Object.prototype.hasOwnProperty.call(ne,Ae)&&(le[Ae]=ne[Ae])}function c(ne,le){var Ae=ne.prototype;if(!(Ae instanceof le)){let Oe=function(){};Oe.prototype=le.prototype,Oe=new Oe,l(Ae,Oe),ne.prototype=Ae=Oe}Ae.constructor!=ne&&(typeof ne!="function"&&console.error("unknown Class:"+ne),Ae.constructor=ne)}var h={},f=h.ELEMENT_NODE=1,p=h.ATTRIBUTE_NODE=2,y=h.TEXT_NODE=3,x=h.CDATA_SECTION_NODE=4,v=h.ENTITY_REFERENCE_NODE=5,_=h.ENTITY_NODE=6,E=h.PROCESSING_INSTRUCTION_NODE=7,w=h.COMMENT_NODE=8,A=h.DOCUMENT_NODE=9,N=h.DOCUMENT_TYPE_NODE=10,k=h.DOCUMENT_FRAGMENT_NODE=11,F=h.NOTATION_NODE=12,C={},M={};C.INDEX_SIZE_ERR=(M[1]="Index size error",1),C.DOMSTRING_SIZE_ERR=(M[2]="DOMString size error",2);var R=C.HIERARCHY_REQUEST_ERR=(M[3]="Hierarchy request error",3);C.WRONG_DOCUMENT_ERR=(M[4]="Wrong document",4),C.INVALID_CHARACTER_ERR=(M[5]="Invalid character",5),C.NO_DATA_ALLOWED_ERR=(M[6]="No data allowed",6),C.NO_MODIFICATION_ALLOWED_ERR=(M[7]="No modification allowed",7);var L=C.NOT_FOUND_ERR=(M[8]="Not found",8);C.NOT_SUPPORTED_ERR=(M[9]="Not supported",9);var H=C.INUSE_ATTRIBUTE_ERR=(M[10]="Attribute in use",10);C.INVALID_STATE_ERR=(M[11]="Invalid state",11),C.SYNTAX_ERR=(M[12]="Syntax error",12),C.INVALID_MODIFICATION_ERR=(M[13]="Invalid modification",13),C.NAMESPACE_ERR=(M[14]="Invalid namespace",14),C.INVALID_ACCESS_ERR=(M[15]="Invalid access",15);function P(ne,le){if(le instanceof Error)var Ae=le;else Ae=this,Error.call(this,M[ne]),this.message=M[ne],Error.captureStackTrace&&Error.captureStackTrace(this,P);return Ae.code=ne,le&&(this.message=this.message+": "+le),Ae}P.prototype=Error.prototype,l(C,P);function O(){}O.prototype={length:0,item:function(ne){return ne>=0&&ne<this.length?this[ne]:null},toString:function(ne,le){for(var Ae=[],Oe=0;Oe<this.length;Oe++)mt(this[Oe],Ae,ne,le);return Ae.join("")},filter:function(ne){return Array.prototype.filter.call(this,ne)},indexOf:function(ne){return Array.prototype.indexOf.call(this,ne)}};function B(ne,le){this._node=ne,this._refresh=le,re(this)}function re(ne){var le=ne._node._inc||ne._node.ownerDocument._inc;if(ne._inc!==le){var Ae=ne._refresh(ne._node);if(jt(ne,"length",Ae.length),!ne.$$length||Ae.length<ne.$$length)for(var Oe=Ae.length;Oe in ne;Oe++)Object.prototype.hasOwnProperty.call(ne,Oe)&&delete ne[Oe];l(Ae,ne),ne._inc=le}}B.prototype.item=function(ne){return re(this),this[ne]||null},c(B,O);function q(){}function X(ne,le){for(var Ae=ne.length;Ae--;)if(ne[Ae]===le)return Ae}function oe(ne,le,Ae,Oe){if(Oe?le[X(le,Oe)]=Ae:le[le.length++]=Ae,ne){Ae.ownerElement=ne;var ft=ne.ownerDocument;ft&&(Oe&&_e(ft,ne,Oe),ie(ft,ne,Ae))}}function ue(ne,le,Ae){var Oe=X(le,Ae);if(Oe>=0){for(var ft=le.length-1;Oe<ft;)le[Oe]=le[++Oe];if(le.length=ft,ne){var Ht=ne.ownerDocument;Ht&&(_e(Ht,ne,Ae),Ae.ownerElement=null)}}else throw new P(L,new Error(ne.tagName+"@"+Ae))}q.prototype={length:0,item:O.prototype.item,getNamedItem:function(ne){for(var le=this.length;le--;){var Ae=this[le];if(Ae.nodeName==ne)return Ae}},setNamedItem:function(ne){var le=ne.ownerElement;if(le&&le!=this._ownerElement)throw new P(H);var Ae=this.getNamedItem(ne.nodeName);return oe(this._ownerElement,this,ne,Ae),Ae},setNamedItemNS:function(ne){var le=ne.ownerElement,Ae;if(le&&le!=this._ownerElement)throw new P(H);return Ae=this.getNamedItemNS(ne.namespaceURI,ne.localName),oe(this._ownerElement,this,ne,Ae),Ae},removeNamedItem:function(ne){var le=this.getNamedItem(ne);return ue(this._ownerElement,this,le),le},removeNamedItemNS:function(ne,le){var Ae=this.getNamedItemNS(ne,le);return ue(this._ownerElement,this,Ae),Ae},getNamedItemNS:function(ne,le){for(var Ae=this.length;Ae--;){var Oe=this[Ae];if(Oe.localName==le&&Oe.namespaceURI==ne)return Oe}return null}};function ge(){}ge.prototype={hasFeature:function(ne,le){return!0},createDocument:function(ne,le,Ae){var Oe=new te;if(Oe.implementation=this,Oe.childNodes=new O,Oe.doctype=Ae||null,Ae&&Oe.appendChild(Ae),le){var ft=Oe.createElementNS(ne,le);Oe.appendChild(ft)}return Oe},createDocumentType:function(ne,le,Ae){var Oe=new bt;return Oe.name=ne,Oe.nodeName=ne,Oe.publicId=le||"",Oe.systemId=Ae||"",Oe}};function j(){}j.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(ne,le){return we(this,ne,le)},replaceChild:function(ne,le){we(this,ne,le,he),le&&this.removeChild(le)},removeChild:function(ne){return Pe(this,ne)},appendChild:function(ne){return this.insertBefore(ne,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(ne){return Kt(this.ownerDocument||this,this,ne)},normalize:function(){for(var ne=this.firstChild;ne;){var le=ne.nextSibling;le&&le.nodeType==y&&ne.nodeType==y?(this.removeChild(le),ne.appendData(le.data)):(ne.normalize(),ne=le)}},isSupported:function(ne,le){return this.ownerDocument.implementation.hasFeature(ne,le)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(ne){for(var le=this;le;){var Ae=le._nsMap;if(Ae){for(var Oe in Ae)if(Object.prototype.hasOwnProperty.call(Ae,Oe)&&Ae[Oe]===ne)return Oe}le=le.nodeType==p?le.ownerDocument:le.parentNode}return null},lookupNamespaceURI:function(ne){for(var le=this;le;){var Ae=le._nsMap;if(Ae&&Object.prototype.hasOwnProperty.call(Ae,ne))return Ae[ne];le=le.nodeType==p?le.ownerDocument:le.parentNode}return null},isDefaultNamespace:function(ne){var le=this.lookupPrefix(ne);return le==null}};function G(ne){return ne=="<"&&"&lt;"||ne==">"&&"&gt;"||ne=="&"&&"&amp;"||ne=='"'&&"&quot;"||"&#"+ne.charCodeAt()+";"}l(h,j),l(h,j.prototype);function Z(ne,le){if(le(ne))return!0;if(ne=ne.firstChild)do if(Z(ne,le))return!0;while(ne=ne.nextSibling)}function te(){this.ownerDocument=this}function ie(ne,le,Ae){ne&&ne._inc++;var Oe=Ae.namespaceURI;Oe===t.XMLNS&&(le._nsMap[Ae.prefix?Ae.localName:""]=Ae.value)}function _e(ne,le,Ae,Oe){ne&&ne._inc++;var ft=Ae.namespaceURI;ft===t.XMLNS&&delete le._nsMap[Ae.prefix?Ae.localName:""]}function Ie(ne,le,Ae){if(ne&&ne._inc){ne._inc++;var Oe=le.childNodes;if(Ae)Oe[Oe.length++]=Ae;else{for(var ft=le.firstChild,Ht=0;ft;)Oe[Ht++]=ft,ft=ft.nextSibling;Oe.length=Ht,delete Oe[Oe.length]}}}function Pe(ne,le){var Ae=le.previousSibling,Oe=le.nextSibling;return Ae?Ae.nextSibling=Oe:ne.firstChild=Oe,Oe?Oe.previousSibling=Ae:ne.lastChild=Ae,le.parentNode=null,le.previousSibling=null,le.nextSibling=null,Ie(ne.ownerDocument,ne),le}function Fe(ne){return ne&&(ne.nodeType===j.DOCUMENT_NODE||ne.nodeType===j.DOCUMENT_FRAGMENT_NODE||ne.nodeType===j.ELEMENT_NODE)}function Ge(ne){return ne&&(gt(ne)||Mt(ne)||ct(ne)||ne.nodeType===j.DOCUMENT_FRAGMENT_NODE||ne.nodeType===j.COMMENT_NODE||ne.nodeType===j.PROCESSING_INSTRUCTION_NODE)}function ct(ne){return ne&&ne.nodeType===j.DOCUMENT_TYPE_NODE}function gt(ne){return ne&&ne.nodeType===j.ELEMENT_NODE}function Mt(ne){return ne&&ne.nodeType===j.TEXT_NODE}function W(ne,le){var Ae=ne.childNodes||[];if(e(Ae,gt)||ct(le))return!1;var Oe=e(Ae,ct);return!(le&&Oe&&Ae.indexOf(Oe)>Ae.indexOf(le))}function Re(ne,le){var Ae=ne.childNodes||[];function Oe(Ht){return gt(Ht)&&Ht!==le}if(e(Ae,Oe))return!1;var ft=e(Ae,ct);return!(le&&ft&&Ae.indexOf(ft)>Ae.indexOf(le))}function Te(ne,le,Ae){if(!Fe(ne))throw new P(R,"Unexpected parent node type "+ne.nodeType);if(Ae&&Ae.parentNode!==ne)throw new P(L,"child not in parent");if(!Ge(le)||ct(le)&&ne.nodeType!==j.DOCUMENT_NODE)throw new P(R,"Unexpected node type "+le.nodeType+" for parent node type "+ne.nodeType)}function ae(ne,le,Ae){var Oe=ne.childNodes||[],ft=le.childNodes||[];if(le.nodeType===j.DOCUMENT_FRAGMENT_NODE){var Ht=ft.filter(gt);if(Ht.length>1||e(ft,Mt))throw new P(R,"More than one element or text in fragment");if(Ht.length===1&&!W(ne,Ae))throw new P(R,"Element in fragment can not be inserted before doctype")}if(gt(le)&&!W(ne,Ae))throw new P(R,"Only one element can be added and only after doctype");if(ct(le)){if(e(Oe,ct))throw new P(R,"Only one doctype is allowed");var mn=e(Oe,gt);if(Ae&&Oe.indexOf(mn)<Oe.indexOf(Ae))throw new P(R,"Doctype can only be inserted before an element");if(!Ae&&mn)throw new P(R,"Doctype can not be appended since element is present")}}function he(ne,le,Ae){var Oe=ne.childNodes||[],ft=le.childNodes||[];if(le.nodeType===j.DOCUMENT_FRAGMENT_NODE){var Ht=ft.filter(gt);if(Ht.length>1||e(ft,Mt))throw new P(R,"More than one element or text in fragment");if(Ht.length===1&&!Re(ne,Ae))throw new P(R,"Element in fragment can not be inserted before doctype")}if(gt(le)&&!Re(ne,Ae))throw new P(R,"Only one element can be added and only after doctype");if(ct(le)){if(e(Oe,function(ss){return ct(ss)&&ss!==Ae}))throw new P(R,"Only one doctype is allowed");var mn=e(Oe,gt);if(Ae&&Oe.indexOf(mn)<Oe.indexOf(Ae))throw new P(R,"Doctype can only be inserted before an element")}}function we(ne,le,Ae,Oe){Te(ne,le,Ae),ne.nodeType===j.DOCUMENT_NODE&&(Oe||ae)(ne,le,Ae);var ft=le.parentNode;if(ft&&ft.removeChild(le),le.nodeType===k){var Ht=le.firstChild;if(Ht==null)return le;var mn=le.lastChild}else Ht=mn=le;var ki=Ae?Ae.previousSibling:ne.lastChild;Ht.previousSibling=ki,mn.nextSibling=Ae,ki?ki.nextSibling=Ht:ne.firstChild=Ht,Ae==null?ne.lastChild=mn:Ae.previousSibling=mn;do{Ht.parentNode=ne;var ss=ne.ownerDocument||ne;Le(Ht,ss)}while(Ht!==mn&&(Ht=Ht.nextSibling));return Ie(ne.ownerDocument||ne,ne),le.nodeType==k&&(le.firstChild=le.lastChild=null),le}function Le(ne,le){if(ne.ownerDocument!==le){if(ne.ownerDocument=le,ne.nodeType===f&&ne.attributes)for(var Ae=0;Ae<ne.attributes.length;Ae++){var Oe=ne.attributes.item(Ae);Oe&&(Oe.ownerDocument=le)}for(var ft=ne.firstChild;ft;)Le(ft,le),ft=ft.nextSibling}}function $e(ne,le){le.parentNode&&le.parentNode.removeChild(le),le.parentNode=ne,le.previousSibling=ne.lastChild,le.nextSibling=null,le.previousSibling?le.previousSibling.nextSibling=le:ne.firstChild=le,ne.lastChild=le,Ie(ne.ownerDocument,ne,le);var Ae=ne.ownerDocument||ne;return Le(le,Ae),le}te.prototype={nodeName:"#document",nodeType:A,doctype:null,documentElement:null,_inc:1,insertBefore:function(ne,le){if(ne.nodeType==k){for(var Ae=ne.firstChild;Ae;){var Oe=Ae.nextSibling;this.insertBefore(Ae,le),Ae=Oe}return ne}return we(this,ne,le),Le(ne,this),this.documentElement===null&&ne.nodeType===f&&(this.documentElement=ne),ne},removeChild:function(ne){return this.documentElement==ne&&(this.documentElement=null),Pe(this,ne)},replaceChild:function(ne,le){we(this,ne,le,he),Le(ne,this),le&&this.removeChild(le),gt(ne)&&(this.documentElement=ne)},importNode:function(ne,le){return Yt(this,ne,le)},getElementById:function(ne){var le=null;return Z(this.documentElement,function(Ae){if(Ae.nodeType==f&&Ae.getAttribute("id")==ne)return le=Ae,!0}),le},getElementsByClassName:function(ne){var le=a(ne);return new B(this,function(Ae){var Oe=[];return le.length>0&&Z(Ae.documentElement,function(ft){if(ft!==Ae&&ft.nodeType===f){var Ht=ft.getAttribute("class");if(Ht){var mn=ne===Ht;if(!mn){var ki=a(Ht);mn=le.every(o(ki))}mn&&Oe.push(ft)}}}),Oe})},createElement:function(ne){var le=new Ce;le.ownerDocument=this,le.nodeName=ne,le.tagName=ne,le.localName=ne,le.childNodes=new O;var Ae=le.attributes=new q;return Ae._ownerElement=le,le},createDocumentFragment:function(){var ne=new on;return ne.ownerDocument=this,ne.childNodes=new O,ne},createTextNode:function(ne){var le=new Me;return le.ownerDocument=this,le.appendData(ne),le},createComment:function(ne){var le=new Xe;return le.ownerDocument=this,le.appendData(ne),le},createCDATASection:function(ne){var le=new dt;return le.ownerDocument=this,le.appendData(ne),le},createProcessingInstruction:function(ne,le){var Ae=new ke;return Ae.ownerDocument=this,Ae.tagName=Ae.nodeName=Ae.target=ne,Ae.nodeValue=Ae.data=le,Ae},createAttribute:function(ne){var le=new be;return le.ownerDocument=this,le.name=ne,le.nodeName=ne,le.localName=ne,le.specified=!0,le},createEntityReference:function(ne){var le=new Gt;return le.ownerDocument=this,le.nodeName=ne,le},createElementNS:function(ne,le){var Ae=new Ce,Oe=le.split(":"),ft=Ae.attributes=new q;return Ae.childNodes=new O,Ae.ownerDocument=this,Ae.nodeName=le,Ae.tagName=le,Ae.namespaceURI=ne,Oe.length==2?(Ae.prefix=Oe[0],Ae.localName=Oe[1]):Ae.localName=le,ft._ownerElement=Ae,Ae},createAttributeNS:function(ne,le){var Ae=new be,Oe=le.split(":");return Ae.ownerDocument=this,Ae.nodeName=le,Ae.name=le,Ae.namespaceURI=ne,Ae.specified=!0,Oe.length==2?(Ae.prefix=Oe[0],Ae.localName=Oe[1]):Ae.localName=le,Ae}},c(te,j);function Ce(){this._nsMap={}}Ce.prototype={nodeType:f,hasAttribute:function(ne){return this.getAttributeNode(ne)!=null},getAttribute:function(ne){var le=this.getAttributeNode(ne);return le&&le.value||""},getAttributeNode:function(ne){return this.attributes.getNamedItem(ne)},setAttribute:function(ne,le){var Ae=this.ownerDocument.createAttribute(ne);Ae.value=Ae.nodeValue=""+le,this.setAttributeNode(Ae)},removeAttribute:function(ne){var le=this.getAttributeNode(ne);le&&this.removeAttributeNode(le)},appendChild:function(ne){return ne.nodeType===k?this.insertBefore(ne,null):$e(this,ne)},setAttributeNode:function(ne){return this.attributes.setNamedItem(ne)},setAttributeNodeNS:function(ne){return this.attributes.setNamedItemNS(ne)},removeAttributeNode:function(ne){return this.attributes.removeNamedItem(ne.nodeName)},removeAttributeNS:function(ne,le){var Ae=this.getAttributeNodeNS(ne,le);Ae&&this.removeAttributeNode(Ae)},hasAttributeNS:function(ne,le){return this.getAttributeNodeNS(ne,le)!=null},getAttributeNS:function(ne,le){var Ae=this.getAttributeNodeNS(ne,le);return Ae&&Ae.value||""},setAttributeNS:function(ne,le,Ae){var Oe=this.ownerDocument.createAttributeNS(ne,le);Oe.value=Oe.nodeValue=""+Ae,this.setAttributeNode(Oe)},getAttributeNodeNS:function(ne,le){return this.attributes.getNamedItemNS(ne,le)},getElementsByTagName:function(ne){return new B(this,function(le){var Ae=[];return Z(le,function(Oe){Oe!==le&&Oe.nodeType==f&&(ne==="*"||Oe.tagName==ne)&&Ae.push(Oe)}),Ae})},getElementsByTagNameNS:function(ne,le){return new B(this,function(Ae){var Oe=[];return Z(Ae,function(ft){ft!==Ae&&ft.nodeType===f&&(ne==="*"||ft.namespaceURI===ne)&&(le==="*"||ft.localName==le)&&Oe.push(ft)}),Oe})}},te.prototype.getElementsByTagName=Ce.prototype.getElementsByTagName,te.prototype.getElementsByTagNameNS=Ce.prototype.getElementsByTagNameNS,c(Ce,j);function be(){}be.prototype.nodeType=p,c(be,j);function Ee(){}Ee.prototype={data:"",substringData:function(ne,le){return this.data.substring(ne,ne+le)},appendData:function(ne){ne=this.data+ne,this.nodeValue=this.data=ne,this.length=ne.length},insertData:function(ne,le){this.replaceData(ne,0,le)},appendChild:function(ne){throw new Error(M[R])},deleteData:function(ne,le){this.replaceData(ne,le,"")},replaceData:function(ne,le,Ae){var Oe=this.data.substring(0,ne),ft=this.data.substring(ne+le);Ae=Oe+Ae+ft,this.nodeValue=this.data=Ae,this.length=Ae.length}},c(Ee,j);function Me(){}Me.prototype={nodeName:"#text",nodeType:y,splitText:function(ne){var le=this.data,Ae=le.substring(ne);le=le.substring(0,ne),this.data=this.nodeValue=le,this.length=le.length;var Oe=this.ownerDocument.createTextNode(Ae);return this.parentNode&&this.parentNode.insertBefore(Oe,this.nextSibling),Oe}},c(Me,Ee);function Xe(){}Xe.prototype={nodeName:"#comment",nodeType:w},c(Xe,Ee);function dt(){}dt.prototype={nodeName:"#cdata-section",nodeType:x},c(dt,Ee);function bt(){}bt.prototype.nodeType=N,c(bt,j);function zt(){}zt.prototype.nodeType=F,c(zt,j);function Nt(){}Nt.prototype.nodeType=_,c(Nt,j);function Gt(){}Gt.prototype.nodeType=v,c(Gt,j);function on(){}on.prototype.nodeName="#document-fragment",on.prototype.nodeType=k,c(on,j);function ke(){}ke.prototype.nodeType=E,c(ke,j);function xe(){}xe.prototype.serializeToString=function(ne,le,Ae){return Ye.call(ne,le,Ae)},j.prototype.toString=Ye;function Ye(ne,le){var Ae=[],Oe=this.nodeType==9&&this.documentElement||this,ft=Oe.prefix,Ht=Oe.namespaceURI;if(Ht&&ft==null){var ft=Oe.lookupPrefix(Ht);if(ft==null)var mn=[{namespace:Ht,prefix:null}]}return mt(this,Ae,ne,le,mn),Ae.join("")}function Je(ne,le,Ae){var Oe=ne.prefix||"",ft=ne.namespaceURI;if(!ft||Oe==="xml"&&ft===t.XML||ft===t.XMLNS)return!1;for(var Ht=Ae.length;Ht--;){var mn=Ae[Ht];if(mn.prefix===Oe)return mn.namespace!==ft}return!0}function pt(ne,le,Ae){ne.push(" ",le,'="',Ae.replace(/[<>&"\t\n\r]/g,G),'"')}function mt(ne,le,Ae,Oe,ft){if(ft||(ft=[]),Oe)if(ne=Oe(ne),ne){if(typeof ne=="string"){le.push(ne);return}}else return;switch(ne.nodeType){case f:var Ht=ne.attributes,mn=Ht.length,de=ne.firstChild,ki=ne.tagName;Ae=t.isHTML(ne.namespaceURI)||Ae;var ss=ki;if(!Ae&&!ne.prefix&&ne.namespaceURI){for(var Br,wr=0;wr<Ht.length;wr++)if(Ht.item(wr).name==="xmlns"){Br=Ht.item(wr).value;break}if(!Br)for(var Ys=ft.length-1;Ys>=0;Ys--){var as=ft[Ys];if(as.prefix===""&&as.namespace===ne.namespaceURI){Br=as.namespace;break}}if(Br!==ne.namespaceURI)for(var Ys=ft.length-1;Ys>=0;Ys--){var as=ft[Ys];if(as.namespace===ne.namespaceURI){as.prefix&&(ss=as.prefix+":"+ki);break}}}le.push("<",ss);for(var Ar=0;Ar<mn;Ar++){var se=Ht.item(Ar);se.prefix=="xmlns"?ft.push({prefix:se.localName,namespace:se.value}):se.nodeName=="xmlns"&&ft.push({prefix:"",namespace:se.value})}for(var Ar=0;Ar<mn;Ar++){var se=Ht.item(Ar);if(Je(se,Ae,ft)){var me=se.prefix||"",fe=se.namespaceURI;pt(le,me?"xmlns:"+me:"xmlns",fe),ft.push({prefix:me,namespace:fe})}mt(se,le,Ae,Oe,ft)}if(ki===ss&&Je(ne,Ae,ft)){var me=ne.prefix||"",fe=ne.namespaceURI;pt(le,me?"xmlns:"+me:"xmlns",fe),ft.push({prefix:me,namespace:fe})}if(de||Ae&&!/^(?:meta|link|img|br|hr|input)$/i.test(ki)){if(le.push(">"),Ae&&/^script$/i.test(ki))for(;de;)de.data?le.push(de.data):mt(de,le,Ae,Oe,ft.slice()),de=de.nextSibling;else for(;de;)mt(de,le,Ae,Oe,ft.slice()),de=de.nextSibling;le.push("</",ss,">")}else le.push("/>");return;case A:case k:for(var de=ne.firstChild;de;)mt(de,le,Ae,Oe,ft.slice()),de=de.nextSibling;return;case p:return pt(le,ne.name,ne.value);case y:return le.push(ne.data.replace(/[<&>]/g,G));case x:return le.push("<![CDATA[",ne.data,"]]>");case w:return le.push("<!--",ne.data,"-->");case N:var ye=ne.publicId,ve=ne.systemId;if(le.push("<!DOCTYPE ",ne.name),ye)le.push(" PUBLIC ",ye),ve&&ve!="."&&le.push(" ",ve),le.push(">");else if(ve&&ve!=".")le.push(" SYSTEM ",ve,">");else{var Ve=ne.internalSubset;Ve&&le.push(" [",Ve,"]"),le.push(">")}return;case E:return le.push("<?",ne.target," ",ne.data,"?>");case v:return le.push("&",ne.nodeName,";");default:le.push("??",ne.nodeName)}}function Yt(ne,le,Ae){var Oe;switch(le.nodeType){case f:Oe=le.cloneNode(!1),Oe.ownerDocument=ne;case k:break;case p:Ae=!0;break}if(Oe||(Oe=le.cloneNode(!1)),Oe.ownerDocument=ne,Oe.parentNode=null,Ae)for(var ft=le.firstChild;ft;)Oe.appendChild(Yt(ne,ft,Ae)),ft=ft.nextSibling;return Oe}function Kt(ne,le,Ae){var Oe=new le.constructor;for(var ft in le)if(Object.prototype.hasOwnProperty.call(le,ft)){var Ht=le[ft];typeof Ht!="object"&&Ht!=Oe[ft]&&(Oe[ft]=Ht)}switch(le.childNodes&&(Oe.childNodes=new O),Oe.ownerDocument=ne,Oe.nodeType){case f:var mn=le.attributes,ki=Oe.attributes=new q,ss=mn.length;ki._ownerElement=Oe;for(var Br=0;Br<ss;Br++)Oe.setAttributeNode(Kt(ne,mn.item(Br),!0));break;case p:Ae=!0}if(Ae)for(var wr=le.firstChild;wr;)Oe.appendChild(Kt(ne,wr,Ae)),wr=wr.nextSibling;return Oe}function jt(ne,le,Ae){ne[le]=Ae}try{if(Object.defineProperty){let ne=function(le){switch(le.nodeType){case f:case k:var Ae=[];for(le=le.firstChild;le;)le.nodeType!==7&&le.nodeType!==8&&Ae.push(ne(le)),le=le.nextSibling;return Ae.join("");default:return le.nodeValue}};Object.defineProperty(B.prototype,"length",{get:function(){return re(this),this.$$length}}),Object.defineProperty(j.prototype,"textContent",{get:function(){return ne(this)},set:function(le){switch(this.nodeType){case f:case k:for(;this.firstChild;)this.removeChild(this.firstChild);(le||String(le))&&this.appendChild(this.ownerDocument.createTextNode(le));break;default:this.data=le,this.value=le,this.nodeValue=le}}}),jt=function(le,Ae,Oe){le["$$"+Ae]=Oe}}}catch{}return Pu.DocumentType=bt,Pu.DOMException=P,Pu.DOMImplementation=ge,Pu.Element=Ce,Pu.Node=j,Pu.NodeList=O,Pu.XMLSerializer=xe,Pu}var dx={},P3={},lH;function i2e(){return lH||(lH=1,(function(n){var e=RI().freeze;n.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ﬃ",fflig:"ﬀ",ffllig:"ﬄ",Ffr:"𝔉",ffr:"𝔣",filig:"ﬁ",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"ﬂ",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"Ĳ",ijlig:"ĳ",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ŉ",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"	",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),n.entityMap=n.HTML_ENTITIES})(P3)),P3}var dA={},cH;function r2e(){if(cH)return dA;cH=1;var n=RI().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,s=1,a=2,o=3,l=4,c=5,h=6,f=7;function p(R,L){this.message=R,this.locator=L,Error.captureStackTrace&&Error.captureStackTrace(this,p)}p.prototype=new Error,p.prototype.name=p.name;function y(){}y.prototype={parse:function(R,L,H){var P=this.domBuilder;P.startDocument(),N(L,L={}),x(R,L,H,P,this.errorHandler),P.endDocument()}};function x(R,L,H,P,O){function B($e){if($e>65535){$e-=65536;var Ce=55296+($e>>10),be=56320+($e&1023);return String.fromCharCode(Ce,be)}else return String.fromCharCode($e)}function re($e){var Ce=$e.slice(1,-1);return Object.hasOwnProperty.call(H,Ce)?H[Ce]:Ce.charAt(0)==="#"?B(parseInt(Ce.substr(1).replace("x","0x"))):(O.error("entity not found:"+$e),$e)}function q($e){if($e>te){var Ce=R.substring(te,$e).replace(/&#?\w+;/g,re);j&&X(te),P.characters(Ce,0,$e-te),te=$e}}function X($e,Ce){for(;$e>=ue&&(Ce=ge.exec(R));)oe=Ce.index,ue=oe+Ce[0].length,j.lineNumber++;j.columnNumber=$e-oe+1}for(var oe=0,ue=0,ge=/.*(?:\r\n?|\n)|.*$/g,j=P.locator,G=[{currentNSMap:L}],Z={},te=0;;){try{var ie=R.indexOf("<",te);if(ie<0){if(!R.substr(te).match(/^\s*$/)){var _e=P.doc,Ie=_e.createTextNode(R.substr(te));_e.appendChild(Ie),P.currentElement=Ie}return}switch(ie>te&&q(ie),R.charAt(ie+1)){case"/":var Te=R.indexOf(">",ie+3),Pe=R.substring(ie+2,Te).replace(/[ \t\n\r]+$/g,""),Fe=G.pop();Te<0?(Pe=R.substring(ie+2).replace(/[\s<].*/,""),O.error("end tag name: "+Pe+" is not complete:"+Fe.tagName),Te=ie+1+Pe.length):Pe.match(/\s</)&&(Pe=Pe.replace(/[\s<].*/,""),O.error("end tag name: "+Pe+" maybe not complete"),Te=ie+1+Pe.length);var Ge=Fe.localNSMap,ct=Fe.tagName==Pe,gt=ct||Fe.tagName&&Fe.tagName.toLowerCase()==Pe.toLowerCase();if(gt){if(P.endElement(Fe.uri,Fe.localName,Pe),Ge)for(var Mt in Ge)Object.prototype.hasOwnProperty.call(Ge,Mt)&&P.endPrefixMapping(Mt);ct||O.fatalError("end tag name: "+Pe+" is not match the current start tagName:"+Fe.tagName)}else G.push(Fe);Te++;break;case"?":j&&X(ie),Te=F(R,ie,P);break;case"!":j&&X(ie),Te=k(R,ie,P,O);break;default:j&&X(ie);var W=new C,Re=G[G.length-1].currentNSMap,Te=_(R,ie,W,Re,re,O),ae=W.length;if(!W.closed&&A(R,Te,W.tagName,Z)&&(W.closed=!0,H.nbsp||O.warning("unclosed xml attribute")),j&&ae){for(var he=v(j,{}),we=0;we<ae;we++){var Le=W[we];X(Le.offset),Le.locator=v(j,{})}P.locator=he,E(W,P,Re)&&G.push(W),P.locator=j}else E(W,P,Re)&&G.push(W);n.isHTML(W.uri)&&!W.closed?Te=w(R,Te,W.tagName,re,P):Te++}}catch($e){if($e instanceof p)throw $e;O.error("element parse error: "+$e),Te=-1}Te>te?te=Te:q(Math.max(ie,te)+1)}}function v(R,L){return L.lineNumber=R.lineNumber,L.columnNumber=R.columnNumber,L}function _(R,L,H,P,O,B){function re(j,G,Z){H.attributeNames.hasOwnProperty(j)&&B.fatalError("Attribute "+j+" redefined"),H.addValue(j,G.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,O),Z)}for(var q,X,oe=++L,ue=r;;){var ge=R.charAt(oe);switch(ge){case"=":if(ue===s)q=R.slice(L,oe),ue=o;else if(ue===a)ue=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===o||ue===s)if(ue===s&&(B.warning('attribute value must after "="'),q=R.slice(L,oe)),L=oe+1,oe=R.indexOf(ge,L),oe>0)X=R.slice(L,oe),re(q,X,L-1),ue=c;else throw new Error("attribute value no end '"+ge+"' match");else if(ue==l)X=R.slice(L,oe),re(q,X,L),B.warning('attribute "'+q+'" missed start quot('+ge+")!!"),L=oe+1,ue=c;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case r:H.setTagName(R.slice(L,oe));case c:case h:case f:ue=f,H.closed=!0;case l:case s:break;case a:H.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return B.error("unexpected end of input"),ue==r&&H.setTagName(R.slice(L,oe)),oe;case">":switch(ue){case r:H.setTagName(R.slice(L,oe));case c:case h:case f:break;case l:case s:X=R.slice(L,oe),X.slice(-1)==="/"&&(H.closed=!0,X=X.slice(0,-1));case a:ue===a&&(X=q),ue==l?(B.warning('attribute "'+X+'" missed quot(")!'),re(q,X,L)):((!n.isHTML(P[""])||!X.match(/^(?:disabled|checked|selected)$/i))&&B.warning('attribute "'+X+'" missed value!! "'+X+'" instead!!'),re(X,X,L));break;case o:throw new Error("attribute value missed!!")}return oe;case"":ge=" ";default:if(ge<=" ")switch(ue){case r:H.setTagName(R.slice(L,oe)),ue=h;break;case s:q=R.slice(L,oe),ue=a;break;case l:var X=R.slice(L,oe);B.warning('attribute "'+X+'" missed quot(")!!'),re(q,X,L);case c:ue=h;break}else switch(ue){case a:H.tagName,(!n.isHTML(P[""])||!q.match(/^(?:disabled|checked|selected)$/i))&&B.warning('attribute "'+q+'" missed value!! "'+q+'" instead2!!'),re(q,q,L),L=oe,ue=s;break;case c:B.warning('attribute space is required"'+q+'"!!');case h:ue=s,L=oe;break;case o:ue=l,L=oe;break;case f:throw new Error("elements closed character '/' and '>' must be connected to")}}oe++}}function E(R,L,H){for(var P=R.tagName,O=null,ge=R.length;ge--;){var B=R[ge],re=B.qName,q=B.value,j=re.indexOf(":");if(j>0)var X=B.prefix=re.slice(0,j),oe=re.slice(j+1),ue=X==="xmlns"&&oe;else oe=re,X=null,ue=re==="xmlns"&&"";B.localName=oe,ue!==!1&&(O==null&&(O={},N(H,H={})),H[ue]=O[ue]=q,B.uri=n.XMLNS,L.startPrefixMapping(ue,q))}for(var ge=R.length;ge--;){B=R[ge];var X=B.prefix;X&&(X==="xml"&&(B.uri=n.XML),X!=="xmlns"&&(B.uri=H[X||""]))}var j=P.indexOf(":");j>0?(X=R.prefix=P.slice(0,j),oe=R.localName=P.slice(j+1)):(X=null,oe=R.localName=P);var G=R.uri=H[X||""];if(L.startElement(G,oe,P,R),R.closed){if(L.endElement(G,oe,P),O)for(X in O)Object.prototype.hasOwnProperty.call(O,X)&&L.endPrefixMapping(X)}else return R.currentNSMap=H,R.localNSMap=O,!0}function w(R,L,H,P,O){if(/^(?:script|textarea)$/i.test(H)){var B=R.indexOf("</"+H+">",L),re=R.substring(L+1,B);if(/[&<]/.test(re))return/^script$/i.test(H)?(O.characters(re,0,re.length),B):(re=re.replace(/&#?\w+;/g,P),O.characters(re,0,re.length),B)}return L+1}function A(R,L,H,P){var O=P[H];return O==null&&(O=R.lastIndexOf("</"+H+">"),O<L&&(O=R.lastIndexOf("</"+H)),P[H]=O),O<L}function N(R,L){for(var H in R)Object.prototype.hasOwnProperty.call(R,H)&&(L[H]=R[H])}function k(R,L,H,P){var O=R.charAt(L+2);switch(O){case"-":if(R.charAt(L+3)==="-"){var B=R.indexOf("-->",L+4);return B>L?(H.comment(R,L+4,B-L-4),B+3):(P.error("Unclosed comment"),-1)}else return-1;default:if(R.substr(L+3,6)=="CDATA["){var B=R.indexOf("]]>",L+9);return H.startCDATA(),H.characters(R,L+9,B-L-9),H.endCDATA(),B+3}var re=M(R,L),q=re.length;if(q>1&&/!doctype/i.test(re[0][0])){var X=re[1][0],oe=!1,ue=!1;q>3&&(/^public$/i.test(re[2][0])?(oe=re[3][0],ue=q>4&&re[4][0]):/^system$/i.test(re[2][0])&&(ue=re[3][0]));var ge=re[q-1];return H.startDTD(X,oe,ue),H.endDTD(),ge.index+ge[0].length}}return-1}function F(R,L,H){var P=R.indexOf("?>",L);if(P){var O=R.substring(L,P).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return O?(O[0].length,H.processingInstruction(O[1],O[2]),P+2):-1}return-1}function C(){this.attributeNames={}}C.prototype={setTagName:function(R){if(!i.test(R))throw new Error("invalid tagName:"+R);this.tagName=R},addValue:function(R,L,H){if(!i.test(R))throw new Error("invalid attribute:"+R);this.attributeNames[R]=this.length,this[this.length++]={qName:R,value:L,offset:H}},length:0,getLocalName:function(R){return this[R].localName},getLocator:function(R){return this[R].locator},getQName:function(R){return this[R].qName},getURI:function(R){return this[R].uri},getValue:function(R){return this[R].value}};function M(R,L){var H,P=[],O=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(O.lastIndex=L,O.exec(R);H=O.exec(R);)if(P.push(H),H[1])return P}return dA.XMLReader=y,dA.ParseError=p,dA}var uH;function s2e(){if(uH)return dx;uH=1;var n=RI(),e=pL(),t=i2e(),i=r2e(),r=e.DOMImplementation,s=n.NAMESPACE,a=i.ParseError,o=i.XMLReader;function l(_){return _.replace(/\r[\n\u0085]/g,`
`).replace(/[\r\u0085\u2028]/g,`
`)}function c(_){this.options=_||{locator:{}}}c.prototype.parseFromString=function(_,E){var w=this.options,A=new o,N=w.domBuilder||new f,k=w.errorHandler,F=w.locator,C=w.xmlns||{},M=/\/x?html?$/.test(E),R=M?t.HTML_ENTITIES:t.XML_ENTITIES;F&&N.setDocumentLocator(F),A.errorHandler=h(k,N,F),A.domBuilder=w.domBuilder||N,M&&(C[""]=s.HTML),C.xml=C.xml||s.XML;var L=w.normalizeLineEndings||l;return _&&typeof _=="string"?A.parse(L(_),C,R):A.errorHandler.error("invalid doc source"),N.doc};function h(_,E,w){if(!_){if(E instanceof f)return E;_=E}var A={},N=_ instanceof Function;w=w||{};function k(F){var C=_[F];!C&&N&&(C=_.length==2?function(M){_(F,M)}:_),A[F]=C&&function(M){C("[xmldom "+F+"]	"+M+y(w))}||function(){}}return k("warning"),k("error"),k("fatalError"),A}function f(){this.cdata=!1}function p(_,E){E.lineNumber=_.lineNumber,E.columnNumber=_.columnNumber}f.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(_,E,w,A){var N=this.doc,k=N.createElementNS(_,w||E),F=A.length;v(this,k),this.currentElement=k,this.locator&&p(this.locator,k);for(var C=0;C<F;C++){var _=A.getURI(C),M=A.getValue(C),w=A.getQName(C),R=N.createAttributeNS(_,w);this.locator&&p(A.getLocator(C),R),R.value=R.nodeValue=M,k.setAttributeNode(R)}},endElement:function(_,E,w){var A=this.currentElement;A.tagName,this.currentElement=A.parentNode},startPrefixMapping:function(_,E){},endPrefixMapping:function(_){},processingInstruction:function(_,E){var w=this.doc.createProcessingInstruction(_,E);this.locator&&p(this.locator,w),v(this,w)},ignorableWhitespace:function(_,E,w){},characters:function(_,E,w){if(_=x.apply(this,arguments),_){if(this.cdata)var A=this.doc.createCDATASection(_);else var A=this.doc.createTextNode(_);this.currentElement?this.currentElement.appendChild(A):/^\s*$/.test(_)&&this.doc.appendChild(A),this.locator&&p(this.locator,A)}},skippedEntity:function(_){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(_){(this.locator=_)&&(_.lineNumber=0)},comment:function(_,E,w){_=x.apply(this,arguments);var A=this.doc.createComment(_);this.locator&&p(this.locator,A),v(this,A)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(_,E,w){var A=this.doc.implementation;if(A&&A.createDocumentType){var N=A.createDocumentType(_,E,w);this.locator&&p(this.locator,N),v(this,N),this.doc.doctype=N}},warning:function(_){console.warn("[xmldom warning]	"+_,y(this.locator))},error:function(_){console.error("[xmldom error]	"+_,y(this.locator))},fatalError:function(_){throw new a(_,this.locator)}};function y(_){if(_)return`
@`+(_.systemId||"")+"#[line:"+_.lineNumber+",col:"+_.columnNumber+"]"}function x(_,E,w){return typeof _=="string"?_.substr(E,w):_.length>=E+w||E?new java.lang.String(_,E,w)+"":_}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(_){f.prototype[_]=function(){return null}});function v(_,E){_.currentElement?_.currentElement.appendChild(E):_.doc.appendChild(E)}return dx.__DOMHandler=f,dx.normalizeLineEndings=l,dx.DOMParser=c,dx}var hH;function a2e(){if(hH)return hx;hH=1;var n=pL();return hx.DOMImplementation=n.DOMImplementation,hx.XMLSerializer=n.XMLSerializer,hx.DOMParser=s2e().DOMParser,hx}var dH;function o2e(){if(dH)return hA;dH=1;var n=a2e(),e=pL();function t(i){var r=null,s=new n.DOMParser({errorHandler:function(o,l){r={level:o,message:l}}}),a=s.parseFromString(i);if(r===null)return a;throw new Error(r.level+": "+r.message)}return hA.parseFromString=t,hA.Node=e.Node,hA}var fH;function l2e(){if(fH)return U3;fH=1;var n=Tp(),e=sr,t=o2e(),i=iZ(),r=i.Element;U3.readString=a;var s=t.Node;function a(o,l){l=l||{};try{var c=t.parseFromString(o,"text/xml")}catch(y){return n.reject(y)}if(c.documentElement.tagName==="parsererror")return n.resolve(new Error(c.documentElement.textContent));function h(y){switch(y.nodeType){case s.ELEMENT_NODE:return f(y);case s.TEXT_NODE:return i.text(y.nodeValue)}}function f(y){var x=p(y),v=[];e.forEach(y.childNodes,function(E){var w=h(E);w&&v.push(w)});var _={};return e.forEach(y.attributes,function(E){_[p(E)]=E.value}),new r(x,_,v)}function p(y){if(y.namespaceURI){var x=l[y.namespaceURI],v;return x?v=x+":":v="{"+y.namespaceURI+"}",v+y.localName}else return y.localName}return n.resolve(h(c.documentElement))}return U3}var L3={},eg={},Ec={},pH;function Ep(){return pH||(pH=1,(function(){var n,e,t,i,r,s,a,o=[].slice,l={}.hasOwnProperty;n=function(){var c,h,f,p,y,x;if(x=arguments[0],y=2<=arguments.length?o.call(arguments,1):[],r(Object.assign))Object.assign.apply(null,arguments);else for(c=0,f=y.length;c<f;c++)if(p=y[c],p!=null)for(h in p)l.call(p,h)&&(x[h]=p[h]);return x},r=function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},s=function(c){var h;return!!c&&((h=typeof c)=="function"||h==="object")},t=function(c){return r(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},i=function(c){var h;if(t(c))return!c.length;for(h in c)if(l.call(c,h))return!1;return!0},a=function(c){var h,f;return s(c)&&(f=Object.getPrototypeOf(c))&&(h=f.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},e=function(c){return r(c.valueOf)?c.valueOf():c},Ec.assign=n,Ec.isFunction=r,Ec.isObject=s,Ec.isArray=t,Ec.isEmpty=i,Ec.isPlainObject=a,Ec.getValue=e}).call(Ec)),Ec}var CS={exports:{}},IS={exports:{}},RS={exports:{}},NS={exports:{}},c2e=NS.exports,gH;function rZ(){return gH||(gH=1,(function(){NS.exports=(function(){function n(e,t,i){if(this.options=e.options,this.stringify=e.stringify,this.parent=e,t==null)throw new Error("Missing attribute name. "+this.debugInfo(t));if(i==null)throw new Error("Missing attribute value. "+this.debugInfo(t));this.name=this.stringify.attName(t),this.value=this.stringify.attValue(i)}return n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(e){return this.options.writer.set(e).attribute(this)},n.prototype.debugInfo=function(e){return e=e||this.name,e==null?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},n})()}).call(c2e)),NS.exports}var u2e=RS.exports,mH;function NI(){return mH||(mH=1,(function(){var n,e,t,i,r,s,a=function(l,c){for(var h in c)o.call(c,h)&&(l[h]=c[h]);function f(){this.constructor=l}return f.prototype=c.prototype,l.prototype=new f,l.__super__=c.prototype,l},o={}.hasOwnProperty;s=Ep(),r=s.isObject,i=s.isFunction,t=s.getValue,e=Ba(),n=rZ(),RS.exports=(function(l){a(c,l);function c(h,f,p){if(c.__super__.constructor.call(this,h),f==null)throw new Error("Missing element name. "+this.debugInfo());this.name=this.stringify.eleName(f),this.attributes={},p!=null&&this.attribute(p),h.isDocument&&(this.isRoot=!0,this.documentObject=h,h.rootObject=this)}return c.prototype.clone=function(){var h,f,p,y;p=Object.create(this),p.isRoot&&(p.documentObject=null),p.attributes={},y=this.attributes;for(f in y)o.call(y,f)&&(h=y[f],p.attributes[f]=h.clone());return p.children=[],this.children.forEach(function(x){var v;return v=x.clone(),v.parent=p,p.children.push(v)}),p},c.prototype.attribute=function(h,f){var p,y;if(h!=null&&(h=t(h)),r(h))for(p in h)o.call(h,p)&&(y=h[p],this.attribute(p,y));else i(f)&&(f=f.apply()),(!this.options.skipNullAttributes||f!=null)&&(this.attributes[h]=new n(this,h,f));return this},c.prototype.removeAttribute=function(h){var f,p,y;if(h==null)throw new Error("Missing attribute name. "+this.debugInfo());if(h=t(h),Array.isArray(h))for(p=0,y=h.length;p<y;p++)f=h[p],delete this.attributes[f];else delete this.attributes[h];return this},c.prototype.toString=function(h){return this.options.writer.set(h).element(this)},c.prototype.att=function(h,f){return this.attribute(h,f)},c.prototype.a=function(h,f){return this.attribute(h,f)},c})(e)}).call(u2e)),RS.exports}var kS={exports:{}},h2e=kS.exports,yH;function kI(){return yH||(yH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),kS.exports=(function(i){e(r,i);function r(s,a){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.text=this.stringify.cdata(a)}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return this.options.writer.set(s).cdata(this)},r})(n)}).call(h2e)),kS.exports}var MS={exports:{}},d2e=MS.exports,vH;function MI(){return vH||(vH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),MS.exports=(function(i){e(r,i);function r(s,a){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing comment text. "+this.debugInfo());this.text=this.stringify.comment(a)}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return this.options.writer.set(s).comment(this)},r})(n)}).call(d2e)),MS.exports}var FS={exports:{}},f2e=FS.exports,_H;function FI(){return _H||(_H=1,(function(){var n,e,t=function(r,s){for(var a in s)i.call(s,a)&&(r[a]=s[a]);function o(){this.constructor=r}return o.prototype=s.prototype,r.prototype=new o,r.__super__=s.prototype,r},i={}.hasOwnProperty;e=Ep().isObject,n=Ba(),FS.exports=(function(r){t(s,r);function s(a,o,l,c){var h;s.__super__.constructor.call(this,a),e(o)&&(h=o,o=h.version,l=h.encoding,c=h.standalone),o||(o="1.0"),this.version=this.stringify.xmlVersion(o),l!=null&&(this.encoding=this.stringify.xmlEncoding(l)),c!=null&&(this.standalone=this.stringify.xmlStandalone(c))}return s.prototype.toString=function(a){return this.options.writer.set(a).declaration(this)},s})(n)}).call(f2e)),FS.exports}var US={exports:{}},PS={exports:{}},p2e=PS.exports,xH;function UI(){return xH||(xH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),PS.exports=(function(i){e(r,i);function r(s,a,o,l,c,h){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(o==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(a));if(!l)throw new Error("Missing DTD attribute type. "+this.debugInfo(a));if(!c)throw new Error("Missing DTD attribute default. "+this.debugInfo(a));if(c.indexOf("#")!==0&&(c="#"+c),!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(a));if(h&&!c.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(a));this.elementName=this.stringify.eleName(a),this.attributeName=this.stringify.attName(o),this.attributeType=this.stringify.dtdAttType(l),this.defaultValue=this.stringify.dtdAttDefault(h),this.defaultValueType=c}return r.prototype.toString=function(s){return this.options.writer.set(s).dtdAttList(this)},r})(n)}).call(p2e)),PS.exports}var LS={exports:{}},g2e=LS.exports,bH;function PI(){return bH||(bH=1,(function(){var n,e,t=function(r,s){for(var a in s)i.call(s,a)&&(r[a]=s[a]);function o(){this.constructor=r}return o.prototype=s.prototype,r.prototype=new o,r.__super__=s.prototype,r},i={}.hasOwnProperty;e=Ep().isObject,n=Ba(),LS.exports=(function(r){t(s,r);function s(a,o,l,c){if(s.__super__.constructor.call(this,a),l==null)throw new Error("Missing DTD entity name. "+this.debugInfo(l));if(c==null)throw new Error("Missing DTD entity value. "+this.debugInfo(l));if(this.pe=!!o,this.name=this.stringify.eleName(l),!e(c))this.value=this.stringify.dtdEntityValue(c);else{if(!c.pubID&&!c.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(l));if(c.pubID&&!c.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(l));if(c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID)),c.nData!=null&&(this.nData=this.stringify.dtdNData(c.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(l))}}return s.prototype.toString=function(a){return this.options.writer.set(a).dtdEntity(this)},s})(n)}).call(g2e)),LS.exports}var OS={exports:{}},m2e=OS.exports,TH;function LI(){return TH||(TH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),OS.exports=(function(i){e(r,i);function r(s,a,o){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing DTD element name. "+this.debugInfo());o||(o="(#PCDATA)"),Array.isArray(o)&&(o="("+o.join(",")+")"),this.name=this.stringify.eleName(a),this.value=this.stringify.dtdElementValue(o)}return r.prototype.toString=function(s){return this.options.writer.set(s).dtdElement(this)},r})(n)}).call(m2e)),OS.exports}var BS={exports:{}},y2e=BS.exports,EH;function OI(){return EH||(EH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),BS.exports=(function(i){e(r,i);function r(s,a,o){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing DTD notation name. "+this.debugInfo(a));if(!o.pubID&&!o.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(a));this.name=this.stringify.eleName(a),o.pubID!=null&&(this.pubID=this.stringify.dtdPubID(o.pubID)),o.sysID!=null&&(this.sysID=this.stringify.dtdSysID(o.sysID))}return r.prototype.toString=function(s){return this.options.writer.set(s).dtdNotation(this)},r})(n)}).call(y2e)),BS.exports}var v2e=US.exports,wH;function BI(){return wH||(wH=1,(function(){var n,e,t,i,r,s,a=function(l,c){for(var h in c)o.call(c,h)&&(l[h]=c[h]);function f(){this.constructor=l}return f.prototype=c.prototype,l.prototype=new f,l.__super__=c.prototype,l},o={}.hasOwnProperty;s=Ep().isObject,r=Ba(),n=UI(),t=PI(),e=LI(),i=OI(),US.exports=(function(l){a(c,l);function c(h,f,p){var y,x;c.__super__.constructor.call(this,h),this.name="!DOCTYPE",this.documentObject=h,s(f)&&(y=f,f=y.pubID,p=y.sysID),p==null&&(x=[f,p],p=x[0],f=x[1]),f!=null&&(this.pubID=this.stringify.dtdPubID(f)),p!=null&&(this.sysID=this.stringify.dtdSysID(p))}return c.prototype.element=function(h,f){var p;return p=new e(this,h,f),this.children.push(p),this},c.prototype.attList=function(h,f,p,y,x){var v;return v=new n(this,h,f,p,y,x),this.children.push(v),this},c.prototype.entity=function(h,f){var p;return p=new t(this,!1,h,f),this.children.push(p),this},c.prototype.pEntity=function(h,f){var p;return p=new t(this,!0,h,f),this.children.push(p),this},c.prototype.notation=function(h,f){var p;return p=new i(this,h,f),this.children.push(p),this},c.prototype.toString=function(h){return this.options.writer.set(h).docType(this)},c.prototype.ele=function(h,f){return this.element(h,f)},c.prototype.att=function(h,f,p,y,x){return this.attList(h,f,p,y,x)},c.prototype.ent=function(h,f){return this.entity(h,f)},c.prototype.pent=function(h,f){return this.pEntity(h,f)},c.prototype.not=function(h,f){return this.notation(h,f)},c.prototype.up=function(){return this.root()||this.documentObject},c})(r)}).call(v2e)),US.exports}var VS={exports:{}},_2e=VS.exports,AH;function VI(){return AH||(AH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),VS.exports=(function(i){e(r,i);function r(s,a){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing raw text. "+this.debugInfo());this.value=this.stringify.raw(a)}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return this.options.writer.set(s).raw(this)},r})(n)}).call(_2e)),VS.exports}var WS={exports:{}},x2e=WS.exports,SH;function WI(){return SH||(SH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),WS.exports=(function(i){e(r,i);function r(s,a){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing element text. "+this.debugInfo());this.value=this.stringify.eleText(a)}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return this.options.writer.set(s).text(this)},r})(n)}).call(x2e)),WS.exports}var HS={exports:{}},b2e=HS.exports,DH;function HI(){return DH||(DH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),HS.exports=(function(i){e(r,i);function r(s,a,o){if(r.__super__.constructor.call(this,s),a==null)throw new Error("Missing instruction target. "+this.debugInfo());this.target=this.stringify.insTarget(a),o&&(this.value=this.stringify.insValue(o))}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return this.options.writer.set(s).processingInstruction(this)},r})(n)}).call(b2e)),HS.exports}var zS={exports:{}},T2e=zS.exports,CH;function gL(){return CH||(CH=1,(function(){var n,e=function(i,r){for(var s in r)t.call(r,s)&&(i[s]=r[s]);function a(){this.constructor=i}return a.prototype=r.prototype,i.prototype=new a,i.__super__=r.prototype,i},t={}.hasOwnProperty;n=Ba(),zS.exports=(function(i){e(r,i);function r(s){r.__super__.constructor.call(this,s),this.isDummy=!0}return r.prototype.clone=function(){return Object.create(this)},r.prototype.toString=function(s){return""},r})(n)}).call(T2e)),zS.exports}var E2e=IS.exports,IH;function Ba(){return IH||(IH=1,(function(){var n,e,t,i,r,s,a,o,l,c,h,f,p,y,x={}.hasOwnProperty;y=Ep(),p=y.isObject,f=y.isFunction,h=y.isEmpty,c=y.getValue,s=null,n=null,e=null,t=null,i=null,o=null,l=null,a=null,r=null,IS.exports=(function(){function v(_){this.parent=_,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],s||(s=NI(),n=kI(),e=MI(),t=FI(),i=BI(),o=VI(),l=WI(),a=HI(),r=gL())}return v.prototype.element=function(_,E,w){var A,N,k,F,C,M,R,L,H,P,O;if(M=null,E===null&&w==null&&(H=[{},null],E=H[0],w=H[1]),E==null&&(E={}),E=c(E),p(E)||(P=[E,w],w=P[0],E=P[1]),_!=null&&(_=c(_)),Array.isArray(_))for(k=0,R=_.length;k<R;k++)N=_[k],M=this.element(N);else if(f(_))M=this.element(_.apply());else if(p(_)){for(C in _)if(x.call(_,C))if(O=_[C],f(O)&&(O=O.apply()),p(O)&&h(O)&&(O=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&C.indexOf(this.stringify.convertAttKey)===0)M=this.attribute(C.substr(this.stringify.convertAttKey.length),O);else if(!this.options.separateArrayItems&&Array.isArray(O))for(F=0,L=O.length;F<L;F++)N=O[F],A={},A[C]=N,M=this.element(A);else p(O)?(M=this.element(C),M.element(O)):M=this.element(C,O)}else this.options.skipNullNodes&&w===null?M=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&_.indexOf(this.stringify.convertTextKey)===0?M=this.text(w):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&_.indexOf(this.stringify.convertCDataKey)===0?M=this.cdata(w):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&_.indexOf(this.stringify.convertCommentKey)===0?M=this.comment(w):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&_.indexOf(this.stringify.convertRawKey)===0?M=this.raw(w):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&_.indexOf(this.stringify.convertPIKey)===0?M=this.instruction(_.substr(this.stringify.convertPIKey.length),w):M=this.node(_,E,w);if(M==null)throw new Error("Could not create any elements with: "+_+". "+this.debugInfo());return M},v.prototype.insertBefore=function(_,E,w){var A,N,k;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(_));return N=this.parent.children.indexOf(this),k=this.parent.children.splice(N),A=this.parent.element(_,E,w),Array.prototype.push.apply(this.parent.children,k),A},v.prototype.insertAfter=function(_,E,w){var A,N,k;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(_));return N=this.parent.children.indexOf(this),k=this.parent.children.splice(N+1),A=this.parent.element(_,E,w),Array.prototype.push.apply(this.parent.children,k),A},v.prototype.remove=function(){var _;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return _=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[_,_-_+1].concat([])),this.parent},v.prototype.node=function(_,E,w){var A,N;return _!=null&&(_=c(_)),E||(E={}),E=c(E),p(E)||(N=[E,w],w=N[0],E=N[1]),A=new s(this,_,E),w!=null&&A.text(w),this.children.push(A),A},v.prototype.text=function(_){var E;return E=new l(this,_),this.children.push(E),this},v.prototype.cdata=function(_){var E;return E=new n(this,_),this.children.push(E),this},v.prototype.comment=function(_){var E;return E=new e(this,_),this.children.push(E),this},v.prototype.commentBefore=function(_){var E,w;return E=this.parent.children.indexOf(this),w=this.parent.children.splice(E),this.parent.comment(_),Array.prototype.push.apply(this.parent.children,w),this},v.prototype.commentAfter=function(_){var E,w;return E=this.parent.children.indexOf(this),w=this.parent.children.splice(E+1),this.parent.comment(_),Array.prototype.push.apply(this.parent.children,w),this},v.prototype.raw=function(_){var E;return E=new o(this,_),this.children.push(E),this},v.prototype.dummy=function(){var _;return _=new r(this),this.children.push(_),_},v.prototype.instruction=function(_,E){var w,A,N,k,F;if(_!=null&&(_=c(_)),E!=null&&(E=c(E)),Array.isArray(_))for(k=0,F=_.length;k<F;k++)w=_[k],this.instruction(w);else if(p(_))for(w in _)x.call(_,w)&&(A=_[w],this.instruction(w,A));else f(E)&&(E=E.apply()),N=new a(this,_,E),this.children.push(N);return this},v.prototype.instructionBefore=function(_,E){var w,A;return w=this.parent.children.indexOf(this),A=this.parent.children.splice(w),this.parent.instruction(_,E),Array.prototype.push.apply(this.parent.children,A),this},v.prototype.instructionAfter=function(_,E){var w,A;return w=this.parent.children.indexOf(this),A=this.parent.children.splice(w+1),this.parent.instruction(_,E),Array.prototype.push.apply(this.parent.children,A),this},v.prototype.declaration=function(_,E,w){var A,N;return A=this.document(),N=new t(A,_,E,w),A.children[0]instanceof t?A.children[0]=N:A.children.unshift(N),A.root()||A},v.prototype.doctype=function(_,E){var w,A,N,k,F,C,M,R,L,H;for(A=this.document(),N=new i(A,_,E),L=A.children,k=F=0,M=L.length;F<M;k=++F)if(w=L[k],w instanceof i)return A.children[k]=N,N;for(H=A.children,k=C=0,R=H.length;C<R;k=++C)if(w=H[k],w.isRoot)return A.children.splice(k,0,N),N;return A.children.push(N),N},v.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},v.prototype.root=function(){var _;for(_=this;_;){if(_.isDocument)return _.rootObject;if(_.isRoot)return _;_=_.parent}},v.prototype.document=function(){var _;for(_=this;_;){if(_.isDocument)return _;_=_.parent}},v.prototype.end=function(_){return this.document().end(_)},v.prototype.prev=function(){var _;for(_=this.parent.children.indexOf(this);_>0&&this.parent.children[_-1].isDummy;)_=_-1;if(_<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[_-1]},v.prototype.next=function(){var _;for(_=this.parent.children.indexOf(this);_<this.parent.children.length-1&&this.parent.children[_+1].isDummy;)_=_+1;if(_===-1||_===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[_+1]},v.prototype.importDocument=function(_){var E;return E=_.root().clone(),E.parent=this,E.isRoot=!1,this.children.push(E),this},v.prototype.debugInfo=function(_){var E,w;return _=_||this.name,_==null&&!((E=this.parent)!=null&&E.name)?"":_==null?"parent: <"+this.parent.name+">":(w=this.parent)!=null&&w.name?"node: <"+_+">, parent: <"+this.parent.name+">":"node: <"+_+">"},v.prototype.ele=function(_,E,w){return this.element(_,E,w)},v.prototype.nod=function(_,E,w){return this.node(_,E,w)},v.prototype.txt=function(_){return this.text(_)},v.prototype.dat=function(_){return this.cdata(_)},v.prototype.com=function(_){return this.comment(_)},v.prototype.ins=function(_,E){return this.instruction(_,E)},v.prototype.doc=function(){return this.document()},v.prototype.dec=function(_,E,w){return this.declaration(_,E,w)},v.prototype.dtd=function(_,E){return this.doctype(_,E)},v.prototype.e=function(_,E,w){return this.element(_,E,w)},v.prototype.n=function(_,E,w){return this.node(_,E,w)},v.prototype.t=function(_){return this.text(_)},v.prototype.d=function(_){return this.cdata(_)},v.prototype.c=function(_){return this.comment(_)},v.prototype.r=function(_){return this.raw(_)},v.prototype.i=function(_,E){return this.instruction(_,E)},v.prototype.u=function(){return this.up()},v.prototype.importXMLBuilder=function(_){return this.importDocument(_)},v})()}).call(E2e)),IS.exports}var GS={exports:{}},w2e=GS.exports,RH;function sZ(){return RH||(RH=1,(function(){var n=function(t,i){return function(){return t.apply(i,arguments)}},e={}.hasOwnProperty;GS.exports=(function(){function t(i){this.assertLegalChar=n(this.assertLegalChar,this);var r,s,a;i||(i={}),this.noDoubleEncoding=i.noDoubleEncoding,s=i.stringify||{};for(r in s)e.call(s,r)&&(a=s[r],this[r]=a)}return t.prototype.eleName=function(i){return i=""+i||"",this.assertLegalChar(i)},t.prototype.eleText=function(i){return i=""+i||"",this.assertLegalChar(this.elEscape(i))},t.prototype.cdata=function(i){return i=""+i||"",i=i.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(i)},t.prototype.comment=function(i){if(i=""+i||"",i.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+i);return this.assertLegalChar(i)},t.prototype.raw=function(i){return""+i||""},t.prototype.attName=function(i){return i=""+i||""},t.prototype.attValue=function(i){return i=""+i||"",this.attEscape(i)},t.prototype.insTarget=function(i){return""+i||""},t.prototype.insValue=function(i){if(i=""+i||"",i.match(/\?>/))throw new Error("Invalid processing instruction value: "+i);return i},t.prototype.xmlVersion=function(i){if(i=""+i||"",!i.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+i);return i},t.prototype.xmlEncoding=function(i){if(i=""+i||"",!i.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+i);return i},t.prototype.xmlStandalone=function(i){return i?"yes":"no"},t.prototype.dtdPubID=function(i){return""+i||""},t.prototype.dtdSysID=function(i){return""+i||""},t.prototype.dtdElementValue=function(i){return""+i||""},t.prototype.dtdAttType=function(i){return""+i||""},t.prototype.dtdAttDefault=function(i){return i!=null?""+i||"":i},t.prototype.dtdEntityValue=function(i){return""+i||""},t.prototype.dtdNData=function(i){return""+i||""},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(i){var r;if(r=i.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),r)throw new Error("Invalid character in string: "+i+" at index "+r.index);return i},t.prototype.elEscape=function(i){var r;return r=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(r,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},t.prototype.attEscape=function(i){var r;return r=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(r,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},t})()}).call(w2e)),GS.exports}var qS={exports:{}},$S={exports:{}},A2e=$S.exports,NH;function aZ(){return NH||(NH=1,(function(){var n={}.hasOwnProperty;$S.exports=(function(){function e(t){var i,r,s,a,o,l,c,h,f;t||(t={}),this.pretty=t.pretty||!1,this.allowEmpty=(r=t.allowEmpty)!=null?r:!1,this.pretty?(this.indent=(s=t.indent)!=null?s:"  ",this.newline=(a=t.newline)!=null?a:`
`,this.offset=(o=t.offset)!=null?o:0,this.dontprettytextnodes=(l=t.dontprettytextnodes)!=null?l:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(c=t.spacebeforeslash)!=null?c:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,h=t.writer||{};for(i in h)n.call(h,i)&&(f=h[i],this[i]=f)}return e.prototype.set=function(t){var i,r,s;t||(t={}),"pretty"in t&&(this.pretty=t.pretty),"allowEmpty"in t&&(this.allowEmpty=t.allowEmpty),this.pretty?(this.indent="indent"in t?t.indent:"  ",this.newline="newline"in t?t.newline:`
`,this.offset="offset"in t?t.offset:0,this.dontprettytextnodes="dontprettytextnodes"in t?t.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in t?t.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=t.writer||{};for(i in r)n.call(r,i)&&(s=r[i],this[i]=s);return this},e.prototype.space=function(t){var i;return this.pretty?(i=(t||0)+this.offset+1,i>0?new Array(i).join(this.indent):""):""},e})()}).call(A2e)),$S.exports}var S2e=qS.exports,kH;function mL(){return kH||(kH=1,(function(){var n,e,t,i,r,s,a,o,l,c,h,f,p,y,x=function(_,E){for(var w in E)v.call(E,w)&&(_[w]=E[w]);function A(){this.constructor=_}return A.prototype=E.prototype,_.prototype=new A,_.__super__=E.prototype,_},v={}.hasOwnProperty;a=FI(),o=BI(),n=kI(),e=MI(),c=NI(),f=VI(),p=WI(),h=HI(),l=gL(),t=UI(),i=LI(),r=PI(),s=OI(),y=aZ(),qS.exports=(function(_){x(E,_);function E(w){E.__super__.constructor.call(this,w)}return E.prototype.document=function(w){var A,N,k,F,C;for(this.textispresent=!1,F="",C=w.children,N=0,k=C.length;N<k;N++)A=C[N],!(A instanceof l)&&(F+=(function(){switch(!1){case!(A instanceof a):return this.declaration(A);case!(A instanceof o):return this.docType(A);case!(A instanceof e):return this.comment(A);case!(A instanceof h):return this.processingInstruction(A);default:return this.element(A,0)}}).call(this));return this.pretty&&F.slice(-this.newline.length)===this.newline&&(F=F.slice(0,-this.newline.length)),F},E.prototype.attribute=function(w){return" "+w.name+'="'+w.value+'"'},E.prototype.cdata=function(w,A){return this.space(A)+"<![CDATA["+w.text+"]]>"+this.newline},E.prototype.comment=function(w,A){return this.space(A)+"<!-- "+w.text+" -->"+this.newline},E.prototype.declaration=function(w,A){var N;return N=this.space(A),N+='<?xml version="'+w.version+'"',w.encoding!=null&&(N+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(N+=' standalone="'+w.standalone+'"'),N+=this.spacebeforeslash+"?>",N+=this.newline,N},E.prototype.docType=function(w,A){var N,k,F,C,M;if(A||(A=0),C=this.space(A),C+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?C+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(C+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(C+=" [",C+=this.newline,M=w.children,k=0,F=M.length;k<F;k++)N=M[k],C+=(function(){switch(!1){case!(N instanceof t):return this.dtdAttList(N,A+1);case!(N instanceof i):return this.dtdElement(N,A+1);case!(N instanceof r):return this.dtdEntity(N,A+1);case!(N instanceof s):return this.dtdNotation(N,A+1);case!(N instanceof n):return this.cdata(N,A+1);case!(N instanceof e):return this.comment(N,A+1);case!(N instanceof h):return this.processingInstruction(N,A+1);default:throw new Error("Unknown DTD node type: "+N.constructor.name)}}).call(this);C+="]"}return C+=this.spacebeforeslash+">",C+=this.newline,C},E.prototype.element=function(w,A){var N,k,F,C,M,R,L,H,P,O,B,re,q;A||(A=0),q=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),re=this.space(A),H="",H+=re+"<"+w.name,P=w.attributes;for(L in P)v.call(P,L)&&(N=P[L],H+=this.attribute(N));if(w.children.length===0||w.children.every(function(X){return X.value===""}))this.allowEmpty?H+="></"+w.name+">"+this.newline:H+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&w.children.length===1&&w.children[0].value!=null)H+=">",H+=w.children[0].value,H+="</"+w.name+">"+this.newline;else{if(this.dontprettytextnodes){for(O=w.children,F=0,M=O.length;F<M;F++)if(k=O[F],k.value!=null){this.textispresent++,q=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,re=this.space(A)),H+=">"+this.newline,B=w.children,C=0,R=B.length;C<R;C++)k=B[C],H+=(function(){switch(!1){case!(k instanceof n):return this.cdata(k,A+1);case!(k instanceof e):return this.comment(k,A+1);case!(k instanceof c):return this.element(k,A+1);case!(k instanceof f):return this.raw(k,A+1);case!(k instanceof p):return this.text(k,A+1);case!(k instanceof h):return this.processingInstruction(k,A+1);case!(k instanceof l):return"";default:throw new Error("Unknown XML node type: "+k.constructor.name)}}).call(this);q&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),H+=re+"</"+w.name+">"+this.newline}return H},E.prototype.processingInstruction=function(w,A){var N;return N=this.space(A)+"<?"+w.target,w.value&&(N+=" "+w.value),N+=this.spacebeforeslash+"?>"+this.newline,N},E.prototype.raw=function(w,A){return this.space(A)+w.value+this.newline},E.prototype.text=function(w,A){return this.space(A)+w.value+this.newline},E.prototype.dtdAttList=function(w,A){var N;return N=this.space(A)+"<!ATTLIST "+w.elementName+" "+w.attributeName+" "+w.attributeType,w.defaultValueType!=="#DEFAULT"&&(N+=" "+w.defaultValueType),w.defaultValue&&(N+=' "'+w.defaultValue+'"'),N+=this.spacebeforeslash+">"+this.newline,N},E.prototype.dtdElement=function(w,A){return this.space(A)+"<!ELEMENT "+w.name+" "+w.value+this.spacebeforeslash+">"+this.newline},E.prototype.dtdEntity=function(w,A){var N;return N=this.space(A)+"<!ENTITY",w.pe&&(N+=" %"),N+=" "+w.name,w.value?N+=' "'+w.value+'"':(w.pubID&&w.sysID?N+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(N+=' SYSTEM "'+w.sysID+'"'),w.nData&&(N+=" NDATA "+w.nData)),N+=this.spacebeforeslash+">"+this.newline,N},E.prototype.dtdNotation=function(w,A){var N;return N=this.space(A)+"<!NOTATION "+w.name,w.pubID&&w.sysID?N+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.pubID?N+=' PUBLIC "'+w.pubID+'"':w.sysID&&(N+=' SYSTEM "'+w.sysID+'"'),N+=this.spacebeforeslash+">"+this.newline,N},E.prototype.openNode=function(w,A){var N,k,F,C;if(A||(A=0),w instanceof c){F=this.space(A)+"<"+w.name,C=w.attributes;for(k in C)v.call(C,k)&&(N=C[k],F+=this.attribute(N));return F+=(w.children?">":"/>")+this.newline,F}else return F=this.space(A)+"<!DOCTYPE "+w.rootNodeName,w.pubID&&w.sysID?F+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(F+=' SYSTEM "'+w.sysID+'"'),F+=(w.children?" [":">")+this.newline,F},E.prototype.closeNode=function(w,A){switch(A||(A=0),!1){case!(w instanceof c):return this.space(A)+"</"+w.name+">"+this.newline;case!(w instanceof o):return this.space(A)+"]>"+this.newline}},E})(y)}).call(S2e)),qS.exports}var D2e=CS.exports,MH;function C2e(){return MH||(MH=1,(function(){var n,e,t,i,r=function(a,o){for(var l in o)s.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},s={}.hasOwnProperty;i=Ep().isPlainObject,n=Ba(),t=sZ(),e=mL(),CS.exports=(function(a){r(o,a);function o(l){o.__super__.constructor.call(this,null),this.name="?xml",l||(l={}),l.writer||(l.writer=new e),this.options=l,this.stringify=new t(l),this.isDocument=!0}return o.prototype.end=function(l){var c;return l?i(l)&&(c=l,l=this.options.writer.set(c)):l=this.options.writer,l.document(this)},o.prototype.toString=function(l){return this.options.writer.set(l).document(this)},o})(n)}).call(D2e)),CS.exports}var jS={exports:{}},I2e=jS.exports,FH;function R2e(){return FH||(FH=1,(function(){var n,e,t,i,r,s,a,o,l,c,h,f,p,y,x,v,_,E,w,A,N={}.hasOwnProperty;A=Ep(),E=A.isObject,_=A.isFunction,w=A.isPlainObject,v=A.getValue,c=NI(),e=kI(),t=MI(),f=VI(),x=WI(),h=HI(),o=FI(),l=BI(),i=UI(),s=PI(),r=LI(),a=OI(),n=rZ(),y=sZ(),p=mL(),jS.exports=(function(){function k(F,C,M){var R;this.name="?xml",F||(F={}),F.writer?w(F.writer)&&(R=F.writer,F.writer=new p(R)):F.writer=new p(F),this.options=F,this.writer=F.writer,this.stringify=new y(F),this.onDataCallback=C||function(){},this.onEndCallback=M||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return k.prototype.node=function(F,C,M){var R,L;if(F==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(F));return this.openCurrent(),F=v(F),C===null&&M==null&&(R=[{},null],C=R[0],M=R[1]),C==null&&(C={}),C=v(C),E(C)||(L=[C,M],M=L[0],C=L[1]),this.currentNode=new c(this,F,C),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,M!=null&&this.text(M),this},k.prototype.element=function(F,C,M){return this.currentNode&&this.currentNode instanceof l?this.dtdElement.apply(this,arguments):this.node(F,C,M)},k.prototype.attribute=function(F,C){var M,R;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(F));if(F!=null&&(F=v(F)),E(F))for(M in F)N.call(F,M)&&(R=F[M],this.attribute(M,R));else _(C)&&(C=C.apply()),(!this.options.skipNullAttributes||C!=null)&&(this.currentNode.attributes[F]=new n(this,F,C));return this},k.prototype.text=function(F){var C;return this.openCurrent(),C=new x(this,F),this.onData(this.writer.text(C,this.currentLevel+1),this.currentLevel+1),this},k.prototype.cdata=function(F){var C;return this.openCurrent(),C=new e(this,F),this.onData(this.writer.cdata(C,this.currentLevel+1),this.currentLevel+1),this},k.prototype.comment=function(F){var C;return this.openCurrent(),C=new t(this,F),this.onData(this.writer.comment(C,this.currentLevel+1),this.currentLevel+1),this},k.prototype.raw=function(F){var C;return this.openCurrent(),C=new f(this,F),this.onData(this.writer.raw(C,this.currentLevel+1),this.currentLevel+1),this},k.prototype.instruction=function(F,C){var M,R,L,H,P;if(this.openCurrent(),F!=null&&(F=v(F)),C!=null&&(C=v(C)),Array.isArray(F))for(M=0,H=F.length;M<H;M++)R=F[M],this.instruction(R);else if(E(F))for(R in F)N.call(F,R)&&(L=F[R],this.instruction(R,L));else _(C)&&(C=C.apply()),P=new h(this,F,C),this.onData(this.writer.processingInstruction(P,this.currentLevel+1),this.currentLevel+1);return this},k.prototype.declaration=function(F,C,M){var R;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return R=new o(this,F,C,M),this.onData(this.writer.declaration(R,this.currentLevel+1),this.currentLevel+1),this},k.prototype.doctype=function(F,C,M){if(this.openCurrent(),F==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new l(this,C,M),this.currentNode.rootNodeName=F,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},k.prototype.dtdElement=function(F,C){var M;return this.openCurrent(),M=new r(this,F,C),this.onData(this.writer.dtdElement(M,this.currentLevel+1),this.currentLevel+1),this},k.prototype.attList=function(F,C,M,R,L){var H;return this.openCurrent(),H=new i(this,F,C,M,R,L),this.onData(this.writer.dtdAttList(H,this.currentLevel+1),this.currentLevel+1),this},k.prototype.entity=function(F,C){var M;return this.openCurrent(),M=new s(this,!1,F,C),this.onData(this.writer.dtdEntity(M,this.currentLevel+1),this.currentLevel+1),this},k.prototype.pEntity=function(F,C){var M;return this.openCurrent(),M=new s(this,!0,F,C),this.onData(this.writer.dtdEntity(M,this.currentLevel+1),this.currentLevel+1),this},k.prototype.notation=function(F,C){var M;return this.openCurrent(),M=new a(this,F,C),this.onData(this.writer.dtdNotation(M,this.currentLevel+1),this.currentLevel+1),this},k.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},k.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},k.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},k.prototype.openNode=function(F){if(!F.isOpen)return!this.root&&this.currentLevel===0&&F instanceof c&&(this.root=F),this.onData(this.writer.openNode(F,this.currentLevel),this.currentLevel),F.isOpen=!0},k.prototype.closeNode=function(F){if(!F.isClosed)return this.onData(this.writer.closeNode(F,this.currentLevel),this.currentLevel),F.isClosed=!0},k.prototype.onData=function(F,C){return this.documentStarted=!0,this.onDataCallback(F,C+1)},k.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},k.prototype.debugInfo=function(F){return F==null?"":"node: <"+F+">"},k.prototype.ele=function(){return this.element.apply(this,arguments)},k.prototype.nod=function(F,C,M){return this.node(F,C,M)},k.prototype.txt=function(F){return this.text(F)},k.prototype.dat=function(F){return this.cdata(F)},k.prototype.com=function(F){return this.comment(F)},k.prototype.ins=function(F,C){return this.instruction(F,C)},k.prototype.dec=function(F,C,M){return this.declaration(F,C,M)},k.prototype.dtd=function(F,C,M){return this.doctype(F,C,M)},k.prototype.e=function(F,C,M){return this.element(F,C,M)},k.prototype.n=function(F,C,M){return this.node(F,C,M)},k.prototype.t=function(F){return this.text(F)},k.prototype.d=function(F){return this.cdata(F)},k.prototype.c=function(F){return this.comment(F)},k.prototype.r=function(F){return this.raw(F)},k.prototype.i=function(F,C){return this.instruction(F,C)},k.prototype.att=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},k.prototype.a=function(){return this.currentNode&&this.currentNode instanceof l?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},k.prototype.ent=function(F,C){return this.entity(F,C)},k.prototype.pent=function(F,C){return this.pEntity(F,C)},k.prototype.not=function(F,C){return this.notation(F,C)},k})()}).call(I2e)),jS.exports}var XS={exports:{}},N2e=XS.exports,UH;function k2e(){return UH||(UH=1,(function(){var n,e,t,i,r,s,a,o,l,c,h,f,p,y,x=function(_,E){for(var w in E)v.call(E,w)&&(_[w]=E[w]);function A(){this.constructor=_}return A.prototype=E.prototype,_.prototype=new A,_.__super__=E.prototype,_},v={}.hasOwnProperty;a=FI(),o=BI(),n=kI(),e=MI(),c=NI(),f=VI(),p=WI(),h=HI(),l=gL(),t=UI(),i=LI(),r=PI(),s=OI(),y=aZ(),XS.exports=(function(_){x(E,_);function E(w,A){E.__super__.constructor.call(this,A),this.stream=w}return E.prototype.document=function(w){var A,N,k,F,C,M,R,L;for(M=w.children,N=0,F=M.length;N<F;N++)A=M[N],A.isLastRootNode=!1;for(w.children[w.children.length-1].isLastRootNode=!0,R=w.children,L=[],k=0,C=R.length;k<C;k++)if(A=R[k],!(A instanceof l))switch(!1){case!(A instanceof a):L.push(this.declaration(A));break;case!(A instanceof o):L.push(this.docType(A));break;case!(A instanceof e):L.push(this.comment(A));break;case!(A instanceof h):L.push(this.processingInstruction(A));break;default:L.push(this.element(A))}return L},E.prototype.attribute=function(w){return this.stream.write(" "+w.name+'="'+w.value+'"')},E.prototype.cdata=function(w,A){return this.stream.write(this.space(A)+"<![CDATA["+w.text+"]]>"+this.endline(w))},E.prototype.comment=function(w,A){return this.stream.write(this.space(A)+"<!-- "+w.text+" -->"+this.endline(w))},E.prototype.declaration=function(w,A){return this.stream.write(this.space(A)),this.stream.write('<?xml version="'+w.version+'"'),w.encoding!=null&&this.stream.write(' encoding="'+w.encoding+'"'),w.standalone!=null&&this.stream.write(' standalone="'+w.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(w))},E.prototype.docType=function(w,A){var N,k,F,C;if(A||(A=0),this.stream.write(this.space(A)),this.stream.write("<!DOCTYPE "+w.root().name),w.pubID&&w.sysID?this.stream.write(' PUBLIC "'+w.pubID+'" "'+w.sysID+'"'):w.sysID&&this.stream.write(' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(w)),C=w.children,k=0,F=C.length;k<F;k++)switch(N=C[k],!1){case!(N instanceof t):this.dtdAttList(N,A+1);break;case!(N instanceof i):this.dtdElement(N,A+1);break;case!(N instanceof r):this.dtdEntity(N,A+1);break;case!(N instanceof s):this.dtdNotation(N,A+1);break;case!(N instanceof n):this.cdata(N,A+1);break;case!(N instanceof e):this.comment(N,A+1);break;case!(N instanceof h):this.processingInstruction(N,A+1);break;default:throw new Error("Unknown DTD node type: "+N.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(w))},E.prototype.element=function(w,A){var N,k,F,C,M,R,L,H;A||(A=0),H=this.space(A),this.stream.write(H+"<"+w.name),R=w.attributes;for(M in R)v.call(R,M)&&(N=R[M],this.attribute(N));if(w.children.length===0||w.children.every(function(P){return P.value===""}))this.allowEmpty?this.stream.write("></"+w.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&w.children.length===1&&w.children[0].value!=null)this.stream.write(">"),this.stream.write(w.children[0].value),this.stream.write("</"+w.name+">");else{for(this.stream.write(">"+this.newline),L=w.children,F=0,C=L.length;F<C;F++)switch(k=L[F],!1){case!(k instanceof n):this.cdata(k,A+1);break;case!(k instanceof e):this.comment(k,A+1);break;case!(k instanceof c):this.element(k,A+1);break;case!(k instanceof f):this.raw(k,A+1);break;case!(k instanceof p):this.text(k,A+1);break;case!(k instanceof h):this.processingInstruction(k,A+1);break;case!(k instanceof l):break;default:throw new Error("Unknown XML node type: "+k.constructor.name)}this.stream.write(H+"</"+w.name+">")}return this.stream.write(this.endline(w))},E.prototype.processingInstruction=function(w,A){return this.stream.write(this.space(A)+"<?"+w.target),w.value&&this.stream.write(" "+w.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(w))},E.prototype.raw=function(w,A){return this.stream.write(this.space(A)+w.value+this.endline(w))},E.prototype.text=function(w,A){return this.stream.write(this.space(A)+w.value+this.endline(w))},E.prototype.dtdAttList=function(w,A){return this.stream.write(this.space(A)+"<!ATTLIST "+w.elementName+" "+w.attributeName+" "+w.attributeType),w.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+w.defaultValueType),w.defaultValue&&this.stream.write(' "'+w.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(w))},E.prototype.dtdElement=function(w,A){return this.stream.write(this.space(A)+"<!ELEMENT "+w.name+" "+w.value),this.stream.write(this.spacebeforeslash+">"+this.endline(w))},E.prototype.dtdEntity=function(w,A){return this.stream.write(this.space(A)+"<!ENTITY"),w.pe&&this.stream.write(" %"),this.stream.write(" "+w.name),w.value?this.stream.write(' "'+w.value+'"'):(w.pubID&&w.sysID?this.stream.write(' PUBLIC "'+w.pubID+'" "'+w.sysID+'"'):w.sysID&&this.stream.write(' SYSTEM "'+w.sysID+'"'),w.nData&&this.stream.write(" NDATA "+w.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(w))},E.prototype.dtdNotation=function(w,A){return this.stream.write(this.space(A)+"<!NOTATION "+w.name),w.pubID&&w.sysID?this.stream.write(' PUBLIC "'+w.pubID+'" "'+w.sysID+'"'):w.pubID?this.stream.write(' PUBLIC "'+w.pubID+'"'):w.sysID&&this.stream.write(' SYSTEM "'+w.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(w))},E.prototype.endline=function(w){return w.isLastRootNode?"":this.newline},E})(y)}).call(N2e)),XS.exports}var PH;function M2e(){return PH||(PH=1,(function(){var n,e,t,i,r,s,a;a=Ep(),r=a.assign,s=a.isFunction,n=C2e(),e=R2e(),i=mL(),t=k2e(),eg.create=function(o,l,c,h){var f,p;if(o==null)throw new Error("Root element needs a name.");return h=r({},l,c,h),f=new n(h),p=f.element(o),h.headless||(f.declaration(h),(h.pubID!=null||h.sysID!=null)&&f.doctype(h)),p},eg.begin=function(o,l,c){var h;return s(o)&&(h=[o,l],l=h[0],c=h[1],o={}),l?new e(o,l,c):new n(o)},eg.stringWriter=function(o){return new i(o)},eg.streamWriter=function(o,l){return new t(o,l)}}).call(eg)),eg}var LH;function F2e(){if(LH)return L3;LH=1;var n=sr,e=M2e();L3.writeString=t;function t(r,s){var a=n.invert(s),o={element:c,text:i};function l(p,y){return o[y.type](p,y)}function c(p,y){var x=p.element(h(y.name),y.attributes);y.children.forEach(function(v){l(x,v)})}function h(p){var y=/^\{(.*)\}(.*)$/.exec(p);if(y){var x=a[y[1]];return x+(x===""?"":":")+y[2]}else return p}function f(p){var y=e.create(h(p.name),{version:"1.0",encoding:"UTF-8",standalone:!0});return n.forEach(s,function(x,v){var _="xmlns"+(v===""?"":":"+v);y.attribute(_,x)}),p.children.forEach(function(x){l(y,x)}),y.end()}return f(r)}function i(r,s){r.text(s.value)}return L3}var OH;function yL(){if(OH)return Fd;OH=1;var n=iZ();return Fd.Element=n.Element,Fd.element=n.element,Fd.emptyElement=n.emptyElement,Fd.text=n.text,Fd.readString=l2e().readString,Fd.writeString=F2e().writeString,Fd}var BH;function U2e(){if(BH)return uA;BH=1;var n=sr,e=Tp(),t=yL();uA.read=r,uA.readXmlFromZipFile=s;var i={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function r(l){return t.readString(l,i).then(function(c){return o(c)[0]})}function s(l,c){return l.exists(c)?l.read(c,"utf-8").then(a).then(r):e.resolve(null)}function a(l){return l.replace(/^\uFEFF/g,"")}function o(l){return l.type==="element"?l.name==="mc:AlternateContent"?l.firstOrEmpty("mc:Fallback").children:(l.children=n.flatten(l.children.map(o,!0)),[l]):[l]}return uA}var fA={},Il={},pA={},VH;function P2e(){if(VH)return pA;VH=1,Object.defineProperty(pA,"__esModule",{value:!0});var n=[{"Typeface name":"Symbol","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Symbol","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"33","Unicode hex":"21"},{"Typeface name":"Symbol","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"8704","Unicode hex":"2200"},{"Typeface name":"Symbol","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"35","Unicode hex":"23"},{"Typeface name":"Symbol","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"8707","Unicode hex":"2203"},{"Typeface name":"Symbol","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"37","Unicode hex":"25"},{"Typeface name":"Symbol","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"38","Unicode hex":"26"},{"Typeface name":"Symbol","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"8717","Unicode hex":"220D"},{"Typeface name":"Symbol","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"40","Unicode hex":"28"},{"Typeface name":"Symbol","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"41","Unicode hex":"29"},{"Typeface name":"Symbol","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"42","Unicode hex":"2A"},{"Typeface name":"Symbol","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"43","Unicode hex":"2B"},{"Typeface name":"Symbol","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"44","Unicode hex":"2C"},{"Typeface name":"Symbol","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"8722","Unicode hex":"2212"},{"Typeface name":"Symbol","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"46","Unicode hex":"2E"},{"Typeface name":"Symbol","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"47","Unicode hex":"2F"},{"Typeface name":"Symbol","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"48","Unicode hex":"30"},{"Typeface name":"Symbol","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"49","Unicode hex":"31"},{"Typeface name":"Symbol","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"50","Unicode hex":"32"},{"Typeface name":"Symbol","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"51","Unicode hex":"33"},{"Typeface name":"Symbol","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"52","Unicode hex":"34"},{"Typeface name":"Symbol","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"53","Unicode hex":"35"},{"Typeface name":"Symbol","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"54","Unicode hex":"36"},{"Typeface name":"Symbol","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"55","Unicode hex":"37"},{"Typeface name":"Symbol","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"56","Unicode hex":"38"},{"Typeface name":"Symbol","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"57","Unicode hex":"39"},{"Typeface name":"Symbol","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"58","Unicode hex":"3A"},{"Typeface name":"Symbol","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"59","Unicode hex":"3B"},{"Typeface name":"Symbol","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"60","Unicode hex":"3C"},{"Typeface name":"Symbol","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"61","Unicode hex":"3D"},{"Typeface name":"Symbol","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"62","Unicode hex":"3E"},{"Typeface name":"Symbol","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"63","Unicode hex":"3F"},{"Typeface name":"Symbol","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"8773","Unicode hex":"2245"},{"Typeface name":"Symbol","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"913","Unicode hex":"391"},{"Typeface name":"Symbol","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"914","Unicode hex":"392"},{"Typeface name":"Symbol","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"935","Unicode hex":"3A7"},{"Typeface name":"Symbol","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"916","Unicode hex":"394"},{"Typeface name":"Symbol","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"917","Unicode hex":"395"},{"Typeface name":"Symbol","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"934","Unicode hex":"3A6"},{"Typeface name":"Symbol","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"915","Unicode hex":"393"},{"Typeface name":"Symbol","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"919","Unicode hex":"397"},{"Typeface name":"Symbol","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"921","Unicode hex":"399"},{"Typeface name":"Symbol","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"977","Unicode hex":"3D1"},{"Typeface name":"Symbol","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"922","Unicode hex":"39A"},{"Typeface name":"Symbol","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"923","Unicode hex":"39B"},{"Typeface name":"Symbol","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"924","Unicode hex":"39C"},{"Typeface name":"Symbol","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"925","Unicode hex":"39D"},{"Typeface name":"Symbol","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"927","Unicode hex":"39F"},{"Typeface name":"Symbol","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"928","Unicode hex":"3A0"},{"Typeface name":"Symbol","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"920","Unicode hex":"398"},{"Typeface name":"Symbol","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"929","Unicode hex":"3A1"},{"Typeface name":"Symbol","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"931","Unicode hex":"3A3"},{"Typeface name":"Symbol","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"932","Unicode hex":"3A4"},{"Typeface name":"Symbol","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"933","Unicode hex":"3A5"},{"Typeface name":"Symbol","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"962","Unicode hex":"3C2"},{"Typeface name":"Symbol","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"937","Unicode hex":"3A9"},{"Typeface name":"Symbol","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"926","Unicode hex":"39E"},{"Typeface name":"Symbol","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"936","Unicode hex":"3A8"},{"Typeface name":"Symbol","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"918","Unicode hex":"396"},{"Typeface name":"Symbol","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"91","Unicode hex":"5B"},{"Typeface name":"Symbol","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"8756","Unicode hex":"2234"},{"Typeface name":"Symbol","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"93","Unicode hex":"5D"},{"Typeface name":"Symbol","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"8869","Unicode hex":"22A5"},{"Typeface name":"Symbol","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"95","Unicode hex":"5F"},{"Typeface name":"Symbol","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"8254","Unicode hex":"203E"},{"Typeface name":"Symbol","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"945","Unicode hex":"3B1"},{"Typeface name":"Symbol","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"946","Unicode hex":"3B2"},{"Typeface name":"Symbol","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"967","Unicode hex":"3C7"},{"Typeface name":"Symbol","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"948","Unicode hex":"3B4"},{"Typeface name":"Symbol","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"949","Unicode hex":"3B5"},{"Typeface name":"Symbol","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"966","Unicode hex":"3C6"},{"Typeface name":"Symbol","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"947","Unicode hex":"3B3"},{"Typeface name":"Symbol","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"951","Unicode hex":"3B7"},{"Typeface name":"Symbol","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"953","Unicode hex":"3B9"},{"Typeface name":"Symbol","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"981","Unicode hex":"3D5"},{"Typeface name":"Symbol","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"954","Unicode hex":"3BA"},{"Typeface name":"Symbol","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"955","Unicode hex":"3BB"},{"Typeface name":"Symbol","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"956","Unicode hex":"3BC"},{"Typeface name":"Symbol","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"957","Unicode hex":"3BD"},{"Typeface name":"Symbol","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"959","Unicode hex":"3BF"},{"Typeface name":"Symbol","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"960","Unicode hex":"3C0"},{"Typeface name":"Symbol","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"952","Unicode hex":"3B8"},{"Typeface name":"Symbol","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"961","Unicode hex":"3C1"},{"Typeface name":"Symbol","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"963","Unicode hex":"3C3"},{"Typeface name":"Symbol","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"964","Unicode hex":"3C4"},{"Typeface name":"Symbol","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"965","Unicode hex":"3C5"},{"Typeface name":"Symbol","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"982","Unicode hex":"3D6"},{"Typeface name":"Symbol","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"969","Unicode hex":"3C9"},{"Typeface name":"Symbol","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"958","Unicode hex":"3BE"},{"Typeface name":"Symbol","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"968","Unicode hex":"3C8"},{"Typeface name":"Symbol","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"950","Unicode hex":"3B6"},{"Typeface name":"Symbol","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"123","Unicode hex":"7B"},{"Typeface name":"Symbol","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"124","Unicode hex":"7C"},{"Typeface name":"Symbol","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"125","Unicode hex":"7D"},{"Typeface name":"Symbol","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"126","Unicode hex":"7E"},{"Typeface name":"Symbol","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"8364","Unicode hex":"20AC"},{"Typeface name":"Symbol","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"978","Unicode hex":"3D2"},{"Typeface name":"Symbol","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"8242","Unicode hex":"2032"},{"Typeface name":"Symbol","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"8804","Unicode hex":"2264"},{"Typeface name":"Symbol","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"8260","Unicode hex":"2044"},{"Typeface name":"Symbol","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"8734","Unicode hex":"221E"},{"Typeface name":"Symbol","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"402","Unicode hex":"192"},{"Typeface name":"Symbol","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9827","Unicode hex":"2663"},{"Typeface name":"Symbol","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9830","Unicode hex":"2666"},{"Typeface name":"Symbol","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"9829","Unicode hex":"2665"},{"Typeface name":"Symbol","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"9824","Unicode hex":"2660"},{"Typeface name":"Symbol","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"8596","Unicode hex":"2194"},{"Typeface name":"Symbol","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"8592","Unicode hex":"2190"},{"Typeface name":"Symbol","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"8593","Unicode hex":"2191"},{"Typeface name":"Symbol","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"8594","Unicode hex":"2192"},{"Typeface name":"Symbol","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"8595","Unicode hex":"2193"},{"Typeface name":"Symbol","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"176","Unicode hex":"B0"},{"Typeface name":"Symbol","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"177","Unicode hex":"B1"},{"Typeface name":"Symbol","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"8243","Unicode hex":"2033"},{"Typeface name":"Symbol","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"8805","Unicode hex":"2265"},{"Typeface name":"Symbol","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"215","Unicode hex":"D7"},{"Typeface name":"Symbol","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"8733","Unicode hex":"221D"},{"Typeface name":"Symbol","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"8706","Unicode hex":"2202"},{"Typeface name":"Symbol","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Symbol","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"247","Unicode hex":"F7"},{"Typeface name":"Symbol","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"8800","Unicode hex":"2260"},{"Typeface name":"Symbol","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"8801","Unicode hex":"2261"},{"Typeface name":"Symbol","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"8776","Unicode hex":"2248"},{"Typeface name":"Symbol","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"8230","Unicode hex":"2026"},{"Typeface name":"Symbol","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Symbol","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"9135","Unicode hex":"23AF"},{"Typeface name":"Symbol","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"8629","Unicode hex":"21B5"},{"Typeface name":"Symbol","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"8501","Unicode hex":"2135"},{"Typeface name":"Symbol","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"8465","Unicode hex":"2111"},{"Typeface name":"Symbol","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"8476","Unicode hex":"211C"},{"Typeface name":"Symbol","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"8472","Unicode hex":"2118"},{"Typeface name":"Symbol","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"8855","Unicode hex":"2297"},{"Typeface name":"Symbol","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"8853","Unicode hex":"2295"},{"Typeface name":"Symbol","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"8709","Unicode hex":"2205"},{"Typeface name":"Symbol","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"8745","Unicode hex":"2229"},{"Typeface name":"Symbol","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"8746","Unicode hex":"222A"},{"Typeface name":"Symbol","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"8835","Unicode hex":"2283"},{"Typeface name":"Symbol","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"8839","Unicode hex":"2287"},{"Typeface name":"Symbol","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"8836","Unicode hex":"2284"},{"Typeface name":"Symbol","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"8834","Unicode hex":"2282"},{"Typeface name":"Symbol","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"8838","Unicode hex":"2286"},{"Typeface name":"Symbol","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"8712","Unicode hex":"2208"},{"Typeface name":"Symbol","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"8713","Unicode hex":"2209"},{"Typeface name":"Symbol","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"8736","Unicode hex":"2220"},{"Typeface name":"Symbol","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"8711","Unicode hex":"2207"},{"Typeface name":"Symbol","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"8719","Unicode hex":"220F"},{"Typeface name":"Symbol","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8730","Unicode hex":"221A"},{"Typeface name":"Symbol","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Symbol","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"172","Unicode hex":"AC"},{"Typeface name":"Symbol","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"8743","Unicode hex":"2227"},{"Typeface name":"Symbol","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"8744","Unicode hex":"2228"},{"Typeface name":"Symbol","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"8660","Unicode hex":"21D4"},{"Typeface name":"Symbol","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"8656","Unicode hex":"21D0"},{"Typeface name":"Symbol","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"8657","Unicode hex":"21D1"},{"Typeface name":"Symbol","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"8658","Unicode hex":"21D2"},{"Typeface name":"Symbol","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"8659","Unicode hex":"21D3"},{"Typeface name":"Symbol","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Symbol","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"12296","Unicode hex":"3008"},{"Typeface name":"Symbol","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"8721","Unicode hex":"2211"},{"Typeface name":"Symbol","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"9115","Unicode hex":"239B"},{"Typeface name":"Symbol","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"9116","Unicode hex":"239C"},{"Typeface name":"Symbol","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9117","Unicode hex":"239D"},{"Typeface name":"Symbol","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9121","Unicode hex":"23A1"},{"Typeface name":"Symbol","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"9122","Unicode hex":"23A2"},{"Typeface name":"Symbol","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"9123","Unicode hex":"23A3"},{"Typeface name":"Symbol","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"9127","Unicode hex":"23A7"},{"Typeface name":"Symbol","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"9128","Unicode hex":"23A8"},{"Typeface name":"Symbol","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"9129","Unicode hex":"23A9"},{"Typeface name":"Symbol","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"9130","Unicode hex":"23AA"},{"Typeface name":"Symbol","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"63743","Unicode hex":"F8FF"},{"Typeface name":"Symbol","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"12297","Unicode hex":"3009"},{"Typeface name":"Symbol","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8747","Unicode hex":"222B"},{"Typeface name":"Symbol","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"8992","Unicode hex":"2320"},{"Typeface name":"Symbol","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"9134","Unicode hex":"23AE"},{"Typeface name":"Symbol","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"8993","Unicode hex":"2321"},{"Typeface name":"Symbol","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"9118","Unicode hex":"239E"},{"Typeface name":"Symbol","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"9119","Unicode hex":"239F"},{"Typeface name":"Symbol","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"9120","Unicode hex":"23A0"},{"Typeface name":"Symbol","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"9124","Unicode hex":"23A4"},{"Typeface name":"Symbol","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"9125","Unicode hex":"23A5"},{"Typeface name":"Symbol","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"9126","Unicode hex":"23A6"},{"Typeface name":"Symbol","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"9131","Unicode hex":"23AB"},{"Typeface name":"Symbol","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"9132","Unicode hex":"23AC"},{"Typeface name":"Symbol","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"9133","Unicode hex":"23AD"},{"Typeface name":"Webdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Webdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128375","Unicode hex":"1F577"},{"Typeface name":"Webdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128376","Unicode hex":"1F578"},{"Typeface name":"Webdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128370","Unicode hex":"1F572"},{"Typeface name":"Webdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128374","Unicode hex":"1F576"},{"Typeface name":"Webdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"127942","Unicode hex":"1F3C6"},{"Typeface name":"Webdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"127894","Unicode hex":"1F396"},{"Typeface name":"Webdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128391","Unicode hex":"1F587"},{"Typeface name":"Webdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128488","Unicode hex":"1F5E8"},{"Typeface name":"Webdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128489","Unicode hex":"1F5E9"},{"Typeface name":"Webdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128496","Unicode hex":"1F5F0"},{"Typeface name":"Webdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128497","Unicode hex":"1F5F1"},{"Typeface name":"Webdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"127798","Unicode hex":"1F336"},{"Typeface name":"Webdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"127895","Unicode hex":"1F397"},{"Typeface name":"Webdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128638","Unicode hex":"1F67E"},{"Typeface name":"Webdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128636","Unicode hex":"1F67C"},{"Typeface name":"Webdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128469","Unicode hex":"1F5D5"},{"Typeface name":"Webdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128470","Unicode hex":"1F5D6"},{"Typeface name":"Webdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128471","Unicode hex":"1F5D7"},{"Typeface name":"Webdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"9204","Unicode hex":"23F4"},{"Typeface name":"Webdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"9205","Unicode hex":"23F5"},{"Typeface name":"Webdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"9206","Unicode hex":"23F6"},{"Typeface name":"Webdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"9207","Unicode hex":"23F7"},{"Typeface name":"Webdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"9194","Unicode hex":"23EA"},{"Typeface name":"Webdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"9193","Unicode hex":"23E9"},{"Typeface name":"Webdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"9198","Unicode hex":"23EE"},{"Typeface name":"Webdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"9197","Unicode hex":"23ED"},{"Typeface name":"Webdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"9208","Unicode hex":"23F8"},{"Typeface name":"Webdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"9209","Unicode hex":"23F9"},{"Typeface name":"Webdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"9210","Unicode hex":"23FA"},{"Typeface name":"Webdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128474","Unicode hex":"1F5DA"},{"Typeface name":"Webdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128499","Unicode hex":"1F5F3"},{"Typeface name":"Webdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128736","Unicode hex":"1F6E0"},{"Typeface name":"Webdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"127959","Unicode hex":"1F3D7"},{"Typeface name":"Webdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"127960","Unicode hex":"1F3D8"},{"Typeface name":"Webdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"127961","Unicode hex":"1F3D9"},{"Typeface name":"Webdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"127962","Unicode hex":"1F3DA"},{"Typeface name":"Webdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"127964","Unicode hex":"1F3DC"},{"Typeface name":"Webdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"127981","Unicode hex":"1F3ED"},{"Typeface name":"Webdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"127963","Unicode hex":"1F3DB"},{"Typeface name":"Webdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"127968","Unicode hex":"1F3E0"},{"Typeface name":"Webdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"127958","Unicode hex":"1F3D6"},{"Typeface name":"Webdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"127965","Unicode hex":"1F3DD"},{"Typeface name":"Webdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128739","Unicode hex":"1F6E3"},{"Typeface name":"Webdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128269","Unicode hex":"1F50D"},{"Typeface name":"Webdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"127956","Unicode hex":"1F3D4"},{"Typeface name":"Webdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128065","Unicode hex":"1F441"},{"Typeface name":"Webdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128066","Unicode hex":"1F442"},{"Typeface name":"Webdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127966","Unicode hex":"1F3DE"},{"Typeface name":"Webdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"127957","Unicode hex":"1F3D5"},{"Typeface name":"Webdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"128740","Unicode hex":"1F6E4"},{"Typeface name":"Webdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127967","Unicode hex":"1F3DF"},{"Typeface name":"Webdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"128755","Unicode hex":"1F6F3"},{"Typeface name":"Webdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128364","Unicode hex":"1F56C"},{"Typeface name":"Webdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"128363","Unicode hex":"1F56B"},{"Typeface name":"Webdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128360","Unicode hex":"1F568"},{"Typeface name":"Webdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"128264","Unicode hex":"1F508"},{"Typeface name":"Webdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"127892","Unicode hex":"1F394"},{"Typeface name":"Webdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"127893","Unicode hex":"1F395"},{"Typeface name":"Webdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128492","Unicode hex":"1F5EC"},{"Typeface name":"Webdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128637","Unicode hex":"1F67D"},{"Typeface name":"Webdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"128493","Unicode hex":"1F5ED"},{"Typeface name":"Webdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128490","Unicode hex":"1F5EA"},{"Typeface name":"Webdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128491","Unicode hex":"1F5EB"},{"Typeface name":"Webdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"11156","Unicode hex":"2B94"},{"Typeface name":"Webdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"10004","Unicode hex":"2714"},{"Typeface name":"Webdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128690","Unicode hex":"1F6B2"},{"Typeface name":"Webdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"11036","Unicode hex":"2B1C"},{"Typeface name":"Webdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128737","Unicode hex":"1F6E1"},{"Typeface name":"Webdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128230","Unicode hex":"1F4E6"},{"Typeface name":"Webdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128753","Unicode hex":"1F6F1"},{"Typeface name":"Webdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"11035","Unicode hex":"2B1B"},{"Typeface name":"Webdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128657","Unicode hex":"1F691"},{"Typeface name":"Webdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"128712","Unicode hex":"1F6C8"},{"Typeface name":"Webdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128745","Unicode hex":"1F6E9"},{"Typeface name":"Webdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128752","Unicode hex":"1F6F0"},{"Typeface name":"Webdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"128968","Unicode hex":"1F7C8"},{"Typeface name":"Webdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128372","Unicode hex":"1F574"},{"Typeface name":"Webdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"11044","Unicode hex":"2B24"},{"Typeface name":"Webdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128741","Unicode hex":"1F6E5"},{"Typeface name":"Webdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128660","Unicode hex":"1F694"},{"Typeface name":"Webdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"128472","Unicode hex":"1F5D8"},{"Typeface name":"Webdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"128473","Unicode hex":"1F5D9"},{"Typeface name":"Webdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"10067","Unicode hex":"2753"},{"Typeface name":"Webdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"128754","Unicode hex":"1F6F2"},{"Typeface name":"Webdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"128647","Unicode hex":"1F687"},{"Typeface name":"Webdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"128653","Unicode hex":"1F68D"},{"Typeface name":"Webdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9971","Unicode hex":"26F3"},{"Typeface name":"Webdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Webdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"8854","Unicode hex":"2296"},{"Typeface name":"Webdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"128685","Unicode hex":"1F6AD"},{"Typeface name":"Webdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"128494","Unicode hex":"1F5EE"},{"Typeface name":"Webdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Webdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128495","Unicode hex":"1F5EF"},{"Typeface name":"Webdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128498","Unicode hex":"1F5F2"},{"Typeface name":"Webdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128697","Unicode hex":"1F6B9"},{"Typeface name":"Webdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"128698","Unicode hex":"1F6BA"},{"Typeface name":"Webdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"128713","Unicode hex":"1F6C9"},{"Typeface name":"Webdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"128714","Unicode hex":"1F6CA"},{"Typeface name":"Webdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"128700","Unicode hex":"1F6BC"},{"Typeface name":"Webdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"128125","Unicode hex":"1F47D"},{"Typeface name":"Webdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"127947","Unicode hex":"1F3CB"},{"Typeface name":"Webdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"9975","Unicode hex":"26F7"},{"Typeface name":"Webdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"127938","Unicode hex":"1F3C2"},{"Typeface name":"Webdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"127948","Unicode hex":"1F3CC"},{"Typeface name":"Webdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"127946","Unicode hex":"1F3CA"},{"Typeface name":"Webdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127940","Unicode hex":"1F3C4"},{"Typeface name":"Webdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"127949","Unicode hex":"1F3CD"},{"Typeface name":"Webdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"127950","Unicode hex":"1F3CE"},{"Typeface name":"Webdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128664","Unicode hex":"1F698"},{"Typeface name":"Webdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128480","Unicode hex":"1F5E0"},{"Typeface name":"Webdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128738","Unicode hex":"1F6E2"},{"Typeface name":"Webdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128176","Unicode hex":"1F4B0"},{"Typeface name":"Webdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"127991","Unicode hex":"1F3F7"},{"Typeface name":"Webdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128179","Unicode hex":"1F4B3"},{"Typeface name":"Webdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128106","Unicode hex":"1F46A"},{"Typeface name":"Webdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"128481","Unicode hex":"1F5E1"},{"Typeface name":"Webdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128482","Unicode hex":"1F5E2"},{"Typeface name":"Webdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128483","Unicode hex":"1F5E3"},{"Typeface name":"Webdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Webdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128388","Unicode hex":"1F584"},{"Typeface name":"Webdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128389","Unicode hex":"1F585"},{"Typeface name":"Webdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Webdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128390","Unicode hex":"1F586"},{"Typeface name":"Webdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128441","Unicode hex":"1F5B9"},{"Typeface name":"Webdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"128442","Unicode hex":"1F5BA"},{"Typeface name":"Webdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128443","Unicode hex":"1F5BB"},{"Typeface name":"Webdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128373","Unicode hex":"1F575"},{"Typeface name":"Webdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"128368","Unicode hex":"1F570"},{"Typeface name":"Webdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128445","Unicode hex":"1F5BD"},{"Typeface name":"Webdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128446","Unicode hex":"1F5BE"},{"Typeface name":"Webdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Webdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128466","Unicode hex":"1F5D2"},{"Typeface name":"Webdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128467","Unicode hex":"1F5D3"},{"Typeface name":"Webdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Webdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128218","Unicode hex":"1F4DA"},{"Typeface name":"Webdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128478","Unicode hex":"1F5DE"},{"Typeface name":"Webdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128479","Unicode hex":"1F5DF"},{"Typeface name":"Webdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128451","Unicode hex":"1F5C3"},{"Typeface name":"Webdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128450","Unicode hex":"1F5C2"},{"Typeface name":"Webdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128444","Unicode hex":"1F5BC"},{"Typeface name":"Webdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"127917","Unicode hex":"1F3AD"},{"Typeface name":"Webdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"127900","Unicode hex":"1F39C"},{"Typeface name":"Webdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"127896","Unicode hex":"1F398"},{"Typeface name":"Webdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"127897","Unicode hex":"1F399"},{"Typeface name":"Webdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"127911","Unicode hex":"1F3A7"},{"Typeface name":"Webdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128191","Unicode hex":"1F4BF"},{"Typeface name":"Webdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"127902","Unicode hex":"1F39E"},{"Typeface name":"Webdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128247","Unicode hex":"1F4F7"},{"Typeface name":"Webdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"127903","Unicode hex":"1F39F"},{"Typeface name":"Webdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"127916","Unicode hex":"1F3AC"},{"Typeface name":"Webdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128253","Unicode hex":"1F4FD"},{"Typeface name":"Webdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128249","Unicode hex":"1F4F9"},{"Typeface name":"Webdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128254","Unicode hex":"1F4FE"},{"Typeface name":"Webdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128251","Unicode hex":"1F4FB"},{"Typeface name":"Webdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"127898","Unicode hex":"1F39A"},{"Typeface name":"Webdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"127899","Unicode hex":"1F39B"},{"Typeface name":"Webdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128250","Unicode hex":"1F4FA"},{"Typeface name":"Webdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128187","Unicode hex":"1F4BB"},{"Typeface name":"Webdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128421","Unicode hex":"1F5A5"},{"Typeface name":"Webdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128422","Unicode hex":"1F5A6"},{"Typeface name":"Webdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128423","Unicode hex":"1F5A7"},{"Typeface name":"Webdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"128377","Unicode hex":"1F579"},{"Typeface name":"Webdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"127918","Unicode hex":"1F3AE"},{"Typeface name":"Webdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"128379","Unicode hex":"1F57B"},{"Typeface name":"Webdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128380","Unicode hex":"1F57C"},{"Typeface name":"Webdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128223","Unicode hex":"1F4DF"},{"Typeface name":"Webdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128385","Unicode hex":"1F581"},{"Typeface name":"Webdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128384","Unicode hex":"1F580"},{"Typeface name":"Webdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128424","Unicode hex":"1F5A8"},{"Typeface name":"Webdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128425","Unicode hex":"1F5A9"},{"Typeface name":"Webdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128447","Unicode hex":"1F5BF"},{"Typeface name":"Webdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128426","Unicode hex":"1F5AA"},{"Typeface name":"Webdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128476","Unicode hex":"1F5DC"},{"Typeface name":"Webdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128274","Unicode hex":"1F512"},{"Typeface name":"Webdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128275","Unicode hex":"1F513"},{"Typeface name":"Webdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128477","Unicode hex":"1F5DD"},{"Typeface name":"Webdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128229","Unicode hex":"1F4E5"},{"Typeface name":"Webdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128228","Unicode hex":"1F4E4"},{"Typeface name":"Webdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128371","Unicode hex":"1F573"},{"Typeface name":"Webdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"127779","Unicode hex":"1F323"},{"Typeface name":"Webdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"127780","Unicode hex":"1F324"},{"Typeface name":"Webdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"127781","Unicode hex":"1F325"},{"Typeface name":"Webdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"127782","Unicode hex":"1F326"},{"Typeface name":"Webdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"9729","Unicode hex":"2601"},{"Typeface name":"Webdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"127784","Unicode hex":"1F328"},{"Typeface name":"Webdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"127783","Unicode hex":"1F327"},{"Typeface name":"Webdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"127785","Unicode hex":"1F329"},{"Typeface name":"Webdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"127786","Unicode hex":"1F32A"},{"Typeface name":"Webdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"127788","Unicode hex":"1F32C"},{"Typeface name":"Webdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"127787","Unicode hex":"1F32B"},{"Typeface name":"Webdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"127772","Unicode hex":"1F31C"},{"Typeface name":"Webdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"127777","Unicode hex":"1F321"},{"Typeface name":"Webdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128715","Unicode hex":"1F6CB"},{"Typeface name":"Webdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128719","Unicode hex":"1F6CF"},{"Typeface name":"Webdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"127869","Unicode hex":"1F37D"},{"Typeface name":"Webdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"127864","Unicode hex":"1F378"},{"Typeface name":"Webdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128718","Unicode hex":"1F6CE"},{"Typeface name":"Webdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128717","Unicode hex":"1F6CD"},{"Typeface name":"Webdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9413","Unicode hex":"24C5"},{"Typeface name":"Webdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9855","Unicode hex":"267F"},{"Typeface name":"Webdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128710","Unicode hex":"1F6C6"},{"Typeface name":"Webdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"128392","Unicode hex":"1F588"},{"Typeface name":"Webdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"127891","Unicode hex":"1F393"},{"Typeface name":"Webdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128484","Unicode hex":"1F5E4"},{"Typeface name":"Webdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128485","Unicode hex":"1F5E5"},{"Typeface name":"Webdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128486","Unicode hex":"1F5E6"},{"Typeface name":"Webdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"128487","Unicode hex":"1F5E7"},{"Typeface name":"Webdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128746","Unicode hex":"1F6EA"},{"Typeface name":"Webdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128063","Unicode hex":"1F43F"},{"Typeface name":"Webdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"128038","Unicode hex":"1F426"},{"Typeface name":"Webdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128031","Unicode hex":"1F41F"},{"Typeface name":"Webdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128021","Unicode hex":"1F415"},{"Typeface name":"Webdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"128008","Unicode hex":"1F408"},{"Typeface name":"Webdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"128620","Unicode hex":"1F66C"},{"Typeface name":"Webdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"128622","Unicode hex":"1F66E"},{"Typeface name":"Webdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"128621","Unicode hex":"1F66D"},{"Typeface name":"Webdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"128623","Unicode hex":"1F66F"},{"Typeface name":"Webdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128506","Unicode hex":"1F5FA"},{"Typeface name":"Webdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"127757","Unicode hex":"1F30D"},{"Typeface name":"Webdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"127759","Unicode hex":"1F30F"},{"Typeface name":"Webdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"127758","Unicode hex":"1F30E"},{"Typeface name":"Webdings","Dingbat dec":"255","Dingbat hex":"FF","Unicode dec":"128330","Unicode hex":"1F54A"},{"Typeface name":"Wingdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128393","Unicode hex":"1F589"},{"Typeface name":"Wingdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"9986","Unicode hex":"2702"},{"Typeface name":"Wingdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"9985","Unicode hex":"2701"},{"Typeface name":"Wingdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128083","Unicode hex":"1F453"},{"Typeface name":"Wingdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"128365","Unicode hex":"1F56D"},{"Typeface name":"Wingdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Wingdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128367","Unicode hex":"1F56F"},{"Typeface name":"Wingdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128383","Unicode hex":"1F57F"},{"Typeface name":"Wingdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"9990","Unicode hex":"2706"},{"Typeface name":"Wingdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128386","Unicode hex":"1F582"},{"Typeface name":"Wingdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Wingdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128234","Unicode hex":"1F4EA"},{"Typeface name":"Wingdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128235","Unicode hex":"1F4EB"},{"Typeface name":"Wingdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128236","Unicode hex":"1F4EC"},{"Typeface name":"Wingdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128237","Unicode hex":"1F4ED"},{"Typeface name":"Wingdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128448","Unicode hex":"1F5C0"},{"Typeface name":"Wingdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128449","Unicode hex":"1F5C1"},{"Typeface name":"Wingdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128462","Unicode hex":"1F5CE"},{"Typeface name":"Wingdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128463","Unicode hex":"1F5CF"},{"Typeface name":"Wingdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128464","Unicode hex":"1F5D0"},{"Typeface name":"Wingdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128452","Unicode hex":"1F5C4"},{"Typeface name":"Wingdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"8987","Unicode hex":"231B"},{"Typeface name":"Wingdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128430","Unicode hex":"1F5AE"},{"Typeface name":"Wingdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128432","Unicode hex":"1F5B0"},{"Typeface name":"Wingdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128434","Unicode hex":"1F5B2"},{"Typeface name":"Wingdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128435","Unicode hex":"1F5B3"},{"Typeface name":"Wingdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128436","Unicode hex":"1F5B4"},{"Typeface name":"Wingdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128427","Unicode hex":"1F5AB"},{"Typeface name":"Wingdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128428","Unicode hex":"1F5AC"},{"Typeface name":"Wingdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"9991","Unicode hex":"2707"},{"Typeface name":"Wingdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"9997","Unicode hex":"270D"},{"Typeface name":"Wingdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128398","Unicode hex":"1F58E"},{"Typeface name":"Wingdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"9996","Unicode hex":"270C"},{"Typeface name":"Wingdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128399","Unicode hex":"1F58F"},{"Typeface name":"Wingdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128077","Unicode hex":"1F44D"},{"Typeface name":"Wingdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128078","Unicode hex":"1F44E"},{"Typeface name":"Wingdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"9756","Unicode hex":"261C"},{"Typeface name":"Wingdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"9758","Unicode hex":"261E"},{"Typeface name":"Wingdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"9757","Unicode hex":"261D"},{"Typeface name":"Wingdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"9759","Unicode hex":"261F"},{"Typeface name":"Wingdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128400","Unicode hex":"1F590"},{"Typeface name":"Wingdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"9786","Unicode hex":"263A"},{"Typeface name":"Wingdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128528","Unicode hex":"1F610"},{"Typeface name":"Wingdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"9785","Unicode hex":"2639"},{"Typeface name":"Wingdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128163","Unicode hex":"1F4A3"},{"Typeface name":"Wingdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128369","Unicode hex":"1F571"},{"Typeface name":"Wingdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"127987","Unicode hex":"1F3F3"},{"Typeface name":"Wingdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127985","Unicode hex":"1F3F1"},{"Typeface name":"Wingdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"9992","Unicode hex":"2708"},{"Typeface name":"Wingdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9788","Unicode hex":"263C"},{"Typeface name":"Wingdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127778","Unicode hex":"1F322"},{"Typeface name":"Wingdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"10052","Unicode hex":"2744"},{"Typeface name":"Wingdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128326","Unicode hex":"1F546"},{"Typeface name":"Wingdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"10014","Unicode hex":"271E"},{"Typeface name":"Wingdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128328","Unicode hex":"1F548"},{"Typeface name":"Wingdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10016","Unicode hex":"2720"},{"Typeface name":"Wingdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"10017","Unicode hex":"2721"},{"Typeface name":"Wingdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"9770","Unicode hex":"262A"},{"Typeface name":"Wingdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"9775","Unicode hex":"262F"},{"Typeface name":"Wingdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128329","Unicode hex":"1F549"},{"Typeface name":"Wingdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"9784","Unicode hex":"2638"},{"Typeface name":"Wingdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"9800","Unicode hex":"2648"},{"Typeface name":"Wingdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"9801","Unicode hex":"2649"},{"Typeface name":"Wingdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"9802","Unicode hex":"264A"},{"Typeface name":"Wingdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"9803","Unicode hex":"264B"},{"Typeface name":"Wingdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"9804","Unicode hex":"264C"},{"Typeface name":"Wingdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"9805","Unicode hex":"264D"},{"Typeface name":"Wingdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"9806","Unicode hex":"264E"},{"Typeface name":"Wingdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"9807","Unicode hex":"264F"},{"Typeface name":"Wingdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"9808","Unicode hex":"2650"},{"Typeface name":"Wingdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"9809","Unicode hex":"2651"},{"Typeface name":"Wingdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"9810","Unicode hex":"2652"},{"Typeface name":"Wingdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9811","Unicode hex":"2653"},{"Typeface name":"Wingdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128624","Unicode hex":"1F670"},{"Typeface name":"Wingdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128629","Unicode hex":"1F675"},{"Typeface name":"Wingdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9899","Unicode hex":"26AB"},{"Typeface name":"Wingdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128318","Unicode hex":"1F53E"},{"Typeface name":"Wingdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9724","Unicode hex":"25FC"},{"Typeface name":"Wingdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128911","Unicode hex":"1F78F"},{"Typeface name":"Wingdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128912","Unicode hex":"1F790"},{"Typeface name":"Wingdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"10065","Unicode hex":"2751"},{"Typeface name":"Wingdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"10066","Unicode hex":"2752"},{"Typeface name":"Wingdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"128927","Unicode hex":"1F79F"},{"Typeface name":"Wingdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"10731","Unicode hex":"29EB"},{"Typeface name":"Wingdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9670","Unicode hex":"25C6"},{"Typeface name":"Wingdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10070","Unicode hex":"2756"},{"Typeface name":"Wingdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"8999","Unicode hex":"2327"},{"Typeface name":"Wingdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"11193","Unicode hex":"2BB9"},{"Typeface name":"Wingdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"8984","Unicode hex":"2318"},{"Typeface name":"Wingdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"127989","Unicode hex":"1F3F5"},{"Typeface name":"Wingdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"127990","Unicode hex":"1F3F6"},{"Typeface name":"Wingdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128630","Unicode hex":"1F676"},{"Typeface name":"Wingdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128631","Unicode hex":"1F677"},{"Typeface name":"Wingdings","Dingbat dec":"127","Dingbat hex":"7F","Unicode dec":"9647","Unicode hex":"25AF"},{"Typeface name":"Wingdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"127243","Unicode hex":"1F10B"},{"Typeface name":"Wingdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"10112","Unicode hex":"2780"},{"Typeface name":"Wingdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"10113","Unicode hex":"2781"},{"Typeface name":"Wingdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"10114","Unicode hex":"2782"},{"Typeface name":"Wingdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"10115","Unicode hex":"2783"},{"Typeface name":"Wingdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10116","Unicode hex":"2784"},{"Typeface name":"Wingdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"10117","Unicode hex":"2785"},{"Typeface name":"Wingdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"10118","Unicode hex":"2786"},{"Typeface name":"Wingdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"10119","Unicode hex":"2787"},{"Typeface name":"Wingdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"10120","Unicode hex":"2788"},{"Typeface name":"Wingdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"10121","Unicode hex":"2789"},{"Typeface name":"Wingdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127244","Unicode hex":"1F10C"},{"Typeface name":"Wingdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"10122","Unicode hex":"278A"},{"Typeface name":"Wingdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"10123","Unicode hex":"278B"},{"Typeface name":"Wingdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"10124","Unicode hex":"278C"},{"Typeface name":"Wingdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"10125","Unicode hex":"278D"},{"Typeface name":"Wingdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"10126","Unicode hex":"278E"},{"Typeface name":"Wingdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"10127","Unicode hex":"278F"},{"Typeface name":"Wingdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"10128","Unicode hex":"2790"},{"Typeface name":"Wingdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"10129","Unicode hex":"2791"},{"Typeface name":"Wingdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"10130","Unicode hex":"2792"},{"Typeface name":"Wingdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"10131","Unicode hex":"2793"},{"Typeface name":"Wingdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128610","Unicode hex":"1F662"},{"Typeface name":"Wingdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128608","Unicode hex":"1F660"},{"Typeface name":"Wingdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"128609","Unicode hex":"1F661"},{"Typeface name":"Wingdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128611","Unicode hex":"1F663"},{"Typeface name":"Wingdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128606","Unicode hex":"1F65E"},{"Typeface name":"Wingdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128604","Unicode hex":"1F65C"},{"Typeface name":"Wingdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128605","Unicode hex":"1F65D"},{"Typeface name":"Wingdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128607","Unicode hex":"1F65F"},{"Typeface name":"Wingdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"8729","Unicode hex":"2219"},{"Typeface name":"Wingdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Wingdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"11037","Unicode hex":"2B1D"},{"Typeface name":"Wingdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"11096","Unicode hex":"2B58"},{"Typeface name":"Wingdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128902","Unicode hex":"1F786"},{"Typeface name":"Wingdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128904","Unicode hex":"1F788"},{"Typeface name":"Wingdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128906","Unicode hex":"1F78A"},{"Typeface name":"Wingdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128907","Unicode hex":"1F78B"},{"Typeface name":"Wingdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128319","Unicode hex":"1F53F"},{"Typeface name":"Wingdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9642","Unicode hex":"25AA"},{"Typeface name":"Wingdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128910","Unicode hex":"1F78E"},{"Typeface name":"Wingdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128961","Unicode hex":"1F7C1"},{"Typeface name":"Wingdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128965","Unicode hex":"1F7C5"},{"Typeface name":"Wingdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"9733","Unicode hex":"2605"},{"Typeface name":"Wingdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128971","Unicode hex":"1F7CB"},{"Typeface name":"Wingdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128975","Unicode hex":"1F7CF"},{"Typeface name":"Wingdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"128979","Unicode hex":"1F7D3"},{"Typeface name":"Wingdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"128977","Unicode hex":"1F7D1"},{"Typeface name":"Wingdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"11216","Unicode hex":"2BD0"},{"Typeface name":"Wingdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"8982","Unicode hex":"2316"},{"Typeface name":"Wingdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"11214","Unicode hex":"2BCE"},{"Typeface name":"Wingdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"11215","Unicode hex":"2BCF"},{"Typeface name":"Wingdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"11217","Unicode hex":"2BD1"},{"Typeface name":"Wingdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"10026","Unicode hex":"272A"},{"Typeface name":"Wingdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"10032","Unicode hex":"2730"},{"Typeface name":"Wingdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"128336","Unicode hex":"1F550"},{"Typeface name":"Wingdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128337","Unicode hex":"1F551"},{"Typeface name":"Wingdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128338","Unicode hex":"1F552"},{"Typeface name":"Wingdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128339","Unicode hex":"1F553"},{"Typeface name":"Wingdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128340","Unicode hex":"1F554"},{"Typeface name":"Wingdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"128341","Unicode hex":"1F555"},{"Typeface name":"Wingdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"128342","Unicode hex":"1F556"},{"Typeface name":"Wingdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128343","Unicode hex":"1F557"},{"Typeface name":"Wingdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128344","Unicode hex":"1F558"},{"Typeface name":"Wingdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128345","Unicode hex":"1F559"},{"Typeface name":"Wingdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128346","Unicode hex":"1F55A"},{"Typeface name":"Wingdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128347","Unicode hex":"1F55B"},{"Typeface name":"Wingdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11184","Unicode hex":"2BB0"},{"Typeface name":"Wingdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11185","Unicode hex":"2BB1"},{"Typeface name":"Wingdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11186","Unicode hex":"2BB2"},{"Typeface name":"Wingdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"11187","Unicode hex":"2BB3"},{"Typeface name":"Wingdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"11188","Unicode hex":"2BB4"},{"Typeface name":"Wingdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"11189","Unicode hex":"2BB5"},{"Typeface name":"Wingdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11190","Unicode hex":"2BB6"},{"Typeface name":"Wingdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11191","Unicode hex":"2BB7"},{"Typeface name":"Wingdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128618","Unicode hex":"1F66A"},{"Typeface name":"Wingdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128619","Unicode hex":"1F66B"},{"Typeface name":"Wingdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128597","Unicode hex":"1F655"},{"Typeface name":"Wingdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128596","Unicode hex":"1F654"},{"Typeface name":"Wingdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128599","Unicode hex":"1F657"},{"Typeface name":"Wingdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128598","Unicode hex":"1F656"},{"Typeface name":"Wingdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128592","Unicode hex":"1F650"},{"Typeface name":"Wingdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128593","Unicode hex":"1F651"},{"Typeface name":"Wingdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128594","Unicode hex":"1F652"},{"Typeface name":"Wingdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128595","Unicode hex":"1F653"},{"Typeface name":"Wingdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"9003","Unicode hex":"232B"},{"Typeface name":"Wingdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8998","Unicode hex":"2326"},{"Typeface name":"Wingdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"11160","Unicode hex":"2B98"},{"Typeface name":"Wingdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"11162","Unicode hex":"2B9A"},{"Typeface name":"Wingdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"11161","Unicode hex":"2B99"},{"Typeface name":"Wingdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"11163","Unicode hex":"2B9B"},{"Typeface name":"Wingdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"11144","Unicode hex":"2B88"},{"Typeface name":"Wingdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"11146","Unicode hex":"2B8A"},{"Typeface name":"Wingdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"11145","Unicode hex":"2B89"},{"Typeface name":"Wingdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"11147","Unicode hex":"2B8B"},{"Typeface name":"Wingdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129128","Unicode hex":"1F868"},{"Typeface name":"Wingdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129130","Unicode hex":"1F86A"},{"Typeface name":"Wingdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129129","Unicode hex":"1F869"},{"Typeface name":"Wingdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129131","Unicode hex":"1F86B"},{"Typeface name":"Wingdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129132","Unicode hex":"1F86C"},{"Typeface name":"Wingdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129133","Unicode hex":"1F86D"},{"Typeface name":"Wingdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129135","Unicode hex":"1F86F"},{"Typeface name":"Wingdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129134","Unicode hex":"1F86E"},{"Typeface name":"Wingdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129144","Unicode hex":"1F878"},{"Typeface name":"Wingdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129146","Unicode hex":"1F87A"},{"Typeface name":"Wingdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129145","Unicode hex":"1F879"},{"Typeface name":"Wingdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129147","Unicode hex":"1F87B"},{"Typeface name":"Wingdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129148","Unicode hex":"1F87C"},{"Typeface name":"Wingdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129149","Unicode hex":"1F87D"},{"Typeface name":"Wingdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129151","Unicode hex":"1F87F"},{"Typeface name":"Wingdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129150","Unicode hex":"1F87E"},{"Typeface name":"Wingdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"8678","Unicode hex":"21E6"},{"Typeface name":"Wingdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"8680","Unicode hex":"21E8"},{"Typeface name":"Wingdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"8679","Unicode hex":"21E7"},{"Typeface name":"Wingdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8681","Unicode hex":"21E9"},{"Typeface name":"Wingdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"11012","Unicode hex":"2B04"},{"Typeface name":"Wingdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"8691","Unicode hex":"21F3"},{"Typeface name":"Wingdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"11009","Unicode hex":"2B01"},{"Typeface name":"Wingdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11008","Unicode hex":"2B00"},{"Typeface name":"Wingdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11011","Unicode hex":"2B03"},{"Typeface name":"Wingdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"11010","Unicode hex":"2B02"},{"Typeface name":"Wingdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"129196","Unicode hex":"1F8AC"},{"Typeface name":"Wingdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"129197","Unicode hex":"1F8AD"},{"Typeface name":"Wingdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128502","Unicode hex":"1F5F6"},{"Typeface name":"Wingdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"10003","Unicode hex":"2713"},{"Typeface name":"Wingdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"128503","Unicode hex":"1F5F7"},{"Typeface name":"Wingdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"128505","Unicode hex":"1F5F9"},{"Typeface name":"Wingdings 2","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 2","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128394","Unicode hex":"1F58A"},{"Typeface name":"Wingdings 2","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128395","Unicode hex":"1F58B"},{"Typeface name":"Wingdings 2","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128396","Unicode hex":"1F58C"},{"Typeface name":"Wingdings 2","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128397","Unicode hex":"1F58D"},{"Typeface name":"Wingdings 2","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"9988","Unicode hex":"2704"},{"Typeface name":"Wingdings 2","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"9984","Unicode hex":"2700"},{"Typeface name":"Wingdings 2","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128382","Unicode hex":"1F57E"},{"Typeface name":"Wingdings 2","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128381","Unicode hex":"1F57D"},{"Typeface name":"Wingdings 2","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128453","Unicode hex":"1F5C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128454","Unicode hex":"1F5C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128455","Unicode hex":"1F5C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128456","Unicode hex":"1F5C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128457","Unicode hex":"1F5C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128458","Unicode hex":"1F5CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128459","Unicode hex":"1F5CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128460","Unicode hex":"1F5CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128461","Unicode hex":"1F5CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128465","Unicode hex":"1F5D1"},{"Typeface name":"Wingdings 2","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128468","Unicode hex":"1F5D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128437","Unicode hex":"1F5B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"128438","Unicode hex":"1F5B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128439","Unicode hex":"1F5B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128440","Unicode hex":"1F5B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128429","Unicode hex":"1F5AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128431","Unicode hex":"1F5AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128433","Unicode hex":"1F5B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128402","Unicode hex":"1F592"},{"Typeface name":"Wingdings 2","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128403","Unicode hex":"1F593"},{"Typeface name":"Wingdings 2","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128408","Unicode hex":"1F598"},{"Typeface name":"Wingdings 2","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128409","Unicode hex":"1F599"},{"Typeface name":"Wingdings 2","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128410","Unicode hex":"1F59A"},{"Typeface name":"Wingdings 2","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"128411","Unicode hex":"1F59B"},{"Typeface name":"Wingdings 2","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128072","Unicode hex":"1F448"},{"Typeface name":"Wingdings 2","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128073","Unicode hex":"1F449"},{"Typeface name":"Wingdings 2","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128412","Unicode hex":"1F59C"},{"Typeface name":"Wingdings 2","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"128413","Unicode hex":"1F59D"},{"Typeface name":"Wingdings 2","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"128414","Unicode hex":"1F59E"},{"Typeface name":"Wingdings 2","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"128415","Unicode hex":"1F59F"},{"Typeface name":"Wingdings 2","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"128416","Unicode hex":"1F5A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128417","Unicode hex":"1F5A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"128070","Unicode hex":"1F446"},{"Typeface name":"Wingdings 2","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128071","Unicode hex":"1F447"},{"Typeface name":"Wingdings 2","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128418","Unicode hex":"1F5A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128419","Unicode hex":"1F5A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128401","Unicode hex":"1F591"},{"Typeface name":"Wingdings 2","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128500","Unicode hex":"1F5F4"},{"Typeface name":"Wingdings 2","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"128504","Unicode hex":"1F5F8"},{"Typeface name":"Wingdings 2","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"128501","Unicode hex":"1F5F5"},{"Typeface name":"Wingdings 2","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9745","Unicode hex":"2611"},{"Typeface name":"Wingdings 2","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"11197","Unicode hex":"2BBD"},{"Typeface name":"Wingdings 2","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"9746","Unicode hex":"2612"},{"Typeface name":"Wingdings 2","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"11198","Unicode hex":"2BBE"},{"Typeface name":"Wingdings 2","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"11199","Unicode hex":"2BBF"},{"Typeface name":"Wingdings 2","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128711","Unicode hex":"1F6C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"128625","Unicode hex":"1F671"},{"Typeface name":"Wingdings 2","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"128628","Unicode hex":"1F674"},{"Typeface name":"Wingdings 2","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128626","Unicode hex":"1F672"},{"Typeface name":"Wingdings 2","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128627","Unicode hex":"1F673"},{"Typeface name":"Wingdings 2","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"8253","Unicode hex":"203D"},{"Typeface name":"Wingdings 2","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128633","Unicode hex":"1F679"},{"Typeface name":"Wingdings 2","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128634","Unicode hex":"1F67A"},{"Typeface name":"Wingdings 2","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"128635","Unicode hex":"1F67B"},{"Typeface name":"Wingdings 2","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"128614","Unicode hex":"1F666"},{"Typeface name":"Wingdings 2","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128612","Unicode hex":"1F664"},{"Typeface name":"Wingdings 2","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"128613","Unicode hex":"1F665"},{"Typeface name":"Wingdings 2","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128615","Unicode hex":"1F667"},{"Typeface name":"Wingdings 2","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128602","Unicode hex":"1F65A"},{"Typeface name":"Wingdings 2","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128600","Unicode hex":"1F658"},{"Typeface name":"Wingdings 2","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"128601","Unicode hex":"1F659"},{"Typeface name":"Wingdings 2","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128603","Unicode hex":"1F65B"},{"Typeface name":"Wingdings 2","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9450","Unicode hex":"24EA"},{"Typeface name":"Wingdings 2","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"9312","Unicode hex":"2460"},{"Typeface name":"Wingdings 2","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"9313","Unicode hex":"2461"},{"Typeface name":"Wingdings 2","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9314","Unicode hex":"2462"},{"Typeface name":"Wingdings 2","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"9315","Unicode hex":"2463"},{"Typeface name":"Wingdings 2","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9316","Unicode hex":"2464"},{"Typeface name":"Wingdings 2","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"9317","Unicode hex":"2465"},{"Typeface name":"Wingdings 2","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9318","Unicode hex":"2466"},{"Typeface name":"Wingdings 2","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9319","Unicode hex":"2467"},{"Typeface name":"Wingdings 2","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9320","Unicode hex":"2468"},{"Typeface name":"Wingdings 2","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9321","Unicode hex":"2469"},{"Typeface name":"Wingdings 2","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9471","Unicode hex":"24FF"},{"Typeface name":"Wingdings 2","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"10102","Unicode hex":"2776"},{"Typeface name":"Wingdings 2","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10103","Unicode hex":"2777"},{"Typeface name":"Wingdings 2","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"10104","Unicode hex":"2778"},{"Typeface name":"Wingdings 2","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10105","Unicode hex":"2779"},{"Typeface name":"Wingdings 2","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"10106","Unicode hex":"277A"},{"Typeface name":"Wingdings 2","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"10107","Unicode hex":"277B"},{"Typeface name":"Wingdings 2","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"10108","Unicode hex":"277C"},{"Typeface name":"Wingdings 2","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"10109","Unicode hex":"277D"},{"Typeface name":"Wingdings 2","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"10110","Unicode hex":"277E"},{"Typeface name":"Wingdings 2","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"10111","Unicode hex":"277F"},{"Typeface name":"Wingdings 2","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"9737","Unicode hex":"2609"},{"Typeface name":"Wingdings 2","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"127765","Unicode hex":"1F315"},{"Typeface name":"Wingdings 2","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"9789","Unicode hex":"263D"},{"Typeface name":"Wingdings 2","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"9790","Unicode hex":"263E"},{"Typeface name":"Wingdings 2","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11839","Unicode hex":"2E3F"},{"Typeface name":"Wingdings 2","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10013","Unicode hex":"271D"},{"Typeface name":"Wingdings 2","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"128327","Unicode hex":"1F547"},{"Typeface name":"Wingdings 2","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"128348","Unicode hex":"1F55C"},{"Typeface name":"Wingdings 2","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"128349","Unicode hex":"1F55D"},{"Typeface name":"Wingdings 2","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"128350","Unicode hex":"1F55E"},{"Typeface name":"Wingdings 2","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"128351","Unicode hex":"1F55F"},{"Typeface name":"Wingdings 2","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"128352","Unicode hex":"1F560"},{"Typeface name":"Wingdings 2","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"128353","Unicode hex":"1F561"},{"Typeface name":"Wingdings 2","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"128354","Unicode hex":"1F562"},{"Typeface name":"Wingdings 2","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128355","Unicode hex":"1F563"},{"Typeface name":"Wingdings 2","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128356","Unicode hex":"1F564"},{"Typeface name":"Wingdings 2","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128357","Unicode hex":"1F565"},{"Typeface name":"Wingdings 2","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128358","Unicode hex":"1F566"},{"Typeface name":"Wingdings 2","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"128359","Unicode hex":"1F567"},{"Typeface name":"Wingdings 2","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128616","Unicode hex":"1F668"},{"Typeface name":"Wingdings 2","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128617","Unicode hex":"1F669"},{"Typeface name":"Wingdings 2","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128900","Unicode hex":"1F784"},{"Typeface name":"Wingdings 2","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"10625","Unicode hex":"2981"},{"Typeface name":"Wingdings 2","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"9679","Unicode hex":"25CF"},{"Typeface name":"Wingdings 2","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"9675","Unicode hex":"25CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128901","Unicode hex":"1F785"},{"Typeface name":"Wingdings 2","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128903","Unicode hex":"1F787"},{"Typeface name":"Wingdings 2","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128905","Unicode hex":"1F789"},{"Typeface name":"Wingdings 2","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"8857","Unicode hex":"2299"},{"Typeface name":"Wingdings 2","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"10687","Unicode hex":"29BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128908","Unicode hex":"1F78C"},{"Typeface name":"Wingdings 2","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128909","Unicode hex":"1F78D"},{"Typeface name":"Wingdings 2","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"9726","Unicode hex":"25FE"},{"Typeface name":"Wingdings 2","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"9632","Unicode hex":"25A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"9633","Unicode hex":"25A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128913","Unicode hex":"1F791"},{"Typeface name":"Wingdings 2","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128914","Unicode hex":"1F792"},{"Typeface name":"Wingdings 2","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128915","Unicode hex":"1F793"},{"Typeface name":"Wingdings 2","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128916","Unicode hex":"1F794"},{"Typeface name":"Wingdings 2","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9635","Unicode hex":"25A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128917","Unicode hex":"1F795"},{"Typeface name":"Wingdings 2","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128918","Unicode hex":"1F796"},{"Typeface name":"Wingdings 2","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128919","Unicode hex":"1F797"},{"Typeface name":"Wingdings 2","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128920","Unicode hex":"1F798"},{"Typeface name":"Wingdings 2","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings 2","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"11045","Unicode hex":"2B25"},{"Typeface name":"Wingdings 2","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"9671","Unicode hex":"25C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"128922","Unicode hex":"1F79A"},{"Typeface name":"Wingdings 2","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"9672","Unicode hex":"25C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"128923","Unicode hex":"1F79B"},{"Typeface name":"Wingdings 2","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128924","Unicode hex":"1F79C"},{"Typeface name":"Wingdings 2","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"128925","Unicode hex":"1F79D"},{"Typeface name":"Wingdings 2","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128926","Unicode hex":"1F79E"},{"Typeface name":"Wingdings 2","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"11050","Unicode hex":"2B2A"},{"Typeface name":"Wingdings 2","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"11047","Unicode hex":"2B27"},{"Typeface name":"Wingdings 2","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128928","Unicode hex":"1F7A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"9686","Unicode hex":"25D6"},{"Typeface name":"Wingdings 2","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"9687","Unicode hex":"25D7"},{"Typeface name":"Wingdings 2","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"11210","Unicode hex":"2BCA"},{"Typeface name":"Wingdings 2","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"11211","Unicode hex":"2BCB"},{"Typeface name":"Wingdings 2","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"11200","Unicode hex":"2BC0"},{"Typeface name":"Wingdings 2","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"11201","Unicode hex":"2BC1"},{"Typeface name":"Wingdings 2","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"11039","Unicode hex":"2B1F"},{"Typeface name":"Wingdings 2","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"11202","Unicode hex":"2BC2"},{"Typeface name":"Wingdings 2","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"11043","Unicode hex":"2B23"},{"Typeface name":"Wingdings 2","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11042","Unicode hex":"2B22"},{"Typeface name":"Wingdings 2","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11203","Unicode hex":"2BC3"},{"Typeface name":"Wingdings 2","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11204","Unicode hex":"2BC4"},{"Typeface name":"Wingdings 2","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128929","Unicode hex":"1F7A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128930","Unicode hex":"1F7A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128931","Unicode hex":"1F7A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128932","Unicode hex":"1F7A4"},{"Typeface name":"Wingdings 2","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128933","Unicode hex":"1F7A5"},{"Typeface name":"Wingdings 2","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128934","Unicode hex":"1F7A6"},{"Typeface name":"Wingdings 2","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128935","Unicode hex":"1F7A7"},{"Typeface name":"Wingdings 2","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128936","Unicode hex":"1F7A8"},{"Typeface name":"Wingdings 2","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128937","Unicode hex":"1F7A9"},{"Typeface name":"Wingdings 2","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128938","Unicode hex":"1F7AA"},{"Typeface name":"Wingdings 2","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128939","Unicode hex":"1F7AB"},{"Typeface name":"Wingdings 2","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128940","Unicode hex":"1F7AC"},{"Typeface name":"Wingdings 2","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128941","Unicode hex":"1F7AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128942","Unicode hex":"1F7AE"},{"Typeface name":"Wingdings 2","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128943","Unicode hex":"1F7AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"128944","Unicode hex":"1F7B0"},{"Typeface name":"Wingdings 2","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"128945","Unicode hex":"1F7B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"128946","Unicode hex":"1F7B2"},{"Typeface name":"Wingdings 2","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"128947","Unicode hex":"1F7B3"},{"Typeface name":"Wingdings 2","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"128948","Unicode hex":"1F7B4"},{"Typeface name":"Wingdings 2","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"128949","Unicode hex":"1F7B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"128950","Unicode hex":"1F7B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"128951","Unicode hex":"1F7B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"128952","Unicode hex":"1F7B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"128953","Unicode hex":"1F7B9"},{"Typeface name":"Wingdings 2","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"128954","Unicode hex":"1F7BA"},{"Typeface name":"Wingdings 2","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"128955","Unicode hex":"1F7BB"},{"Typeface name":"Wingdings 2","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"128956","Unicode hex":"1F7BC"},{"Typeface name":"Wingdings 2","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128957","Unicode hex":"1F7BD"},{"Typeface name":"Wingdings 2","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128958","Unicode hex":"1F7BE"},{"Typeface name":"Wingdings 2","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"128959","Unicode hex":"1F7BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"128960","Unicode hex":"1F7C0"},{"Typeface name":"Wingdings 2","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128962","Unicode hex":"1F7C2"},{"Typeface name":"Wingdings 2","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128964","Unicode hex":"1F7C4"},{"Typeface name":"Wingdings 2","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"128966","Unicode hex":"1F7C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"128969","Unicode hex":"1F7C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128970","Unicode hex":"1F7CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"10038","Unicode hex":"2736"},{"Typeface name":"Wingdings 2","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"128972","Unicode hex":"1F7CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128974","Unicode hex":"1F7CE"},{"Typeface name":"Wingdings 2","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128976","Unicode hex":"1F7D0"},{"Typeface name":"Wingdings 2","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128978","Unicode hex":"1F7D2"},{"Typeface name":"Wingdings 2","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"10041","Unicode hex":"2739"},{"Typeface name":"Wingdings 2","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128963","Unicode hex":"1F7C3"},{"Typeface name":"Wingdings 2","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128967","Unicode hex":"1F7C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Wingdings 2","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128973","Unicode hex":"1F7CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128980","Unicode hex":"1F7D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11212","Unicode hex":"2BCC"},{"Typeface name":"Wingdings 2","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11213","Unicode hex":"2BCD"},{"Typeface name":"Wingdings 2","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"8251","Unicode hex":"203B"},{"Typeface name":"Wingdings 2","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"8258","Unicode hex":"2042"},{"Typeface name":"Wingdings 3","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 3","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"11104","Unicode hex":"2B60"},{"Typeface name":"Wingdings 3","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"11106","Unicode hex":"2B62"},{"Typeface name":"Wingdings 3","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"11105","Unicode hex":"2B61"},{"Typeface name":"Wingdings 3","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"11107","Unicode hex":"2B63"},{"Typeface name":"Wingdings 3","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"11110","Unicode hex":"2B66"},{"Typeface name":"Wingdings 3","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"11111","Unicode hex":"2B67"},{"Typeface name":"Wingdings 3","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"11113","Unicode hex":"2B69"},{"Typeface name":"Wingdings 3","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"11112","Unicode hex":"2B68"},{"Typeface name":"Wingdings 3","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"11120","Unicode hex":"2B70"},{"Typeface name":"Wingdings 3","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"11122","Unicode hex":"2B72"},{"Typeface name":"Wingdings 3","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"11121","Unicode hex":"2B71"},{"Typeface name":"Wingdings 3","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"11123","Unicode hex":"2B73"},{"Typeface name":"Wingdings 3","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"11126","Unicode hex":"2B76"},{"Typeface name":"Wingdings 3","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"11128","Unicode hex":"2B78"},{"Typeface name":"Wingdings 3","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"11131","Unicode hex":"2B7B"},{"Typeface name":"Wingdings 3","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"11133","Unicode hex":"2B7D"},{"Typeface name":"Wingdings 3","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"11108","Unicode hex":"2B64"},{"Typeface name":"Wingdings 3","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"11109","Unicode hex":"2B65"},{"Typeface name":"Wingdings 3","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"11114","Unicode hex":"2B6A"},{"Typeface name":"Wingdings 3","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"11116","Unicode hex":"2B6C"},{"Typeface name":"Wingdings 3","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"11115","Unicode hex":"2B6B"},{"Typeface name":"Wingdings 3","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"11117","Unicode hex":"2B6D"},{"Typeface name":"Wingdings 3","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"11085","Unicode hex":"2B4D"},{"Typeface name":"Wingdings 3","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"11168","Unicode hex":"2BA0"},{"Typeface name":"Wingdings 3","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"11169","Unicode hex":"2BA1"},{"Typeface name":"Wingdings 3","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"11170","Unicode hex":"2BA2"},{"Typeface name":"Wingdings 3","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"11171","Unicode hex":"2BA3"},{"Typeface name":"Wingdings 3","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"11172","Unicode hex":"2BA4"},{"Typeface name":"Wingdings 3","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"11173","Unicode hex":"2BA5"},{"Typeface name":"Wingdings 3","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"11174","Unicode hex":"2BA6"},{"Typeface name":"Wingdings 3","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"11175","Unicode hex":"2BA7"},{"Typeface name":"Wingdings 3","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"11152","Unicode hex":"2B90"},{"Typeface name":"Wingdings 3","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"11153","Unicode hex":"2B91"},{"Typeface name":"Wingdings 3","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"11154","Unicode hex":"2B92"},{"Typeface name":"Wingdings 3","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"11155","Unicode hex":"2B93"},{"Typeface name":"Wingdings 3","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"11136","Unicode hex":"2B80"},{"Typeface name":"Wingdings 3","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"11139","Unicode hex":"2B83"},{"Typeface name":"Wingdings 3","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"11134","Unicode hex":"2B7E"},{"Typeface name":"Wingdings 3","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"11135","Unicode hex":"2B7F"},{"Typeface name":"Wingdings 3","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"11140","Unicode hex":"2B84"},{"Typeface name":"Wingdings 3","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"11142","Unicode hex":"2B86"},{"Typeface name":"Wingdings 3","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"11141","Unicode hex":"2B85"},{"Typeface name":"Wingdings 3","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"11143","Unicode hex":"2B87"},{"Typeface name":"Wingdings 3","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"11151","Unicode hex":"2B8F"},{"Typeface name":"Wingdings 3","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"11149","Unicode hex":"2B8D"},{"Typeface name":"Wingdings 3","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"11150","Unicode hex":"2B8E"},{"Typeface name":"Wingdings 3","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"11148","Unicode hex":"2B8C"},{"Typeface name":"Wingdings 3","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"11118","Unicode hex":"2B6E"},{"Typeface name":"Wingdings 3","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"11119","Unicode hex":"2B6F"},{"Typeface name":"Wingdings 3","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9099","Unicode hex":"238B"},{"Typeface name":"Wingdings 3","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"8996","Unicode hex":"2324"},{"Typeface name":"Wingdings 3","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"8963","Unicode hex":"2303"},{"Typeface name":"Wingdings 3","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"8997","Unicode hex":"2325"},{"Typeface name":"Wingdings 3","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"9251","Unicode hex":"2423"},{"Typeface name":"Wingdings 3","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"9085","Unicode hex":"237D"},{"Typeface name":"Wingdings 3","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"8682","Unicode hex":"21EA"},{"Typeface name":"Wingdings 3","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"11192","Unicode hex":"2BB8"},{"Typeface name":"Wingdings 3","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"129184","Unicode hex":"1F8A0"},{"Typeface name":"Wingdings 3","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"129185","Unicode hex":"1F8A1"},{"Typeface name":"Wingdings 3","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"129186","Unicode hex":"1F8A2"},{"Typeface name":"Wingdings 3","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"129187","Unicode hex":"1F8A3"},{"Typeface name":"Wingdings 3","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"129188","Unicode hex":"1F8A4"},{"Typeface name":"Wingdings 3","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"129189","Unicode hex":"1F8A5"},{"Typeface name":"Wingdings 3","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"129190","Unicode hex":"1F8A6"},{"Typeface name":"Wingdings 3","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"129191","Unicode hex":"1F8A7"},{"Typeface name":"Wingdings 3","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"129192","Unicode hex":"1F8A8"},{"Typeface name":"Wingdings 3","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"129193","Unicode hex":"1F8A9"},{"Typeface name":"Wingdings 3","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"129194","Unicode hex":"1F8AA"},{"Typeface name":"Wingdings 3","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"129195","Unicode hex":"1F8AB"},{"Typeface name":"Wingdings 3","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"129104","Unicode hex":"1F850"},{"Typeface name":"Wingdings 3","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"129106","Unicode hex":"1F852"},{"Typeface name":"Wingdings 3","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"129105","Unicode hex":"1F851"},{"Typeface name":"Wingdings 3","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"129107","Unicode hex":"1F853"},{"Typeface name":"Wingdings 3","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"129108","Unicode hex":"1F854"},{"Typeface name":"Wingdings 3","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"129109","Unicode hex":"1F855"},{"Typeface name":"Wingdings 3","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"129111","Unicode hex":"1F857"},{"Typeface name":"Wingdings 3","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"129110","Unicode hex":"1F856"},{"Typeface name":"Wingdings 3","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"129112","Unicode hex":"1F858"},{"Typeface name":"Wingdings 3","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"129113","Unicode hex":"1F859"},{"Typeface name":"Wingdings 3","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9650","Unicode hex":"25B2"},{"Typeface name":"Wingdings 3","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9660","Unicode hex":"25BC"},{"Typeface name":"Wingdings 3","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9651","Unicode hex":"25B3"},{"Typeface name":"Wingdings 3","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9661","Unicode hex":"25BD"},{"Typeface name":"Wingdings 3","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9664","Unicode hex":"25C0"},{"Typeface name":"Wingdings 3","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9654","Unicode hex":"25B6"},{"Typeface name":"Wingdings 3","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"9665","Unicode hex":"25C1"},{"Typeface name":"Wingdings 3","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9655","Unicode hex":"25B7"},{"Typeface name":"Wingdings 3","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"9699","Unicode hex":"25E3"},{"Typeface name":"Wingdings 3","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"9698","Unicode hex":"25E2"},{"Typeface name":"Wingdings 3","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"9700","Unicode hex":"25E4"},{"Typeface name":"Wingdings 3","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"9701","Unicode hex":"25E5"},{"Typeface name":"Wingdings 3","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"128896","Unicode hex":"1F780"},{"Typeface name":"Wingdings 3","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128898","Unicode hex":"1F782"},{"Typeface name":"Wingdings 3","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128897","Unicode hex":"1F781"},{"Typeface name":"Wingdings 3","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128899","Unicode hex":"1F783"},{"Typeface name":"Wingdings 3","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"11205","Unicode hex":"2BC5"},{"Typeface name":"Wingdings 3","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"11206","Unicode hex":"2BC6"},{"Typeface name":"Wingdings 3","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"11207","Unicode hex":"2BC7"},{"Typeface name":"Wingdings 3","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11208","Unicode hex":"2BC8"},{"Typeface name":"Wingdings 3","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"11164","Unicode hex":"2B9C"},{"Typeface name":"Wingdings 3","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"11166","Unicode hex":"2B9E"},{"Typeface name":"Wingdings 3","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"11165","Unicode hex":"2B9D"},{"Typeface name":"Wingdings 3","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"11167","Unicode hex":"2B9F"},{"Typeface name":"Wingdings 3","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"129040","Unicode hex":"1F810"},{"Typeface name":"Wingdings 3","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"129042","Unicode hex":"1F812"},{"Typeface name":"Wingdings 3","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"129041","Unicode hex":"1F811"},{"Typeface name":"Wingdings 3","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"129043","Unicode hex":"1F813"},{"Typeface name":"Wingdings 3","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"129044","Unicode hex":"1F814"},{"Typeface name":"Wingdings 3","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"129046","Unicode hex":"1F816"},{"Typeface name":"Wingdings 3","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"129045","Unicode hex":"1F815"},{"Typeface name":"Wingdings 3","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"129047","Unicode hex":"1F817"},{"Typeface name":"Wingdings 3","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"129048","Unicode hex":"1F818"},{"Typeface name":"Wingdings 3","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"129050","Unicode hex":"1F81A"},{"Typeface name":"Wingdings 3","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"129049","Unicode hex":"1F819"},{"Typeface name":"Wingdings 3","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"129051","Unicode hex":"1F81B"},{"Typeface name":"Wingdings 3","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"129052","Unicode hex":"1F81C"},{"Typeface name":"Wingdings 3","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"129054","Unicode hex":"1F81E"},{"Typeface name":"Wingdings 3","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"129053","Unicode hex":"1F81D"},{"Typeface name":"Wingdings 3","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"129055","Unicode hex":"1F81F"},{"Typeface name":"Wingdings 3","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"129024","Unicode hex":"1F800"},{"Typeface name":"Wingdings 3","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"129026","Unicode hex":"1F802"},{"Typeface name":"Wingdings 3","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"129025","Unicode hex":"1F801"},{"Typeface name":"Wingdings 3","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"129027","Unicode hex":"1F803"},{"Typeface name":"Wingdings 3","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"129028","Unicode hex":"1F804"},{"Typeface name":"Wingdings 3","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"129030","Unicode hex":"1F806"},{"Typeface name":"Wingdings 3","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"129029","Unicode hex":"1F805"},{"Typeface name":"Wingdings 3","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"129031","Unicode hex":"1F807"},{"Typeface name":"Wingdings 3","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"129032","Unicode hex":"1F808"},{"Typeface name":"Wingdings 3","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"129034","Unicode hex":"1F80A"},{"Typeface name":"Wingdings 3","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"129033","Unicode hex":"1F809"},{"Typeface name":"Wingdings 3","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"129035","Unicode hex":"1F80B"},{"Typeface name":"Wingdings 3","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"129056","Unicode hex":"1F820"},{"Typeface name":"Wingdings 3","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"129058","Unicode hex":"1F822"},{"Typeface name":"Wingdings 3","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"129060","Unicode hex":"1F824"},{"Typeface name":"Wingdings 3","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"129062","Unicode hex":"1F826"},{"Typeface name":"Wingdings 3","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"129064","Unicode hex":"1F828"},{"Typeface name":"Wingdings 3","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"129066","Unicode hex":"1F82A"},{"Typeface name":"Wingdings 3","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"129068","Unicode hex":"1F82C"},{"Typeface name":"Wingdings 3","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"129180","Unicode hex":"1F89C"},{"Typeface name":"Wingdings 3","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"129181","Unicode hex":"1F89D"},{"Typeface name":"Wingdings 3","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"129182","Unicode hex":"1F89E"},{"Typeface name":"Wingdings 3","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"129183","Unicode hex":"1F89F"},{"Typeface name":"Wingdings 3","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"129070","Unicode hex":"1F82E"},{"Typeface name":"Wingdings 3","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"129072","Unicode hex":"1F830"},{"Typeface name":"Wingdings 3","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"129074","Unicode hex":"1F832"},{"Typeface name":"Wingdings 3","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"129076","Unicode hex":"1F834"},{"Typeface name":"Wingdings 3","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"129078","Unicode hex":"1F836"},{"Typeface name":"Wingdings 3","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"129080","Unicode hex":"1F838"},{"Typeface name":"Wingdings 3","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"129082","Unicode hex":"1F83A"},{"Typeface name":"Wingdings 3","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"129081","Unicode hex":"1F839"},{"Typeface name":"Wingdings 3","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"129083","Unicode hex":"1F83B"},{"Typeface name":"Wingdings 3","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"129176","Unicode hex":"1F898"},{"Typeface name":"Wingdings 3","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"129178","Unicode hex":"1F89A"},{"Typeface name":"Wingdings 3","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"129177","Unicode hex":"1F899"},{"Typeface name":"Wingdings 3","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"129179","Unicode hex":"1F89B"},{"Typeface name":"Wingdings 3","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"129084","Unicode hex":"1F83C"},{"Typeface name":"Wingdings 3","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"129086","Unicode hex":"1F83E"},{"Typeface name":"Wingdings 3","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"129085","Unicode hex":"1F83D"},{"Typeface name":"Wingdings 3","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"129087","Unicode hex":"1F83F"},{"Typeface name":"Wingdings 3","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"129088","Unicode hex":"1F840"},{"Typeface name":"Wingdings 3","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"129090","Unicode hex":"1F842"},{"Typeface name":"Wingdings 3","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"129089","Unicode hex":"1F841"},{"Typeface name":"Wingdings 3","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"129091","Unicode hex":"1F843"},{"Typeface name":"Wingdings 3","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"129092","Unicode hex":"1F844"},{"Typeface name":"Wingdings 3","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"129094","Unicode hex":"1F846"},{"Typeface name":"Wingdings 3","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"129093","Unicode hex":"1F845"},{"Typeface name":"Wingdings 3","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"129095","Unicode hex":"1F847"},{"Typeface name":"Wingdings 3","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11176","Unicode hex":"2BA8"},{"Typeface name":"Wingdings 3","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11177","Unicode hex":"2BA9"},{"Typeface name":"Wingdings 3","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"11178","Unicode hex":"2BAA"},{"Typeface name":"Wingdings 3","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"11179","Unicode hex":"2BAB"},{"Typeface name":"Wingdings 3","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"11180","Unicode hex":"2BAC"},{"Typeface name":"Wingdings 3","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"11181","Unicode hex":"2BAD"},{"Typeface name":"Wingdings 3","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"11182","Unicode hex":"2BAE"},{"Typeface name":"Wingdings 3","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"11183","Unicode hex":"2BAF"},{"Typeface name":"Wingdings 3","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"129120","Unicode hex":"1F860"},{"Typeface name":"Wingdings 3","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"129122","Unicode hex":"1F862"},{"Typeface name":"Wingdings 3","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"129121","Unicode hex":"1F861"},{"Typeface name":"Wingdings 3","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"129123","Unicode hex":"1F863"},{"Typeface name":"Wingdings 3","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"129124","Unicode hex":"1F864"},{"Typeface name":"Wingdings 3","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"129125","Unicode hex":"1F865"},{"Typeface name":"Wingdings 3","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"129127","Unicode hex":"1F867"},{"Typeface name":"Wingdings 3","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"129126","Unicode hex":"1F866"},{"Typeface name":"Wingdings 3","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"129136","Unicode hex":"1F870"},{"Typeface name":"Wingdings 3","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"129138","Unicode hex":"1F872"},{"Typeface name":"Wingdings 3","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"129137","Unicode hex":"1F871"},{"Typeface name":"Wingdings 3","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"129139","Unicode hex":"1F873"},{"Typeface name":"Wingdings 3","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"129140","Unicode hex":"1F874"},{"Typeface name":"Wingdings 3","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"129141","Unicode hex":"1F875"},{"Typeface name":"Wingdings 3","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129143","Unicode hex":"1F877"},{"Typeface name":"Wingdings 3","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129142","Unicode hex":"1F876"},{"Typeface name":"Wingdings 3","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129152","Unicode hex":"1F880"},{"Typeface name":"Wingdings 3","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129154","Unicode hex":"1F882"},{"Typeface name":"Wingdings 3","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129153","Unicode hex":"1F881"},{"Typeface name":"Wingdings 3","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129155","Unicode hex":"1F883"},{"Typeface name":"Wingdings 3","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129156","Unicode hex":"1F884"},{"Typeface name":"Wingdings 3","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129157","Unicode hex":"1F885"},{"Typeface name":"Wingdings 3","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129159","Unicode hex":"1F887"},{"Typeface name":"Wingdings 3","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129158","Unicode hex":"1F886"},{"Typeface name":"Wingdings 3","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129168","Unicode hex":"1F890"},{"Typeface name":"Wingdings 3","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129170","Unicode hex":"1F892"},{"Typeface name":"Wingdings 3","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129169","Unicode hex":"1F891"},{"Typeface name":"Wingdings 3","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129171","Unicode hex":"1F893"},{"Typeface name":"Wingdings 3","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129172","Unicode hex":"1F894"},{"Typeface name":"Wingdings 3","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129174","Unicode hex":"1F896"},{"Typeface name":"Wingdings 3","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"129173","Unicode hex":"1F895"},{"Typeface name":"Wingdings 3","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"129175","Unicode hex":"1F897"}];return pA.default=n,pA}var WH;function L2e(){if(WH)return Il;WH=1;var n=Il&&Il.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(Il,"__esModule",{value:!0}),Il.hex=Il.dec=Il.codePoint=void 0;for(var e=n(P2e()),t={},i=String.fromCodePoint?String.fromCodePoint:p,r=0,s=e.default;r<s.length;r++){var a=s[r],o=parseInt(a["Unicode dec"],10),l={codePoint:o,string:i(o)};t[a["Typeface name"].toUpperCase()+"_"+a["Dingbat dec"]]=l}function c(y,x){return t[y.toUpperCase()+"_"+x]}Il.codePoint=c;function h(y,x){return c(y,parseInt(x,10))}Il.dec=h;function f(y,x){return c(y,parseInt(x,16))}Il.hex=f;function p(y){if(y<=65535)return String.fromCharCode(y);var x=Math.floor((y-65536)/1024)+55296,v=(y-65536)%1024+56320;return String.fromCharCode(x,v)}return Il}var Ud={},HH;function oZ(){if(HH)return Ud;HH=1;var n=sr;Ud.paragraph=e,Ud.run=t,Ud._elements=r,Ud._elementsOfType=i,Ud.getDescendantsOfType=s,Ud.getDescendants=a;function e(l){return i("paragraph",l)}function t(l){return i("run",l)}function i(l,c){return r(function(h){return h.type===l?c(h):h})}function r(l){return function c(h){if(h.children){var f=n.map(h.children,c);h=n.extend(h,{children:f})}return l(h)}}function s(l,c){return a(l).filter(function(h){return h.type===c})}function a(l){var c=[];return o(l,function(h){c.push(h)}),c}function o(l,c){l.children&&l.children.forEach(function(h){o(h,c),c(h)})}return Ud}var gA={},zH;function O2e(){if(zH)return gA;zH=1,gA.uriToZipEntryName=n,gA.replaceFragment=e;function n(t,i){return i.charAt(0)==="/"?i.substr(1):t+"/"+i}function e(t,i){var r=t.indexOf("#");return r!==-1&&(t=t.substring(0,r)),t+"#"+i}return gA}var GH;function B2e(){if(GH)return fA;GH=1,fA.createBodyReader=l,fA._readNumberingProperties=h;var n=L2e(),e=sr,t=t0(),i=Bh().Result,r=Bh().warning,s=yL(),a=oZ(),o=O2e();function l(k){return{readXmlElement:function(F){return new c(k).readXmlElement(F)},readXmlElements:function(F){return new c(k).readXmlElements(F)}}}function c(k){var F=[],C=[],M=[],R=k.relationships,L=k.contentTypes,H=k.docxFile,P=k.files,O=k.numbering,B=k.styles;function re(ke){var xe=ke.map(q);return w(xe)}function q(ke){if(ke.type==="element"){var xe=ae[ke.name];if(xe)return xe(ke);if(!Object.prototype.hasOwnProperty.call(p,ke.name)){var Ye=r("An unrecognised element was ignored: "+ke.name);return y([Ye])}}return x()}function X(ke){return te(ke).map(function(xe){return{type:"paragraphProperties",styleId:xe.styleId,styleName:xe.name,alignment:ke.firstOrEmpty("w:jc").attributes["w:val"],numbering:h(xe.styleId,ke.firstOrEmpty("w:numPr"),O),indent:oe(ke.firstOrEmpty("w:ind"))}})}function oe(ke){return{start:ke.attributes["w:start"]||ke.attributes["w:left"],end:ke.attributes["w:end"]||ke.attributes["w:right"],firstLine:ke.attributes["w:firstLine"],hanging:ke.attributes["w:hanging"]}}function ue(ke){return ie(ke).map(function(xe){var Ye=ke.firstOrEmpty("w:sz").attributes["w:val"],Je=/^[0-9]+$/.test(Ye)?parseInt(Ye,10)/2:null;return{type:"runProperties",styleId:xe.styleId,styleName:xe.name,verticalAlignment:ke.firstOrEmpty("w:vertAlign").attributes["w:val"],font:ke.firstOrEmpty("w:rFonts").attributes["w:ascii"],fontSize:Je,isBold:j(ke.first("w:b")),isUnderline:ge(ke.first("w:u")),isItalic:j(ke.first("w:i")),isStrikethrough:j(ke.first("w:strike")),isAllCaps:j(ke.first("w:caps")),isSmallCaps:j(ke.first("w:smallCaps")),highlight:Z(ke.firstOrEmpty("w:highlight").attributes["w:val"])}})}function ge(ke){if(ke){var xe=ke.attributes["w:val"];return xe!==void 0&&xe!=="false"&&xe!=="0"&&xe!=="none"}else return!1}function j(ke){if(ke){var xe=ke.attributes["w:val"];return xe!=="false"&&xe!=="0"}else return!1}function G(ke){return ke!=="false"&&ke!=="0"}function Z(ke){return!ke||ke==="none"?null:ke}function te(ke){return Ie(ke,"w:pStyle","Paragraph",B.findParagraphStyleById)}function ie(ke){return Ie(ke,"w:rStyle","Run",B.findCharacterStyleById)}function _e(ke){return Ie(ke,"w:tblStyle","Table",B.findTableStyleById)}function Ie(ke,xe,Ye,Je){var pt=[],mt=ke.first(xe),Yt=null,Kt=null;if(mt&&(Yt=mt.attributes["w:val"],Yt)){var jt=Je(Yt);jt?Kt=jt.name:pt.push(on(Ye,Yt))}return _({styleId:Yt,name:Kt},pt)}function Pe(ke){var xe=ke.attributes["w:fldCharType"];if(xe==="begin")F.push({type:"begin",fldChar:ke}),C=[];else if(xe==="end"){var Ye=F.pop();if(Ye.type==="begin"&&(Ye=Ge(Ye)),Ye.type==="checkbox")return v(t.checkbox({checked:Ye.checked}))}else if(xe==="separate"){var Je=F.pop(),pt=Ge(Je);F.push(pt)}return x()}function Fe(){var ke=e.last(F.filter(function(xe){return xe.type==="hyperlink"}));return ke?ke.options:null}function Ge(ke){return ct(C.join(""),ke.type==="begin"?ke.fldChar:s.emptyElement)}function ct(ke,xe){var Ye=/^\s*HYPERLINK\s+(\\l\s+)?(?:"(.*)"|([^\\]\S*))/.exec(ke);if(Ye){var Je=Ye[2]===void 0?Ye[3]:Ye[2],pt=Ye[1]===void 0?{href:Je}:{anchor:Je};return{type:"hyperlink",options:pt}}var mt=/\s*FORMCHECKBOX\s*/.exec(ke);if(mt){var Yt=xe.firstOrEmpty("w:ffData").firstOrEmpty("w:checkBox"),Kt=Yt.first("w:checked"),jt=Kt==null?j(Yt.first("w:default")):j(Kt);return{type:"checkbox",checked:jt}}return{type:"unknown"}}function gt(ke){return C.push(ke.text()),x()}function Mt(ke){var xe=ke.attributes["w:font"],Ye=ke.attributes["w:char"],Je=n.hex(xe,Ye);return Je==null&&/^F0..$/.test(Ye)&&(Je=n.hex(xe,Ye.substring(2))),Je==null?y([r("A w:sym element with an unsupported character was ignored: char "+Ye+" in font "+xe)]):v(new t.Text(Je.string))}function W(ke){return function(xe){var Ye=xe.attributes["w:id"];return v(new t.NoteReference({noteType:ke,noteId:Ye}))}}function Re(ke){return v(t.commentReference({commentId:ke.attributes["w:id"]}))}function Te(ke){return re(ke.children)}var ae={"w:p":function(ke){var xe=ke.firstOrEmpty("w:pPr"),Ye=!!xe.firstOrEmpty("w:rPr").first("w:del");if(Ye)return ke.children.forEach(function(pt){M.push(pt)}),x();var Je=ke.children;return M.length>0&&(Je=M.concat(Je),M=[]),E.map(X(xe),re(Je),function(pt,mt){return new t.Paragraph(mt,pt)}).insertExtra()},"w:r":function(ke){return E.map(ue(ke.firstOrEmpty("w:rPr")),re(ke.children),function(xe,Ye){var Je=Fe();return Je!==null&&(Ye=[new t.Hyperlink(Ye,Je)]),new t.Run(Ye,xe)})},"w:fldChar":Pe,"w:instrText":gt,"w:t":function(ke){return v(new t.Text(ke.text()))},"w:tab":function(ke){return v(new t.Tab)},"w:noBreakHyphen":function(){return v(new t.Text("‑"))},"w:softHyphen":function(ke){return v(new t.Text("­"))},"w:sym":Mt,"w:hyperlink":function(ke){var xe=ke.attributes["r:id"],Ye=ke.attributes["w:anchor"];return re(ke.children).map(function(Je){function pt(Yt){var Kt=ke.attributes["w:tgtFrame"]||null;return new t.Hyperlink(Je,e.extend({targetFrame:Kt},Yt))}if(xe){var mt=R.findTargetByRelationshipId(xe);return Ye&&(mt=o.replaceFragment(mt,Ye)),pt({href:mt})}else return Ye?pt({anchor:Ye}):Je})},"w:tbl":he,"w:tr":Le,"w:tc":$e,"w:footnoteReference":W("footnote"),"w:endnoteReference":W("endnote"),"w:commentReference":Re,"w:br":function(ke){var xe=ke.attributes["w:type"];return xe==null||xe==="textWrapping"?v(t.lineBreak):xe==="page"?v(t.pageBreak):xe==="column"?v(t.columnBreak):y([r("Unsupported break type: "+xe)])},"w:bookmarkStart":function(ke){var xe=ke.attributes["w:name"];return xe==="_GoBack"?x():v(new t.BookmarkStart({name:xe}))},"mc:AlternateContent":function(ke){return Te(ke.firstOrEmpty("mc:Fallback"))},"w:sdt":function(ke){var xe=re(ke.firstOrEmpty("w:sdtContent").children);return xe.map(function(Ye){var Je=ke.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(Je){var pt=Je.first("wordml:checked"),mt=!!pt&&G(pt.attributes["wordml:val"]),Yt=t.checkbox({checked:mt}),Kt=!1,jt=Ye.map(a._elementsOfType(t.types.text,function(ne){return ne.value.length>0&&!Kt?(Kt=!0,Yt):ne}));return Kt?jt:Yt}else return Ye})},"w:ins":Te,"w:object":Te,"w:smartTag":Te,"w:drawing":Te,"w:pict":function(ke){return Te(ke).toExtra()},"v:roundrect":Te,"v:shape":Te,"v:textbox":Te,"w:txbxContent":Te,"wp:inline":Me,"wp:anchor":Me,"v:imagedata":zt,"v:group":Te,"v:rect":Te};return{readXmlElement:q,readXmlElements:re};function he(ke){var xe=we(ke.firstOrEmpty("w:tblPr"));return re(ke.children).flatMap(be).flatMap(function(Ye){return xe.map(function(Je){return t.Table(Ye,Je)})})}function we(ke){return _e(ke).map(function(xe){return{styleId:xe.styleId,styleName:xe.name}})}function Le(ke){var xe=ke.firstOrEmpty("w:trPr"),Ye=!!xe.first("w:del");if(Ye)return x();var Je=!!xe.first("w:tblHeader");return re(ke.children).map(function(pt){return t.TableRow(pt,{isHeader:Je})})}function $e(ke){return re(ke.children).map(function(xe){var Ye=ke.firstOrEmpty("w:tcPr"),Je=Ye.firstOrEmpty("w:gridSpan").attributes["w:val"],pt=Je?parseInt(Je,10):1,mt=t.TableCell(xe,{colSpan:pt});return mt._vMerge=Ce(Ye),mt})}function Ce(ke){var xe=ke.first("w:vMerge");if(xe){var Ye=xe.attributes["w:val"];return Ye==="continue"||!Ye}else return null}function be(ke){var xe=e.any(ke,function(pt){return pt.type!==t.types.tableRow});if(xe)return Ee(ke),_(ke,[r("unexpected non-row element in table, cell merging may be incorrect")]);var Ye=e.any(ke,function(pt){return e.any(pt.children,function(mt){return mt.type!==t.types.tableCell})});if(Ye)return Ee(ke),_(ke,[r("unexpected non-cell element in table row, cell merging may be incorrect")]);var Je={};return ke.forEach(function(pt){var mt=0;pt.children.forEach(function(Yt){Yt._vMerge&&Je[mt]?Je[mt].rowSpan++:(Je[mt]=Yt,Yt._vMerge=!1),mt+=Yt.colSpan})}),ke.forEach(function(pt){pt.children=pt.children.filter(function(mt){return!mt._vMerge}),pt.children.forEach(function(mt){delete mt._vMerge})}),v(ke)}function Ee(ke){ke.forEach(function(xe){var Ye=a.getDescendantsOfType(xe,t.types.tableCell);Ye.forEach(function(Je){delete Je._vMerge})})}function Me(ke){var xe=ke.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return w(xe.map(Xe.bind(null,ke)))}function Xe(ke,xe){var Ye=ke.firstOrEmpty("wp:docPr"),Je=Ye.attributes,pt=dt(Je.descr)?Je.title:Je.descr,mt=bt(xe);return mt===null?y([r("Could not find image file for a:blip element")]):Gt(mt,pt).map(function(Yt){var Kt=Ye.firstOrEmpty("a:hlinkClick"),jt=Kt.attributes["r:id"];if(jt){var ne=R.findTargetByRelationshipId(jt);return new t.Hyperlink([Yt],{href:ne})}else return Yt})}function dt(ke){return ke==null||/^\s*$/.test(ke)}function bt(ke){var xe=ke.attributes["r:embed"],Ye=ke.attributes["r:link"];if(xe)return Nt(xe);if(Ye){var Je=R.findTargetByRelationshipId(Ye);return{path:Je,read:P.read.bind(P,Je)}}else return null}function zt(ke){var xe=ke.attributes["r:id"];return xe?Gt(Nt(xe),ke.attributes["o:title"]):y([r("A v:imagedata element without a relationship ID was ignored")])}function Nt(ke){var xe=o.uriToZipEntryName("word",R.findTargetByRelationshipId(ke));return{path:xe,read:H.read.bind(H,xe)}}function Gt(ke,xe){var Ye=L.findContentType(ke.path),Je=t.Image({readImage:ke.read,altText:xe,contentType:Ye}),pt=f[Ye]?[]:r("Image of type "+Ye+" is unlikely to display in web browsers");return _(Je,pt)}function on(ke,xe){return r(ke+" style with ID "+xe+" was referenced but not defined in the document")}}function h(k,F,C){var M=F.firstOrEmpty("w:ilvl").attributes["w:val"],R=F.firstOrEmpty("w:numId").attributes["w:val"];if(M!==void 0&&R!==void 0)return C.findLevel(R,M);if(k!=null){var L=C.findLevelByParagraphStyleId(k);if(L!=null)return L}return R!==void 0?C.findLevel(R,"0"):null}var f={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},p={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function y(k){return new E(null,null,k)}function x(){return new E(null)}function v(k){return new E(k)}function _(k,F){return new E(k,null,F)}function E(k,F,C){this.value=k||[],this.extra=F||[],this._result=new i({element:this.value,extra:F},C),this.messages=this._result.messages}E.prototype.toExtra=function(){return new E(null,A(this.extra,this.value),this.messages)},E.prototype.insertExtra=function(){var k=this.extra;return k&&k.length?new E(A(this.value,k),null,this.messages):this},E.prototype.map=function(k){var F=this._result.map(function(C){return k(C.element)});return new E(F.value,this.extra,F.messages)},E.prototype.flatMap=function(k){var F=this._result.flatMap(function(C){return k(C.element)._result});return new E(F.value.element,A(this.extra,F.value.extra),F.messages)},E.map=function(k,F,C){return new E(C(k.value,F.value),A(k.extra,F.extra),k.messages.concat(F.messages))};function w(k){var F=i.combine(e.pluck(k,"_result"));return new E(e.flatten(e.pluck(F.value,"element")),e.filter(e.flatten(e.pluck(F.value,"extra")),N),F.messages)}function A(k,F){return e.flatten([k,F])}function N(k){return k}return fA}var O3={},qH;function V2e(){if(qH)return O3;qH=1,O3.DocumentXmlReader=t;var n=t0(),e=Bh().Result;function t(i){var r=i.bodyReader;function s(a){var o=a.first("w:body");if(o==null)throw new Error("Could not find the body element: are you sure this is a docx file?");var l=r.readXmlElements(o.children).map(function(c){return new n.Document(c,{notes:i.notes,comments:i.comments})});return new e(l.value,l.messages)}return{convertXmlToDocument:s}}return O3}var fx={},$H;function W2e(){if($H)return fx;$H=1,fx.readRelationships=n,fx.defaultValue=new e([]),fx.Relationships=e;function n(t){var i=[];return t.children.forEach(function(r){if(r.name==="relationships:Relationship"){var s={relationshipId:r.attributes.Id,target:r.attributes.Target,type:r.attributes.Type};i.push(s)}}),new e(i)}function e(t){var i={};t.forEach(function(s){i[s.relationshipId]=s.target});var r={};return t.forEach(function(s){r[s.type]||(r[s.type]=[]),r[s.type].push(s.target)}),{findTargetByRelationshipId:function(s){return i[s]},findTargetsByType:function(s){return r[s]||[]}}}return fx}var mA={},jH;function H2e(){if(jH)return mA;jH=1,mA.readContentTypesFromXml=e;var n={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};mA.defaultContentTypes=t({},{});function e(i){var r={},s={};return i.children.forEach(function(a){if(a.name==="content-types:Default"&&(r[a.attributes.Extension]=a.attributes.ContentType),a.name==="content-types:Override"){var o=a.attributes.PartName;o.charAt(0)==="/"&&(o=o.substring(1)),s[o]=a.attributes.ContentType}}),t(s,r)}function t(i,r){return{findContentType:function(s){var a=i[s];if(a)return a;var o=s.split("."),l=o[o.length-1];if(r.hasOwnProperty(l))return r[l];var c=n[l.toLowerCase()];return c?"image/"+c:null}}}return mA}var px={},XH;function z2e(){if(XH)return px;XH=1;var n=sr;px.readNumberingXml=t,px.Numbering=e,px.defaultNumbering=new e({},{});function e(a,o,l){var c=n.flatten(n.values(o).map(function(y){return n.values(y.levels)})),h=n.indexBy(c.filter(function(y){return y.paragraphStyleId!=null}),"paragraphStyleId");function f(y,x){var v=a[y];if(v){var _=o[v.abstractNumId];if(_){if(_.numStyleLink==null)return o[v.abstractNumId].levels[x];var E=l.findNumberingStyleById(_.numStyleLink);return f(E.numId,x)}else return null}else return null}function p(y){return h[y]||null}return{findLevel:f,findLevelByParagraphStyleId:p}}function t(a,o){if(!o||!o.styles)throw new Error("styles is missing");var l=i(a),c=s(a);return new e(c,l,o.styles)}function i(a){var o={};return a.getElementsByTagName("w:abstractNum").forEach(function(l){var c=l.attributes["w:abstractNumId"];o[c]=r(l)}),o}function r(a){var o={},l=null;a.getElementsByTagName("w:lvl").forEach(function(h){var f=h.attributes["w:ilvl"],p=h.firstOrEmpty("w:numFmt").attributes["w:val"],y=p!=="bullet",x=h.firstOrEmpty("w:pStyle").attributes["w:val"];f===void 0?l={isOrdered:y,level:"0",paragraphStyleId:x}:o[f]={isOrdered:y,level:f,paragraphStyleId:x}}),l!==null&&o[l.level]===void 0&&(o[l.level]=l);var c=a.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:o,numStyleLink:c}}function s(a){var o={};return a.getElementsByTagName("w:num").forEach(function(l){var c=l.attributes["w:numId"],h=l.first("w:abstractNumId").attributes["w:val"];o[c]={abstractNumId:h}}),o}return px}var gx={},KH;function G2e(){if(KH)return gx;KH=1,gx.readStylesXml=e,gx.Styles=n,gx.defaultStyles=new n({},{});function n(a,o,l,c){return{findParagraphStyleById:function(h){return a[h]},findCharacterStyleById:function(h){return o[h]},findTableStyleById:function(h){return l[h]},findNumberingStyleById:function(h){return c[h]}}}n.EMPTY=new n({},{},{},{});function e(a){var o={},l={},c={},h={},f={paragraph:o,character:l,table:c,numbering:h};return a.getElementsByTagName("w:style").forEach(function(p){var y=t(p),x=f[y.type];x&&x[y.styleId]===void 0&&(x[y.styleId]=y)}),new n(o,l,c,h)}function t(a){var o=a.attributes["w:type"];if(o==="numbering")return r(o,a);var l=s(a),c=i(a);return{type:o,styleId:l,name:c}}function i(a){var o=a.first("w:name");return o?o.attributes["w:val"]:null}function r(a,o){var l=s(o),c=o.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:a,numId:c,styleId:l}}function s(a){return a.attributes["w:styleId"]}return gx}var Q0={},YH;function q2e(){if(YH)return Q0;YH=1;var n=t0(),e=Bh().Result;Q0.createFootnotesReader=t.bind(Q0,"footnote"),Q0.createEndnotesReader=t.bind(Q0,"endnote");function t(i,r){function s(l){return e.combine(l.getElementsByTagName("w:"+i).filter(a).map(o))}function a(l){var c=l.attributes["w:type"];return c!=="continuationSeparator"&&c!=="separator"}function o(l){var c=l.attributes["w:id"];return r.readXmlElements(l.children).map(function(h){return n.Note({noteType:i,noteId:c,body:h})})}return s}return Q0}var B3={},JH;function $2e(){if(JH)return B3;JH=1;var n=t0(),e=Bh().Result;function t(i){function r(a){return e.combine(a.getElementsByTagName("w:comment").map(s))}function s(a){var o=a.attributes["w:id"];function l(c){return(a.attributes[c]||"").trim()||null}return i.readXmlElements(a.children).map(function(c){return n.comment({commentId:o,body:c,authorName:l("w:author"),authorInitials:l("w:initials")})})}return r}return B3.createCommentsReader=t,B3}var V3={},QH;function j2e(){if(QH)return V3;QH=1;var n=Tp();V3.Files=e;function e(){function t(i){return n.reject(new Error("could not open external image: '"+i+`'
cannot open linked files from a web browser`))}return{read:t}}return V3}var ZH;function X2e(){if(ZH)return aA;ZH=1,aA.read=x,aA._findPartPaths=v;var n=Tp(),e=t0(),t=Bh().Result,i=nZ(),r=U2e().readXmlFromZipFile,s=B2e().createBodyReader,a=V2e().DocumentXmlReader,o=W2e(),l=H2e(),c=z2e(),h=G2e(),f=q2e(),p=$2e(),y=j2e().Files;function x(R,L,H){L=L||{},H=H||{};var P=new y({externalFileAccess:H.externalFileAccess,relativeToFile:L.path});return n.props({contentTypes:k(R),partPaths:v(R),docxFile:R,files:P}).also(function(O){return{styles:C(R,O.partPaths.styles)}}).also(function(O){return{numbering:F(R,O.partPaths.numbering,O.styles)}}).also(function(O){return{footnotes:A(O.partPaths.footnotes,O,function(B,re){return re?f.createFootnotesReader(B)(re):new t([])}),endnotes:A(O.partPaths.endnotes,O,function(B,re){return re?f.createEndnotesReader(B)(re):new t([])}),comments:A(O.partPaths.comments,O,function(B,re){return re?p.createCommentsReader(B)(re):new t([])})}}).also(function(O){return{notes:O.footnotes.flatMap(function(B){return O.endnotes.map(function(re){return new e.Notes(B.concat(re))})})}}).then(function(O){return A(O.partPaths.mainDocument,O,function(B,re){return O.notes.flatMap(function(q){return O.comments.flatMap(function(X){var oe=new a({bodyReader:B,notes:q,comments:X});return oe.convertXmlToDocument(re)})})})})}function v(R){return M(R).then(function(L){var H=_({docxFile:R,relationships:L,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!R.exists(H))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return w({filename:N(H),readElement:o.readRelationships,defaultValue:o.defaultValue})(R).then(function(P){function O(B){return _({docxFile:R,relationships:P,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+B,basePath:i.splitPath(H).dirname,fallbackPath:"word/"+B+".xml"})}return{mainDocument:H,comments:O("comments"),endnotes:O("endnotes"),footnotes:O("footnotes"),numbering:O("numbering"),styles:O("styles")}})})}function _(R){var L=R.docxFile,H=R.relationships,P=R.relationshipType,O=R.basePath,B=R.fallbackPath,re=H.findTargetsByType(P),q=re.map(function(oe){return E(i.joinPath(O,oe),"/")}),X=q.filter(function(oe){return L.exists(oe)});return X.length===0?B:X[0]}function E(R,L){return R.substring(0,L.length)===L?R.substring(L.length):R}function w(R){return function(L){return r(L,R.filename).then(function(H){return H?R.readElement(H):R.defaultValue})}}function A(R,L,H){var P=w({filename:N(R),readElement:o.readRelationships,defaultValue:o.defaultValue});return P(L.docxFile).then(function(O){var B=new s({relationships:O,contentTypes:L.contentTypes,docxFile:L.docxFile,numbering:L.numbering,styles:L.styles,files:L.files});return r(L.docxFile,R).then(function(re){return H(B,re)})})}function N(R){var L=i.splitPath(R);return i.joinPath(L.dirname,"_rels",L.basename+".rels")}var k=w({filename:"[Content_Types].xml",readElement:l.readContentTypesFromXml,defaultValue:l.defaultContentTypes});function F(R,L,H){return w({filename:L,readElement:function(P){return c.readNumberingXml(P,{styles:H})},defaultValue:c.defaultNumbering})(R)}function C(R,L){return w({filename:L,readElement:h.readStylesXml,defaultValue:h.defaultStyles})(R)}var M=w({filename:"_rels/.rels",readElement:o.readRelationships,defaultValue:o.defaultValue});return aA}var yA={},ez;function K2e(){if(ez)return yA;ez=1;var n=sr,e=Tp(),t=yL();yA.writeStyleMap=a,yA.readStyleMap=h;var i="http://schemas.zwobble.org/mammoth/style-map",r="mammoth/style-map",s="/"+r;function a(f,p){return f.write(r,p),o(f).then(function(){return l(f)})}function o(f){var p="word/_rels/document.xml.rels",y="http://schemas.openxmlformats.org/package/2006/relationships",x="{"+y+"}Relationship";return f.read(p,"utf8").then(t.readString).then(function(v){var _=v.children;c(_,x,"Id",{Id:"rMammothStyleMap",Type:i,Target:s});var E={"":y};return f.write(p,t.writeString(v,E))})}function l(f){var p="[Content_Types].xml",y="http://schemas.openxmlformats.org/package/2006/content-types",x="{"+y+"}Override";return f.read(p,"utf8").then(t.readString).then(function(v){var _=v.children;c(_,x,"PartName",{PartName:s,ContentType:"text/prs.mammoth.style-map"});var E={"":y};return f.write(p,t.writeString(v,E))})}function c(f,p,y,x){var v=n.find(f,function(_){return _.name===p&&_.attributes[y]===x[y]});v?v.attributes=x:f.push(t.element(p,x))}function h(f){return f.exists(r)?f.read(r,"utf8"):e.resolve(null)}return yA}var vA={},tg={},Lu={},Pd={},tz;function lZ(){if(tz)return Pd;tz=1;var n=GI();function e(l,c,h){return i(n.element(l,c,{fresh:!1}),h)}function t(l,c,h){var f=n.element(l,c,{fresh:!0});return i(f,h)}function i(l,c){return{type:"element",tag:l,children:c||[]}}function r(l){return{type:"text",value:l}}var s={type:"forceWrite"};Pd.freshElement=t,Pd.nonFreshElement=e,Pd.elementWithTag=i,Pd.text=r,Pd.forceWrite=s;var a={br:!0,hr:!0,img:!0,input:!0};function o(l){return l.children.length===0&&a[l.tag.tagName]}return Pd.isVoidElement=o,Pd}var W3,nz;function Y2e(){if(nz)return W3;nz=1;var n=sr,e=lZ();function t(v){return i(c(v))}function i(v){var _=[];return v.map(r).forEach(function(E){l(_,E)}),_}function r(v){return s[v.type](v)}var s={element:a,text:o,forceWrite:o};function a(v){return e.elementWithTag(v.tag,i(v.children))}function o(v){return v}function l(v,_){var E=v[v.length-1];_.type==="element"&&!_.tag.fresh&&E&&E.type==="element"&&_.tag.matchesElement(E.tag)?(_.tag.separator&&l(E.children,e.text(_.tag.separator)),_.children.forEach(function(w){l(E.children,w)})):v.push(_)}function c(v){return h(v,function(_){return f[_.type](_)})}function h(v,_){return n.flatten(n.map(v,_),!0)}var f={element:y,text:x,forceWrite:p};function p(v){return[v]}function y(v){var _=c(v.children);return _.length===0&&!e.isVoidElement(v)?[]:[e.elementWithTag(v.tag,_)]}function x(v){return v.value.length===0?[]:[v]}return W3=t,W3}var iz;function zI(){if(iz)return Lu;iz=1;var n=lZ();Lu.freshElement=n.freshElement,Lu.nonFreshElement=n.nonFreshElement,Lu.elementWithTag=n.elementWithTag,Lu.text=n.text,Lu.forceWrite=n.forceWrite,Lu.simplify=Y2e();function e(a,o){o.forEach(function(l){t(a,l)})}function t(a,o){i[o.type](a,o)}var i={element:r,text:s,forceWrite:function(){}};function r(a,o){n.isVoidElement(o)?a.selfClosing(o.tag.tagName,o.tag.attributes):(a.open(o.tag.tagName,o.tag.attributes),e(a,o.children),a.close(o.tag.tagName))}function s(a,o){a.text(o.value)}return Lu.write=e,Lu}var rz;function GI(){if(rz)return tg;rz=1;var n=sr,e=zI();tg.topLevelElement=t,tg.elements=i,tg.element=s;function t(o,l){return i([s(o,l,{fresh:!0})])}function i(o){return new r(o.map(function(l){return n.isString(l)?s(l):l}))}function r(o){this._elements=o}r.prototype.wrap=function(l){for(var c=l(),h=this._elements.length-1;h>=0;h--)c=this._elements[h].wrapNodes(c);return c};function s(o,l,c){return c=c||{},new a(o,l,c)}function a(o,l,c){var h={};n.isArray(o)?(o.forEach(function(f){h[f]=!0}),o=o[0]):h[o]=!0,this.tagName=o,this.tagNames=h,this.attributes=l||{},this.fresh=c.fresh,this.separator=c.separator}return a.prototype.matchesElement=function(o){return this.tagNames[o.tagName]&&n.isEqual(this.attributes||{},o.attributes||{})},a.prototype.wrap=function(l){return this.wrapNodes(l())},a.prototype.wrapNodes=function(l){return[e.elementWithTag(this,l)]},tg.empty=i([]),tg.ignore={wrap:function(){return[]}},tg}var H3={},sz;function cZ(){return sz||(sz=1,(function(n){var e=sr,t=Tp(),i=zI();n.imgElement=r;function r(s){return function(a,o){return t.when(s(a)).then(function(l){var c={};return a.altText&&(c.alt=a.altText),e.extend(c,l),[i.freshElement("img",c)]})}}n.inline=n.imgElement,n.dataUri=r(function(s){return s.readAsBase64String().then(function(a){return{src:"data:"+s.contentType+";base64,"+a}})})})(H3)),H3}var z3={},G3={},az;function J2e(){if(az)return G3;az=1;var n=sr;G3.writer=e;function e(o){return o=o||{},o.prettyPrint?i():r()}var t={div:!0,p:!0,ul:!0,li:!0};function i(){var o=0,l="  ",c=[],h=!0,f=!1,p=r();function y(k,F){t[k]&&A(),c.push(k),p.open(k,F),t[k]&&o++,h=!1}function x(k){t[k]&&(o--,A()),c.pop(),p.close(k)}function v(k){w();var F=N()?k:k.replace(`
`,`
`+l);p.text(F)}function _(k,F){A(),p.selfClosing(k,F)}function E(){return c.length===0||t[c[c.length-1]]}function w(){f||(A(),f=!0)}function A(){if(f=!1,!h&&E()&&!N()){p._append(`
`);for(var k=0;k<o;k++)p._append(l)}}function N(){return n.some(c,function(k){return k==="pre"})}return{asString:p.asString,open:y,close:x,text:v,selfClosing:_}}function r(){var o=[];function l(v,_){var E=f(_);o.push("<"+v+E+">")}function c(v){o.push("</"+v+">")}function h(v,_){var E=f(_);o.push("<"+v+E+" />")}function f(v){return n.map(v,function(_,E){return" "+E+'="'+a(_)+'"'}).join("")}function p(v){o.push(s(v))}function y(v){o.push(v)}function x(){return o.join("")}return{asString:x,open:l,close:c,text:p,selfClosing:h,_append:y}}function s(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return G3}var q3={},oz;function Q2e(){if(oz)return q3;oz=1;var n=sr;function e(f){return t(f,f)}function t(f,p){return function(){return{start:f,end:p}}}function i(f){var p=f.href||"";return p?{start:"[",end:"]("+p+")",anchorPosition:"before"}:{}}function r(f){var p=f.src||"",y=f.alt||"";return p||y?{start:"!["+y+"]("+p+")"}:{}}function s(f){return function(p,y){return{start:y?`
`:"",end:y?"":`
`,list:{isOrdered:f.isOrdered,indent:y?y.indent+1:0,count:0}}}}function a(f,p,y){p=p||{indent:0,isOrdered:!1,count:0},p.count++,y.hasClosed=!1;var x=p.isOrdered?p.count+".":"-",v=l("	",p.indent)+x+" ";return{start:v,end:function(){if(!y.hasClosed)return y.hasClosed=!0,`
`}}}var o={p:t("",`

`),br:t("",`  
`),ul:s({isOrdered:!1}),ol:s({isOrdered:!0}),li:a,strong:e("__"),em:e("*"),a:i,img:r};(function(){for(var f=1;f<=6;f++)o["h"+f]=t(l("#",f)+" ",`

`)})();function l(f,p){return new Array(p+1).join(f)}function c(){var f=[],p=[],y=null,x={};function v(k,F){F=F||{};var C=o[k]||function(){return{}},M=C(F,y,x);p.push({end:M.end,list:y}),M.list&&(y=M.list);var R=M.anchorPosition==="before";R&&_(F),f.push(M.start||""),R||_(F)}function _(k){k.id&&f.push('<a id="'+k.id+'"></a>')}function E(k){var F=p.pop();y=F.list;var C=n.isFunction(F.end)?F.end():F.end;f.push(C||"")}function w(k,F){v(k,F),E()}function A(k){f.push(h(k))}function N(){return f.join("")}return{asString:N,open:v,close:E,text:A,selfClosing:w}}q3.writer=c;function h(f){return f.replace(/\\/g,"\\\\").replace(/([\`\*_\{\}\[\]\(\)\#\+\-\.\!])/g,"\\$1")}return q3}var lz;function Z2e(){if(lz)return z3;lz=1;var n=J2e(),e=Q2e();z3.writer=t;function t(i){return i=i||{},i.outputFormat==="markdown"?e.writer():n.writer(i)}return z3}var cz;function eTe(){if(cz)return vA;cz=1;var n=sr,e=Tp(),t=t0(),i=GI(),r=Bh(),s=cZ(),a=zI(),o=Z2e();vA.DocumentConverter=l;function l(_){return{convertToHtml:function(E){var w=n.indexBy(E.type===t.types.document?E.comments:[],"commentId"),A=new c(_,w);return A.convertToHtml(E)}}}function c(_,E){var w=1,A=[],N=[];_=n.extend({ignoreEmptyParagraphs:!0},_);var k=_.idPrefix===void 0?"":_.idPrefix,F=_.ignoreEmptyParagraphs,C=i.topLevelElement("p"),M=_.styleMap||[];function R(W){var Re=[],Te=H(W,Re,{}),ae=[];x(Te,function(we){we.type==="deferred"&&ae.push(we)});var he={};return e.mapSeries(ae,function(we){return we.value().then(function(Le){he[we.id]=Le})}).then(function(){function we($e){return y($e,function(Ce){return Ce.type==="deferred"?he[Ce.id]:Ce.children?[n.extend({},Ce,{children:we(Ce.children)})]:[Ce]})}var Le=o.writer({prettyPrint:_.prettyPrint,outputFormat:_.outputFormat});return a.write(Le,a.simplify(we(Te))),new r.Result(Le.asString(),Re)})}function L(W,Re,Te){return y(W,function(ae){return H(ae,Re,Te)})}function H(W,Re,Te){if(!Te)throw new Error("options not set");var ae=Mt[W.type];return ae?ae(W,Re,Te):[]}function P(W,Re,Te){return O(W,Re).wrap(function(){var ae=L(W.children,Re,Te);return F?ae:[a.forceWrite].concat(ae)})}function O(W,Re){var Te=X(W);return Te?Te.to:(W.styleId&&Re.push(p("paragraph",W)),C)}function B(W,Re,Te){var ae=function(){return L(W.children,Re,Te)},he=[];if(W.highlight!==null){var we=q({type:"highlight",color:W.highlight});we&&he.push(we)}W.isSmallCaps&&he.push(re("smallCaps")),W.isAllCaps&&he.push(re("allCaps")),W.isStrikethrough&&he.push(re("strikethrough","s")),W.isUnderline&&he.push(re("underline")),W.verticalAlignment===t.verticalAlignment.subscript&&he.push(i.element("sub",{},{fresh:!1})),W.verticalAlignment===t.verticalAlignment.superscript&&he.push(i.element("sup",{},{fresh:!1})),W.isItalic&&he.push(re("italic","em")),W.isBold&&he.push(re("bold","strong"));var Le=i.empty,$e=X(W);return $e?Le=$e.to:W.styleId&&Re.push(p("run",W)),he.push(Le),he.forEach(function(Ce){ae=Ce.wrap.bind(Ce,ae)}),ae()}function re(W,Re){var Te=q({type:W});return Te||(Re?i.element(Re,{},{fresh:!1}):i.empty)}function q(W,Re){var Te=X(W);return Te?Te.to:Re}function X(W){for(var Re=0;Re<M.length;Re++)if(M[Re].from.matches(W))return M[Re]}function oe(W){return function(Re,Te){return e.attempt(function(){return W(Re,Te)}).caught(function(ae){return Te.push(r.error(ae)),[]})}}function ue(W){return j(W.noteType,W.noteId)}function ge(W){return G(W.noteType,W.noteId)}function j(W,Re){return Z(W+"-"+Re)}function G(W,Re){return Z(W+"-ref-"+Re)}function Z(W){return k+W}var te=i.elements([i.element("table",{},{fresh:!0})]);function ie(W,Re,Te){return q(W,te).wrap(function(){return _e(W,Re,Te)})}function _e(W,Re,Te){var ae=n.findIndex(W.children,function($e){return!$e.type===t.types.tableRow||!$e.isHeader});ae===-1&&(ae=W.children.length);var he;if(ae===0)he=L(W.children,Re,n.extend({},Te,{isTableHeader:!1}));else{var we=L(W.children.slice(0,ae),Re,n.extend({},Te,{isTableHeader:!0})),Le=L(W.children.slice(ae),Re,n.extend({},Te,{isTableHeader:!1}));he=[a.freshElement("thead",{},we),a.freshElement("tbody",{},Le)]}return[a.forceWrite].concat(he)}function Ie(W,Re,Te){var ae=L(W.children,Re,Te);return[a.freshElement("tr",{},[a.forceWrite].concat(ae))]}function Pe(W,Re,Te){var ae=Te.isTableHeader?"th":"td",he=L(W.children,Re,Te),we={};return W.colSpan!==1&&(we.colspan=W.colSpan.toString()),W.rowSpan!==1&&(we.rowspan=W.rowSpan.toString()),[a.freshElement(ae,we,[a.forceWrite].concat(he))]}function Fe(W,Re,Te){return q(W,i.ignore).wrap(function(){var ae=E[W.commentId],he=N.length+1,we="["+v(ae)+he+"]";return N.push({label:we,comment:ae}),[a.freshElement("a",{href:"#"+j("comment",W.commentId),id:G("comment",W.commentId)},[a.text(we)])]})}function Ge(W,Re,Te){var ae=W.label,he=W.comment,we=L(he.body,Re,Te).concat([a.nonFreshElement("p",{},[a.text(" "),a.freshElement("a",{href:"#"+G("comment",he.commentId)},[a.text("↑")])])]);return[a.freshElement("dt",{id:j("comment",he.commentId)},[a.text("Comment "+ae)]),a.freshElement("dd",{},we)]}function ct(W,Re,Te){return gt(W).wrap(function(){return[]})}function gt(W){var Re=X(W);return Re?Re.to:W.breakType==="line"?i.topLevelElement("br"):i.empty}var Mt={document:function(W,Re,Te){var ae=L(W.children,Re,Te),he=A.map(function(Le){return W.notes.resolve(Le)}),we=L(he,Re,Te);return ae.concat([a.freshElement("ol",{},we),a.freshElement("dl",{},y(N,function(Le){return Ge(Le,Re,Te)}))])},paragraph:P,run:B,text:function(W,Re,Te){return[a.text(W.value)]},tab:function(W,Re,Te){return[a.text("	")]},hyperlink:function(W,Re,Te){var ae=W.anchor?"#"+Z(W.anchor):W.href,he={href:ae};W.targetFrame!=null&&(he.target=W.targetFrame);var we=L(W.children,Re,Te);return[a.nonFreshElement("a",he,we)]},checkbox:function(W){var Re={type:"checkbox"};return W.checked&&(Re.checked="checked"),[a.freshElement("input",Re)]},bookmarkStart:function(W,Re,Te){var ae=a.freshElement("a",{id:Z(W.name)},[a.forceWrite]);return[ae]},noteReference:function(W,Re,Te){A.push(W);var ae=a.freshElement("a",{href:"#"+ue(W),id:ge(W)},[a.text("["+w+++"]")]);return[a.freshElement("sup",{},[ae])]},note:function(W,Re,Te){var ae=L(W.body,Re,Te),he=a.elementWithTag(i.element("p",{},{fresh:!1}),[a.text(" "),a.freshElement("a",{href:"#"+ge(W)},[a.text("↑")])]),we=ae.concat([he]);return a.freshElement("li",{id:ue(W)},we)},commentReference:Fe,comment:Ge,image:f(oe(_.convertImage||s.dataUri)),table:ie,tableRow:Ie,tableCell:Pe,break:ct};return{convertToHtml:R}}var h=1;function f(_){return function(E,w,A){return[{type:"deferred",id:h++,value:function(){return _(E,w,A)}}]}}function p(_,E){return r.warning("Unrecognised "+_+" style: '"+E.styleName+"' (Style ID: "+E.styleId+")")}function y(_,E){return n.flatten(_.map(E),!0)}function x(_,E){_.forEach(function(w){E(w),w.children&&x(w.children,E)})}var v=vA.commentAuthorLabel=function(E){return E.authorInitials||""};return vA}var $3={},uz;function tTe(){if(uz)return $3;uz=1;var n=t0();function e(t){if(t.type==="text")return t.value;if(t.type===n.types.tab)return"	";var i=t.type==="paragraph"?`

`:"";return(t.children||[]).map(e).join("")+i}return $3.convertElementToRawText=e,$3}var mx={},Rl={},j3={},X3={exports:{}},hz;function nTe(){if(hz)return X3.exports;hz=1;var n=X3.exports=function(e,t){this._tokens=e,this._startIndex=t||0};return n.prototype.head=function(){return this._tokens[this._startIndex]},n.prototype.tail=function(e){return new n(this._tokens,this._startIndex+1)},n.prototype.toArray=function(){return this._tokens.slice(this._startIndex)},n.prototype.end=function(){return this._tokens[this._tokens.length-1]},n.prototype.to=function(e){var t=this.head().source,i=e.head()||e.end();return t.to(i.source)},X3.exports}var dz;function iTe(){if(dz)return j3;dz=1;var n=nTe();return j3.Parser=function(e){var t=function(i,r){return i(new n(r))};return{parseTokens:t}},j3}var K3={},Y3={},fz;function rTe(){return fz||(fz=1,(function(n){n.none=Object.create({value:function(){throw new Error("Called value on none")},isNone:function(){return!0},isSome:function(){return!1},map:function(){return n.none},flatMap:function(){return n.none},filter:function(){return n.none},toArray:function(){return[]},orElse:e,valueOrElse:e});function e(i){return typeof i=="function"?i():i}n.some=function(i){return new t(i)};var t=function(i){this._value=i};t.prototype.value=function(){return this._value},t.prototype.isNone=function(){return!1},t.prototype.isSome=function(){return!0},t.prototype.map=function(i){return new t(i(this._value))},t.prototype.flatMap=function(i){return i(this._value)},t.prototype.filter=function(i){return i(this._value)?this:n.none},t.prototype.toArray=function(){return[this._value]},t.prototype.orElse=function(i){return this},t.prototype.valueOrElse=function(i){return this._value},n.isOption=function(i){return i===n.none||i instanceof t},n.fromNullable=function(i){return i==null?n.none:new t(i)}})(Y3)),Y3}var J3,pz;function vL(){if(pz)return J3;pz=1,J3={failure:function(e,t){if(e.length<1)throw new Error("Failure must have errors");return new n({status:"failure",remaining:t,errors:e})},error:function(e,t){if(e.length<1)throw new Error("Failure must have errors");return new n({status:"error",remaining:t,errors:e})},success:function(e,t,i){return new n({status:"success",value:e,source:i,remaining:t,errors:[]})},cut:function(e){return new n({status:"cut",remaining:e,errors:[]})}};var n=function(e){this._value=e.value,this._status=e.status,this._hasValue=e.value!==void 0,this._remaining=e.remaining,this._source=e.source,this._errors=e.errors};return n.prototype.map=function(e){return this._hasValue?new n({value:e(this._value,this._source),status:this._status,remaining:this._remaining,source:this._source,errors:this._errors}):this},n.prototype.changeRemaining=function(e){return new n({value:this._value,status:this._status,remaining:e,source:this._source,errors:this._errors})},n.prototype.isSuccess=function(){return this._status==="success"||this._status==="cut"},n.prototype.isFailure=function(){return this._status==="failure"},n.prototype.isError=function(){return this._status==="error"},n.prototype.isCut=function(){return this._status==="cut"},n.prototype.value=function(){return this._value},n.prototype.remaining=function(){return this._remaining},n.prototype.source=function(){return this._source},n.prototype.errors=function(){return this._errors},J3}var Q3={},gz;function uZ(){if(gz)return Q3;gz=1,Q3.error=function(e){return new n(e)};var n=function(e){this.expected=e.expected,this.actual=e.actual,this._location=e.location};return n.prototype.describe=function(){var e=this._location?this._location.describe()+`:
`:"";return e+"Expected "+this.expected+`
but got `+this.actual},n.prototype.lineNumber=function(){return this._location.lineNumber()},n.prototype.characterNumber=function(){return this._location.characterNumber()},Q3}var Z3={},mz;function sTe(){if(mz)return Z3;mz=1,Z3.fromArray=function(e){var t=0,i=function(){return t<e.length};return new n({hasNext:i,next:function(){if(i())return e[t++];throw new Error("No more elements")}})};var n=function(e){this._iterator=e};return n.prototype.map=function(e){var t=this._iterator;return new n({hasNext:function(){return t.hasNext()},next:function(){return e(t.next())}})},n.prototype.filter=function(e){var t=this._iterator,i=!1,r=!1,s,a=function(){if(!i)for(i=!0,r=!1;t.hasNext()&&!r;)s=t.next(),r=e(s)};return new n({hasNext:function(){return a(),r},next:function(){a();var o=s;return i=!1,o}})},n.prototype.first=function(){var e=this._iterator;return this._iterator.hasNext()?e.next():null},n.prototype.toArray=function(){for(var e=[];this._iterator.hasNext();)e.push(this._iterator.next());return e},Z3}var yz;function hZ(){return yz||(yz=1,(function(n){var e=sr,t=rTe(),i=vL(),r=uZ(),s=sTe();n.token=function(p,y){var x=y!==void 0;return function(v){var _=v.head();if(_&&_.name===p&&(!x||_.value===y))return i.success(_.value,v.tail(),_.source);var E=h({name:p,value:y});return f(v,E)}},n.tokenOfType=function(p){return n.token(p)},n.firstOf=function(p,y){return e.isArray(y)||(y=Array.prototype.slice.call(arguments,1)),function(x){return s.fromArray(y).map(function(v){return v(x)}).filter(function(v){return v.isSuccess()||v.isError()}).first()||f(x,p)}},n.then=function(p,y){return function(x){var v=p(x);return v.map||console.log(v),v.map(y)}},n.sequence=function(){var p=Array.prototype.slice.call(arguments,0),y=function(v){var _=e.foldl(p,function(w,A){var N=w.result,k=w.hasCut;if(!N.isSuccess())return{result:N,hasCut:k};var F=A(N.remaining());if(F.isCut())return{result:N,hasCut:!0};if(F.isSuccess()){var C;A.isCaptured?C=N.value().withValue(A,F.value()):C=N.value();var M=F.remaining(),R=v.to(M);return{result:i.success(C,M,R),hasCut:k}}else return k?{result:i.error(F.errors(),F.remaining()),hasCut:k}:{result:F,hasCut:k}},{result:i.success(new a,v),hasCut:!1}).result,E=v.to(_.remaining());return _.map(function(w){return w.withValue(n.sequence.source,E)})};y.head=function(){var v=e.find(p,x);return n.then(y,n.sequence.extract(v))},y.map=function(v){return n.then(y,function(_){return v.apply(this,_.toArray())})};function x(v){return v.isCaptured}return y};var a=function(p,y){this._values=p||{},this._valuesArray=y||[]};a.prototype.withValue=function(p,y){if(p.captureName&&p.captureName in this._values)throw new Error('Cannot add second value for capture "'+p.captureName+'"');var x=e.clone(this._values);x[p.captureName]=y;var v=this._valuesArray.concat([y]);return new a(x,v)},a.prototype.get=function(p){if(p.captureName in this._values)return this._values[p.captureName];throw new Error('No value for capture "'+p.captureName+'"')},a.prototype.toArray=function(){return this._valuesArray},n.sequence.capture=function(p,y){var x=function(){return p.apply(this,arguments)};return x.captureName=y,x.isCaptured=!0,x},n.sequence.extract=function(p){return function(y){return y.get(p)}},n.sequence.applyValues=function(p){var y=Array.prototype.slice.call(arguments,1);return function(x){var v=y.map(function(_){return x.get(_)});return p.apply(this,v)}},n.sequence.source={captureName:"☃source☃"},n.sequence.cut=function(){return function(p){return i.cut(p)}},n.optional=function(p){return function(y){var x=p(y);return x.isSuccess()?x.map(t.some):x.isFailure()?i.success(t.none,y):x}},n.zeroOrMoreWithSeparator=function(p,y){return c(p,y,!1)},n.oneOrMoreWithSeparator=function(p,y){return c(p,y,!0)};var o=n.zeroOrMore=function(p){return function(y){for(var x=[],v;(v=p(y))&&v.isSuccess();)y=v.remaining(),x.push(v.value());return v.isError()?v:i.success(x,y)}};n.oneOrMore=function(p){return n.oneOrMoreWithSeparator(p,l)};function l(p){return i.success(null,p)}var c=function(p,y,x){return function(v){var _=p(v);if(_.isSuccess()){var E=n.sequence.capture(p,"main"),w=o(n.then(n.sequence(y,E),n.sequence.extract(E))),A=w(_.remaining());return i.success([_.value()].concat(A.value()),A.remaining())}else return x||_.isError()?_:i.success([],v)}};n.leftAssociative=function(p,y,x){var v;x?v=[{func:x,rule:y}]:v=y,v=v.map(function(E){return n.then(E.rule,function(w){return function(A,N){return E.func(A,w,N)}})});var _=n.firstOf.apply(null,["rules"].concat(v));return function(E){var w=E,A=p(E);if(!A.isSuccess())return A;for(var N=_(A.remaining());N.isSuccess();){var k=N.remaining(),F=w.to(N.remaining()),C=N.value();A=i.success(C(A.value(),F),k,F),N=_(A.remaining())}return N.isError()?N:A}},n.leftAssociative.firstOf=function(){return Array.prototype.slice.call(arguments,0)},n.nonConsuming=function(p){return function(y){return p(y).changeRemaining(y)}};var h=function(p){return p.value?p.name+' "'+p.value+'"':p.name};function f(p,y){var x,v=p.head();return v?x=r.error({expected:y,actual:h(v),location:v.source}):x=r.error({expected:y,actual:"end of tokens"}),i.failure([x],p)}})(K3)),K3}var eM={exports:{}},vz;function dZ(){if(vz)return eM.exports;vz=1,eM.exports=function(e,t){var i={asString:function(){return e},range:function(r,s){return new n(e,t,r,s)}};return i};var n=function(e,t,i,r){this._string=e,this._description=t,this._startIndex=i,this._endIndex=r};return n.prototype.to=function(e){return new n(this._string,this._description,this._startIndex,e._endIndex)},n.prototype.describe=function(){var e=this._position(),t=this._description?this._description+`
`:"";return t+"Line number: "+e.lineNumber+`
Character number: `+e.characterNumber},n.prototype.lineNumber=function(){return this._position().lineNumber},n.prototype.characterNumber=function(){return this._position().characterNumber},n.prototype._position=function(){for(var e=this,t=0,i=function(){return e._string.indexOf(`
`,t)},r=1;i()!==-1&&i()<this._startIndex;)t=i()+1,r+=1;var s=this._startIndex-t+1;return{lineNumber:r,characterNumber:s}},eM.exports}var tM,_z;function fZ(){return _z||(_z=1,tM=function(n,e,t){this.name=n,this.value=e,t&&(this.source=t)}),tM}var nM={},xz;function aTe(){return xz||(xz=1,(function(n){var e=hZ(),t=vL();n.parser=function(s,a,o){var l={rule:p,leftAssociative:y,rightAssociative:x},c=new i(o.map(f)),h=e.firstOf(s,a);function f(E){return{name:E.name,rule:r(E.ruleBuilder.bind(null,l))}}function p(){return v(c)}function y(E){return v(c.untilExclusive(E))}function x(E){return v(c.untilInclusive(E))}function v(E){return _.bind(null,E)}function _(E,w){var A=h(w);return A.isSuccess()?E.apply(A):A}return l};function i(s){function a(f){return new i(s.slice(0,l().indexOf(f)))}function o(f){return new i(s.slice(0,l().indexOf(f)+1))}function l(){return s.map(function(f){return f.name})}function c(f){for(var p,y;;)if(p=h(f.remaining()),p.isSuccess())y=f.source().to(p.source()),f=t.success(p.value()(f.value(),y),p.remaining(),y);else return p.isFailure()?f:p}function h(f){return e.firstOf("infix",s.map(function(p){return p.rule}))(f)}return{apply:c,untilExclusive:a,untilInclusive:o}}n.infix=function(s,a){function o(l){return n.infix(s,function(c){var h=a(c);return function(f){var p=h(f);return p.map(function(y){return function(x,v){return l(x,y,v)}})}})}return{name:s,ruleBuilder:a,map:o}};var r=function(s){var a;return function(o){return a||(a=s()),a(o)}}})(nM)),nM}var iM={},bz;function oTe(){if(bz)return iM;bz=1;var n=fZ(),e=dZ();iM.RegexTokeniser=t;function t(i){i=i.map(function(o){return{name:o.name,regex:new RegExp(o.regex.source,"g")}});function r(o,l){for(var c=new e(o,l),h=0,f=[];h<o.length;){var p=s(o,h,c);h=p.endIndex,f.push(p.token)}return f.push(a(o,c)),f}function s(o,l,c){for(var h=0;h<i.length;h++){var f=i[h].regex;f.lastIndex=l;var p=f.exec(o);if(p){var x=l+p[0].length;if(p.index===l&&x>l){var y=p[1],v=new n(i[h].name,y,c.range(l,x));return{token:v,endIndex:x}}}}var x=l+1,v=new n("unrecognisedCharacter",o.substring(l,x),c.range(l,x));return{token:v,endIndex:x}}function a(o,l){return new n("end",null,l.range(o.length,o.length))}return{tokenise:r}}return iM}var Tz;function pZ(){return Tz||(Tz=1,Rl.Parser=iTe().Parser,Rl.rules=hZ(),Rl.errors=uZ(),Rl.results=vL(),Rl.StringSource=dZ(),Rl.Token=fZ(),Rl.bottomUp=aTe(),Rl.RegexTokeniser=oTe().RegexTokeniser,Rl.rule=function(n){var e;return function(t){return e||(e=n()),e(t)}}),Rl}var Hr={},Ez;function lTe(){if(Ez)return Hr;Ez=1,Hr.paragraph=n,Hr.run=e,Hr.table=t,Hr.bold=new r("bold"),Hr.italic=new r("italic"),Hr.underline=new r("underline"),Hr.strikethrough=new r("strikethrough"),Hr.allCaps=new r("allCaps"),Hr.smallCaps=new r("smallCaps"),Hr.highlight=i,Hr.commentReference=new r("commentReference"),Hr.lineBreak=new a({breakType:"line"}),Hr.pageBreak=new a({breakType:"page"}),Hr.columnBreak=new a({breakType:"column"}),Hr.equalTo=l,Hr.startsWith=c;function n(p){return new r("paragraph",p)}function e(p){return new r("run",p)}function t(p){return new r("table",p)}function i(p){return new s(p)}function r(p,y){y=y||{},this._elementType=p,this._styleId=y.styleId,this._styleName=y.styleName,y.list&&(this._listIndex=y.list.levelIndex,this._listIsOrdered=y.list.isOrdered)}r.prototype.matches=function(p){return p.type===this._elementType&&(this._styleId===void 0||p.styleId===this._styleId)&&(this._styleName===void 0||p.styleName&&this._styleName.operator(this._styleName.operand,p.styleName))&&(this._listIndex===void 0||o(p,this._listIndex,this._listIsOrdered))&&(this._breakType===void 0||this._breakType===p.breakType)};function s(p){p=p||{},this._color=p.color}s.prototype.matches=function(p){return p.type==="highlight"&&(this._color===void 0||p.color===this._color)};function a(p){p=p||{},this._breakType=p.breakType}a.prototype.matches=function(p){return p.type==="break"&&(this._breakType===void 0||p.breakType===this._breakType)};function o(p,y,x){return p.numbering&&p.numbering.level==y&&p.numbering.isOrdered==x}function l(p){return{operator:h,operand:p}}function c(p){return{operator:f,operand:p}}function h(p,y){return p.toUpperCase()===y.toUpperCase()}function f(p,y){return y.toUpperCase().indexOf(p.toUpperCase())===0}return Hr}var rM={},wz;function cTe(){if(wz)return rM;wz=1;var n=pZ(),e=n.RegexTokeniser;rM.tokenise=i;var t="'((?:\\\\.|[^'])*)";function i(r){var s="(?:[a-zA-Z\\-_]|\\\\.)",a=new e([{name:"identifier",regex:new RegExp("("+s+"(?:"+s+"|[0-9])*)")},{name:"dot",regex:/\./},{name:"colon",regex:/:/},{name:"gt",regex:/>/},{name:"whitespace",regex:/\s+/},{name:"arrow",regex:/=>/},{name:"equals",regex:/=/},{name:"startsWith",regex:/\^=/},{name:"open-paren",regex:/\(/},{name:"close-paren",regex:/\)/},{name:"open-square-bracket",regex:/\[/},{name:"close-square-bracket",regex:/\]/},{name:"string",regex:new RegExp(t+"'")},{name:"unterminated-string",regex:new RegExp(t)},{name:"integer",regex:/([0-9]+)/},{name:"choice",regex:/\|/},{name:"bang",regex:/(!)/}]);return a.tokenise(r)}return rM}var Az;function uTe(){if(Az)return mx;Az=1;var n=sr,e=pZ(),t=lTe(),i=GI(),r=cTe().tokenise,s=Bh();mx.readHtmlPath=h,mx.readDocumentMatcher=l,mx.readStyle=a;function a(M){return N(C,M)}function o(){return e.rules.sequence(e.rules.sequence.capture(c()),e.rules.tokenOfType("whitespace"),e.rules.tokenOfType("arrow"),e.rules.sequence.capture(e.rules.optional(e.rules.sequence(e.rules.tokenOfType("whitespace"),e.rules.sequence.capture(f())).head())),e.rules.tokenOfType("end")).map(function(M,R){return{from:M,to:R.valueOrElse(i.empty)}})}function l(M){return N(c(),M)}function c(){var M=e.rules.sequence,R=function(Ge,ct){return e.rules.then(e.rules.token("identifier",Ge),function(){return ct})},L=R("p",t.paragraph),H=R("r",t.run),P=e.rules.firstOf("p or r or table",L,H),O=e.rules.sequence(e.rules.tokenOfType("dot"),e.rules.sequence.cut(),e.rules.sequence.capture(p)).map(function(Ge){return{styleId:Ge}}),B=e.rules.firstOf("style name matcher",e.rules.then(e.rules.sequence(e.rules.tokenOfType("equals"),e.rules.sequence.cut(),e.rules.sequence.capture(x)).head(),function(Ge){return{styleName:t.equalTo(Ge)}}),e.rules.then(e.rules.sequence(e.rules.tokenOfType("startsWith"),e.rules.sequence.cut(),e.rules.sequence.capture(x)).head(),function(Ge){return{styleName:t.startsWith(Ge)}})),re=e.rules.sequence(e.rules.tokenOfType("open-square-bracket"),e.rules.sequence.cut(),e.rules.token("identifier","style-name"),e.rules.sequence.capture(B),e.rules.tokenOfType("close-square-bracket")).head(),q=e.rules.firstOf("list type",R("ordered-list",{isOrdered:!0}),R("unordered-list",{isOrdered:!1})),X=M(e.rules.tokenOfType("colon"),M.capture(q),M.cut(),e.rules.tokenOfType("open-paren"),M.capture(y),e.rules.tokenOfType("close-paren")).map(function(Ge,ct){return{list:{isOrdered:Ge.isOrdered,levelIndex:ct-1}}});function oe(Ge){var ct=e.rules.firstOf.apply(e.rules.firstOf,["matcher suffix"].concat(Ge)),gt=e.rules.zeroOrMore(ct);return e.rules.then(gt,function(Mt){var W={};return Mt.forEach(function(Re){n.extend(W,Re)}),W})}var ue=M(M.capture(P),M.capture(oe([O,re,X]))).map(function(Ge,ct){return Ge(ct)}),ge=M(e.rules.token("identifier","table"),M.capture(oe([O,re]))).map(function(Ge){return t.table(Ge)}),j=R("b",t.bold),G=R("i",t.italic),Z=R("u",t.underline),te=R("strike",t.strikethrough),ie=R("all-caps",t.allCaps),_e=R("small-caps",t.smallCaps),Ie=M(e.rules.token("identifier","highlight"),e.rules.sequence.capture(e.rules.optional(e.rules.sequence(e.rules.tokenOfType("open-square-bracket"),e.rules.sequence.cut(),e.rules.token("identifier","color"),e.rules.tokenOfType("equals"),e.rules.sequence.capture(x),e.rules.tokenOfType("close-square-bracket")).head()))).map(function(Ge){return t.highlight({color:Ge.valueOrElse(void 0)})}),Pe=R("comment-reference",t.commentReference),Fe=M(e.rules.token("identifier","br"),M.cut(),e.rules.tokenOfType("open-square-bracket"),e.rules.token("identifier","type"),e.rules.tokenOfType("equals"),M.capture(x),e.rules.tokenOfType("close-square-bracket")).map(function(Ge){switch(Ge){case"line":return t.lineBreak;case"page":return t.pageBreak;case"column":return t.columnBreak}});return e.rules.firstOf("element type",ue,ge,j,G,Z,te,ie,_e,Ie,Pe,Fe)}function h(M){return N(f(),M)}function f(){var M=e.rules.sequence.capture,R=e.rules.tokenOfType("whitespace"),L=e.rules.then(e.rules.optional(e.rules.sequence(e.rules.tokenOfType("colon"),e.rules.token("identifier","fresh"))),function(B){return B.map(function(){return!0}).valueOrElse(!1)}),H=e.rules.then(e.rules.optional(e.rules.sequence(e.rules.tokenOfType("colon"),e.rules.token("identifier","separator"),e.rules.tokenOfType("open-paren"),M(x),e.rules.tokenOfType("close-paren")).head()),function(B){return B.valueOrElse("")}),P=e.rules.oneOrMoreWithSeparator(p,e.rules.tokenOfType("choice")),O=e.rules.sequence(M(P),M(e.rules.zeroOrMore(A)),M(L),M(H)).map(function(B,re,q,X){var oe={},ue={};return re.forEach(function(ge){ge.append&&oe[ge.name]?oe[ge.name]+=" "+ge.value:oe[ge.name]=ge.value}),q&&(ue.fresh=!0),X&&(ue.separator=X),i.element(B,oe,ue)});return e.rules.firstOf("html path",e.rules.then(e.rules.tokenOfType("bang"),function(){return i.ignore}),e.rules.then(e.rules.zeroOrMoreWithSeparator(O,e.rules.sequence(R,e.rules.tokenOfType("gt"),R)),i.elements))}var p=e.rules.then(e.rules.tokenOfType("identifier"),_),y=e.rules.tokenOfType("integer"),x=e.rules.then(e.rules.tokenOfType("string"),_),v={n:`
`,r:"\r",t:"	"};function _(M){return M.replace(/\\(.)/g,function(R,L){return v[L]||L})}var E=e.rules.sequence(e.rules.tokenOfType("open-square-bracket"),e.rules.sequence.cut(),e.rules.sequence.capture(p),e.rules.tokenOfType("equals"),e.rules.sequence.capture(x),e.rules.tokenOfType("close-square-bracket")).map(function(M,R){return{name:M,value:R,append:!1}}),w=e.rules.sequence(e.rules.tokenOfType("dot"),e.rules.sequence.cut(),e.rules.sequence.capture(p)).map(function(M){return{name:"class",value:M,append:!0}}),A=e.rules.firstOf("attribute or class",E,w);function N(M,R){var L=r(R),H=e.Parser(),P=H.parseTokens(M,L);return P.isSuccess()?s.success(P.value()):new s.Result(null,[s.warning(k(R,P))])}function k(M,R){return"Did not understand this style mapping, so ignored it: "+M+`
`+R.errors().map(F).join(`
`)}function F(M){return"Error was at character number "+M.characterNumber()+": Expected "+M.expected+" but got "+M.actual}var C=o();return mx}var yx={},Sz;function hTe(){if(Sz)return yx;Sz=1,yx.readOptions=i;var n=sr,e=yx._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],t=yx._standardOptions={externalFileAccess:!1,transformDocument:s,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function i(a){return a=a||{},n.extend({},t,a,{customStyleMap:r(a.styleMap),readStyleMap:function(){var o=this.customStyleMap;return this.includeEmbeddedStyleMap&&(o=o.concat(r(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(o=o.concat(e)),o}})}function r(a){return a?n.isString(a)?a.split(`
`).map(function(o){return o.trim()}).filter(function(o){return o!==""&&o.charAt(0)!=="#"}):a:[]}function s(a){return a}return yx}var sM={},Dz;function dTe(){if(Dz)return sM;Dz=1;var n=Tp(),e=nZ();sM.openZip=t;function t(i){return i.arrayBuffer?n.resolve(e.openArrayBuffer(i.arrayBuffer)):n.reject(new Error("Could not find file in options"))}return sM}var aM={},Cz;function fTe(){if(Cz)return aM;Cz=1;var n=GI(),e=zI();aM.element=t;function t(i){return function(r){return e.elementWithTag(n.element(i),[r])}}return aM}var Iz;function pTe(){if(Iz)return Ho;Iz=1;var n=sr,e=X2e(),t=K2e(),i=eTe().DocumentConverter,r=tTe().convertElementToRawText,s=uTe().readStyle,a=hTe().readOptions,o=dTe(),l=Bh().Result;Ho.convertToHtml=c,Ho.convertToMarkdown=h,Ho.convert=f,Ho.extractRawText=v,Ho.images=cZ(),Ho.transforms=oZ(),Ho.underline=fTe(),Ho.embedStyleMap=_,Ho.readEmbeddedStyleMap=p;function c(E,w){return f(E,w)}function h(E,w){var A=Object.create(w||{});return A.outputFormat="markdown",f(E,A)}function f(E,w){return w=a(w),o.openZip(E).tap(function(A){return t.readStyleMap(A).then(function(N){w.embeddedStyleMap=N})}).then(function(A){return e.read(A,E,w).then(function(N){return N.map(w.transformDocument)}).then(function(N){return y(N,w)})})}function p(E){return o.openZip(E).then(t.readStyleMap)}function y(E,w){var A=x(w.readStyleMap()),N=n.extend({},w,{styleMap:A.value}),k=new i(N);return E.flatMapThen(function(F){return A.flatMapThen(function(C){return k.convertToHtml(F)})})}function x(E){return l.combine((E||[]).map(s)).map(function(w){return w.filter(function(A){return!!A})})}function v(E){return o.openZip(E).then(e.read).then(function(w){return w.map(r)})}function _(E,w){return o.openZip(E).tap(function(A){return t.writeStyleMap(A,w)}).then(function(A){return A.toArrayBuffer()}).then(function(A){return{toArrayBuffer:function(){return A},toBuffer:function(){return Buffer.from(A)}}})}return Ho.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)},Ho}var gTe=pTe();const mTe=AP(gTe);/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var $D={};$D.version="0.18.5";var gZ=1252,yTe=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],mZ=function(n){yTe.indexOf(n)!=-1&&(gZ=n)};function vTe(){mZ(1252)}var Rb=function(n){mZ(n)};function _Te(){Rb(1200),vTe()}var _A=function(e){return String.fromCharCode(e)},Rz=function(e){return String.fromCharCode(e)},jD,Gf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Nb(n){for(var e="",t=0,i=0,r=0,s=0,a=0,o=0,l=0,c=0;c<n.length;)t=n.charCodeAt(c++),s=t>>2,i=n.charCodeAt(c++),a=(t&3)<<4|i>>4,r=n.charCodeAt(c++),o=(i&15)<<2|r>>6,l=r&63,isNaN(i)?o=l=64:isNaN(r)&&(l=64),e+=Gf.charAt(s)+Gf.charAt(a)+Gf.charAt(o)+Gf.charAt(l);return e}function Vh(n){var e="",t=0,i=0,r=0,s=0,a=0,o=0,l=0;n=n.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<n.length;)s=Gf.indexOf(n.charAt(c++)),a=Gf.indexOf(n.charAt(c++)),t=s<<2|a>>4,e+=String.fromCharCode(t),o=Gf.indexOf(n.charAt(c++)),i=(a&15)<<4|o>>2,o!==64&&(e+=String.fromCharCode(i)),l=Gf.indexOf(n.charAt(c++)),r=(o&3)<<6|l,l!==64&&(e+=String.fromCharCode(r));return e}var Vn=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),Qh=(function(){if(typeof Buffer<"u"){var n=!Buffer.from;if(!n)try{Buffer.from("foo","utf8")}catch{n=!0}return n?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}})();function Wm(n){return Vn?Buffer.alloc?Buffer.alloc(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}function Nz(n){return Vn?Buffer.allocUnsafe?Buffer.allocUnsafe(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}var Xl=function(e){return Vn?Qh(e,"binary"):e.split("").map(function(t){return t.charCodeAt(0)&255})};function qI(n){if(typeof ArrayBuffer>"u")return Xl(n);for(var e=new ArrayBuffer(n.length),t=new Uint8Array(e),i=0;i!=n.length;++i)t[i]=n.charCodeAt(i)&255;return e}function nE(n){if(Array.isArray(n))return n.map(function(i){return String.fromCharCode(i)}).join("");for(var e=[],t=0;t<n.length;++t)e[t]=String.fromCharCode(n[t]);return e.join("")}function xTe(n){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(n)}var As=Vn?function(n){return Buffer.concat(n.map(function(e){return Buffer.isBuffer(e)?e:Qh(e)}))}:function(n){if(typeof Uint8Array<"u"){var e=0,t=0;for(e=0;e<n.length;++e)t+=n[e].length;var i=new Uint8Array(t),r=0;for(e=0,t=0;e<n.length;t+=r,++e)if(r=n[e].length,n[e]instanceof Uint8Array)i.set(n[e],t);else{if(typeof n[e]=="string")throw"wtf";i.set(new Uint8Array(n[e]),t)}return i}return[].concat.apply([],n.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function bTe(n){for(var e=[],t=0,i=n.length+250,r=Wm(n.length+255),s=0;s<n.length;++s){var a=n.charCodeAt(s);if(a<128)r[t++]=a;else if(a<2048)r[t++]=192|a>>6&31,r[t++]=128|a&63;else if(a>=55296&&a<57344){a=(a&1023)+64;var o=n.charCodeAt(++s)&1023;r[t++]=240|a>>8&7,r[t++]=128|a>>2&63,r[t++]=128|o>>6&15|(a&3)<<4,r[t++]=128|o&63}else r[t++]=224|a>>12&15,r[t++]=128|a>>6&63,r[t++]=128|a&63;t>i&&(e.push(r.slice(0,t)),t=0,r=Wm(65535),i=65530)}return e.push(r.slice(0,t)),As(e)}var tb=/\u0000/g,xA=/[\u0001-\u0006]/g;function Ly(n){for(var e="",t=n.length-1;t>=0;)e+=n.charAt(t--);return e}function Yl(n,e){var t=""+n;return t.length>=e?t:Ji("0",e-t.length)+t}function _L(n,e){var t=""+n;return t.length>=e?t:Ji(" ",e-t.length)+t}function XD(n,e){var t=""+n;return t.length>=e?t:t+Ji(" ",e-t.length)}function TTe(n,e){var t=""+Math.round(n);return t.length>=e?t:Ji("0",e-t.length)+t}function ETe(n,e){var t=""+n;return t.length>=e?t:Ji("0",e-t.length)+t}var kz=Math.pow(2,32);function Z0(n,e){if(n>kz||n<-kz)return TTe(n,e);var t=Math.round(n);return ETe(t,e)}function KD(n,e){return e=e||0,n.length>=7+e&&(n.charCodeAt(e)|32)===103&&(n.charCodeAt(e+1)|32)===101&&(n.charCodeAt(e+2)|32)===110&&(n.charCodeAt(e+3)|32)===101&&(n.charCodeAt(e+4)|32)===114&&(n.charCodeAt(e+5)|32)===97&&(n.charCodeAt(e+6)|32)===108}var Mz=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],oM=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function wTe(n){return n||(n={}),n[0]="General",n[1]="0",n[2]="0.00",n[3]="#,##0",n[4]="#,##0.00",n[9]="0%",n[10]="0.00%",n[11]="0.00E+00",n[12]="# ?/?",n[13]="# ??/??",n[14]="m/d/yy",n[15]="d-mmm-yy",n[16]="d-mmm",n[17]="mmm-yy",n[18]="h:mm AM/PM",n[19]="h:mm:ss AM/PM",n[20]="h:mm",n[21]="h:mm:ss",n[22]="m/d/yy h:mm",n[37]="#,##0 ;(#,##0)",n[38]="#,##0 ;[Red](#,##0)",n[39]="#,##0.00;(#,##0.00)",n[40]="#,##0.00;[Red](#,##0.00)",n[45]="mm:ss",n[46]="[h]:mm:ss",n[47]="mmss.0",n[48]="##0.0E+0",n[49]="@",n[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',n}var Qi={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},Fz={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},ATe={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function YD(n,e,t){for(var i=n<0?-1:1,r=n*i,s=0,a=1,o=0,l=1,c=0,h=0,f=Math.floor(r);c<e&&(f=Math.floor(r),o=f*a+s,h=f*c+l,!(r-f<5e-8));)r=1/(r-f),s=a,a=o,l=c,c=h;if(h>e&&(c>e?(h=l,o=s):(h=c,o=a)),!t)return[0,i*o,h];var p=Math.floor(i*o/h);return[p,i*o-p*h,h]}function bA(n,e,t){if(n>2958465||n<0)return null;var i=n|0,r=Math.floor(86400*(n-i)),s=0,a=[],o={D:i,T:r,u:86400*(n-i)-r,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),e&&e.date1904&&(i+=1462),o.u>.9999&&(o.u=0,++r==86400&&(o.T=r=0,++i,++o.D)),i===60)a=t?[1317,10,29]:[1900,2,29],s=3;else if(i===0)a=t?[1317,8,29]:[1900,1,0],s=6;else{i>60&&--i;var l=new Date(1900,0,1);l.setDate(l.getDate()+i-1),a=[l.getFullYear(),l.getMonth()+1,l.getDate()],s=l.getDay(),i<60&&(s=(s+6)%7),t&&(s=kTe(l,a))}return o.y=a[0],o.m=a[1],o.d=a[2],o.S=r%60,r=Math.floor(r/60),o.M=r%60,r=Math.floor(r/60),o.H=r,o.q=s,o}var yZ=new Date(1899,11,31,0,0,0),STe=yZ.getTime(),DTe=new Date(1900,2,1,0,0,0);function vZ(n,e){var t=n.getTime();return e?t-=1461*24*60*60*1e3:n>=DTe&&(t+=1440*60*1e3),(t-(STe+(n.getTimezoneOffset()-yZ.getTimezoneOffset())*6e4))/(1440*60*1e3)}function xL(n){return n.indexOf(".")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function CTe(n){return n.indexOf("E")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function ITe(n){var e=n<0?12:11,t=xL(n.toFixed(12));return t.length<=e||(t=n.toPrecision(10),t.length<=e)?t:n.toExponential(5)}function RTe(n){var e=xL(n.toFixed(11));return e.length>(n<0?12:11)||e==="0"||e==="-0"?n.toPrecision(6):e}function NTe(n){var e=Math.floor(Math.log(Math.abs(n))*Math.LOG10E),t;return e>=-4&&e<=-1?t=n.toPrecision(10+e):Math.abs(e)<=9?t=ITe(n):e===10?t=n.toFixed(10).substr(0,12):t=RTe(n),xL(CTe(t.toUpperCase()))}function YU(n,e){switch(typeof n){case"string":return n;case"boolean":return n?"TRUE":"FALSE";case"number":return(n|0)===n?n.toString(10):NTe(n);case"undefined":return"";case"object":if(n==null)return"";if(n instanceof Date)return rp(14,vZ(n,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+n)}function kTe(n,e){e[0]-=581;var t=n.getDay();return n<60&&(t=(t+6)%7),t}function MTe(n,e,t,i){var r="",s=0,a=0,o=t.y,l,c=0;switch(n){case 98:o=t.y+543;case 121:switch(e.length){case 1:case 2:l=o%100,c=2;break;default:l=o%1e4,c=4;break}break;case 109:switch(e.length){case 1:case 2:l=t.m,c=e.length;break;case 3:return oM[t.m-1][1];case 5:return oM[t.m-1][0];default:return oM[t.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=t.d,c=e.length;break;case 3:return Mz[t.q][0];default:return Mz[t.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(t.H+11)%12,c=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=t.H,c=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=t.M,c=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return t.u===0&&(e=="s"||e=="ss")?Yl(t.S,e.length):(i>=2?a=i===3?1e3:100:a=i===1?10:1,s=Math.round(a*(t.S+t.u)),s>=60*a&&(s=0),e==="s"?s===0?"0":""+s/a:(r=Yl(s,2+i),e==="ss"?r.substr(0,2):"."+r.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=t.D*24+t.H;break;case"[m]":case"[mm]":l=(t.D*24+t.H)*60+t.M;break;case"[s]":case"[ss]":l=((t.D*24+t.H)*60+t.M)*60+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+e}c=e.length===3?1:2;break;case 101:l=o,c=1;break}var h=c>0?Yl(l,c):"";return h}function qf(n){var e=3;if(n.length<=e)return n;for(var t=n.length%e,i=n.substr(0,t);t!=n.length;t+=e)i+=(i.length>0?",":"")+n.substr(t,e);return i}var _Z=/%/g;function FTe(n,e,t){var i=e.replace(_Z,""),r=e.length-i.length;return Ch(n,i,t*Math.pow(10,2*r))+Ji("%",r)}function UTe(n,e,t){for(var i=e.length-1;e.charCodeAt(i-1)===44;)--i;return Ch(n,e.substr(0,i),t/Math.pow(10,3*(e.length-i)))}function xZ(n,e){var t,i=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+xZ(n,-e);var r=n.indexOf(".");r===-1&&(r=n.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%r;if(s<0&&(s+=r),t=(e/Math.pow(10,s)).toPrecision(i+1+(r+s)%r),t.indexOf("e")===-1){var a=Math.floor(Math.log(e)*Math.LOG10E);for(t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(a-t.length+s):t+="E+"+(a-s);t.substr(0,2)==="0.";)t=t.charAt(0)+t.substr(2,r)+"."+t.substr(2+r),t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,h){return l+c+h.substr(0,(r+s)%r)+"."+h.substr(s)+"E"})}else t=e.toExponential(i);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var bZ=/# (\?+)( ?)\/( ?)(\d+)/;function PTe(n,e,t){var i=parseInt(n[4],10),r=Math.round(e*i),s=Math.floor(r/i),a=r-s*i,o=i;return t+(s===0?"":""+s)+" "+(a===0?Ji(" ",n[1].length+1+n[4].length):_L(a,n[1].length)+n[2]+"/"+n[3]+Yl(o,n[4].length))}function LTe(n,e,t){return t+(e===0?"":""+e)+Ji(" ",n[1].length+2+n[4].length)}var TZ=/^#*0*\.([0#]+)/,EZ=/\).*[0#]/,wZ=/\(###\) ###\\?-####/;function aa(n){for(var e="",t,i=0;i!=n.length;++i)switch(t=n.charCodeAt(i)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(t)}return e}function Uz(n,e){var t=Math.pow(10,e);return""+Math.round(n*t)/t}function Pz(n,e){var t=n-Math.floor(n),i=Math.pow(10,e);return e<(""+Math.round(t*i)).length?0:Math.round(t*i)}function OTe(n,e){return e<(""+Math.round((n-Math.floor(n))*Math.pow(10,e))).length?1:0}function BTe(n){return n<2147483647&&n>-2147483648?""+(n>=0?n|0:n-1|0):""+Math.floor(n)}function Go(n,e,t){if(n.charCodeAt(0)===40&&!e.match(EZ)){var i=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?Go("n",i,t):"("+Go("n",i,-t)+")"}if(e.charCodeAt(e.length-1)===44)return UTe(n,e,t);if(e.indexOf("%")!==-1)return FTe(n,e,t);if(e.indexOf("E")!==-1)return xZ(e,t);if(e.charCodeAt(0)===36)return"$"+Go(n,e.substr(e.charAt(1)==" "?2:1),t);var r,s,a,o,l=Math.abs(t),c=t<0?"-":"";if(e.match(/^00+$/))return c+Z0(l,e.length);if(e.match(/^[#?]+$/))return r=Z0(t,0),r==="0"&&(r=""),r.length>e.length?r:aa(e.substr(0,e.length-r.length))+r;if(s=e.match(bZ))return PTe(s,l,c);if(e.match(/^#+0+$/))return c+Z0(l,e.length-e.indexOf("0"));if(s=e.match(TZ))return r=Uz(t,s[1].length).replace(/^([^\.]+)$/,"$1."+aa(s[1])).replace(/\.$/,"."+aa(s[1])).replace(/\.(\d*)$/,function(x,v){return"."+v+Ji("0",aa(s[1]).length-v.length)}),e.indexOf("0.")!==-1?r:r.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+Uz(l,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+qf(Z0(l,0));if(s=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+Go(n,e,-t):qf(""+(Math.floor(t)+OTe(t,s[1].length)))+"."+Yl(Pz(t,s[1].length),s[1].length);if(s=e.match(/^#,#*,#0/))return Go(n,e.replace(/^#,#*,/,""),t);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return r=Ly(Go(n,e.replace(/[\\-]/g,""),t)),a=0,Ly(Ly(e.replace(/\\/g,"")).replace(/[0#]/g,function(x){return a<r.length?r.charAt(a++):x==="0"?"0":""}));if(e.match(wZ))return r=Go(n,"##########",t),"("+r.substr(0,3)+") "+r.substr(3,3)+"-"+r.substr(6);var h="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),o=YD(l,Math.pow(10,a)-1,!1),r=""+c,h=Ch("n",s[1],o[1]),h.charAt(h.length-1)==" "&&(h=h.substr(0,h.length-1)+"0"),r+=h+s[2]+"/"+s[3],h=XD(o[2],a),h.length<s[4].length&&(h=aa(s[4].substr(s[4].length-h.length))+h),r+=h,r;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),o=YD(l,Math.pow(10,a)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?_L(o[1],a)+s[2]+"/"+s[3]+XD(o[2],a):Ji(" ",2*a+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return r=Z0(t,0),e.length<=r.length?r:aa(e.substr(0,e.length-r.length))+r;if(s=e.match(/^([#0?]+)\.([#0]+)$/)){r=""+t.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=r.indexOf(".");var f=e.indexOf(".")-a,p=e.length-r.length-f;return aa(e.substr(0,f)+r+e.substr(e.length-p))}if(s=e.match(/^00,000\.([#0]*0)$/))return a=Pz(t,s[1].length),t<0?"-"+Go(n,e,-t):qf(BTe(t)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(x){return"00,"+(x.length<3?Yl(0,3-x.length):"")+x})+"."+Yl(a,s[1].length);switch(e){case"###,##0.00":return Go(n,"#,##0.00",t);case"###,###":case"##,###":case"#,###":var y=qf(Z0(l,0));return y!=="0"?c+y:"";case"###,###.00":return Go(n,"###,##0.00",t).replace(/^0\./,".");case"#,###.00":return Go(n,"#,##0.00",t).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function VTe(n,e,t){for(var i=e.length-1;e.charCodeAt(i-1)===44;)--i;return Ch(n,e.substr(0,i),t/Math.pow(10,3*(e.length-i)))}function WTe(n,e,t){var i=e.replace(_Z,""),r=e.length-i.length;return Ch(n,i,t*Math.pow(10,2*r))+Ji("%",r)}function AZ(n,e){var t,i=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+AZ(n,-e);var r=n.indexOf(".");r===-1&&(r=n.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%r;if(s<0&&(s+=r),t=(e/Math.pow(10,s)).toPrecision(i+1+(r+s)%r),!t.match(/[Ee]/)){var a=Math.floor(Math.log(e)*Math.LOG10E);t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(a-t.length+s):t+="E+"+(a-s),t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,h){return l+c+h.substr(0,(r+s)%r)+"."+h.substr(s)+"E"})}else t=e.toExponential(i);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}function Ac(n,e,t){if(n.charCodeAt(0)===40&&!e.match(EZ)){var i=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?Ac("n",i,t):"("+Ac("n",i,-t)+")"}if(e.charCodeAt(e.length-1)===44)return VTe(n,e,t);if(e.indexOf("%")!==-1)return WTe(n,e,t);if(e.indexOf("E")!==-1)return AZ(e,t);if(e.charCodeAt(0)===36)return"$"+Ac(n,e.substr(e.charAt(1)==" "?2:1),t);var r,s,a,o,l=Math.abs(t),c=t<0?"-":"";if(e.match(/^00+$/))return c+Yl(l,e.length);if(e.match(/^[#?]+$/))return r=""+t,t===0&&(r=""),r.length>e.length?r:aa(e.substr(0,e.length-r.length))+r;if(s=e.match(bZ))return LTe(s,l,c);if(e.match(/^#+0+$/))return c+Yl(l,e.length-e.indexOf("0"));if(s=e.match(TZ))return r=(""+t).replace(/^([^\.]+)$/,"$1."+aa(s[1])).replace(/\.$/,"."+aa(s[1])),r=r.replace(/\.(\d*)$/,function(x,v){return"."+v+Ji("0",aa(s[1]).length-v.length)}),e.indexOf("0.")!==-1?r:r.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+qf(""+l);if(s=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+Ac(n,e,-t):qf(""+t)+"."+Ji("0",s[1].length);if(s=e.match(/^#,#*,#0/))return Ac(n,e.replace(/^#,#*,/,""),t);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return r=Ly(Ac(n,e.replace(/[\\-]/g,""),t)),a=0,Ly(Ly(e.replace(/\\/g,"")).replace(/[0#]/g,function(x){return a<r.length?r.charAt(a++):x==="0"?"0":""}));if(e.match(wZ))return r=Ac(n,"##########",t),"("+r.substr(0,3)+") "+r.substr(3,3)+"-"+r.substr(6);var h="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(s[4].length,7),o=YD(l,Math.pow(10,a)-1,!1),r=""+c,h=Ch("n",s[1],o[1]),h.charAt(h.length-1)==" "&&(h=h.substr(0,h.length-1)+"0"),r+=h+s[2]+"/"+s[3],h=XD(o[2],a),h.length<s[4].length&&(h=aa(s[4].substr(s[4].length-h.length))+h),r+=h,r;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(s[1].length,s[4].length),7),o=YD(l,Math.pow(10,a)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?_L(o[1],a)+s[2]+"/"+s[3]+XD(o[2],a):Ji(" ",2*a+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return r=""+t,e.length<=r.length?r:aa(e.substr(0,e.length-r.length))+r;if(s=e.match(/^([#0]+)\.([#0]+)$/)){r=""+t.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),a=r.indexOf(".");var f=e.indexOf(".")-a,p=e.length-r.length-f;return aa(e.substr(0,f)+r+e.substr(e.length-p))}if(s=e.match(/^00,000\.([#0]*0)$/))return t<0?"-"+Ac(n,e,-t):qf(""+t).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(x){return"00,"+(x.length<3?Yl(0,3-x.length):"")+x})+"."+Yl(0,s[1].length);switch(e){case"###,###":case"##,###":case"#,###":var y=qf(""+l);return y!=="0"?c+y:"";default:if(e.match(/\.[0#?]*$/))return Ac(n,e.slice(0,e.lastIndexOf(".")),t)+aa(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function Ch(n,e,t){return(t|0)===t?Ac(n,e,t):Go(n,e,t)}function HTe(n){for(var e=[],t=!1,i=0,r=0;i<n.length;++i)switch(n.charCodeAt(i)){case 34:t=!t;break;case 95:case 42:case 92:++i;break;case 59:e[e.length]=n.substr(r,i-r),r=i+1}if(e[e.length]=n.substr(r),t===!0)throw new Error("Format |"+n+"| unterminated string ");return e}var SZ=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function DZ(n){for(var e=0,t="",i="";e<n.length;)switch(t=n.charAt(e)){case"G":KD(n,e)&&(e+=6),e++;break;case'"':for(;n.charCodeAt(++e)!==34&&e<n.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(n.charAt(e+1)==="1"||n.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(n.substr(e,3).toUpperCase()==="A/P"||n.substr(e,5).toUpperCase()==="AM/PM"||n.substr(e,5).toUpperCase()==="上午/下午")return!0;++e;break;case"[":for(i=t;n.charAt(e++)!=="]"&&e<n.length;)i+=n.charAt(e);if(i.match(SZ))return!0;break;case".":case"0":case"#":for(;e<n.length&&("0#?.,E+-%".indexOf(t=n.charAt(++e))>-1||t=="\\"&&n.charAt(e+1)=="-"&&"0#".indexOf(n.charAt(e+2))>-1););break;case"?":for(;n.charAt(++e)===t;);break;case"*":++e,(n.charAt(e)==" "||n.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<n.length&&"0123456789".indexOf(n.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function zTe(n,e,t,i){for(var r=[],s="",a=0,o="",l="t",c,h,f,p="H";a<n.length;)switch(o=n.charAt(a)){case"G":if(!KD(n,a))throw new Error("unrecognized character "+o+" in "+n);r[r.length]={t:"G",v:"General"},a+=7;break;case'"':for(s="";(f=n.charCodeAt(++a))!==34&&a<n.length;)s+=String.fromCharCode(f);r[r.length]={t:"t",v:s},++a;break;case"\\":var y=n.charAt(++a),x=y==="("||y===")"?y:"t";r[r.length]={t:x,v:y},++a;break;case"_":r[r.length]={t:"t",v:" "},a+=2;break;case"@":r[r.length]={t:"T",v:e},++a;break;case"B":case"b":if(n.charAt(a+1)==="1"||n.charAt(a+1)==="2"){if(c==null&&(c=bA(e,t,n.charAt(a+1)==="2"),c==null))return"";r[r.length]={t:"X",v:n.substr(a,2)},l=o,a+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||c==null&&(c=bA(e,t),c==null))return"";for(s=o;++a<n.length&&n.charAt(a).toLowerCase()===o;)s+=o;o==="m"&&l.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=p),r[r.length]={t:o,v:s},l=o;break;case"A":case"a":case"上":var v={t:o,v:o};if(c==null&&(c=bA(e,t)),n.substr(a,3).toUpperCase()==="A/P"?(c!=null&&(v.v=c.H>=12?"P":"A"),v.t="T",p="h",a+=3):n.substr(a,5).toUpperCase()==="AM/PM"?(c!=null&&(v.v=c.H>=12?"PM":"AM"),v.t="T",a+=5,p="h"):n.substr(a,5).toUpperCase()==="上午/下午"?(c!=null&&(v.v=c.H>=12?"下午":"上午"),v.t="T",a+=5,p="h"):(v.t="t",++a),c==null&&v.t==="T")return"";r[r.length]=v,l=o;break;case"[":for(s=o;n.charAt(a++)!=="]"&&a<n.length;)s+=n.charAt(a);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(SZ)){if(c==null&&(c=bA(e,t),c==null))return"";r[r.length]={t:"Z",v:s.toLowerCase()},l=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",DZ(n)||(r[r.length]={t:"t",v:s}));break;case".":if(c!=null){for(s=o;++a<n.length&&(o=n.charAt(a))==="0";)s+=o;r[r.length]={t:"s",v:s};break}case"0":case"#":for(s=o;++a<n.length&&"0#?.,E+-%".indexOf(o=n.charAt(a))>-1;)s+=o;r[r.length]={t:"n",v:s};break;case"?":for(s=o;n.charAt(++a)===o;)s+=o;r[r.length]={t:o,v:s},l=o;break;case"*":++a,(n.charAt(a)==" "||n.charAt(a)=="*")&&++a;break;case"(":case")":r[r.length]={t:i===1?"t":o,v:o},++a;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=o;a<n.length&&"0123456789".indexOf(n.charAt(++a))>-1;)s+=n.charAt(a);r[r.length]={t:"D",v:s};break;case" ":r[r.length]={t:o,v:o},++a;break;case"$":r[r.length]={t:"t",v:"$"},++a;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+n);r[r.length]={t:"t",v:o},++a;break}var _=0,E=0,w;for(a=r.length-1,l="t";a>=0;--a)switch(r[a].t){case"h":case"H":r[a].t=p,l="h",_<1&&(_=1);break;case"s":(w=r[a].v.match(/\.0+$/))&&(E=Math.max(E,w[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":l=r[a].t;break;case"m":l==="s"&&(r[a].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&r[a].v.match(/[Hh]/)&&(_=1),_<2&&r[a].v.match(/[Mm]/)&&(_=2),_<3&&r[a].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M),c.M>=60&&(c.M=0,++c.H);break;case 2:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M);break}var A="",N;for(a=0;a<r.length;++a)switch(r[a].t){case"t":case"T":case" ":case"D":break;case"X":r[a].v="",r[a].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":r[a].v=MTe(r[a].t.charCodeAt(0),r[a].v,c,E),r[a].t="t";break;case"n":case"?":for(N=a+1;r[N]!=null&&((o=r[N].t)==="?"||o==="D"||(o===" "||o==="t")&&r[N+1]!=null&&(r[N+1].t==="?"||r[N+1].t==="t"&&r[N+1].v==="/")||r[a].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(r[N].v==="/"||r[N].v===" "&&r[N+1]!=null&&r[N+1].t=="?"));)r[a].v+=r[N].v,r[N]={v:"",t:";"},++N;A+=r[a].v,a=N-1;break;case"G":r[a].t="t",r[a].v=YU(e,t);break}var k="",F,C;if(A.length>0){A.charCodeAt(0)==40?(F=e<0&&A.charCodeAt(0)===45?-e:e,C=Ch("n",A,F)):(F=e<0&&i>1?-e:e,C=Ch("n",A,F),F<0&&r[0]&&r[0].t=="t"&&(C=C.substr(1),r[0].v="-"+r[0].v)),N=C.length-1;var M=r.length;for(a=0;a<r.length;++a)if(r[a]!=null&&r[a].t!="t"&&r[a].v.indexOf(".")>-1){M=a;break}var R=r.length;if(M===r.length&&C.indexOf("E")===-1){for(a=r.length-1;a>=0;--a)r[a]==null||"n?".indexOf(r[a].t)===-1||(N>=r[a].v.length-1?(N-=r[a].v.length,r[a].v=C.substr(N+1,r[a].v.length)):N<0?r[a].v="":(r[a].v=C.substr(0,N+1),N=-1),r[a].t="t",R=a);N>=0&&R<r.length&&(r[R].v=C.substr(0,N+1)+r[R].v)}else if(M!==r.length&&C.indexOf("E")===-1){for(N=C.indexOf(".")-1,a=M;a>=0;--a)if(!(r[a]==null||"n?".indexOf(r[a].t)===-1)){for(h=r[a].v.indexOf(".")>-1&&a===M?r[a].v.indexOf(".")-1:r[a].v.length-1,k=r[a].v.substr(h+1);h>=0;--h)N>=0&&(r[a].v.charAt(h)==="0"||r[a].v.charAt(h)==="#")&&(k=C.charAt(N--)+k);r[a].v=k,r[a].t="t",R=a}for(N>=0&&R<r.length&&(r[R].v=C.substr(0,N+1)+r[R].v),N=C.indexOf(".")+1,a=M;a<r.length;++a)if(!(r[a]==null||"n?(".indexOf(r[a].t)===-1&&a!==M)){for(h=r[a].v.indexOf(".")>-1&&a===M?r[a].v.indexOf(".")+1:0,k=r[a].v.substr(0,h);h<r[a].v.length;++h)N<C.length&&(k+=C.charAt(N++));r[a].v=k,r[a].t="t",R=a}}}for(a=0;a<r.length;++a)r[a]!=null&&"n?".indexOf(r[a].t)>-1&&(F=i>1&&e<0&&a>0&&r[a-1].v==="-"?-e:e,r[a].v=Ch(r[a].t,r[a].v,F),r[a].t="t");var L="";for(a=0;a!==r.length;++a)r[a]!=null&&(L+=r[a].v);return L}var Lz=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function Oz(n,e){if(e==null)return!1;var t=parseFloat(e[2]);switch(e[1]){case"=":if(n==t)return!0;break;case">":if(n>t)return!0;break;case"<":if(n<t)return!0;break;case"<>":if(n!=t)return!0;break;case">=":if(n>=t)return!0;break;case"<=":if(n<=t)return!0;break}return!1}function GTe(n,e){var t=HTe(n),i=t.length,r=t[i-1].indexOf("@");if(i<4&&r>-1&&--i,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof e!="number")return[4,t.length===4||r>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=r>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=r>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=r>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break}var s=e>0?t[0]:e<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[i,s];if(t[0].match(/\[[=<>]/)!=null||t[1].match(/\[[=<>]/)!=null){var a=t[0].match(Lz),o=t[1].match(Lz);return Oz(e,a)?[i,t[0]]:Oz(e,o)?[i,t[1]]:[i,t[a!=null&&o!=null?2:1]]}return[i,s]}function rp(n,e,t){t==null&&(t={});var i="";switch(typeof n){case"string":n=="m/d/yy"&&t.dateNF?i=t.dateNF:i=n;break;case"number":n==14&&t.dateNF?i=t.dateNF:i=(t.table!=null?t.table:Qi)[n],i==null&&(i=t.table&&t.table[Fz[n]]||Qi[Fz[n]]),i==null&&(i=ATe[n]||"General");break}if(KD(i,0))return YU(e,t);e instanceof Date&&(e=vZ(e,t.date1904));var r=GTe(i,e);if(KD(r[1]))return YU(e,t);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return zTe(r[1],e,t,r[0])}function CZ(n,e){if(typeof e!="number"){e=+e||-1;for(var t=0;t<392;++t){if(Qi[t]==null){e<0&&(e=t);continue}if(Qi[t]==n){e=t;break}}e<0&&(e=391)}return Qi[e]=n,e}function $I(n){for(var e=0;e!=392;++e)n[e]!==void 0&&CZ(n[e],e)}function jI(){Qi=wTe()}var IZ=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function qTe(n){var e=typeof n=="number"?Qi[n]:n;return e=e.replace(IZ,"(\\d+)"),new RegExp("^"+e+"$")}function $Te(n,e,t){var i=-1,r=-1,s=-1,a=-1,o=-1,l=-1;(e.match(IZ)||[]).forEach(function(f,p){var y=parseInt(t[p+1],10);switch(f.toLowerCase().charAt(0)){case"y":i=y;break;case"d":s=y;break;case"h":a=y;break;case"s":l=y;break;case"m":a>=0?o=y:r=y;break}}),l>=0&&o==-1&&r>=0&&(o=r,r=-1);var c=(""+(i>=0?i:new Date().getFullYear())).slice(-4)+"-"+("00"+(r>=1?r:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var h=("00"+(a>=0?a:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return a==-1&&o==-1&&l==-1?c:i==-1&&r==-1&&s==-1?h:c+"T"+h}var jTe=(function(){var n={};n.version="1.2.0";function e(){for(var C=0,M=new Array(256),R=0;R!=256;++R)C=R,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,C=C&1?-306674912^C>>>1:C>>>1,M[R]=C;return typeof Int32Array<"u"?new Int32Array(M):M}var t=e();function i(C){var M=0,R=0,L=0,H=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(L=0;L!=256;++L)H[L]=C[L];for(L=0;L!=256;++L)for(R=C[L],M=256+L;M<4096;M+=256)R=H[M]=R>>>8^C[R&255];var P=[];for(L=1;L!=16;++L)P[L-1]=typeof Int32Array<"u"?H.subarray(L*256,L*256+256):H.slice(L*256,L*256+256);return P}var r=i(t),s=r[0],a=r[1],o=r[2],l=r[3],c=r[4],h=r[5],f=r[6],p=r[7],y=r[8],x=r[9],v=r[10],_=r[11],E=r[12],w=r[13],A=r[14];function N(C,M){for(var R=M^-1,L=0,H=C.length;L<H;)R=R>>>8^t[(R^C.charCodeAt(L++))&255];return~R}function k(C,M){for(var R=M^-1,L=C.length-15,H=0;H<L;)R=A[C[H++]^R&255]^w[C[H++]^R>>8&255]^E[C[H++]^R>>16&255]^_[C[H++]^R>>>24]^v[C[H++]]^x[C[H++]]^y[C[H++]]^p[C[H++]]^f[C[H++]]^h[C[H++]]^c[C[H++]]^l[C[H++]]^o[C[H++]]^a[C[H++]]^s[C[H++]]^t[C[H++]];for(L+=15;H<L;)R=R>>>8^t[(R^C[H++])&255];return~R}function F(C,M){for(var R=M^-1,L=0,H=C.length,P=0,O=0;L<H;)P=C.charCodeAt(L++),P<128?R=R>>>8^t[(R^P)&255]:P<2048?(R=R>>>8^t[(R^(192|P>>6&31))&255],R=R>>>8^t[(R^(128|P&63))&255]):P>=55296&&P<57344?(P=(P&1023)+64,O=C.charCodeAt(L++)&1023,R=R>>>8^t[(R^(240|P>>8&7))&255],R=R>>>8^t[(R^(128|P>>2&63))&255],R=R>>>8^t[(R^(128|O>>6&15|(P&3)<<4))&255],R=R>>>8^t[(R^(128|O&63))&255]):(R=R>>>8^t[(R^(224|P>>12&15))&255],R=R>>>8^t[(R^(128|P>>6&63))&255],R=R>>>8^t[(R^(128|P&63))&255]);return~R}return n.table=t,n.bstr=N,n.buf=k,n.str=F,n})(),fi=(function(){var e={};e.version="1.2.1";function t(se,me){for(var fe=se.split("/"),de=me.split("/"),ye=0,ve=0,Ve=Math.min(fe.length,de.length);ye<Ve;++ye){if(ve=fe[ye].length-de[ye].length)return ve;if(fe[ye]!=de[ye])return fe[ye]<de[ye]?-1:1}return fe.length-de.length}function i(se){if(se.charAt(se.length-1)=="/")return se.slice(0,-1).indexOf("/")===-1?se:i(se.slice(0,-1));var me=se.lastIndexOf("/");return me===-1?se:se.slice(0,me+1)}function r(se){if(se.charAt(se.length-1)=="/")return r(se.slice(0,-1));var me=se.lastIndexOf("/");return me===-1?se:se.slice(me+1)}function s(se,me){typeof me=="string"&&(me=new Date(me));var fe=me.getHours();fe=fe<<6|me.getMinutes(),fe=fe<<5|me.getSeconds()>>>1,se.write_shift(2,fe);var de=me.getFullYear()-1980;de=de<<4|me.getMonth()+1,de=de<<5|me.getDate(),se.write_shift(2,de)}function a(se){var me=se.read_shift(2)&65535,fe=se.read_shift(2)&65535,de=new Date,ye=fe&31;fe>>>=5;var ve=fe&15;fe>>>=4,de.setMilliseconds(0),de.setFullYear(fe+1980),de.setMonth(ve-1),de.setDate(ye);var Ve=me&31;me>>>=5;var nt=me&63;return me>>>=6,de.setHours(me),de.setMinutes(nt),de.setSeconds(Ve<<1),de}function o(se){vo(se,0);for(var me={},fe=0;se.l<=se.length-4;){var de=se.read_shift(2),ye=se.read_shift(2),ve=se.l+ye,Ve={};switch(de){case 21589:fe=se.read_shift(1),fe&1&&(Ve.mtime=se.read_shift(4)),ye>5&&(fe&2&&(Ve.atime=se.read_shift(4)),fe&4&&(Ve.ctime=se.read_shift(4))),Ve.mtime&&(Ve.mt=new Date(Ve.mtime*1e3));break}se.l=ve,me[de]=Ve}return me}var l;function c(){return l||(l={})}function h(se,me){if(se[0]==80&&se[1]==75)return Kt(se,me);if((se[0]|32)==109&&(se[1]|32)==105)return ki(se,me);if(se.length<512)throw new Error("CFB file size "+se.length+" < 512");var fe=3,de=512,ye=0,ve=0,Ve=0,nt=0,He=0,je=[],qe=se.slice(0,512);vo(qe,0);var ht=f(qe);switch(fe=ht[0],fe){case 3:de=512;break;case 4:de=4096;break;case 0:if(ht[1]==0)return Kt(se,me);default:throw new Error("Major Version: Expected 3 or 4 saw "+fe)}de!==512&&(qe=se.slice(0,de),vo(qe,28));var yt=se.slice(0,de);p(qe,fe);var Et=qe.read_shift(4,"i");if(fe===3&&Et!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Et);qe.l+=4,Ve=qe.read_shift(4,"i"),qe.l+=4,qe.chk("00100000","Mini Stream Cutoff Size: "),nt=qe.read_shift(4,"i"),ye=qe.read_shift(4,"i"),He=qe.read_shift(4,"i"),ve=qe.read_shift(4,"i");for(var ut=-1,Tt=0;Tt<109&&(ut=qe.read_shift(4,"i"),!(ut<0));++Tt)je[Tt]=ut;var Ft=y(se,de);_(He,ve,Ft,de,je);var qn=w(Ft,Ve,je,de);qn[Ve].name="!Directory",ye>0&&nt!==O&&(qn[nt].name="!MiniFAT"),qn[je[0]].name="!FAT",qn.fat_addrs=je,qn.ssz=de;var $n={},gi=[],Ns=[],vl=[];A(Ve,qn,Ft,gi,ye,$n,Ns,nt),x(Ns,vl,gi),gi.shift();var _l={FileIndex:Ns,FullPaths:vl};return me&&me.raw&&(_l.raw={header:yt,sectors:Ft}),_l}function f(se){if(se[se.l]==80&&se[se.l+1]==75)return[0,0];se.chk(B,"Header Signature: "),se.l+=16;var me=se.read_shift(2,"u");return[se.read_shift(2,"u"),me]}function p(se,me){var fe=9;switch(se.l+=2,fe=se.read_shift(2)){case 9:if(me!=3)throw new Error("Sector Shift: Expected 9 saw "+fe);break;case 12:if(me!=4)throw new Error("Sector Shift: Expected 12 saw "+fe);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+fe)}se.chk("0600","Mini Sector Shift: "),se.chk("000000000000","Reserved: ")}function y(se,me){for(var fe=Math.ceil(se.length/me)-1,de=[],ye=1;ye<fe;++ye)de[ye-1]=se.slice(ye*me,(ye+1)*me);return de[fe-1]=se.slice(fe*me),de}function x(se,me,fe){for(var de=0,ye=0,ve=0,Ve=0,nt=0,He=fe.length,je=[],qe=[];de<He;++de)je[de]=qe[de]=de,me[de]=fe[de];for(;nt<qe.length;++nt)de=qe[nt],ye=se[de].L,ve=se[de].R,Ve=se[de].C,je[de]===de&&(ye!==-1&&je[ye]!==ye&&(je[de]=je[ye]),ve!==-1&&je[ve]!==ve&&(je[de]=je[ve])),Ve!==-1&&(je[Ve]=de),ye!==-1&&de!=je[de]&&(je[ye]=je[de],qe.lastIndexOf(ye)<nt&&qe.push(ye)),ve!==-1&&de!=je[de]&&(je[ve]=je[de],qe.lastIndexOf(ve)<nt&&qe.push(ve));for(de=1;de<He;++de)je[de]===de&&(ve!==-1&&je[ve]!==ve?je[de]=je[ve]:ye!==-1&&je[ye]!==ye&&(je[de]=je[ye]));for(de=1;de<He;++de)if(se[de].type!==0){if(nt=de,nt!=je[nt])do nt=je[nt],me[de]=me[nt]+"/"+me[de];while(nt!==0&&je[nt]!==-1&&nt!=je[nt]);je[de]=-1}for(me[0]+="/",de=1;de<He;++de)se[de].type!==2&&(me[de]+="/")}function v(se,me,fe){for(var de=se.start,ye=se.size,ve=[],Ve=de;fe&&ye>0&&Ve>=0;)ve.push(me.slice(Ve*P,Ve*P+P)),ye-=P,Ve=ug(fe,Ve*4);return ve.length===0?tt(0):As(ve).slice(0,se.size)}function _(se,me,fe,de,ye){var ve=O;if(se===O){if(me!==0)throw new Error("DIFAT chain shorter than expected")}else if(se!==-1){var Ve=fe[se],nt=(de>>>2)-1;if(!Ve)return;for(var He=0;He<nt&&(ve=ug(Ve,He*4))!==O;++He)ye.push(ve);_(ug(Ve,de-4),me-1,fe,de,ye)}}function E(se,me,fe,de,ye){var ve=[],Ve=[];ye||(ye=[]);var nt=de-1,He=0,je=0;for(He=me;He>=0;){ye[He]=!0,ve[ve.length]=He,Ve.push(se[He]);var qe=fe[Math.floor(He*4/de)];if(je=He*4&nt,de<4+je)throw new Error("FAT boundary crossed: "+He+" 4 "+de);if(!se[qe])break;He=ug(se[qe],je)}return{nodes:ve,data:$z([Ve])}}function w(se,me,fe,de){var ye=se.length,ve=[],Ve=[],nt=[],He=[],je=de-1,qe=0,ht=0,yt=0,Et=0;for(qe=0;qe<ye;++qe)if(nt=[],yt=qe+me,yt>=ye&&(yt-=ye),!Ve[yt]){He=[];var ut=[];for(ht=yt;ht>=0;){ut[ht]=!0,Ve[ht]=!0,nt[nt.length]=ht,He.push(se[ht]);var Tt=fe[Math.floor(ht*4/de)];if(Et=ht*4&je,de<4+Et)throw new Error("FAT boundary crossed: "+ht+" 4 "+de);if(!se[Tt]||(ht=ug(se[Tt],Et),ut[ht]))break}ve[yt]={nodes:nt,data:$z([He])}}return ve}function A(se,me,fe,de,ye,ve,Ve,nt){for(var He=0,je=de.length?2:0,qe=me[se].data,ht=0,yt=0,Et;ht<qe.length;ht+=128){var ut=qe.slice(ht,ht+128);vo(ut,64),yt=ut.read_shift(2),Et=AL(ut,0,yt-je),de.push(Et);var Tt={name:Et,type:ut.read_shift(1),color:ut.read_shift(1),L:ut.read_shift(4,"i"),R:ut.read_shift(4,"i"),C:ut.read_shift(4,"i"),clsid:ut.read_shift(16),state:ut.read_shift(4,"i"),start:0,size:0},Ft=ut.read_shift(2)+ut.read_shift(2)+ut.read_shift(2)+ut.read_shift(2);Ft!==0&&(Tt.ct=N(ut,ut.l-8));var qn=ut.read_shift(2)+ut.read_shift(2)+ut.read_shift(2)+ut.read_shift(2);qn!==0&&(Tt.mt=N(ut,ut.l-8)),Tt.start=ut.read_shift(4,"i"),Tt.size=ut.read_shift(4,"i"),Tt.size<0&&Tt.start<0&&(Tt.size=Tt.type=0,Tt.start=O,Tt.name=""),Tt.type===5?(He=Tt.start,ye>0&&He!==O&&(me[He].name="!StreamData")):Tt.size>=4096?(Tt.storage="fat",me[Tt.start]===void 0&&(me[Tt.start]=E(fe,Tt.start,me.fat_addrs,me.ssz)),me[Tt.start].name=Tt.name,Tt.content=me[Tt.start].data.slice(0,Tt.size)):(Tt.storage="minifat",Tt.size<0?Tt.size=0:He!==O&&Tt.start!==O&&me[He]&&(Tt.content=v(Tt,me[He].data,(me[nt]||{}).data))),Tt.content&&vo(Tt.content,0),ve[Et]=Tt,Ve.push(Tt)}}function N(se,me){return new Date((xo(se,me+4)/1e7*Math.pow(2,32)+xo(se,me)/1e7-11644473600)*1e3)}function k(se,me){return c(),h(l.readFileSync(se),me)}function F(se,me){var fe=me&&me.type;switch(fe||Vn&&Buffer.isBuffer(se)&&(fe="buffer"),fe||"base64"){case"file":return k(se,me);case"base64":return h(Xl(Vh(se)),me);case"binary":return h(Xl(se),me)}return h(se,me)}function C(se,me){var fe=me||{},de=fe.root||"Root Entry";if(se.FullPaths||(se.FullPaths=[]),se.FileIndex||(se.FileIndex=[]),se.FullPaths.length!==se.FileIndex.length)throw new Error("inconsistent CFB structure");se.FullPaths.length===0&&(se.FullPaths[0]=de+"/",se.FileIndex[0]={name:de,type:5}),fe.CLSID&&(se.FileIndex[0].clsid=fe.CLSID),M(se)}function M(se){var me="Sh33tJ5";if(!fi.find(se,"/"+me)){var fe=tt(4);fe[0]=55,fe[1]=fe[3]=50,fe[2]=54,se.FileIndex.push({name:me,type:2,content:fe,size:4,L:69,R:69,C:69}),se.FullPaths.push(se.FullPaths[0]+me),R(se)}}function R(se,me){C(se);for(var fe=!1,de=!1,ye=se.FullPaths.length-1;ye>=0;--ye){var ve=se.FileIndex[ye];switch(ve.type){case 0:de?fe=!0:(se.FileIndex.pop(),se.FullPaths.pop());break;case 1:case 2:case 5:de=!0,isNaN(ve.R*ve.L*ve.C)&&(fe=!0),ve.R>-1&&ve.L>-1&&ve.R==ve.L&&(fe=!0);break;default:fe=!0;break}}if(!(!fe&&!me)){var Ve=new Date(1987,1,19),nt=0,He=Object.create?Object.create(null):{},je=[];for(ye=0;ye<se.FullPaths.length;++ye)He[se.FullPaths[ye]]=!0,se.FileIndex[ye].type!==0&&je.push([se.FullPaths[ye],se.FileIndex[ye]]);for(ye=0;ye<je.length;++ye){var qe=i(je[ye][0]);de=He[qe],de||(je.push([qe,{name:r(qe).replace("/",""),type:1,clsid:q,ct:Ve,mt:Ve,content:null}]),He[qe]=!0)}for(je.sort(function(Et,ut){return t(Et[0],ut[0])}),se.FullPaths=[],se.FileIndex=[],ye=0;ye<je.length;++ye)se.FullPaths[ye]=je[ye][0],se.FileIndex[ye]=je[ye][1];for(ye=0;ye<je.length;++ye){var ht=se.FileIndex[ye],yt=se.FullPaths[ye];if(ht.name=r(yt).replace("/",""),ht.L=ht.R=ht.C=-(ht.color=1),ht.size=ht.content?ht.content.length:0,ht.start=0,ht.clsid=ht.clsid||q,ye===0)ht.C=je.length>1?1:-1,ht.size=0,ht.type=5;else if(yt.slice(-1)=="/"){for(nt=ye+1;nt<je.length&&i(se.FullPaths[nt])!=yt;++nt);for(ht.C=nt>=je.length?-1:nt,nt=ye+1;nt<je.length&&i(se.FullPaths[nt])!=i(yt);++nt);ht.R=nt>=je.length?-1:nt,ht.type=1}else i(se.FullPaths[ye+1]||"")==i(yt)&&(ht.R=ye+1),ht.type=2}}}function L(se,me){var fe=me||{};if(fe.fileType=="mad")return ss(se,fe);switch(R(se),fe.fileType){case"zip":return ne(se,fe)}var de=(function(Et){for(var ut=0,Tt=0,Ft=0;Ft<Et.FileIndex.length;++Ft){var qn=Et.FileIndex[Ft];if(qn.content){var $n=qn.content.length;$n>0&&($n<4096?ut+=$n+63>>6:Tt+=$n+511>>9)}}for(var gi=Et.FullPaths.length+3>>2,Ns=ut+7>>3,vl=ut+127>>7,_l=Ns+Tt+gi+vl,Va=_l+127>>7,ed=Va<=109?0:Math.ceil((Va-109)/127);_l+Va+ed+127>>7>Va;)ed=++Va<=109?0:Math.ceil((Va-109)/127);var ks=[1,ed,Va,vl,gi,Tt,ut,0];return Et.FileIndex[0].size=ut<<6,ks[7]=(Et.FileIndex[0].start=ks[0]+ks[1]+ks[2]+ks[3]+ks[4]+ks[5])+(ks[6]+7>>3),ks})(se),ye=tt(de[7]<<9),ve=0,Ve=0;{for(ve=0;ve<8;++ve)ye.write_shift(1,re[ve]);for(ve=0;ve<8;++ve)ye.write_shift(2,0);for(ye.write_shift(2,62),ye.write_shift(2,3),ye.write_shift(2,65534),ye.write_shift(2,9),ye.write_shift(2,6),ve=0;ve<3;++ve)ye.write_shift(2,0);for(ye.write_shift(4,0),ye.write_shift(4,de[2]),ye.write_shift(4,de[0]+de[1]+de[2]+de[3]-1),ye.write_shift(4,0),ye.write_shift(4,4096),ye.write_shift(4,de[3]?de[0]+de[1]+de[2]-1:O),ye.write_shift(4,de[3]),ye.write_shift(-4,de[1]?de[0]-1:O),ye.write_shift(4,de[1]),ve=0;ve<109;++ve)ye.write_shift(-4,ve<de[2]?de[1]+ve:-1)}if(de[1])for(Ve=0;Ve<de[1];++Ve){for(;ve<236+Ve*127;++ve)ye.write_shift(-4,ve<de[2]?de[1]+ve:-1);ye.write_shift(-4,Ve===de[1]-1?O:Ve+1)}var nt=function(Et){for(Ve+=Et;ve<Ve-1;++ve)ye.write_shift(-4,ve+1);Et&&(++ve,ye.write_shift(-4,O))};for(Ve=ve=0,Ve+=de[1];ve<Ve;++ve)ye.write_shift(-4,X.DIFSECT);for(Ve+=de[2];ve<Ve;++ve)ye.write_shift(-4,X.FATSECT);nt(de[3]),nt(de[4]);for(var He=0,je=0,qe=se.FileIndex[0];He<se.FileIndex.length;++He)qe=se.FileIndex[He],qe.content&&(je=qe.content.length,!(je<4096)&&(qe.start=Ve,nt(je+511>>9)));for(nt(de[6]+7>>3);ye.l&511;)ye.write_shift(-4,X.ENDOFCHAIN);for(Ve=ve=0,He=0;He<se.FileIndex.length;++He)qe=se.FileIndex[He],qe.content&&(je=qe.content.length,!(!je||je>=4096)&&(qe.start=Ve,nt(je+63>>6)));for(;ye.l&511;)ye.write_shift(-4,X.ENDOFCHAIN);for(ve=0;ve<de[4]<<2;++ve){var ht=se.FullPaths[ve];if(!ht||ht.length===0){for(He=0;He<17;++He)ye.write_shift(4,0);for(He=0;He<3;++He)ye.write_shift(4,-1);for(He=0;He<12;++He)ye.write_shift(4,0);continue}qe=se.FileIndex[ve],ve===0&&(qe.start=qe.size?qe.start-1:O);var yt=ve===0&&fe.root||qe.name;if(je=2*(yt.length+1),ye.write_shift(64,yt,"utf16le"),ye.write_shift(2,je),ye.write_shift(1,qe.type),ye.write_shift(1,qe.color),ye.write_shift(-4,qe.L),ye.write_shift(-4,qe.R),ye.write_shift(-4,qe.C),qe.clsid)ye.write_shift(16,qe.clsid,"hex");else for(He=0;He<4;++He)ye.write_shift(4,0);ye.write_shift(4,qe.state||0),ye.write_shift(4,0),ye.write_shift(4,0),ye.write_shift(4,0),ye.write_shift(4,0),ye.write_shift(4,qe.start),ye.write_shift(4,qe.size),ye.write_shift(4,0)}for(ve=1;ve<se.FileIndex.length;++ve)if(qe=se.FileIndex[ve],qe.size>=4096)if(ye.l=qe.start+1<<9,Vn&&Buffer.isBuffer(qe.content))qe.content.copy(ye,ye.l,0,qe.size),ye.l+=qe.size+511&-512;else{for(He=0;He<qe.size;++He)ye.write_shift(1,qe.content[He]);for(;He&511;++He)ye.write_shift(1,0)}for(ve=1;ve<se.FileIndex.length;++ve)if(qe=se.FileIndex[ve],qe.size>0&&qe.size<4096)if(Vn&&Buffer.isBuffer(qe.content))qe.content.copy(ye,ye.l,0,qe.size),ye.l+=qe.size+63&-64;else{for(He=0;He<qe.size;++He)ye.write_shift(1,qe.content[He]);for(;He&63;++He)ye.write_shift(1,0)}if(Vn)ye.l=ye.length;else for(;ye.l<ye.length;)ye.write_shift(1,0);return ye}function H(se,me){var fe=se.FullPaths.map(function(He){return He.toUpperCase()}),de=fe.map(function(He){var je=He.split("/");return je[je.length-(He.slice(-1)=="/"?2:1)]}),ye=!1;me.charCodeAt(0)===47?(ye=!0,me=fe[0].slice(0,-1)+me):ye=me.indexOf("/")!==-1;var ve=me.toUpperCase(),Ve=ye===!0?fe.indexOf(ve):de.indexOf(ve);if(Ve!==-1)return se.FileIndex[Ve];var nt=!ve.match(xA);for(ve=ve.replace(tb,""),nt&&(ve=ve.replace(xA,"!")),Ve=0;Ve<fe.length;++Ve)if((nt?fe[Ve].replace(xA,"!"):fe[Ve]).replace(tb,"")==ve||(nt?de[Ve].replace(xA,"!"):de[Ve]).replace(tb,"")==ve)return se.FileIndex[Ve];return null}var P=64,O=-2,B="d0cf11e0a1b11ae1",re=[208,207,17,224,161,177,26,225],q="00000000000000000000000000000000",X={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:O,FREESECT:-1,HEADER_SIGNATURE:B,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:q,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function oe(se,me,fe){c();var de=L(se,fe);l.writeFileSync(me,de)}function ue(se){for(var me=new Array(se.length),fe=0;fe<se.length;++fe)me[fe]=String.fromCharCode(se[fe]);return me.join("")}function ge(se,me){var fe=L(se,me);switch(me&&me.type||"buffer"){case"file":return c(),l.writeFileSync(me.filename,fe),fe;case"binary":return typeof fe=="string"?fe:ue(fe);case"base64":return Nb(typeof fe=="string"?fe:ue(fe));case"buffer":if(Vn)return Buffer.isBuffer(fe)?fe:Qh(fe);case"array":return typeof fe=="string"?Xl(fe):fe}return fe}var j;function G(se){try{var me=se.InflateRaw,fe=new me;if(fe._processChunk(new Uint8Array([3,0]),fe._finishFlushFlag),fe.bytesRead)j=se;else throw new Error("zlib does not expose bytesRead")}catch(de){console.error("cannot use native zlib: "+(de.message||de))}}function Z(se,me){if(!j)return mt(se,me);var fe=j.InflateRaw,de=new fe,ye=de._processChunk(se.slice(se.l),de._finishFlushFlag);return se.l+=de.bytesRead,ye}function te(se){return j?j.deflateRawSync(se):Nt(se)}var ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Ie=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function Pe(se){var me=(se<<1|se<<11)&139536|(se<<5|se<<15)&558144;return(me>>16|me>>8|me)&255}for(var Fe=typeof Uint8Array<"u",Ge=Fe?new Uint8Array(256):[],ct=0;ct<256;++ct)Ge[ct]=Pe(ct);function gt(se,me){var fe=Ge[se&255];return me<=8?fe>>>8-me:(fe=fe<<8|Ge[se>>8&255],me<=16?fe>>>16-me:(fe=fe<<8|Ge[se>>16&255],fe>>>24-me))}function Mt(se,me){var fe=me&7,de=me>>>3;return(se[de]|(fe<=6?0:se[de+1]<<8))>>>fe&3}function W(se,me){var fe=me&7,de=me>>>3;return(se[de]|(fe<=5?0:se[de+1]<<8))>>>fe&7}function Re(se,me){var fe=me&7,de=me>>>3;return(se[de]|(fe<=4?0:se[de+1]<<8))>>>fe&15}function Te(se,me){var fe=me&7,de=me>>>3;return(se[de]|(fe<=3?0:se[de+1]<<8))>>>fe&31}function ae(se,me){var fe=me&7,de=me>>>3;return(se[de]|(fe<=1?0:se[de+1]<<8))>>>fe&127}function he(se,me,fe){var de=me&7,ye=me>>>3,ve=(1<<fe)-1,Ve=se[ye]>>>de;return fe<8-de||(Ve|=se[ye+1]<<8-de,fe<16-de)||(Ve|=se[ye+2]<<16-de,fe<24-de)||(Ve|=se[ye+3]<<24-de),Ve&ve}function we(se,me,fe){var de=me&7,ye=me>>>3;return de<=5?se[ye]|=(fe&7)<<de:(se[ye]|=fe<<de&255,se[ye+1]=(fe&7)>>8-de),me+3}function Le(se,me,fe){var de=me&7,ye=me>>>3;return fe=(fe&1)<<de,se[ye]|=fe,me+1}function $e(se,me,fe){var de=me&7,ye=me>>>3;return fe<<=de,se[ye]|=fe&255,fe>>>=8,se[ye+1]=fe,me+8}function Ce(se,me,fe){var de=me&7,ye=me>>>3;return fe<<=de,se[ye]|=fe&255,fe>>>=8,se[ye+1]=fe&255,se[ye+2]=fe>>>8,me+16}function be(se,me){var fe=se.length,de=2*fe>me?2*fe:me+5,ye=0;if(fe>=me)return se;if(Vn){var ve=Nz(de);if(se.copy)se.copy(ve);else for(;ye<se.length;++ye)ve[ye]=se[ye];return ve}else if(Fe){var Ve=new Uint8Array(de);if(Ve.set)Ve.set(se);else for(;ye<fe;++ye)Ve[ye]=se[ye];return Ve}return se.length=de,se}function Ee(se){for(var me=new Array(se),fe=0;fe<se;++fe)me[fe]=0;return me}function Me(se,me,fe){var de=1,ye=0,ve=0,Ve=0,nt=0,He=se.length,je=Fe?new Uint16Array(32):Ee(32);for(ve=0;ve<32;++ve)je[ve]=0;for(ve=He;ve<fe;++ve)se[ve]=0;He=se.length;var qe=Fe?new Uint16Array(He):Ee(He);for(ve=0;ve<He;++ve)je[ye=se[ve]]++,de<ye&&(de=ye),qe[ve]=0;for(je[0]=0,ve=1;ve<=de;++ve)je[ve+16]=nt=nt+je[ve-1]<<1;for(ve=0;ve<He;++ve)nt=se[ve],nt!=0&&(qe[ve]=je[nt+16]++);var ht=0;for(ve=0;ve<He;++ve)if(ht=se[ve],ht!=0)for(nt=gt(qe[ve],de)>>de-ht,Ve=(1<<de+4-ht)-1;Ve>=0;--Ve)me[nt|Ve<<ht]=ht&15|ve<<4;return de}var Xe=Fe?new Uint16Array(512):Ee(512),dt=Fe?new Uint16Array(32):Ee(32);if(!Fe){for(var bt=0;bt<512;++bt)Xe[bt]=0;for(bt=0;bt<32;++bt)dt[bt]=0}(function(){for(var se=[],me=0;me<32;me++)se.push(5);Me(se,dt,32);var fe=[];for(me=0;me<=143;me++)fe.push(8);for(;me<=255;me++)fe.push(9);for(;me<=279;me++)fe.push(7);for(;me<=287;me++)fe.push(8);Me(fe,Xe,288)})();var zt=(function(){for(var me=Fe?new Uint8Array(32768):[],fe=0,de=0;fe<Ie.length-1;++fe)for(;de<Ie[fe+1];++de)me[de]=fe;for(;de<32768;++de)me[de]=29;var ye=Fe?new Uint8Array(259):[];for(fe=0,de=0;fe<_e.length-1;++fe)for(;de<_e[fe+1];++de)ye[de]=fe;function ve(nt,He){for(var je=0;je<nt.length;){var qe=Math.min(65535,nt.length-je),ht=je+qe==nt.length;for(He.write_shift(1,+ht),He.write_shift(2,qe),He.write_shift(2,~qe&65535);qe-- >0;)He[He.l++]=nt[je++]}return He.l}function Ve(nt,He){for(var je=0,qe=0,ht=Fe?new Uint16Array(32768):[];qe<nt.length;){var yt=Math.min(65535,nt.length-qe);if(yt<10){for(je=we(He,je,+(qe+yt==nt.length)),je&7&&(je+=8-(je&7)),He.l=je/8|0,He.write_shift(2,yt),He.write_shift(2,~yt&65535);yt-- >0;)He[He.l++]=nt[qe++];je=He.l*8;continue}je=we(He,je,+(qe+yt==nt.length)+2);for(var Et=0;yt-- >0;){var ut=nt[qe];Et=(Et<<5^ut)&32767;var Tt=-1,Ft=0;if((Tt=ht[Et])&&(Tt|=qe&-32768,Tt>qe&&(Tt-=32768),Tt<qe))for(;nt[Tt+Ft]==nt[qe+Ft]&&Ft<250;)++Ft;if(Ft>2){ut=ye[Ft],ut<=22?je=$e(He,je,Ge[ut+1]>>1)-1:($e(He,je,3),je+=5,$e(He,je,Ge[ut-23]>>5),je+=3);var qn=ut<8?0:ut-4>>2;qn>0&&(Ce(He,je,Ft-_e[ut]),je+=qn),ut=me[qe-Tt],je=$e(He,je,Ge[ut]>>3),je-=3;var $n=ut<4?0:ut-2>>1;$n>0&&(Ce(He,je,qe-Tt-Ie[ut]),je+=$n);for(var gi=0;gi<Ft;++gi)ht[Et]=qe&32767,Et=(Et<<5^nt[qe])&32767,++qe;yt-=Ft-1}else ut<=143?ut=ut+48:je=Le(He,je,1),je=$e(He,je,Ge[ut]),ht[Et]=qe&32767,++qe}je=$e(He,je,0)-1}return He.l=(je+7)/8|0,He.l}return function(He,je){return He.length<8?ve(He,je):Ve(He,je)}})();function Nt(se){var me=tt(50+Math.floor(se.length*1.1)),fe=zt(se,me);return me.slice(0,fe)}var Gt=Fe?new Uint16Array(32768):Ee(32768),on=Fe?new Uint16Array(32768):Ee(32768),ke=Fe?new Uint16Array(128):Ee(128),xe=1,Ye=1;function Je(se,me){var fe=Te(se,me)+257;me+=5;var de=Te(se,me)+1;me+=5;var ye=Re(se,me)+4;me+=4;for(var ve=0,Ve=Fe?new Uint8Array(19):Ee(19),nt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],He=1,je=Fe?new Uint8Array(8):Ee(8),qe=Fe?new Uint8Array(8):Ee(8),ht=Ve.length,yt=0;yt<ye;++yt)Ve[ie[yt]]=ve=W(se,me),He<ve&&(He=ve),je[ve]++,me+=3;var Et=0;for(je[0]=0,yt=1;yt<=He;++yt)qe[yt]=Et=Et+je[yt-1]<<1;for(yt=0;yt<ht;++yt)(Et=Ve[yt])!=0&&(nt[yt]=qe[Et]++);var ut=0;for(yt=0;yt<ht;++yt)if(ut=Ve[yt],ut!=0){Et=Ge[nt[yt]]>>8-ut;for(var Tt=(1<<7-ut)-1;Tt>=0;--Tt)ke[Et|Tt<<ut]=ut&7|yt<<3}var Ft=[];for(He=1;Ft.length<fe+de;)switch(Et=ke[ae(se,me)],me+=Et&7,Et>>>=3){case 16:for(ve=3+Mt(se,me),me+=2,Et=Ft[Ft.length-1];ve-- >0;)Ft.push(Et);break;case 17:for(ve=3+W(se,me),me+=3;ve-- >0;)Ft.push(0);break;case 18:for(ve=11+ae(se,me),me+=7;ve-- >0;)Ft.push(0);break;default:Ft.push(Et),He<Et&&(He=Et);break}var qn=Ft.slice(0,fe),$n=Ft.slice(fe);for(yt=fe;yt<286;++yt)qn[yt]=0;for(yt=de;yt<30;++yt)$n[yt]=0;return xe=Me(qn,Gt,286),Ye=Me($n,on,30),me}function pt(se,me){if(se[0]==3&&!(se[1]&3))return[Wm(me),2];for(var fe=0,de=0,ye=Nz(me||1<<18),ve=0,Ve=ye.length>>>0,nt=0,He=0;(de&1)==0;){if(de=W(se,fe),fe+=3,de>>>1)de>>1==1?(nt=9,He=5):(fe=Je(se,fe),nt=xe,He=Ye);else{fe&7&&(fe+=8-(fe&7));var je=se[fe>>>3]|se[(fe>>>3)+1]<<8;if(fe+=32,je>0)for(!me&&Ve<ve+je&&(ye=be(ye,ve+je),Ve=ye.length);je-- >0;)ye[ve++]=se[fe>>>3],fe+=8;continue}for(;;){!me&&Ve<ve+32767&&(ye=be(ye,ve+32767),Ve=ye.length);var qe=he(se,fe,nt),ht=de>>>1==1?Xe[qe]:Gt[qe];if(fe+=ht&15,ht>>>=4,(ht>>>8&255)===0)ye[ve++]=ht;else{if(ht==256)break;ht-=257;var yt=ht<8?0:ht-4>>2;yt>5&&(yt=0);var Et=ve+_e[ht];yt>0&&(Et+=he(se,fe,yt),fe+=yt),qe=he(se,fe,He),ht=de>>>1==1?dt[qe]:on[qe],fe+=ht&15,ht>>>=4;var ut=ht<4?0:ht-2>>1,Tt=Ie[ht];for(ut>0&&(Tt+=he(se,fe,ut),fe+=ut),!me&&Ve<Et&&(ye=be(ye,Et+100),Ve=ye.length);ve<Et;)ye[ve]=ye[ve-Tt],++ve}}}return me?[ye,fe+7>>>3]:[ye.slice(0,ve),fe+7>>>3]}function mt(se,me){var fe=se.slice(se.l||0),de=pt(fe,me);return se.l+=de[1],de[0]}function Yt(se,me){if(se)typeof console<"u"&&console.error(me);else throw new Error(me)}function Kt(se,me){var fe=se;vo(fe,0);var de=[],ye=[],ve={FileIndex:de,FullPaths:ye};C(ve,{root:me.root});for(var Ve=fe.length-4;(fe[Ve]!=80||fe[Ve+1]!=75||fe[Ve+2]!=5||fe[Ve+3]!=6)&&Ve>=0;)--Ve;fe.l=Ve+4,fe.l+=4;var nt=fe.read_shift(2);fe.l+=6;var He=fe.read_shift(4);for(fe.l=He,Ve=0;Ve<nt;++Ve){fe.l+=20;var je=fe.read_shift(4),qe=fe.read_shift(4),ht=fe.read_shift(2),yt=fe.read_shift(2),Et=fe.read_shift(2);fe.l+=8;var ut=fe.read_shift(4),Tt=o(fe.slice(fe.l+ht,fe.l+ht+yt));fe.l+=ht+yt+Et;var Ft=fe.l;fe.l=ut+4,jt(fe,je,qe,ve,Tt),fe.l=Ft}return ve}function jt(se,me,fe,de,ye){se.l+=2;var ve=se.read_shift(2),Ve=se.read_shift(2),nt=a(se);if(ve&8257)throw new Error("Unsupported ZIP encryption");for(var He=se.read_shift(4),je=se.read_shift(4),qe=se.read_shift(4),ht=se.read_shift(2),yt=se.read_shift(2),Et="",ut=0;ut<ht;++ut)Et+=String.fromCharCode(se[se.l++]);if(yt){var Tt=o(se.slice(se.l,se.l+yt));(Tt[21589]||{}).mt&&(nt=Tt[21589].mt),((ye||{})[21589]||{}).mt&&(nt=ye[21589].mt)}se.l+=yt;var Ft=se.slice(se.l,se.l+je);switch(Ve){case 8:Ft=Z(se,qe);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+Ve)}var qn=!1;ve&8&&(He=se.read_shift(4),He==134695760&&(He=se.read_shift(4),qn=!0),je=se.read_shift(4),qe=se.read_shift(4)),je!=me&&Yt(qn,"Bad compressed size: "+me+" != "+je),qe!=fe&&Yt(qn,"Bad uncompressed size: "+fe+" != "+qe),wr(de,Et,Ft,{unsafe:!0,mt:nt})}function ne(se,me){var fe=me||{},de=[],ye=[],ve=tt(1),Ve=fe.compression?8:0,nt=0,He=0,je=0,qe=0,ht=0,yt=se.FullPaths[0],Et=yt,ut=se.FileIndex[0],Tt=[],Ft=0;for(He=1;He<se.FullPaths.length;++He)if(Et=se.FullPaths[He].slice(yt.length),ut=se.FileIndex[He],!(!ut.size||!ut.content||Et=="Sh33tJ5")){var qn=qe,$n=tt(Et.length);for(je=0;je<Et.length;++je)$n.write_shift(1,Et.charCodeAt(je)&127);$n=$n.slice(0,$n.l),Tt[ht]=jTe.buf(ut.content,0);var gi=ut.content;Ve==8&&(gi=te(gi)),ve=tt(30),ve.write_shift(4,67324752),ve.write_shift(2,20),ve.write_shift(2,nt),ve.write_shift(2,Ve),ut.mt?s(ve,ut.mt):ve.write_shift(4,0),ve.write_shift(-4,Tt[ht]),ve.write_shift(4,gi.length),ve.write_shift(4,ut.content.length),ve.write_shift(2,$n.length),ve.write_shift(2,0),qe+=ve.length,de.push(ve),qe+=$n.length,de.push($n),qe+=gi.length,de.push(gi),ve=tt(46),ve.write_shift(4,33639248),ve.write_shift(2,0),ve.write_shift(2,20),ve.write_shift(2,nt),ve.write_shift(2,Ve),ve.write_shift(4,0),ve.write_shift(-4,Tt[ht]),ve.write_shift(4,gi.length),ve.write_shift(4,ut.content.length),ve.write_shift(2,$n.length),ve.write_shift(2,0),ve.write_shift(2,0),ve.write_shift(2,0),ve.write_shift(2,0),ve.write_shift(4,0),ve.write_shift(4,qn),Ft+=ve.l,ye.push(ve),Ft+=$n.length,ye.push($n),++ht}return ve=tt(22),ve.write_shift(4,101010256),ve.write_shift(2,0),ve.write_shift(2,0),ve.write_shift(2,ht),ve.write_shift(2,ht),ve.write_shift(4,Ft),ve.write_shift(4,qe),ve.write_shift(2,0),As([As(de),As(ye),ve])}var le={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function Ae(se,me){if(se.ctype)return se.ctype;var fe=se.name||"",de=fe.match(/\.([^\.]+)$/);return de&&le[de[1]]||me&&(de=(fe=me).match(/[\.\\]([^\.\\])+$/),de&&le[de[1]])?le[de[1]]:"application/octet-stream"}function Oe(se){for(var me=Nb(se),fe=[],de=0;de<me.length;de+=76)fe.push(me.slice(de,de+76));return fe.join(`\r
`)+`\r
`}function ft(se){var me=se.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(je){var qe=je.charCodeAt(0).toString(16).toUpperCase();return"="+(qe.length==1?"0"+qe:qe)});me=me.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),me.charAt(0)==`
`&&(me="=0D"+me.slice(1)),me=me.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var fe=[],de=me.split(`\r
`),ye=0;ye<de.length;++ye){var ve=de[ye];if(ve.length==0){fe.push("");continue}for(var Ve=0;Ve<ve.length;){var nt=76,He=ve.slice(Ve,Ve+nt);He.charAt(nt-1)=="="?nt--:He.charAt(nt-2)=="="?nt-=2:He.charAt(nt-3)=="="&&(nt-=3),He=ve.slice(Ve,Ve+nt),Ve+=nt,Ve<ve.length&&(He+="="),fe.push(He)}}return fe.join(`\r
`)}function Ht(se){for(var me=[],fe=0;fe<se.length;++fe){for(var de=se[fe];fe<=se.length&&de.charAt(de.length-1)=="=";)de=de.slice(0,de.length-1)+se[++fe];me.push(de)}for(var ye=0;ye<me.length;++ye)me[ye]=me[ye].replace(/[=][0-9A-Fa-f]{2}/g,function(ve){return String.fromCharCode(parseInt(ve.slice(1),16))});return Xl(me.join(`\r
`))}function mn(se,me,fe){for(var de="",ye="",ve="",Ve,nt=0;nt<10;++nt){var He=me[nt];if(!He||He.match(/^\s*$/))break;var je=He.match(/^(.*?):\s*([^\s].*)$/);if(je)switch(je[1].toLowerCase()){case"content-location":de=je[2].trim();break;case"content-type":ve=je[2].trim();break;case"content-transfer-encoding":ye=je[2].trim();break}}switch(++nt,ye.toLowerCase()){case"base64":Ve=Xl(Vh(me.slice(nt).join("")));break;case"quoted-printable":Ve=Ht(me.slice(nt));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ye)}var qe=wr(se,de.slice(fe.length),Ve,{unsafe:!0});ve&&(qe.ctype=ve)}function ki(se,me){if(ue(se.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var fe=me&&me.root||"",de=(Vn&&Buffer.isBuffer(se)?se.toString("binary"):ue(se)).split(`\r
`),ye=0,ve="";for(ye=0;ye<de.length;++ye)if(ve=de[ye],!!/^Content-Location:/i.test(ve)&&(ve=ve.slice(ve.indexOf("file")),fe||(fe=ve.slice(0,ve.lastIndexOf("/")+1)),ve.slice(0,fe.length)!=fe))for(;fe.length>0&&(fe=fe.slice(0,fe.length-1),fe=fe.slice(0,fe.lastIndexOf("/")+1),ve.slice(0,fe.length)!=fe););var Ve=(de[1]||"").match(/boundary="(.*?)"/);if(!Ve)throw new Error("MAD cannot find boundary");var nt="--"+(Ve[1]||""),He=[],je=[],qe={FileIndex:He,FullPaths:je};C(qe);var ht,yt=0;for(ye=0;ye<de.length;++ye){var Et=de[ye];Et!==nt&&Et!==nt+"--"||(yt++&&mn(qe,de.slice(ht,ye),fe),ht=ye)}return qe}function ss(se,me){var fe=me||{},de=fe.boundary||"SheetJS";de="------="+de;for(var ye=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+de.slice(2)+'"',"","",""],ve=se.FullPaths[0],Ve=ve,nt=se.FileIndex[0],He=1;He<se.FullPaths.length;++He)if(Ve=se.FullPaths[He].slice(ve.length),nt=se.FileIndex[He],!(!nt.size||!nt.content||Ve=="Sh33tJ5")){Ve=Ve.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(Ft){return"_x"+Ft.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(Ft){return"_u"+Ft.charCodeAt(0).toString(16)+"_"});for(var je=nt.content,qe=Vn&&Buffer.isBuffer(je)?je.toString("binary"):ue(je),ht=0,yt=Math.min(1024,qe.length),Et=0,ut=0;ut<=yt;++ut)(Et=qe.charCodeAt(ut))>=32&&Et<128&&++ht;var Tt=ht>=yt*4/5;ye.push(de),ye.push("Content-Location: "+(fe.root||"file:///C:/SheetJS/")+Ve),ye.push("Content-Transfer-Encoding: "+(Tt?"quoted-printable":"base64")),ye.push("Content-Type: "+Ae(nt,Ve)),ye.push(""),ye.push(Tt?ft(qe):Oe(qe))}return ye.push(de+`--\r
`),ye.join(`\r
`)}function Br(se){var me={};return C(me,se),me}function wr(se,me,fe,de){var ye=de&&de.unsafe;ye||C(se);var ve=!ye&&fi.find(se,me);if(!ve){var Ve=se.FullPaths[0];me.slice(0,Ve.length)==Ve?Ve=me:(Ve.slice(-1)!="/"&&(Ve+="/"),Ve=(Ve+me).replace("//","/")),ve={name:r(me),type:2},se.FileIndex.push(ve),se.FullPaths.push(Ve),ye||fi.utils.cfb_gc(se)}return ve.content=fe,ve.size=fe?fe.length:0,de&&(de.CLSID&&(ve.clsid=de.CLSID),de.mt&&(ve.mt=de.mt),de.ct&&(ve.ct=de.ct)),ve}function Ys(se,me){C(se);var fe=fi.find(se,me);if(fe){for(var de=0;de<se.FileIndex.length;++de)if(se.FileIndex[de]==fe)return se.FileIndex.splice(de,1),se.FullPaths.splice(de,1),!0}return!1}function as(se,me,fe){C(se);var de=fi.find(se,me);if(de){for(var ye=0;ye<se.FileIndex.length;++ye)if(se.FileIndex[ye]==de)return se.FileIndex[ye].name=r(fe),se.FullPaths[ye]=fe,!0}return!1}function Ar(se){R(se,!0)}return e.find=H,e.read=F,e.parse=h,e.write=ge,e.writeFile=oe,e.utils={cfb_new:Br,cfb_add:wr,cfb_del:Ys,cfb_mov:as,cfb_gc:Ar,ReadShift:ib,CheckField:jZ,prep_blob:vo,bconcat:As,use_zlib:G,_deflateRaw:Nt,_inflateRaw:mt,consts:X},e})();function XTe(n){return typeof n=="string"?qI(n):Array.isArray(n)?xTe(n):n}function iE(n,e,t){if(typeof Deno<"u"){if(t&&typeof e=="string")switch(t){case"utf8":e=new TextEncoder(t).encode(e);break;case"binary":e=qI(e);break;default:throw new Error("Unsupported encoding "+t)}return Deno.writeFileSync(n,e)}var i=t=="utf8"?Mb(e):e;if(typeof IE_SaveFile<"u")return IE_SaveFile(i,n);if(typeof Blob<"u"){var r=new Blob([XTe(i)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(r,n);if(typeof saveAs<"u")return saveAs(r,n);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var s=URL.createObjectURL(r);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(s)},6e4),chrome.downloads.download({url:s,filename:n,saveAs:!0});var a=document.createElement("a");if(a.download!=null)return a.download=n,a.href=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(s)},6e4),s}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var o=File(n);return o.open("w"),o.encoding="binary",Array.isArray(e)&&(e=nE(e)),o.write(e),o.close(),e}catch(l){if(!l.message||!l.message.match(/onstruct/))throw l}throw new Error("cannot save file "+n)}function Rs(n){for(var e=Object.keys(n),t=[],i=0;i<e.length;++i)Object.prototype.hasOwnProperty.call(n,e[i])&&t.push(e[i]);return t}function Bz(n,e){for(var t=[],i=Rs(n),r=0;r!==i.length;++r)t[n[i[r]][e]]==null&&(t[n[i[r]][e]]=i[r]);return t}function bL(n){for(var e=[],t=Rs(n),i=0;i!==t.length;++i)e[n[t[i]]]=t[i];return e}function XI(n){for(var e=[],t=Rs(n),i=0;i!==t.length;++i)e[n[t[i]]]=parseInt(t[i],10);return e}function KTe(n){for(var e=[],t=Rs(n),i=0;i!==t.length;++i)e[n[t[i]]]==null&&(e[n[t[i]]]=[]),e[n[t[i]]].push(t[i]);return e}var JD=new Date(1899,11,30,0,0,0);function Ua(n,e){var t=n.getTime(),i=JD.getTime()+(n.getTimezoneOffset()-JD.getTimezoneOffset())*6e4;return(t-i)/(1440*60*1e3)}var RZ=new Date,YTe=JD.getTime()+(RZ.getTimezoneOffset()-JD.getTimezoneOffset())*6e4,Vz=RZ.getTimezoneOffset();function NZ(n){var e=new Date;return e.setTime(n*24*60*60*1e3+YTe),e.getTimezoneOffset()!==Vz&&e.setTime(e.getTime()+(e.getTimezoneOffset()-Vz)*6e4),e}var Wz=new Date("2017-02-19T19:06:09.000Z"),kZ=isNaN(Wz.getFullYear())?new Date("2/19/17"):Wz,JTe=kZ.getFullYear()==2017;function ha(n,e){var t=new Date(n);if(JTe)return e>0?t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3):e<0&&t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3),t;if(n instanceof Date)return n;if(kZ.getFullYear()==1917&&!isNaN(t.getFullYear())){var i=t.getFullYear();return n.indexOf(""+i)>-1||t.setFullYear(t.getFullYear()+100),t}var r=n.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+r[0],+r[1]-1,+r[2],+r[3]||0,+r[4]||0,+r[5]||0);return n.indexOf("Z")>-1&&(s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3)),s}function KI(n,e){if(Vn&&Buffer.isBuffer(n))return n.toString("binary");if(typeof TextDecoder<"u")try{var t={"€":"","‚":"",ƒ:"","„":"","…":"","†":"","‡":"","ˆ":"","‰":"",Š:"","‹":"",Œ:"",Ž:"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"",š:"","›":"",œ:"",ž:"",Ÿ:""};return Array.isArray(n)&&(n=new Uint8Array(n)),new TextDecoder("latin1").decode(n).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(s){return t[s]||s})}catch{}for(var i=[],r=0;r!=n.length;++r)i.push(String.fromCharCode(n[r]));return i.join("")}function Pa(n){if(typeof JSON<"u"&&!Array.isArray(n))return JSON.parse(JSON.stringify(n));if(typeof n!="object"||n==null)return n;if(n instanceof Date)return new Date(n.getTime());var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=Pa(n[t]));return e}function Ji(n,e){for(var t="";t.length<e;)t+=n;return t}function Ih(n){var e=Number(n);if(!isNaN(e))return isFinite(e)?e:NaN;if(!/\d/.test(n))return e;var t=1,i=n.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return t*=100,""});return!isNaN(e=Number(i))||(i=i.replace(/[(](.*)[)]/,function(r,s){return t=-t,s}),!isNaN(e=Number(i)))?e/t:e}var QTe=["january","february","march","april","may","june","july","august","september","october","november","december"];function kb(n){var e=new Date(n),t=new Date(NaN),i=e.getYear(),r=e.getMonth(),s=e.getDate();if(isNaN(s))return t;var a=n.toLowerCase();if(a.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(a=a.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),a.length>3&&QTe.indexOf(a)==-1)return t}else if(a.match(/[a-z]/))return t;return i<0||i>8099?t:(r>0||s>1)&&i!=101?e:n.match(/[^-0-9:,\/\\]/)?t:e}function pn(n,e,t){if(n.FullPaths){if(typeof t=="string"){var i;return Vn?i=Qh(t):i=bTe(t),fi.utils.cfb_add(n,e,i)}fi.utils.cfb_add(n,e,t)}else n.file(e,t)}function TL(){return fi.utils.cfb_new()}var Er=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,ZTe={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},EL=bL(ZTe),wL=/[&<>'"]/g,eEe=/[\u0000-\u0008\u000b-\u001f]/g;function ni(n){var e=n+"";return e.replace(wL,function(t){return EL[t]}).replace(eEe,function(t){return"_x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+"_"})}function Hz(n){return ni(n).replace(/ /g,"_x0020_")}var MZ=/[\u0000-\u001f]/g;function tEe(n){var e=n+"";return e.replace(wL,function(t){return EL[t]}).replace(/\n/g,"<br/>").replace(MZ,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}function nEe(n){var e=n+"";return e.replace(wL,function(t){return EL[t]}).replace(MZ,function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"})}function iEe(n){return n.replace(/(\r\n|[\r\n])/g,"&#10;")}function rEe(n){switch(n){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function lM(n){for(var e="",t=0,i=0,r=0,s=0,a=0,o=0;t<n.length;){if(i=n.charCodeAt(t++),i<128){e+=String.fromCharCode(i);continue}if(r=n.charCodeAt(t++),i>191&&i<224){a=(i&31)<<6,a|=r&63,e+=String.fromCharCode(a);continue}if(s=n.charCodeAt(t++),i<240){e+=String.fromCharCode((i&15)<<12|(r&63)<<6|s&63);continue}a=n.charCodeAt(t++),o=((i&7)<<18|(r&63)<<12|(s&63)<<6|a&63)-65536,e+=String.fromCharCode(55296+(o>>>10&1023)),e+=String.fromCharCode(56320+(o&1023))}return e}function zz(n){var e=Wm(2*n.length),t,i,r=1,s=0,a=0,o;for(i=0;i<n.length;i+=r)r=1,(o=n.charCodeAt(i))<128?t=o:o<224?(t=(o&31)*64+(n.charCodeAt(i+1)&63),r=2):o<240?(t=(o&15)*4096+(n.charCodeAt(i+1)&63)*64+(n.charCodeAt(i+2)&63),r=3):(r=4,t=(o&7)*262144+(n.charCodeAt(i+1)&63)*4096+(n.charCodeAt(i+2)&63)*64+(n.charCodeAt(i+3)&63),t-=65536,a=55296+(t>>>10&1023),t=56320+(t&1023)),a!==0&&(e[s++]=a&255,e[s++]=a>>>8,a=0),e[s++]=t%256,e[s++]=t>>>8;return e.slice(0,s).toString("ucs2")}function Gz(n){return Qh(n,"binary").toString("utf8")}var TA="foo bar bazâð£",nb=Vn&&(Gz(TA)==lM(TA)&&Gz||zz(TA)==lM(TA)&&zz)||lM,Mb=Vn?function(n){return Qh(n,"utf8").toString("binary")}:function(n){for(var e=[],t=0,i=0,r=0;t<n.length;)switch(i=n.charCodeAt(t++),!0){case i<128:e.push(String.fromCharCode(i));break;case i<2048:e.push(String.fromCharCode(192+(i>>6))),e.push(String.fromCharCode(128+(i&63)));break;case(i>=55296&&i<57344):i-=55296,r=n.charCodeAt(t++)-56320+(i<<10),e.push(String.fromCharCode(240+(r>>18&7))),e.push(String.fromCharCode(144+(r>>12&63))),e.push(String.fromCharCode(128+(r>>6&63))),e.push(String.fromCharCode(128+(r&63)));break;default:e.push(String.fromCharCode(224+(i>>12))),e.push(String.fromCharCode(128+(i>>6&63))),e.push(String.fromCharCode(128+(i&63)))}return e.join("")},sEe=(function(){var n=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(t){for(var i=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
`).replace(/<[^>]*>/g,""),r=0;r<n.length;++r)i=i.replace(n[r][0],n[r][1]);return i}})(),FZ=/(^\s|\s$|\n)/;function Ss(n,e){return"<"+n+(e.match(FZ)?' xml:space="preserve"':"")+">"+e+"</"+n+">"}function Fb(n){return Rs(n).map(function(e){return" "+e+'="'+n[e]+'"'}).join("")}function vt(n,e,t){return"<"+n+(t!=null?Fb(t):"")+(e!=null?(e.match(FZ)?' xml:space="preserve"':"")+">"+e+"</"+n:"/")+">"}function JU(n,e){try{return n.toISOString().replace(/\.\d*/,"")}catch(t){if(e)throw t}return""}function aEe(n,e){switch(typeof n){case"string":var t=vt("vt:lpwstr",ni(n));return t=t.replace(/&quot;/g,"_x0022_"),t;case"number":return vt((n|0)==n?"vt:i4":"vt:r8",ni(String(n)));case"boolean":return vt("vt:bool",n?"true":"false")}if(n instanceof Date)return vt("vt:filetime",JU(n));throw new Error("Unable to serialize "+n)}var Qr={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},j1=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],_o={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function oEe(n,e){for(var t=1-2*(n[e+7]>>>7),i=((n[e+7]&127)<<4)+(n[e+6]>>>4&15),r=n[e+6]&15,s=5;s>=0;--s)r=r*256+n[e+s];return i==2047?r==0?t*(1/0):NaN:(i==0?i=-1022:(i-=1023,r+=Math.pow(2,52)),t*Math.pow(2,i-52)*r)}function lEe(n,e,t){var i=(e<0||1/e==-1/0?1:0)<<7,r=0,s=0,a=i?-e:e;isFinite(a)?a==0?r=s=0:(r=Math.floor(Math.log(a)/Math.LN2),s=a*Math.pow(2,52-r),r<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?r=-1022:(s-=Math.pow(2,52),r+=1023)):(r=2047,s=isNaN(e)?26985:0);for(var o=0;o<=5;++o,s/=256)n[t+o]=s&255;n[t+6]=(r&15)<<4|s&15,n[t+7]=r>>4|i}var qz=function(n){for(var e=[],t=10240,i=0;i<n[0].length;++i)if(n[0][i])for(var r=0,s=n[0][i].length;r<s;r+=t)e.push.apply(e,n[0][i].slice(r,r+t));return e},$z=Vn?function(n){return n[0].length>0&&Buffer.isBuffer(n[0][0])?Buffer.concat(n[0].map(function(e){return Buffer.isBuffer(e)?e:Qh(e)})):qz(n)}:qz,jz=function(n,e,t){for(var i=[],r=e;r<t;r+=2)i.push(String.fromCharCode(jx(n,r)));return i.join("").replace(tb,"")},AL=Vn?function(n,e,t){return Buffer.isBuffer(n)?n.toString("utf16le",e,t).replace(tb,""):jz(n,e,t)}:jz,Xz=function(n,e,t){for(var i=[],r=e;r<e+t;++r)i.push(("0"+n[r].toString(16)).slice(-2));return i.join("")},UZ=Vn?function(n,e,t){return Buffer.isBuffer(n)?n.toString("hex",e,e+t):Xz(n,e,t)}:Xz,Kz=function(n,e,t){for(var i=[],r=e;r<t;r++)i.push(String.fromCharCode(dy(n,r)));return i.join("")},rE=Vn?function(e,t,i){return Buffer.isBuffer(e)?e.toString("utf8",t,i):Kz(e,t,i)}:Kz,PZ=function(n,e){var t=xo(n,e);return t>0?rE(n,e+4,e+4+t-1):""},LZ=PZ,OZ=function(n,e){var t=xo(n,e);return t>0?rE(n,e+4,e+4+t-1):""},BZ=OZ,VZ=function(n,e){var t=2*xo(n,e);return t>0?rE(n,e+4,e+4+t-1):""},WZ=VZ,HZ=function(e,t){var i=xo(e,t);return i>0?AL(e,t+4,t+4+i):""},zZ=HZ,GZ=function(n,e){var t=xo(n,e);return t>0?rE(n,e+4,e+4+t):""},qZ=GZ,$Z=function(n,e){return oEe(n,e)},QD=$Z,SL=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};Vn&&(LZ=function(e,t){if(!Buffer.isBuffer(e))return PZ(e,t);var i=e.readUInt32LE(t);return i>0?e.toString("utf8",t+4,t+4+i-1):""},BZ=function(e,t){if(!Buffer.isBuffer(e))return OZ(e,t);var i=e.readUInt32LE(t);return i>0?e.toString("utf8",t+4,t+4+i-1):""},WZ=function(e,t){if(!Buffer.isBuffer(e))return VZ(e,t);var i=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+i-1)},zZ=function(e,t){if(!Buffer.isBuffer(e))return HZ(e,t);var i=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+i)},qZ=function(e,t){if(!Buffer.isBuffer(e))return GZ(e,t);var i=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+i)},QD=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):$Z(e,t)},SL=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var dy=function(n,e){return n[e]},jx=function(n,e){return n[e+1]*256+n[e]},cEe=function(n,e){var t=n[e+1]*256+n[e];return t<32768?t:(65535-t+1)*-1},xo=function(n,e){return n[e+3]*(1<<24)+(n[e+2]<<16)+(n[e+1]<<8)+n[e]},ug=function(n,e){return n[e+3]<<24|n[e+2]<<16|n[e+1]<<8|n[e]},uEe=function(n,e){return n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3]};function ib(n,e){var t="",i,r,s=[],a,o,l,c;switch(e){case"dbcs":if(c=this.l,Vn&&Buffer.isBuffer(this))t=this.slice(this.l,this.l+2*n).toString("utf16le");else for(l=0;l<n;++l)t+=String.fromCharCode(jx(this,c)),c+=2;n*=2;break;case"utf8":t=rE(this,this.l,this.l+n);break;case"utf16le":n*=2,t=AL(this,this.l,this.l+n);break;case"wstr":return ib.call(this,n,"dbcs");case"lpstr-ansi":t=LZ(this,this.l),n=4+xo(this,this.l);break;case"lpstr-cp":t=BZ(this,this.l),n=4+xo(this,this.l);break;case"lpwstr":t=WZ(this,this.l),n=4+2*xo(this,this.l);break;case"lpp4":n=4+xo(this,this.l),t=zZ(this,this.l),n&2&&(n+=2);break;case"8lpp4":n=4+xo(this,this.l),t=qZ(this,this.l),n&3&&(n+=4-(n&3));break;case"cstr":for(n=0,t="";(a=dy(this,this.l+n++))!==0;)s.push(_A(a));t=s.join("");break;case"_wstr":for(n=0,t="";(a=jx(this,this.l+n))!==0;)s.push(_A(a)),n+=2;n+=2,t=s.join("");break;case"dbcs-cont":for(t="",c=this.l,l=0;l<n;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return a=dy(this,c),this.l=c+1,o=ib.call(this,n-l,a?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(_A(jx(this,c))),c+=2}t=s.join(""),n*=2;break;case"cpstr":case"sbcs-cont":for(t="",c=this.l,l=0;l!=n;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return a=dy(this,c),this.l=c+1,o=ib.call(this,n-l,a?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(_A(dy(this,c))),c+=1}t=s.join("");break;default:switch(n){case 1:return i=dy(this,this.l),this.l++,i;case 2:return i=(e==="i"?cEe:jx)(this,this.l),this.l+=2,i;case 4:case-4:return e==="i"||(this[this.l+3]&128)===0?(i=(n>0?ug:uEe)(this,this.l),this.l+=4,i):(r=xo(this,this.l),this.l+=4,r);case 8:case-8:if(e==="f")return n==8?r=QD(this,this.l):r=QD([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,r;n=8;case 16:t=UZ(this,this.l,n);break}}return this.l+=n,t}var hEe=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24&255},dEe=function(n,e,t){n[t]=e&255,n[t+1]=e>>8&255,n[t+2]=e>>16&255,n[t+3]=e>>24&255},fEe=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255};function pEe(n,e,t){var i=0,r=0;if(t==="dbcs"){for(r=0;r!=e.length;++r)fEe(this,e.charCodeAt(r),this.l+2*r);i=2*e.length}else if(t==="sbcs"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),r=0;r!=e.length;++r)this[this.l+r]=e.charCodeAt(r)&255;i=e.length}else if(t==="hex"){for(;r<n;++r)this[this.l++]=parseInt(e.slice(2*r,2*r+2),16)||0;return this}else if(t==="utf16le"){var s=Math.min(this.l+n,this.length);for(r=0;r<Math.min(e.length,n);++r){var a=e.charCodeAt(r);this[this.l++]=a&255,this[this.l++]=a>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(n){case 1:i=1,this[this.l]=e&255;break;case 2:i=2,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255;break;case 3:i=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:i=4,hEe(this,e,this.l);break;case 8:if(i=8,t==="f"){lEe(this,e,this.l);break}case 16:break;case-4:i=4,dEe(this,e,this.l);break}return this.l+=i,this}function jZ(n,e){var t=UZ(this,this.l,n.length>>1);if(t!==n)throw new Error(e+"Expected "+n+" saw "+t);this.l+=n.length>>1}function vo(n,e){n.l=e,n.read_shift=ib,n.chk=jZ,n.write_shift=pEe}function hu(n,e){n.l+=e}function tt(n){var e=Wm(n);return vo(e,0),e}function Fa(){var n=[],e=Vn?256:2048,t=function(c){var h=tt(c);return vo(h,0),h},i=t(e),r=function(){i&&(i.length>i.l&&(i=i.slice(0,i.l),i.l=i.length),i.length>0&&n.push(i),i=null)},s=function(c){return i&&c<i.length-i.l?i:(r(),i=t(Math.max(c+1,e)))},a=function(){return r(),As(n)},o=function(c){r(),i=c,i.l==null&&(i.l=i.length),s(e)};return{next:s,push:o,end:a,_bufs:n}}function lt(n,e,t,i){var r=+e,s;if(!isNaN(r)){i||(i=oIe[r].p||(t||[]).length||0),s=1+(r>=128?1:0)+1,i>=128&&++s,i>=16384&&++s,i>=2097152&&++s;var a=n.next(s);r<=127?a.write_shift(1,r):(a.write_shift(1,(r&127)+128),a.write_shift(1,r>>7));for(var o=0;o!=4;++o)if(i>=128)a.write_shift(1,(i&127)+128),i>>=7;else{a.write_shift(1,i);break}i>0&&SL(t)&&n.push(t)}}function rb(n,e,t){var i=Pa(n);if(e.s?(i.cRel&&(i.c+=e.s.c),i.rRel&&(i.r+=e.s.r)):(i.cRel&&(i.c+=e.c),i.rRel&&(i.r+=e.r)),!t||t.biff<12){for(;i.c>=256;)i.c-=256;for(;i.r>=65536;)i.r-=65536}return i}function Yz(n,e,t){var i=Pa(n);return i.s=rb(i.s,e.s,t),i.e=rb(i.e,e.s,t),i}function sb(n,e){if(n.cRel&&n.c<0)for(n=Pa(n);n.c<0;)n.c+=e>8?16384:256;if(n.rRel&&n.r<0)for(n=Pa(n);n.r<0;)n.r+=e>8?1048576:e>5?65536:16384;var t=ii(n);return!n.cRel&&n.cRel!=null&&(t=yEe(t)),!n.rRel&&n.rRel!=null&&(t=gEe(t)),t}function cM(n,e){return n.s.r==0&&!n.s.rRel&&n.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!n.e.rRel?(n.s.cRel?"":"$")+qs(n.s.c)+":"+(n.e.cRel?"":"$")+qs(n.e.c):n.s.c==0&&!n.s.cRel&&n.e.c==(e.biff>=12?16383:255)&&!n.e.cRel?(n.s.rRel?"":"$")+Is(n.s.r)+":"+(n.e.rRel?"":"$")+Is(n.e.r):sb(n.s,e.biff)+":"+sb(n.e,e.biff)}function DL(n){return parseInt(mEe(n),10)-1}function Is(n){return""+(n+1)}function gEe(n){return n.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function mEe(n){return n.replace(/\$(\d+)$/,"$1")}function CL(n){for(var e=vEe(n),t=0,i=0;i!==e.length;++i)t=26*t+e.charCodeAt(i)-64;return t-1}function qs(n){if(n<0)throw new Error("invalid column "+n);var e="";for(++n;n;n=Math.floor((n-1)/26))e=String.fromCharCode((n-1)%26+65)+e;return e}function yEe(n){return n.replace(/^([A-Z])/,"$$$1")}function vEe(n){return n.replace(/^\$([A-Z])/,"$1")}function _Ee(n){return n.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function ts(n){for(var e=0,t=0,i=0;i<n.length;++i){var r=n.charCodeAt(i);r>=48&&r<=57?e=10*e+(r-48):r>=65&&r<=90&&(t=26*t+(r-64))}return{c:t-1,r:e-1}}function ii(n){for(var e=n.c+1,t="";e;e=(e-1)/26|0)t=String.fromCharCode((e-1)%26+65)+t;return t+(n.r+1)}function Do(n){var e=n.indexOf(":");return e==-1?{s:ts(n),e:ts(n)}:{s:ts(n.slice(0,e)),e:ts(n.slice(e+1))}}function br(n,e){return typeof e>"u"||typeof e=="number"?br(n.s,n.e):(typeof n!="string"&&(n=ii(n)),typeof e!="string"&&(e=ii(e)),n==e?n:n+":"+e)}function Ri(n){var e={s:{c:0,r:0},e:{c:0,r:0}},t=0,i=0,r=0,s=n.length;for(t=0;i<s&&!((r=n.charCodeAt(i)-64)<1||r>26);++i)t=26*t+r;for(e.s.c=--t,t=0;i<s&&!((r=n.charCodeAt(i)-48)<0||r>9);++i)t=10*t+r;if(e.s.r=--t,i===s||r!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++i,t=0;i!=s&&!((r=n.charCodeAt(i)-64)<1||r>26);++i)t=26*t+r;for(e.e.c=--t,t=0;i!=s&&!((r=n.charCodeAt(i)-48)<0||r>9);++i)t=10*t+r;return e.e.r=--t,e}function Jz(n,e){var t=n.t=="d"&&e instanceof Date;if(n.z!=null)try{return n.w=rp(n.z,t?Ua(e):e)}catch{}try{return n.w=rp((n.XF||{}).numFmtId||(t?14:0),t?Ua(e):e)}catch{return""+e}}function Wh(n,e,t){return n==null||n.t==null||n.t=="z"?"":n.w!==void 0?n.w:(n.t=="d"&&!n.z&&t&&t.dateNF&&(n.z=t.dateNF),n.t=="e"?sE[n.v]||n.v:e==null?Jz(n,n.v):Jz(n,e))}function n0(n,e){var t=e&&e.sheet?e.sheet:"Sheet1",i={};return i[t]=n,{SheetNames:[t],Sheets:i}}function XZ(n,e,t){var i=t||{},r=n?Array.isArray(n):i.dense,s=n||(r?[]:{}),a=0,o=0;if(s&&i.origin!=null){if(typeof i.origin=="number")a=i.origin;else{var l=typeof i.origin=="string"?ts(i.origin):i.origin;a=l.r,o=l.c}s["!ref"]||(s["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var h=Ri(s["!ref"]);c.s.c=h.s.c,c.s.r=h.s.r,c.e.c=Math.max(c.e.c,h.e.c),c.e.r=Math.max(c.e.r,h.e.r),a==-1&&(c.e.r=a=h.e.r+1)}for(var f=0;f!=e.length;++f)if(e[f]){if(!Array.isArray(e[f]))throw new Error("aoa_to_sheet expects an array of arrays");for(var p=0;p!=e[f].length;++p)if(!(typeof e[f][p]>"u")){var y={v:e[f][p]},x=a+f,v=o+p;if(c.s.r>x&&(c.s.r=x),c.s.c>v&&(c.s.c=v),c.e.r<x&&(c.e.r=x),c.e.c<v&&(c.e.c=v),e[f][p]&&typeof e[f][p]=="object"&&!Array.isArray(e[f][p])&&!(e[f][p]instanceof Date))y=e[f][p];else if(Array.isArray(y.v)&&(y.f=e[f][p][1],y.v=y.v[0]),y.v===null)if(y.f)y.t="n";else if(i.nullError)y.t="e",y.v=0;else if(i.sheetStubs)y.t="z";else continue;else typeof y.v=="number"?y.t="n":typeof y.v=="boolean"?y.t="b":y.v instanceof Date?(y.z=i.dateNF||Qi[14],i.cellDates?(y.t="d",y.w=rp(y.z,Ua(y.v))):(y.t="n",y.v=Ua(y.v),y.w=rp(y.z,y.v))):y.t="s";if(r)s[x]||(s[x]=[]),s[x][v]&&s[x][v].z&&(y.z=s[x][v].z),s[x][v]=y;else{var _=ii({c:v,r:x});s[_]&&s[_].z&&(y.z=s[_].z),s[_]=y}}}return c.s.c<1e7&&(s["!ref"]=br(c)),s}function X1(n,e){return XZ(null,n,e)}function xEe(n){return n.read_shift(4,"i")}function ic(n,e){return e||(e=tt(4)),e.write_shift(4,n),e}function $s(n){var e=n.read_shift(4);return e===0?"":n.read_shift(e,"dbcs")}function ns(n,e){var t=!1;return e==null&&(t=!0,e=tt(4+2*n.length)),e.write_shift(4,n.length),n.length>0&&e.write_shift(0,n,"dbcs"),t?e.slice(0,e.l):e}function bEe(n){return{ich:n.read_shift(2),ifnt:n.read_shift(2)}}function TEe(n,e){return e||(e=tt(4)),e.write_shift(2,0),e.write_shift(2,0),e}function IL(n,e){var t=n.l,i=n.read_shift(1),r=$s(n),s=[],a={t:r,h:r};if((i&1)!==0){for(var o=n.read_shift(4),l=0;l!=o;++l)s.push(bEe(n));a.r=s}else a.r=[{ich:0,ifnt:0}];return n.l=t+e,a}function EEe(n,e){var t=!1;return e==null&&(t=!0,e=tt(15+4*n.t.length)),e.write_shift(1,0),ns(n.t,e),t?e.slice(0,e.l):e}var wEe=IL;function AEe(n,e){var t=!1;return e==null&&(t=!0,e=tt(23+4*n.t.length)),e.write_shift(1,1),ns(n.t,e),e.write_shift(4,1),TEe({},e),t?e.slice(0,e.l):e}function yl(n){var e=n.read_shift(4),t=n.read_shift(2);return t+=n.read_shift(1)<<16,n.l++,{c:e,iStyleRef:t}}function i0(n,e){return e==null&&(e=tt(8)),e.write_shift(-4,n.c),e.write_shift(3,n.iStyleRef||n.s),e.write_shift(1,0),e}function r0(n){var e=n.read_shift(2);return e+=n.read_shift(1)<<16,n.l++,{c:-1,iStyleRef:e}}function s0(n,e){return e==null&&(e=tt(4)),e.write_shift(3,n.iStyleRef||n.s),e.write_shift(1,0),e}var SEe=$s,KZ=ns;function RL(n){var e=n.read_shift(4);return e===0||e===4294967295?"":n.read_shift(e,"dbcs")}function ZD(n,e){var t=!1;return e==null&&(t=!0,e=tt(127)),e.write_shift(4,n.length>0?n.length:4294967295),n.length>0&&e.write_shift(0,n,"dbcs"),t?e.slice(0,e.l):e}var DEe=$s,QU=RL,NL=ZD;function YZ(n){var e=n.slice(n.l,n.l+4),t=e[0]&1,i=e[0]&2;n.l+=4;var r=i===0?QD([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):ug(e,0)>>2;return t?r/100:r}function JZ(n,e){e==null&&(e=tt(4));var t=0,i=0,r=n*100;if(n==(n|0)&&n>=-536870912&&n<1<<29?i=1:r==(r|0)&&r>=-536870912&&r<1<<29&&(i=1,t=1),i)e.write_shift(-4,((t?r:n)<<2)+(t+2));else throw new Error("unsupported RkNumber "+n)}function QZ(n){var e={s:{},e:{}};return e.s.r=n.read_shift(4),e.e.r=n.read_shift(4),e.s.c=n.read_shift(4),e.e.c=n.read_shift(4),e}function CEe(n,e){return e||(e=tt(16)),e.write_shift(4,n.s.r),e.write_shift(4,n.e.r),e.write_shift(4,n.s.c),e.write_shift(4,n.e.c),e}var a0=QZ,K1=CEe;function Y1(n){if(n.length-n.l<8)throw"XLS Xnum Buffer underflow";return n.read_shift(8,"f")}function Hm(n,e){return(e||tt(8)).write_shift(8,n,"f")}function IEe(n){var e={},t=n.read_shift(1),i=t>>>1,r=n.read_shift(1),s=n.read_shift(2,"i"),a=n.read_shift(1),o=n.read_shift(1),l=n.read_shift(1);switch(n.l++,i){case 0:e.auto=1;break;case 1:e.index=r;var c=OEe[r];c&&(e.rgb=lG(c));break;case 2:e.rgb=lG([a,o,l]);break;case 3:e.theme=r;break}return s!=0&&(e.tint=s>0?s/32767:s/32768),e}function eC(n,e){if(e||(e=tt(8)),!n||n.auto)return e.write_shift(4,0),e.write_shift(4,0),e;n.index!=null?(e.write_shift(1,2),e.write_shift(1,n.index)):n.theme!=null?(e.write_shift(1,6),e.write_shift(1,n.theme)):(e.write_shift(1,5),e.write_shift(1,0));var t=n.tint||0;if(t>0?t*=32767:t<0&&(t*=32768),e.write_shift(2,t),!n.rgb||n.theme!=null)e.write_shift(2,0),e.write_shift(1,0),e.write_shift(1,0);else{var i=n.rgb||"FFFFFF";typeof i=="number"&&(i=("000000"+i.toString(16)).slice(-6)),e.write_shift(1,parseInt(i.slice(0,2),16)),e.write_shift(1,parseInt(i.slice(2,4),16)),e.write_shift(1,parseInt(i.slice(4,6),16)),e.write_shift(1,255)}return e}function REe(n){var e=n.read_shift(1);n.l++;var t={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return t}function NEe(n,e){e||(e=tt(2));var t=(n.italic?2:0)|(n.strike?8:0)|(n.outline?16:0)|(n.shadow?32:0)|(n.condense?64:0)|(n.extend?128:0);return e.write_shift(1,t),e.write_shift(1,0),e}var ZZ=2,mo=3,EA=11,tC=19,wA=64,kEe=65,MEe=71,FEe=4108,UEe=4126,bs=80,Qz={1:{n:"CodePage",t:ZZ},2:{n:"Category",t:bs},3:{n:"PresentationFormat",t:bs},4:{n:"ByteCount",t:mo},5:{n:"LineCount",t:mo},6:{n:"ParagraphCount",t:mo},7:{n:"SlideCount",t:mo},8:{n:"NoteCount",t:mo},9:{n:"HiddenCount",t:mo},10:{n:"MultimediaClipCount",t:mo},11:{n:"ScaleCrop",t:EA},12:{n:"HeadingPairs",t:FEe},13:{n:"TitlesOfParts",t:UEe},14:{n:"Manager",t:bs},15:{n:"Company",t:bs},16:{n:"LinksUpToDate",t:EA},17:{n:"CharacterCount",t:mo},19:{n:"SharedDoc",t:EA},22:{n:"HyperlinksChanged",t:EA},23:{n:"AppVersion",t:mo,p:"version"},24:{n:"DigSig",t:kEe},26:{n:"ContentType",t:bs},27:{n:"ContentStatus",t:bs},28:{n:"Language",t:bs},29:{n:"Version",t:bs},255:{},2147483648:{n:"Locale",t:tC},2147483651:{n:"Behavior",t:tC},1919054434:{}},Zz={1:{n:"CodePage",t:ZZ},2:{n:"Title",t:bs},3:{n:"Subject",t:bs},4:{n:"Author",t:bs},5:{n:"Keywords",t:bs},6:{n:"Comments",t:bs},7:{n:"Template",t:bs},8:{n:"LastAuthor",t:bs},9:{n:"RevNumber",t:bs},10:{n:"EditTime",t:wA},11:{n:"LastPrinted",t:wA},12:{n:"CreatedDate",t:wA},13:{n:"ModifiedDate",t:wA},14:{n:"PageCount",t:mo},15:{n:"WordCount",t:mo},16:{n:"CharCount",t:mo},17:{n:"Thumbnail",t:MEe},18:{n:"Application",t:bs},19:{n:"DocSecurity",t:mo},255:{},2147483648:{n:"Locale",t:tC},2147483651:{n:"Behavior",t:tC},1919054434:{}};function PEe(n){return n.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var LEe=PEe([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),OEe=Pa(LEe),sE={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},BEe={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},AA={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function eee(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function tee(n,e){var t=KTe(BEe),i=[],r;i[i.length]=Er,i[i.length]=vt("Types",null,{xmlns:Qr.CT,"xmlns:xsd":Qr.xsd,"xmlns:xsi":Qr.xsi}),i=i.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(l){return vt("Default",null,{Extension:l[0],ContentType:l[1]})}));var s=function(l){n[l]&&n[l].length>0&&(r=n[l][0],i[i.length]=vt("Override",null,{PartName:(r[0]=="/"?"":"/")+r,ContentType:AA[l][e.bookType]||AA[l].xlsx}))},a=function(l){(n[l]||[]).forEach(function(c){i[i.length]=vt("Override",null,{PartName:(c[0]=="/"?"":"/")+c,ContentType:AA[l][e.bookType]||AA[l].xlsx})})},o=function(l){(n[l]||[]).forEach(function(c){i[i.length]=vt("Override",null,{PartName:(c[0]=="/"?"":"/")+c,ContentType:t[l][0]})})};return s("workbooks"),a("sheets"),a("charts"),o("themes"),["strs","styles"].forEach(s),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),a("metadata"),o("people"),i.length>2&&(i[i.length]="</Types>",i[1]=i[1].replace("/>",">")),i.join("")}var Mn={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function nee(n){var e=n.lastIndexOf("/");return n.slice(0,e+1)+"_rels/"+n.slice(e+1)+".rels"}function Oy(n){var e=[Er,vt("Relationships",null,{xmlns:Qr.RELS})];return Rs(n["!id"]).forEach(function(t){e[e.length]=vt("Relationship",null,n["!id"][t])}),e.length>2&&(e[e.length]="</Relationships>",e[1]=e[1].replace("/>",">")),e.join("")}function ei(n,e,t,i,r,s){if(r||(r={}),n["!id"]||(n["!id"]={}),n["!idx"]||(n["!idx"]=1),e<0)for(e=n["!idx"];n["!id"]["rId"+e];++e);if(n["!idx"]=e+1,r.Id="rId"+e,r.Type=i,r.Target=t,[Mn.HLINK,Mn.XPATH,Mn.XMISS].indexOf(r.Type)>-1&&(r.TargetMode="External"),n["!id"][r.Id])throw new Error("Cannot rewrite rId "+e);return n["!id"][r.Id]=r,n[("/"+r.Target).replace("//","/")]=r,e}function VEe(n){var e=[Er];e.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
`),e.push(`  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
`);for(var t=0;t<n.length;++t)e.push('  <manifest:file-entry manifest:full-path="'+n[t][0]+'" manifest:media-type="'+n[t][1]+`"/>
`);return e.push("</manifest:manifest>"),e.join("")}function eG(n,e,t){return['  <rdf:Description rdf:about="'+n+`">
`,'    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(t||"odf")+"#"+e+`"/>
`,`  </rdf:Description>
`].join("")}function WEe(n,e){return['  <rdf:Description rdf:about="'+n+`">
`,'    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+e+`"/>
`,`  </rdf:Description>
`].join("")}function HEe(n){var e=[Er];e.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
`);for(var t=0;t!=n.length;++t)e.push(eG(n[t][0],n[t][1])),e.push(WEe("",n[t][0]));return e.push(eG("","Document","pkg")),e.push("</rdf:RDF>"),e.join("")}function iee(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+$D.version+"</meta:generator></office:meta></office:document-meta>"}var Fm=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function uM(n,e,t,i,r){r[n]!=null||e==null||e===""||(r[n]=e,e=ni(e),i[i.length]=t?vt(n,e,t):Ss(n,e))}function ree(n,e){var t=e||{},i=[Er,vt("cp:coreProperties",null,{"xmlns:cp":Qr.CORE_PROPS,"xmlns:dc":Qr.dc,"xmlns:dcterms":Qr.dcterms,"xmlns:dcmitype":Qr.dcmitype,"xmlns:xsi":Qr.xsi})],r={};if(!n&&!t.Props)return i.join("");n&&(n.CreatedDate!=null&&uM("dcterms:created",typeof n.CreatedDate=="string"?n.CreatedDate:JU(n.CreatedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},i,r),n.ModifiedDate!=null&&uM("dcterms:modified",typeof n.ModifiedDate=="string"?n.ModifiedDate:JU(n.ModifiedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},i,r));for(var s=0;s!=Fm.length;++s){var a=Fm[s],o=t.Props&&t.Props[a[1]]!=null?t.Props[a[1]]:n?n[a[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&uM(a[0],o,null,i,r)}return i.length>2&&(i[i.length]="</cp:coreProperties>",i[1]=i[1].replace("/>",">")),i.join("")}var By=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],see=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function aee(n){var e=[],t=vt;return n||(n={}),n.Application="SheetJS",e[e.length]=Er,e[e.length]=vt("Properties",null,{xmlns:Qr.EXT_PROPS,"xmlns:vt":Qr.vt}),By.forEach(function(i){if(n[i[1]]!==void 0){var r;switch(i[2]){case"string":r=ni(String(n[i[1]]));break;case"bool":r=n[i[1]]?"true":"false";break}r!==void 0&&(e[e.length]=t(i[0],r))}}),e[e.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+t("vt:variant",t("vt:i4",String(n.Worksheets))),{size:2,baseType:"variant"})),e[e.length]=t("TitlesOfParts",t("vt:vector",n.SheetNames.map(function(i){return"<vt:lpstr>"+ni(i)+"</vt:lpstr>"}).join(""),{size:n.Worksheets,baseType:"lpstr"})),e.length>2&&(e[e.length]="</Properties>",e[1]=e[1].replace("/>",">")),e.join("")}function oee(n){var e=[Er,vt("Properties",null,{xmlns:Qr.CUST_PROPS,"xmlns:vt":Qr.vt})];if(!n)return e.join("");var t=1;return Rs(n).forEach(function(r){++t,e[e.length]=vt("property",aEe(n[r]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t,name:ni(r)})}),e.length>2&&(e[e.length]="</Properties>",e[1]=e[1].replace("/>",">")),e.join("")}var tG={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function zEe(n,e){var t=[];return Rs(tG).map(function(i){for(var r=0;r<Fm.length;++r)if(Fm[r][1]==i)return Fm[r];for(r=0;r<By.length;++r)if(By[r][1]==i)return By[r];throw i}).forEach(function(i){if(n[i[1]]!=null){var r=e&&e.Props&&e.Props[i[1]]!=null?e.Props[i[1]]:n[i[1]];switch(i[2]){case"date":r=new Date(r).toISOString().replace(/\.\d*Z/,"Z");break}typeof r=="number"?r=String(r):r===!0||r===!1?r=r?"1":"0":r instanceof Date&&(r=new Date(r).toISOString().replace(/\.\d*Z/,"")),t.push(Ss(tG[i[1]]||i[1],r))}}),vt("DocumentProperties",t.join(""),{xmlns:_o.o})}function GEe(n,e){var t=["Worksheets","SheetNames"],i="CustomDocumentProperties",r=[];return n&&Rs(n).forEach(function(s){if(Object.prototype.hasOwnProperty.call(n,s)){for(var a=0;a<Fm.length;++a)if(s==Fm[a][1])return;for(a=0;a<By.length;++a)if(s==By[a][1])return;for(a=0;a<t.length;++a)if(s==t[a])return;var o=n[s],l="string";typeof o=="number"?(l="float",o=String(o)):o===!0||o===!1?(l="boolean",o=o?"1":"0"):o=String(o),r.push(vt(Hz(s),o,{"dt:dt":l}))}}),e&&Rs(e).forEach(function(s){if(Object.prototype.hasOwnProperty.call(e,s)&&!(n&&Object.prototype.hasOwnProperty.call(n,s))){var a=e[s],o="string";typeof a=="number"?(o="float",a=String(a)):a===!0||a===!1?(o="boolean",a=a?"1":"0"):a instanceof Date?(o="dateTime.tz",a=a.toISOString()):a=String(a),r.push(vt(Hz(s),a,{"dt:dt":o}))}}),"<"+i+' xmlns="'+_o.o+'">'+r.join("")+"</"+i+">"}function qEe(n){var e=typeof n=="string"?new Date(Date.parse(n)):n,t=e.getTime()/1e3+11644473600,i=t%Math.pow(2,32),r=(t-i)/Math.pow(2,32);i*=1e7,r*=1e7;var s=i/Math.pow(2,32)|0;s>0&&(i=i%Math.pow(2,32),r+=s);var a=tt(8);return a.write_shift(4,i),a.write_shift(4,r),a}function nG(n,e){var t=tt(4),i=tt(4);switch(t.write_shift(4,n==80?31:n),n){case 3:i.write_shift(-4,e);break;case 5:i=tt(8),i.write_shift(8,e,"f");break;case 11:i.write_shift(4,e?1:0);break;case 64:i=qEe(e);break;case 31:case 80:for(i=tt(4+2*(e.length+1)+(e.length%2?0:2)),i.write_shift(4,e.length+1),i.write_shift(0,e,"dbcs");i.l!=i.length;)i.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+n+" "+e)}return As([t,i])}var lee=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function $Ee(n){switch(typeof n){case"boolean":return 11;case"number":return(n|0)==n?3:5;case"string":return 31;case"object":if(n instanceof Date)return 64;break}return-1}function iG(n,e,t){var i=tt(8),r=[],s=[],a=8,o=0,l=tt(8),c=tt(8);if(l.write_shift(4,2),l.write_shift(4,1200),c.write_shift(4,1),s.push(l),r.push(c),a+=8+l.length,!e){c=tt(8),c.write_shift(4,0),r.unshift(c);var h=[tt(4)];for(h[0].write_shift(4,n.length),o=0;o<n.length;++o){var f=n[o][0];for(l=tt(8+2*(f.length+1)+(f.length%2?0:2)),l.write_shift(4,o+2),l.write_shift(4,f.length+1),l.write_shift(0,f,"dbcs");l.l!=l.length;)l.write_shift(1,0);h.push(l)}l=As(h),s.unshift(l),a+=8+l.length}for(o=0;o<n.length;++o)if(!(e&&!e[n[o][0]])&&!(lee.indexOf(n[o][0])>-1||see.indexOf(n[o][0])>-1)&&n[o][1]!=null){var p=n[o][1],y=0;if(e){y=+e[n[o][0]];var x=t[y];if(x.p=="version"&&typeof p=="string"){var v=p.split(".");p=(+v[0]<<16)+(+v[1]||0)}l=nG(x.t,p)}else{var _=$Ee(p);_==-1&&(_=31,p=String(p)),l=nG(_,p)}s.push(l),c=tt(8),c.write_shift(4,e?y:2+o),r.push(c),a+=8+l.length}var E=8*(s.length+1);for(o=0;o<s.length;++o)r[o].write_shift(4,E),E+=s[o].length;return i.write_shift(4,a),i.write_shift(4,s.length),As([i].concat(r).concat(s))}function rG(n,e,t,i,r,s){var a=tt(r?68:48),o=[a];a.write_shift(2,65534),a.write_shift(2,0),a.write_shift(4,842412599),a.write_shift(16,fi.utils.consts.HEADER_CLSID,"hex"),a.write_shift(4,r?2:1),a.write_shift(16,e,"hex"),a.write_shift(4,r?68:48);var l=iG(n,t,i);if(o.push(l),r){var c=iG(r,null,null);a.write_shift(16,s,"hex"),a.write_shift(4,68+l.length),o.push(c)}return As(o)}function jEe(n,e){e||(e=tt(n));for(var t=0;t<n;++t)e.write_shift(1,0);return e}function XEe(n,e){return n.read_shift(e)===1}function oa(n,e){return e||(e=tt(2)),e.write_shift(2,+!!n),e}function cee(n){return n.read_shift(2,"u")}function sl(n,e){return e||(e=tt(2)),e.write_shift(2,n),e}function uee(n,e,t){return t||(t=tt(2)),t.write_shift(1,e=="e"?+n:+!!n),t.write_shift(1,e=="e"?1:0),t}function hee(n,e,t){var i=n.read_shift(t&&t.biff>=12?2:1),r="sbcs-cont";if(t&&t.biff>=8,!t||t.biff==8){var s=n.read_shift(1);s&&(r="dbcs-cont")}else t.biff==12&&(r="wstr");t.biff>=2&&t.biff<=5&&(r="cpstr");var a=i?n.read_shift(i,r):"";return a}function KEe(n){var e=n.t||"",t=tt(3);t.write_shift(2,e.length),t.write_shift(1,1);var i=tt(2*e.length);i.write_shift(2*e.length,e,"utf16le");var r=[t,i];return As(r)}function YEe(n,e,t){var i;if(t){if(t.biff>=2&&t.biff<=5)return n.read_shift(e,"cpstr");if(t.biff>=12)return n.read_shift(e,"dbcs-cont")}var r=n.read_shift(1);return r===0?i=n.read_shift(e,"sbcs-cont"):i=n.read_shift(e,"dbcs-cont"),i}function JEe(n,e,t){var i=n.read_shift(t&&t.biff==2?1:2);return i===0?(n.l++,""):YEe(n,i,t)}function QEe(n,e,t){if(t.biff>5)return JEe(n,e,t);var i=n.read_shift(1);return i===0?(n.l++,""):n.read_shift(i,t.biff<=4||!n.lens?"cpstr":"sbcs-cont")}function dee(n,e,t){return t||(t=tt(3+2*n.length)),t.write_shift(2,n.length),t.write_shift(1,1),t.write_shift(31,n,"utf16le"),t}function sG(n,e){e||(e=tt(6+n.length*2)),e.write_shift(4,1+n.length);for(var t=0;t<n.length;++t)e.write_shift(2,n.charCodeAt(t));return e.write_shift(2,0),e}function ZEe(n){var e=tt(512),t=0,i=n.Target;i.slice(0,7)=="file://"&&(i=i.slice(7));var r=i.indexOf("#"),s=r>-1?31:23;switch(i.charAt(0)){case"#":s=28;break;case".":s&=-3;break}e.write_shift(4,2),e.write_shift(4,s);var a=[8,6815827,6619237,4849780,83];for(t=0;t<a.length;++t)e.write_shift(4,a[t]);if(s==28)i=i.slice(1),sG(i,e);else if(s&2){for(a="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),t=0;t<a.length;++t)e.write_shift(1,parseInt(a[t],16));var o=r>-1?i.slice(0,r):i;for(e.write_shift(4,2*(o.length+1)),t=0;t<o.length;++t)e.write_shift(2,o.charCodeAt(t));e.write_shift(2,0),s&8&&sG(r>-1?i.slice(r+1):"",e)}else{for(a="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),t=0;t<a.length;++t)e.write_shift(1,parseInt(a[t],16));for(var l=0;i.slice(l*3,l*3+3)=="../"||i.slice(l*3,l*3+3)=="..\\";)++l;for(e.write_shift(2,l),e.write_shift(4,i.length-3*l+1),t=0;t<i.length-3*l;++t)e.write_shift(1,i.charCodeAt(t+3*l)&255);for(e.write_shift(1,0),e.write_shift(2,65535),e.write_shift(2,57005),t=0;t<6;++t)e.write_shift(4,0)}return e.slice(0,e.l)}function zm(n,e,t,i){return i||(i=tt(6)),i.write_shift(2,n),i.write_shift(2,e),i.write_shift(2,t||0),i}function ewe(n,e,t){var i=t.biff>8?4:2,r=n.read_shift(i),s=n.read_shift(i,"i"),a=n.read_shift(i,"i");return[r,s,a]}function twe(n){var e=n.read_shift(2),t=n.read_shift(2),i=n.read_shift(2),r=n.read_shift(2);return{s:{c:i,r:e},e:{c:r,r:t}}}function fee(n,e){return e||(e=tt(8)),e.write_shift(2,n.s.r),e.write_shift(2,n.e.r),e.write_shift(2,n.s.c),e.write_shift(2,n.e.c),e}function kL(n,e,t){var i=1536,r=16;switch(t.bookType){case"biff8":break;case"biff5":i=1280,r=8;break;case"biff4":i=4,r=6;break;case"biff3":i=3,r=6;break;case"biff2":i=2,r=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var s=tt(r);return s.write_shift(2,i),s.write_shift(2,e),r>4&&s.write_shift(2,29282),r>6&&s.write_shift(2,1997),r>8&&(s.write_shift(2,49161),s.write_shift(2,1),s.write_shift(2,1798),s.write_shift(2,0)),s}function nwe(n,e){var t=!e||e.biff==8,i=tt(t?112:54);for(i.write_shift(e.biff==8?2:1,7),t&&i.write_shift(1,0),i.write_shift(4,859007059),i.write_shift(4,5458548|(t?0:536870912));i.l<i.length;)i.write_shift(1,t?0:32);return i}function iwe(n,e){var t=!e||e.biff>=8?2:1,i=tt(8+t*n.name.length);i.write_shift(4,n.pos),i.write_shift(1,n.hs||0),i.write_shift(1,n.dt),i.write_shift(1,n.name.length),e.biff>=8&&i.write_shift(1,1),i.write_shift(t*n.name.length,n.name,e.biff<8?"sbcs":"utf16le");var r=i.slice(0,i.l);return r.l=i.l,r}function rwe(n,e){var t=tt(8);t.write_shift(4,n.Count),t.write_shift(4,n.Unique);for(var i=[],r=0;r<n.length;++r)i[r]=KEe(n[r]);var s=As([t].concat(i));return s.parts=[t.length].concat(i.map(function(a){return a.length})),s}function swe(){var n=tt(18);return n.write_shift(2,0),n.write_shift(2,0),n.write_shift(2,29280),n.write_shift(2,17600),n.write_shift(2,56),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(2,1),n.write_shift(2,500),n}function awe(n){var e=tt(18),t=1718;return n&&n.RTL&&(t|=64),e.write_shift(2,t),e.write_shift(4,0),e.write_shift(4,64),e.write_shift(4,0),e.write_shift(4,0),e}function owe(n,e){var t=n.name||"Arial",i=e&&e.biff==5,r=i?15+t.length:16+2*t.length,s=tt(r);return s.write_shift(2,n.sz*20),s.write_shift(4,0),s.write_shift(2,400),s.write_shift(4,0),s.write_shift(2,0),s.write_shift(1,t.length),i||s.write_shift(1,1),s.write_shift((i?1:2)*t.length,t,i?"sbcs":"utf16le"),s}function lwe(n,e,t,i){var r=tt(10);return zm(n,e,i,r),r.write_shift(4,t),r}function cwe(n,e,t,i,r){var s=!r||r.biff==8,a=tt(8+ +s+(1+s)*t.length);return zm(n,e,i,a),a.write_shift(2,t.length),s&&a.write_shift(1,1),a.write_shift((1+s)*t.length,t,s?"utf16le":"sbcs"),a}function uwe(n,e,t,i){var r=t&&t.biff==5;i||(i=tt(r?3+e.length:5+2*e.length)),i.write_shift(2,n),i.write_shift(r?1:2,e.length),r||i.write_shift(1,1),i.write_shift((r?1:2)*e.length,e,r?"sbcs":"utf16le");var s=i.length>i.l?i.slice(0,i.l):i;return s.l==null&&(s.l=s.length),s}function hwe(n,e){var t=e.biff==8||!e.biff?4:2,i=tt(2*t+6);return i.write_shift(t,n.s.r),i.write_shift(t,n.e.r+1),i.write_shift(2,n.s.c),i.write_shift(2,n.e.c+1),i.write_shift(2,0),i}function aG(n,e,t,i){var r=t&&t.biff==5;i||(i=tt(r?16:20)),i.write_shift(2,0),n.style?(i.write_shift(2,n.numFmtId||0),i.write_shift(2,65524)):(i.write_shift(2,n.numFmtId||0),i.write_shift(2,e<<4));var s=0;return n.numFmtId>0&&r&&(s|=1024),i.write_shift(4,s),i.write_shift(4,0),r||i.write_shift(4,0),i.write_shift(2,0),i}function dwe(n){var e=tt(8);return e.write_shift(4,0),e.write_shift(2,0),e.write_shift(2,0),e}function fwe(n,e,t,i,r,s){var a=tt(8);return zm(n,e,i,a),uee(t,s,a),a}function pwe(n,e,t,i){var r=tt(14);return zm(n,e,i,r),Hm(t,r),r}function gwe(n,e,t){if(t.biff<8)return mwe(n,e,t);for(var i=[],r=n.l+e,s=n.read_shift(t.biff>8?4:2);s--!==0;)i.push(ewe(n,t.biff>8?12:6,t));if(n.l!=r)throw new Error("Bad ExternSheet: "+n.l+" != "+r);return i}function mwe(n,e,t){n[n.l+1]==3&&n[n.l]++;var i=hee(n,e,t);return i.charCodeAt(0)==3?i.slice(1):i}function ywe(n){var e=tt(2+n.length*8);e.write_shift(2,n.length);for(var t=0;t<n.length;++t)fee(n[t],e);return e}function vwe(n){var e=tt(24),t=ts(n[0]);e.write_shift(2,t.r),e.write_shift(2,t.r),e.write_shift(2,t.c),e.write_shift(2,t.c);for(var i="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<16;++r)e.write_shift(1,parseInt(i[r],16));return As([e,ZEe(n[1])])}function _we(n){var e=n[1].Tooltip,t=tt(10+2*(e.length+1));t.write_shift(2,2048);var i=ts(n[0]);t.write_shift(2,i.r),t.write_shift(2,i.r),t.write_shift(2,i.c),t.write_shift(2,i.c);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function xwe(n){return n||(n=tt(4)),n.write_shift(2,1),n.write_shift(2,1),n}function bwe(n,e,t){if(!t.cellStyles)return hu(n,e);var i=t&&t.biff>=12?4:2,r=n.read_shift(i),s=n.read_shift(i),a=n.read_shift(i),o=n.read_shift(i),l=n.read_shift(2);i==2&&(n.l+=2);var c={s:r,e:s,w:a,ixfe:o,flags:l};return(t.biff>=5||!t.biff)&&(c.level=l>>8&7),c}function Twe(n,e){var t=tt(12);t.write_shift(2,e),t.write_shift(2,e),t.write_shift(2,n.width*256),t.write_shift(2,0);var i=0;return n.hidden&&(i|=1),t.write_shift(1,i),i=n.level||0,t.write_shift(1,i),t.write_shift(2,0),t}function Ewe(n){for(var e=tt(2*n),t=0;t<n;++t)e.write_shift(2,t+1);return e}function wwe(n,e,t){var i=tt(15);return oE(i,n,e),i.write_shift(8,t,"f"),i}function Awe(n,e,t){var i=tt(9);return oE(i,n,e),i.write_shift(2,t),i}var Swe=(function(){var n={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},e=bL({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function t(o,l){var c=[],h=Wm(1);switch(l.type){case"base64":h=Xl(Vh(o));break;case"binary":h=Xl(o);break;case"buffer":case"array":h=o;break}vo(h,0);var f=h.read_shift(1),p=!!(f&136),y=!1,x=!1;switch(f){case 2:break;case 3:break;case 48:y=!0,p=!0;break;case 49:y=!0,p=!0;break;case 131:break;case 139:break;case 140:x=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+f.toString(16))}var v=0,_=521;f==2&&(v=h.read_shift(2)),h.l+=3,f!=2&&(v=h.read_shift(4)),v>1048576&&(v=1e6),f!=2&&(_=h.read_shift(2));var E=h.read_shift(2),w=l.codepage||1252;f!=2&&(h.l+=16,h.read_shift(1),h[h.l]!==0&&(w=n[h[h.l]]),h.l+=1,h.l+=2),x&&(h.l+=36);for(var A=[],N={},k=Math.min(h.length,f==2?521:_-10-(y?264:0)),F=x?32:11;h.l<k&&h[h.l]!=13;)switch(N={},N.name=jD.utils.decode(w,h.slice(h.l,h.l+F)).replace(/[\u0000\r\n].*$/g,""),h.l+=F,N.type=String.fromCharCode(h.read_shift(1)),f!=2&&!x&&(N.offset=h.read_shift(4)),N.len=h.read_shift(1),f==2&&(N.offset=h.read_shift(2)),N.dec=h.read_shift(1),N.name.length&&A.push(N),f!=2&&(h.l+=x?13:14),N.type){case"B":(!y||N.len!=8)&&l.WTF&&console.log("Skipping "+N.name+":"+N.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+N.name+":"+N.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+N.type)}if(h[h.l]!==13&&(h.l=_-1),h.read_shift(1)!==13)throw new Error("DBF Terminator not found "+h.l+" "+h[h.l]);h.l=_;var C=0,M=0;for(c[0]=[],M=0;M!=A.length;++M)c[0][M]=A[M].name;for(;v-- >0;){if(h[h.l]===42){h.l+=E;continue}for(++h.l,c[++C]=[],M=0,M=0;M!=A.length;++M){var R=h.slice(h.l,h.l+A[M].len);h.l+=A[M].len,vo(R,0);var L=jD.utils.decode(w,R);switch(A[M].type){case"C":L.trim().length&&(c[C][M]=L.replace(/\s+$/,""));break;case"D":L.length===8?c[C][M]=new Date(+L.slice(0,4),+L.slice(4,6)-1,+L.slice(6,8)):c[C][M]=L;break;case"F":c[C][M]=parseFloat(L.trim());break;case"+":case"I":c[C][M]=x?R.read_shift(-4,"i")^2147483648:R.read_shift(4,"i");break;case"L":switch(L.trim().toUpperCase()){case"Y":case"T":c[C][M]=!0;break;case"N":case"F":c[C][M]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+L+"|")}break;case"M":if(!p)throw new Error("DBF Unexpected MEMO for type "+f.toString(16));c[C][M]="##MEMO##"+(x?parseInt(L.trim(),10):R.read_shift(4));break;case"N":L=L.replace(/\u0000/g,"").trim(),L&&L!="."&&(c[C][M]=+L||0);break;case"@":c[C][M]=new Date(R.read_shift(-8,"f")-621356832e5);break;case"T":c[C][M]=new Date((R.read_shift(4)-2440588)*864e5+R.read_shift(4));break;case"Y":c[C][M]=R.read_shift(4,"i")/1e4+R.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":c[C][M]=-R.read_shift(-8,"f");break;case"B":if(y&&A[M].len==8){c[C][M]=R.read_shift(8,"f");break}case"G":case"P":R.l+=A[M].len;break;case"0":if(A[M].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+A[M].type)}}}if(f!=2&&h.l<h.length&&h[h.l++]!=26)throw new Error("DBF EOF Marker missing "+(h.l-1)+" of "+h.length+" "+h[h.l-1].toString(16));return l&&l.sheetRows&&(c=c.slice(0,l.sheetRows)),l.DBF=A,c}function i(o,l){var c=l||{};c.dateNF||(c.dateNF="yyyymmdd");var h=X1(t(o,c),c);return h["!cols"]=c.DBF.map(function(f){return{wch:f.len,DBF:f}}),delete c.DBF,h}function r(o,l){try{return n0(i(o,l),l)}catch(c){if(l&&l.WTF)throw c}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function a(o,l){var c=l||{};if(+c.codepage>=0&&Rb(+c.codepage),c.type=="string")throw new Error("Cannot write DBF to JS string");var h=Fa(),f=aC(o,{header:1,raw:!0,cellDates:!0}),p=f[0],y=f.slice(1),x=o["!cols"]||[],v=0,_=0,E=0,w=1;for(v=0;v<p.length;++v){if(((x[v]||{}).DBF||{}).name){p[v]=x[v].DBF.name,++E;continue}if(p[v]!=null){if(++E,typeof p[v]=="number"&&(p[v]=p[v].toString(10)),typeof p[v]!="string")throw new Error("DBF Invalid column name "+p[v]+" |"+typeof p[v]+"|");if(p.indexOf(p[v])!==v){for(_=0;_<1024;++_)if(p.indexOf(p[v]+"_"+_)==-1){p[v]+="_"+_;break}}}}var A=Ri(o["!ref"]),N=[],k=[],F=[];for(v=0;v<=A.e.c-A.s.c;++v){var C="",M="",R=0,L=[];for(_=0;_<y.length;++_)y[_][v]!=null&&L.push(y[_][v]);if(L.length==0||p[v]==null){N[v]="?";continue}for(_=0;_<L.length;++_){switch(typeof L[_]){case"number":M="B";break;case"string":M="C";break;case"boolean":M="L";break;case"object":M=L[_]instanceof Date?"D":"C";break;default:M="C"}R=Math.max(R,String(L[_]).length),C=C&&C!=M?"C":M}R>250&&(R=250),M=((x[v]||{}).DBF||{}).type,M=="C"&&x[v].DBF.len>R&&(R=x[v].DBF.len),C=="B"&&M=="N"&&(C="N",F[v]=x[v].DBF.dec,R=x[v].DBF.len),k[v]=C=="C"||M=="N"?R:s[C]||0,w+=k[v],N[v]=C}var H=h.next(32);for(H.write_shift(4,318902576),H.write_shift(4,y.length),H.write_shift(2,296+32*E),H.write_shift(2,w),v=0;v<4;++v)H.write_shift(4,0);for(H.write_shift(4,0|(+e[gZ]||3)<<8),v=0,_=0;v<p.length;++v)if(p[v]!=null){var P=h.next(32),O=(p[v].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);P.write_shift(1,O,"sbcs"),P.write_shift(1,N[v]=="?"?"C":N[v],"sbcs"),P.write_shift(4,_),P.write_shift(1,k[v]||s[N[v]]||0),P.write_shift(1,F[v]||0),P.write_shift(1,2),P.write_shift(4,0),P.write_shift(1,0),P.write_shift(4,0),P.write_shift(4,0),_+=k[v]||s[N[v]]||0}var B=h.next(264);for(B.write_shift(4,13),v=0;v<65;++v)B.write_shift(4,0);for(v=0;v<y.length;++v){var re=h.next(w);for(re.write_shift(1,0),_=0;_<p.length;++_)if(p[_]!=null)switch(N[_]){case"L":re.write_shift(1,y[v][_]==null?63:y[v][_]?84:70);break;case"B":re.write_shift(8,y[v][_]||0,"f");break;case"N":var q="0";for(typeof y[v][_]=="number"&&(q=y[v][_].toFixed(F[_]||0)),E=0;E<k[_]-q.length;++E)re.write_shift(1,32);re.write_shift(1,q,"sbcs");break;case"D":y[v][_]?(re.write_shift(4,("0000"+y[v][_].getFullYear()).slice(-4),"sbcs"),re.write_shift(2,("00"+(y[v][_].getMonth()+1)).slice(-2),"sbcs"),re.write_shift(2,("00"+y[v][_].getDate()).slice(-2),"sbcs")):re.write_shift(8,"00000000","sbcs");break;case"C":var X=String(y[v][_]!=null?y[v][_]:"").slice(0,k[_]);for(re.write_shift(1,X,"sbcs"),E=0;E<k[_]-X.length;++E)re.write_shift(1,32);break}}return h.next(1).write_shift(1,26),h.end()}return{to_workbook:r,to_sheet:i,from_sheet:a}})(),Dwe=(function(){var n={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},e=new RegExp("\x1BN("+Rs(n).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(p,y){var x=n[y];return typeof x=="number"?Rz(x):x},i=function(p,y,x){var v=y.charCodeAt(0)-32<<4|x.charCodeAt(0)-48;return v==59?p:Rz(v)};n["|"]=254;function r(p,y){switch(y.type){case"base64":return s(Vh(p),y);case"binary":return s(p,y);case"buffer":return s(Vn&&Buffer.isBuffer(p)?p.toString("binary"):nE(p),y);case"array":return s(KI(p),y)}throw new Error("Unrecognized type "+y.type)}function s(p,y){var x=p.split(/[\n\r]+/),v=-1,_=-1,E=0,w=0,A=[],N=[],k=null,F={},C=[],M=[],R=[],L=0,H;for(+y.codepage>=0&&Rb(+y.codepage);E!==x.length;++E){L=0;var P=x[E].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,i).replace(e,t),O=P.replace(/;;/g,"\0").split(";").map(function(ie){return ie.replace(/\u0000/g,";")}),B=O[0],re;if(P.length>0)switch(B){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":O[1].charAt(0)=="P"&&N.push(P.slice(3).replace(/;;/g,";"));break;case"C":var q=!1,X=!1,oe=!1,ue=!1,ge=-1,j=-1;for(w=1;w<O.length;++w)switch(O[w].charAt(0)){case"A":break;case"X":_=parseInt(O[w].slice(1))-1,X=!0;break;case"Y":for(v=parseInt(O[w].slice(1))-1,X||(_=0),H=A.length;H<=v;++H)A[H]=[];break;case"K":re=O[w].slice(1),re.charAt(0)==='"'?re=re.slice(1,re.length-1):re==="TRUE"?re=!0:re==="FALSE"?re=!1:isNaN(Ih(re))?isNaN(kb(re).getDate())||(re=ha(re)):(re=Ih(re),k!==null&&DZ(k)&&(re=NZ(re))),q=!0;break;case"E":ue=!0;var G=AAe(O[w].slice(1),{r:v,c:_});A[v][_]=[A[v][_],G];break;case"S":oe=!0,A[v][_]=[A[v][_],"S5S"];break;case"G":break;case"R":ge=parseInt(O[w].slice(1))-1;break;case"C":j=parseInt(O[w].slice(1))-1;break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+P)}if(q&&(A[v][_]&&A[v][_].length==2?A[v][_][0]=re:A[v][_]=re,k=null),oe){if(ue)throw new Error("SYLK shared formula cannot have own formula");var Z=ge>-1&&A[ge][j];if(!Z||!Z[1])throw new Error("SYLK shared formula cannot find base");A[v][_][1]=SAe(Z[1],{r:v-ge,c:_-j})}break;case"F":var te=0;for(w=1;w<O.length;++w)switch(O[w].charAt(0)){case"X":_=parseInt(O[w].slice(1))-1,++te;break;case"Y":for(v=parseInt(O[w].slice(1))-1,H=A.length;H<=v;++H)A[H]=[];break;case"M":L=parseInt(O[w].slice(1))/20;break;case"F":break;case"G":break;case"P":k=N[parseInt(O[w].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(R=O[w].slice(1).split(" "),H=parseInt(R[0],10);H<=parseInt(R[1],10);++H)L=parseInt(R[2],10),M[H-1]=L===0?{hidden:!0}:{wch:L},ML(M[H-1]);break;case"C":_=parseInt(O[w].slice(1))-1,M[_]||(M[_]={});break;case"R":v=parseInt(O[w].slice(1))-1,C[v]||(C[v]={}),L>0?(C[v].hpt=L,C[v].hpx=vee(L)):L===0&&(C[v].hidden=!0);break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+P)}te<1&&(k=null);break;default:if(y&&y.WTF)throw new Error("SYLK bad record "+P)}}return C.length>0&&(F["!rows"]=C),M.length>0&&(F["!cols"]=M),y&&y.sheetRows&&(A=A.slice(0,y.sheetRows)),[A,F]}function a(p,y){var x=r(p,y),v=x[0],_=x[1],E=X1(v,y);return Rs(_).forEach(function(w){E[w]=_[w]}),E}function o(p,y){return n0(a(p,y),y)}function l(p,y,x,v){var _="C;Y"+(x+1)+";X"+(v+1)+";K";switch(p.t){case"n":_+=p.v||0,p.f&&!p.F&&(_+=";E"+UL(p.f,{r:x,c:v}));break;case"b":_+=p.v?"TRUE":"FALSE";break;case"e":_+=p.w||p.v;break;case"d":_+='"'+(p.w||p.v)+'"';break;case"s":_+='"'+p.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return _}function c(p,y){y.forEach(function(x,v){var _="F;W"+(v+1)+" "+(v+1)+" ";x.hidden?_+="0":(typeof x.width=="number"&&!x.wpx&&(x.wpx=nC(x.width)),typeof x.wpx=="number"&&!x.wch&&(x.wch=iC(x.wpx)),typeof x.wch=="number"&&(_+=Math.round(x.wch))),_.charAt(_.length-1)!=" "&&p.push(_)})}function h(p,y){y.forEach(function(x,v){var _="F;";x.hidden?_+="M0;":x.hpt?_+="M"+20*x.hpt+";":x.hpx&&(_+="M"+20*rC(x.hpx)+";"),_.length>2&&p.push(_+"R"+(v+1))})}function f(p,y){var x=["ID;PWXL;N;E"],v=[],_=Ri(p["!ref"]),E,w=Array.isArray(p),A=`\r
`;x.push("P;PGeneral"),x.push("F;P0;DG0G8;M255"),p["!cols"]&&c(x,p["!cols"]),p["!rows"]&&h(x,p["!rows"]),x.push("B;Y"+(_.e.r-_.s.r+1)+";X"+(_.e.c-_.s.c+1)+";D"+[_.s.c,_.s.r,_.e.c,_.e.r].join(" "));for(var N=_.s.r;N<=_.e.r;++N)for(var k=_.s.c;k<=_.e.c;++k){var F=ii({r:N,c:k});E=w?(p[N]||[])[k]:p[F],!(!E||E.v==null&&(!E.f||E.F))&&v.push(l(E,p,N,k))}return x.join(A)+A+v.join(A)+A+"E"+A}return{to_workbook:o,to_sheet:a,from_sheet:f}})(),Cwe=(function(){function n(s,a){switch(a.type){case"base64":return e(Vh(s),a);case"binary":return e(s,a);case"buffer":return e(Vn&&Buffer.isBuffer(s)?s.toString("binary"):nE(s),a);case"array":return e(KI(s),a)}throw new Error("Unrecognized type "+a.type)}function e(s,a){for(var o=s.split(`
`),l=-1,c=-1,h=0,f=[];h!==o.length;++h){if(o[h].trim()==="BOT"){f[++l]=[],c=0;continue}if(!(l<0)){var p=o[h].trim().split(","),y=p[0],x=p[1];++h;for(var v=o[h]||"";(v.match(/["]/g)||[]).length&1&&h<o.length-1;)v+=`
`+o[++h];switch(v=v.trim(),+y){case-1:if(v==="BOT"){f[++l]=[],c=0;continue}else if(v!=="EOD")throw new Error("Unrecognized DIF special command "+v);break;case 0:v==="TRUE"?f[l][c]=!0:v==="FALSE"?f[l][c]=!1:isNaN(Ih(x))?isNaN(kb(x).getDate())?f[l][c]=x:f[l][c]=ha(x):f[l][c]=Ih(x),++c;break;case 1:v=v.slice(1,v.length-1),v=v.replace(/""/g,'"'),v&&v.match(/^=".*"$/)&&(v=v.slice(2,-1)),f[l][c++]=v!==""?v:null;break}if(v==="EOD")break}}return a&&a.sheetRows&&(f=f.slice(0,a.sheetRows)),f}function t(s,a){return X1(n(s,a),a)}function i(s,a){return n0(t(s,a),a)}var r=(function(){var s=function(l,c,h,f,p){l.push(c),l.push(h+","+f),l.push('"'+p.replace(/"/g,'""')+'"')},a=function(l,c,h,f){l.push(c+","+h),l.push(c==1?'"'+f.replace(/"/g,'""')+'"':f)};return function(l){var c=[],h=Ri(l["!ref"]),f,p=Array.isArray(l);s(c,"TABLE",0,1,"sheetjs"),s(c,"VECTORS",0,h.e.r-h.s.r+1,""),s(c,"TUPLES",0,h.e.c-h.s.c+1,""),s(c,"DATA",0,0,"");for(var y=h.s.r;y<=h.e.r;++y){a(c,-1,0,"BOT");for(var x=h.s.c;x<=h.e.c;++x){var v=ii({r:y,c:x});if(f=p?(l[y]||[])[x]:l[v],!f){a(c,1,0,"");continue}switch(f.t){case"n":var _=f.w;!_&&f.v!=null&&(_=f.v),_==null?f.f&&!f.F?a(c,1,0,"="+f.f):a(c,1,0,""):a(c,0,_,"V");break;case"b":a(c,0,f.v?1:0,f.v?"TRUE":"FALSE");break;case"s":a(c,1,0,isNaN(f.v)?f.v:'="'+f.v+'"');break;case"d":f.w||(f.w=rp(f.z||Qi[14],Ua(ha(f.v)))),a(c,0,f.w,"V");break;default:a(c,1,0,"")}}}a(c,-1,0,"EOD");var E=`\r
`,w=c.join(E);return w}})();return{to_workbook:i,to_sheet:t,from_sheet:r}})(),pee=(function(){function n(f){return f.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function e(f){return f.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(f,p){for(var y=f.split(`
`),x=-1,v=-1,_=0,E=[];_!==y.length;++_){var w=y[_].trim().split(":");if(w[0]==="cell"){var A=ts(w[1]);if(E.length<=A.r)for(x=E.length;x<=A.r;++x)E[x]||(E[x]=[]);switch(x=A.r,v=A.c,w[2]){case"t":E[x][v]=n(w[3]);break;case"v":E[x][v]=+w[3];break;case"vtf":var N=w[w.length-1];case"vtc":switch(w[3]){case"nl":E[x][v]=!!+w[4];break;default:E[x][v]=+w[4];break}w[2]=="vtf"&&(E[x][v]=[E[x][v],N])}}}return p&&p.sheetRows&&(E=E.slice(0,p.sheetRows)),E}function i(f,p){return X1(t(f,p),p)}function r(f,p){return n0(i(f,p),p)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),a=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),l="--SocialCalcSpreadsheetControlSave--";function c(f){if(!f||!f["!ref"])return"";for(var p=[],y=[],x,v="",_=Do(f["!ref"]),E=Array.isArray(f),w=_.s.r;w<=_.e.r;++w)for(var A=_.s.c;A<=_.e.c;++A)if(v=ii({r:w,c:A}),x=E?(f[w]||[])[A]:f[v],!(!x||x.v==null||x.t==="z")){switch(y=["cell",v,"t"],x.t){case"s":case"str":y.push(e(x.v));break;case"n":x.f?(y[2]="vtf",y[3]="n",y[4]=x.v,y[5]=e(x.f)):(y[2]="v",y[3]=x.v);break;case"b":y[2]="vt"+(x.f?"f":"c"),y[3]="nl",y[4]=x.v?"1":"0",y[5]=e(x.f||(x.v?"TRUE":"FALSE"));break;case"d":var N=Ua(ha(x.v));y[2]="vtc",y[3]="nd",y[4]=""+N,y[5]=x.w||rp(x.z||Qi[14],N);break;case"e":continue}p.push(y.join(":"))}return p.push("sheet:c:"+(_.e.c-_.s.c+1)+":r:"+(_.e.r-_.s.r+1)+":tvf:1"),p.push("valueformat:1:text-wiki"),p.join(`
`)}function h(f){return[s,a,o,a,c(f),l].join(`
`)}return{to_workbook:r,to_sheet:i,from_sheet:h}})(),Iwe=(function(){function n(h,f,p,y,x){x.raw?f[p][y]=h:h===""||(h==="TRUE"?f[p][y]=!0:h==="FALSE"?f[p][y]=!1:isNaN(Ih(h))?isNaN(kb(h).getDate())?f[p][y]=h:f[p][y]=ha(h):f[p][y]=Ih(h))}function e(h,f){var p=f||{},y=[];if(!h||h.length===0)return y;for(var x=h.split(/[\r\n]/),v=x.length-1;v>=0&&x[v].length===0;)--v;for(var _=10,E=0,w=0;w<=v;++w)E=x[w].indexOf(" "),E==-1?E=x[w].length:E++,_=Math.max(_,E);for(w=0;w<=v;++w){y[w]=[];var A=0;for(n(x[w].slice(0,_).trim(),y,w,A,p),A=1;A<=(x[w].length-_)/10+1;++A)n(x[w].slice(_+(A-1)*10,_+A*10).trim(),y,w,A,p)}return p.sheetRows&&(y=y.slice(0,p.sheetRows)),y}var t={44:",",9:"	",59:";",124:"|"},i={44:3,9:2,59:1,124:0};function r(h){for(var f={},p=!1,y=0,x=0;y<h.length;++y)(x=h.charCodeAt(y))==34?p=!p:!p&&x in t&&(f[x]=(f[x]||0)+1);x=[];for(y in f)Object.prototype.hasOwnProperty.call(f,y)&&x.push([f[y],y]);if(!x.length){f=i;for(y in f)Object.prototype.hasOwnProperty.call(f,y)&&x.push([f[y],y])}return x.sort(function(v,_){return v[0]-_[0]||i[v[1]]-i[_[1]]}),t[x.pop()[1]]||44}function s(h,f){var p=f||{},y="",x=p.dense?[]:{},v={s:{c:0,r:0},e:{c:0,r:0}};h.slice(0,4)=="sep="?h.charCodeAt(5)==13&&h.charCodeAt(6)==10?(y=h.charAt(4),h=h.slice(7)):h.charCodeAt(5)==13||h.charCodeAt(5)==10?(y=h.charAt(4),h=h.slice(6)):y=r(h.slice(0,1024)):p&&p.FS?y=p.FS:y=r(h.slice(0,1024));var _=0,E=0,w=0,A=0,N=0,k=y.charCodeAt(0),F=!1,C=0,M=h.charCodeAt(0);h=h.replace(/\r\n/mg,`
`);var R=p.dateNF!=null?qTe(p.dateNF):null;function L(){var H=h.slice(A,N),P={};if(H.charAt(0)=='"'&&H.charAt(H.length-1)=='"'&&(H=H.slice(1,-1).replace(/""/g,'"')),H.length===0)P.t="z";else if(p.raw)P.t="s",P.v=H;else if(H.trim().length===0)P.t="s",P.v=H;else if(H.charCodeAt(0)==61)H.charCodeAt(1)==34&&H.charCodeAt(H.length-1)==34?(P.t="s",P.v=H.slice(2,-1).replace(/""/g,'"')):DAe(H)?(P.t="n",P.f=H.slice(1)):(P.t="s",P.v=H);else if(H=="TRUE")P.t="b",P.v=!0;else if(H=="FALSE")P.t="b",P.v=!1;else if(!isNaN(w=Ih(H)))P.t="n",p.cellText!==!1&&(P.w=H),P.v=w;else if(!isNaN(kb(H).getDate())||R&&H.match(R)){P.z=p.dateNF||Qi[14];var O=0;R&&H.match(R)&&(H=$Te(H,p.dateNF,H.match(R)||[]),O=1),p.cellDates?(P.t="d",P.v=ha(H,O)):(P.t="n",P.v=Ua(ha(H,O))),p.cellText!==!1&&(P.w=rp(P.z,P.v instanceof Date?Ua(P.v):P.v)),p.cellNF||delete P.z}else P.t="s",P.v=H;if(P.t=="z"||(p.dense?(x[_]||(x[_]=[]),x[_][E]=P):x[ii({c:E,r:_})]=P),A=N+1,M=h.charCodeAt(A),v.e.c<E&&(v.e.c=E),v.e.r<_&&(v.e.r=_),C==k)++E;else if(E=0,++_,p.sheetRows&&p.sheetRows<=_)return!0}e:for(;N<h.length;++N)switch(C=h.charCodeAt(N)){case 34:M===34&&(F=!F);break;case k:case 10:case 13:if(!F&&L())break e;break}return N-A>0&&L(),x["!ref"]=br(v),x}function a(h,f){return!(f&&f.PRN)||f.FS||h.slice(0,4)=="sep="||h.indexOf("	")>=0||h.indexOf(",")>=0||h.indexOf(";")>=0?s(h,f):X1(e(h,f),f)}function o(h,f){var p="",y=f.type=="string"?[0,0,0,0]:WIe(h,f);switch(f.type){case"base64":p=Vh(h);break;case"binary":p=h;break;case"buffer":f.codepage==65001?p=h.toString("utf8"):f.codepage&&typeof jD<"u"||(p=Vn&&Buffer.isBuffer(h)?h.toString("binary"):nE(h));break;case"array":p=KI(h);break;case"string":p=h;break;default:throw new Error("Unrecognized type "+f.type)}return y[0]==239&&y[1]==187&&y[2]==191?p=nb(p.slice(3)):f.type!="string"&&f.type!="buffer"&&f.codepage==65001?p=nb(p):f.type=="binary"&&typeof jD<"u",p.slice(0,19)=="socialcalc:version:"?pee.to_sheet(f.type=="string"?p:nb(p),f):a(p,f)}function l(h,f){return n0(o(h,f),f)}function c(h){for(var f=[],p=Ri(h["!ref"]),y,x=Array.isArray(h),v=p.s.r;v<=p.e.r;++v){for(var _=[],E=p.s.c;E<=p.e.c;++E){var w=ii({r:v,c:E});if(y=x?(h[v]||[])[E]:h[w],!y||y.v==null){_.push("          ");continue}for(var A=(y.w||(Wh(y),y.w)||"").slice(0,10);A.length<10;)A+=" ";_.push(A+(E===0?" ":""))}f.push(_.join(""))}return f.join(`
`)}return{to_workbook:l,to_sheet:o,from_sheet:c}})(),oG=(function(){function n(G,Z,te){if(G){vo(G,G.l||0);for(var ie=te.Enum||ge;G.l<G.length;){var _e=G.read_shift(2),Ie=ie[_e]||ie[65535],Pe=G.read_shift(2),Fe=G.l+Pe,Ge=Ie.f&&Ie.f(G,Pe,te);if(G.l=Fe,Z(Ge,Ie,_e))return}}}function e(G,Z){switch(Z.type){case"base64":return t(Xl(Vh(G)),Z);case"binary":return t(Xl(G),Z);case"buffer":case"array":return t(G,Z)}throw"Unsupported type "+Z.type}function t(G,Z){if(!G)return G;var te=Z||{},ie=te.dense?[]:{},_e="Sheet1",Ie="",Pe=0,Fe={},Ge=[],ct=[],gt={s:{r:0,c:0},e:{r:0,c:0}},Mt=te.sheetRows||0;if(G[2]==0&&(G[3]==8||G[3]==9)&&G.length>=16&&G[14]==5&&G[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(G[2]==2)te.Enum=ge,n(G,function(ae,he,we){switch(we){case 0:te.vers=ae,ae>=4096&&(te.qpro=!0);break;case 6:gt=ae;break;case 204:ae&&(Ie=ae);break;case 222:Ie=ae;break;case 15:case 51:te.qpro||(ae[1].v=ae[1].v.slice(1));case 13:case 14:case 16:we==14&&(ae[2]&112)==112&&(ae[2]&15)>1&&(ae[2]&15)<15&&(ae[1].z=te.dateNF||Qi[14],te.cellDates&&(ae[1].t="d",ae[1].v=NZ(ae[1].v))),te.qpro&&ae[3]>Pe&&(ie["!ref"]=br(gt),Fe[_e]=ie,Ge.push(_e),ie=te.dense?[]:{},gt={s:{r:0,c:0},e:{r:0,c:0}},Pe=ae[3],_e=Ie||"Sheet"+(Pe+1),Ie="");var Le=te.dense?(ie[ae[0].r]||[])[ae[0].c]:ie[ii(ae[0])];if(Le){Le.t=ae[1].t,Le.v=ae[1].v,ae[1].z!=null&&(Le.z=ae[1].z),ae[1].f!=null&&(Le.f=ae[1].f);break}te.dense?(ie[ae[0].r]||(ie[ae[0].r]=[]),ie[ae[0].r][ae[0].c]=ae[1]):ie[ii(ae[0])]=ae[1];break}},te);else if(G[2]==26||G[2]==14)te.Enum=j,G[2]==14&&(te.qpro=!0,G.l=0),n(G,function(ae,he,we){switch(we){case 204:_e=ae;break;case 22:ae[1].v=ae[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(ae[3]>Pe&&(ie["!ref"]=br(gt),Fe[_e]=ie,Ge.push(_e),ie=te.dense?[]:{},gt={s:{r:0,c:0},e:{r:0,c:0}},Pe=ae[3],_e="Sheet"+(Pe+1)),Mt>0&&ae[0].r>=Mt)break;te.dense?(ie[ae[0].r]||(ie[ae[0].r]=[]),ie[ae[0].r][ae[0].c]=ae[1]):ie[ii(ae[0])]=ae[1],gt.e.c<ae[0].c&&(gt.e.c=ae[0].c),gt.e.r<ae[0].r&&(gt.e.r=ae[0].r);break;case 27:ae[14e3]&&(ct[ae[14e3][0]]=ae[14e3][1]);break;case 1537:ct[ae[0]]=ae[1],ae[0]==Pe&&(_e=ae[1]);break}},te);else throw new Error("Unrecognized LOTUS BOF "+G[2]);if(ie["!ref"]=br(gt),Fe[Ie||_e]=ie,Ge.push(Ie||_e),!ct.length)return{SheetNames:Ge,Sheets:Fe};for(var W={},Re=[],Te=0;Te<ct.length;++Te)Fe[Ge[Te]]?(Re.push(ct[Te]||Ge[Te]),W[ct[Te]]=Fe[ct[Te]]||Fe[Ge[Te]]):(Re.push(ct[Te]),W[ct[Te]]={"!ref":"A1"});return{SheetNames:Re,Sheets:W}}function i(G,Z){var te=Z||{};if(+te.codepage>=0&&Rb(+te.codepage),te.type=="string")throw new Error("Cannot write WK1 to JS string");var ie=Fa(),_e=Ri(G["!ref"]),Ie=Array.isArray(G),Pe=[];_t(ie,0,s(1030)),_t(ie,6,l(_e));for(var Fe=Math.min(_e.e.r,8191),Ge=_e.s.r;Ge<=Fe;++Ge)for(var ct=Is(Ge),gt=_e.s.c;gt<=_e.e.c;++gt){Ge===_e.s.r&&(Pe[gt]=qs(gt));var Mt=Pe[gt]+ct,W=Ie?(G[Ge]||[])[gt]:G[Mt];if(!(!W||W.t=="z"))if(W.t=="n")(W.v|0)==W.v&&W.v>=-32768&&W.v<=32767?_t(ie,13,y(Ge,gt,W.v)):_t(ie,14,v(Ge,gt,W.v));else{var Re=Wh(W);_t(ie,15,f(Ge,gt,Re.slice(0,239)))}}return _t(ie,1),ie.end()}function r(G,Z){var te=Z||{};if(+te.codepage>=0&&Rb(+te.codepage),te.type=="string")throw new Error("Cannot write WK3 to JS string");var ie=Fa();_t(ie,0,a(G));for(var _e=0,Ie=0;_e<G.SheetNames.length;++_e)(G.Sheets[G.SheetNames[_e]]||{})["!ref"]&&_t(ie,27,ue(G.SheetNames[_e],Ie++));var Pe=0;for(_e=0;_e<G.SheetNames.length;++_e){var Fe=G.Sheets[G.SheetNames[_e]];if(!(!Fe||!Fe["!ref"])){for(var Ge=Ri(Fe["!ref"]),ct=Array.isArray(Fe),gt=[],Mt=Math.min(Ge.e.r,8191),W=Ge.s.r;W<=Mt;++W)for(var Re=Is(W),Te=Ge.s.c;Te<=Ge.e.c;++Te){W===Ge.s.r&&(gt[Te]=qs(Te));var ae=gt[Te]+Re,he=ct?(Fe[W]||[])[Te]:Fe[ae];if(!(!he||he.t=="z"))if(he.t=="n")_t(ie,23,L(W,Te,Pe,he.v));else{var we=Wh(he);_t(ie,22,C(W,Te,Pe,we.slice(0,239)))}}++Pe}}return _t(ie,1),ie.end()}function s(G){var Z=tt(2);return Z.write_shift(2,G),Z}function a(G){var Z=tt(26);Z.write_shift(2,4096),Z.write_shift(2,4),Z.write_shift(4,0);for(var te=0,ie=0,_e=0,Ie=0;Ie<G.SheetNames.length;++Ie){var Pe=G.SheetNames[Ie],Fe=G.Sheets[Pe];if(!(!Fe||!Fe["!ref"])){++_e;var Ge=Do(Fe["!ref"]);te<Ge.e.r&&(te=Ge.e.r),ie<Ge.e.c&&(ie=Ge.e.c)}}return te>8191&&(te=8191),Z.write_shift(2,te),Z.write_shift(1,_e),Z.write_shift(1,ie),Z.write_shift(2,0),Z.write_shift(2,0),Z.write_shift(1,1),Z.write_shift(1,2),Z.write_shift(4,0),Z.write_shift(4,0),Z}function o(G,Z,te){var ie={s:{c:0,r:0},e:{c:0,r:0}};return Z==8&&te.qpro?(ie.s.c=G.read_shift(1),G.l++,ie.s.r=G.read_shift(2),ie.e.c=G.read_shift(1),G.l++,ie.e.r=G.read_shift(2),ie):(ie.s.c=G.read_shift(2),ie.s.r=G.read_shift(2),Z==12&&te.qpro&&(G.l+=2),ie.e.c=G.read_shift(2),ie.e.r=G.read_shift(2),Z==12&&te.qpro&&(G.l+=2),ie.s.c==65535&&(ie.s.c=ie.e.c=ie.s.r=ie.e.r=0),ie)}function l(G){var Z=tt(8);return Z.write_shift(2,G.s.c),Z.write_shift(2,G.s.r),Z.write_shift(2,G.e.c),Z.write_shift(2,G.e.r),Z}function c(G,Z,te){var ie=[{c:0,r:0},{t:"n",v:0},0,0];return te.qpro&&te.vers!=20768?(ie[0].c=G.read_shift(1),ie[3]=G.read_shift(1),ie[0].r=G.read_shift(2),G.l+=2):(ie[2]=G.read_shift(1),ie[0].c=G.read_shift(2),ie[0].r=G.read_shift(2)),ie}function h(G,Z,te){var ie=G.l+Z,_e=c(G,Z,te);if(_e[1].t="s",te.vers==20768){G.l++;var Ie=G.read_shift(1);return _e[1].v=G.read_shift(Ie,"utf8"),_e}return te.qpro&&G.l++,_e[1].v=G.read_shift(ie-G.l,"cstr"),_e}function f(G,Z,te){var ie=tt(7+te.length);ie.write_shift(1,255),ie.write_shift(2,Z),ie.write_shift(2,G),ie.write_shift(1,39);for(var _e=0;_e<ie.length;++_e){var Ie=te.charCodeAt(_e);ie.write_shift(1,Ie>=128?95:Ie)}return ie.write_shift(1,0),ie}function p(G,Z,te){var ie=c(G,Z,te);return ie[1].v=G.read_shift(2,"i"),ie}function y(G,Z,te){var ie=tt(7);return ie.write_shift(1,255),ie.write_shift(2,Z),ie.write_shift(2,G),ie.write_shift(2,te,"i"),ie}function x(G,Z,te){var ie=c(G,Z,te);return ie[1].v=G.read_shift(8,"f"),ie}function v(G,Z,te){var ie=tt(13);return ie.write_shift(1,255),ie.write_shift(2,Z),ie.write_shift(2,G),ie.write_shift(8,te,"f"),ie}function _(G,Z,te){var ie=G.l+Z,_e=c(G,Z,te);if(_e[1].v=G.read_shift(8,"f"),te.qpro)G.l=ie;else{var Ie=G.read_shift(2);N(G.slice(G.l,G.l+Ie),_e),G.l+=Ie}return _e}function E(G,Z,te){var ie=Z&32768;return Z&=-32769,Z=(ie?G:0)+(Z>=8192?Z-16384:Z),(ie?"":"$")+(te?qs(Z):Is(Z))}var w={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},A=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function N(G,Z){vo(G,0);for(var te=[],ie=0,_e="",Ie="",Pe="",Fe="";G.l<G.length;){var Ge=G[G.l++];switch(Ge){case 0:te.push(G.read_shift(8,"f"));break;case 1:Ie=E(Z[0].c,G.read_shift(2),!0),_e=E(Z[0].r,G.read_shift(2),!1),te.push(Ie+_e);break;case 2:{var ct=E(Z[0].c,G.read_shift(2),!0),gt=E(Z[0].r,G.read_shift(2),!1);Ie=E(Z[0].c,G.read_shift(2),!0),_e=E(Z[0].r,G.read_shift(2),!1),te.push(ct+gt+":"+Ie+_e)}break;case 3:if(G.l<G.length){console.error("WK1 premature formula end");return}break;case 4:te.push("("+te.pop()+")");break;case 5:te.push(G.read_shift(2));break;case 6:{for(var Mt="";Ge=G[G.l++];)Mt+=String.fromCharCode(Ge);te.push('"'+Mt.replace(/"/g,'""')+'"')}break;case 8:te.push("-"+te.pop());break;case 23:te.push("+"+te.pop());break;case 22:te.push("NOT("+te.pop()+")");break;case 20:case 21:Fe=te.pop(),Pe=te.pop(),te.push(["AND","OR"][Ge-20]+"("+Pe+","+Fe+")");break;default:if(Ge<32&&A[Ge])Fe=te.pop(),Pe=te.pop(),te.push(Pe+A[Ge]+Fe);else if(w[Ge]){if(ie=w[Ge][1],ie==69&&(ie=G[G.l++]),ie>te.length){console.error("WK1 bad formula parse 0x"+Ge.toString(16)+":|"+te.join("|")+"|");return}var W=te.slice(-ie);te.length-=ie,te.push(w[Ge][0]+"("+W.join(",")+")")}else return Ge<=7?console.error("WK1 invalid opcode "+Ge.toString(16)):Ge<=24?console.error("WK1 unsupported op "+Ge.toString(16)):Ge<=30?console.error("WK1 invalid opcode "+Ge.toString(16)):Ge<=115?console.error("WK1 unsupported function opcode "+Ge.toString(16)):console.error("WK1 unrecognized opcode "+Ge.toString(16))}}te.length==1?Z[1].f=""+te[0]:console.error("WK1 bad formula parse |"+te.join("|")+"|")}function k(G){var Z=[{c:0,r:0},{t:"n",v:0},0];return Z[0].r=G.read_shift(2),Z[3]=G[G.l++],Z[0].c=G[G.l++],Z}function F(G,Z){var te=k(G);return te[1].t="s",te[1].v=G.read_shift(Z-4,"cstr"),te}function C(G,Z,te,ie){var _e=tt(6+ie.length);_e.write_shift(2,G),_e.write_shift(1,te),_e.write_shift(1,Z),_e.write_shift(1,39);for(var Ie=0;Ie<ie.length;++Ie){var Pe=ie.charCodeAt(Ie);_e.write_shift(1,Pe>=128?95:Pe)}return _e.write_shift(1,0),_e}function M(G,Z){var te=k(G);te[1].v=G.read_shift(2);var ie=te[1].v>>1;if(te[1].v&1)switch(ie&7){case 0:ie=(ie>>3)*5e3;break;case 1:ie=(ie>>3)*500;break;case 2:ie=(ie>>3)/20;break;case 3:ie=(ie>>3)/200;break;case 4:ie=(ie>>3)/2e3;break;case 5:ie=(ie>>3)/2e4;break;case 6:ie=(ie>>3)/16;break;case 7:ie=(ie>>3)/64;break}return te[1].v=ie,te}function R(G,Z){var te=k(G),ie=G.read_shift(4),_e=G.read_shift(4),Ie=G.read_shift(2);if(Ie==65535)return ie===0&&_e===3221225472?(te[1].t="e",te[1].v=15):ie===0&&_e===3489660928?(te[1].t="e",te[1].v=42):te[1].v=0,te;var Pe=Ie&32768;return Ie=(Ie&32767)-16446,te[1].v=(1-Pe*2)*(_e*Math.pow(2,Ie+32)+ie*Math.pow(2,Ie)),te}function L(G,Z,te,ie){var _e=tt(14);if(_e.write_shift(2,G),_e.write_shift(1,te),_e.write_shift(1,Z),ie==0)return _e.write_shift(4,0),_e.write_shift(4,0),_e.write_shift(2,65535),_e;var Ie=0,Pe=0,Fe=0,Ge=0;return ie<0&&(Ie=1,ie=-ie),Pe=Math.log2(ie)|0,ie/=Math.pow(2,Pe-31),Ge=ie>>>0,(Ge&2147483648)==0&&(ie/=2,++Pe,Ge=ie>>>0),ie-=Ge,Ge|=2147483648,Ge>>>=0,ie*=Math.pow(2,32),Fe=ie>>>0,_e.write_shift(4,Fe),_e.write_shift(4,Ge),Pe+=16383+(Ie?32768:0),_e.write_shift(2,Pe),_e}function H(G,Z){var te=R(G);return G.l+=Z-14,te}function P(G,Z){var te=k(G),ie=G.read_shift(4);return te[1].v=ie>>6,te}function O(G,Z){var te=k(G),ie=G.read_shift(8,"f");return te[1].v=ie,te}function B(G,Z){var te=O(G);return G.l+=Z-10,te}function re(G,Z){return G[G.l+Z-1]==0?G.read_shift(Z,"cstr"):""}function q(G,Z){var te=G[G.l++];te>Z-1&&(te=Z-1);for(var ie="";ie.length<te;)ie+=String.fromCharCode(G[G.l++]);return ie}function X(G,Z,te){if(!(!te.qpro||Z<21)){var ie=G.read_shift(1);G.l+=17,G.l+=1,G.l+=2;var _e=G.read_shift(Z-21,"cstr");return[ie,_e]}}function oe(G,Z){for(var te={},ie=G.l+Z;G.l<ie;){var _e=G.read_shift(2);if(_e==14e3){for(te[_e]=[0,""],te[_e][0]=G.read_shift(2);G[G.l];)te[_e][1]+=String.fromCharCode(G[G.l]),G.l++;G.l++}}return te}function ue(G,Z){var te=tt(5+G.length);te.write_shift(2,14e3),te.write_shift(2,Z);for(var ie=0;ie<G.length;++ie){var _e=G.charCodeAt(ie);te[te.l++]=_e>127?95:_e}return te[te.l++]=0,te}var ge={0:{n:"BOF",f:cee},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:p},14:{n:"NUMBER",f:x},15:{n:"LABEL",f:h},16:{n:"FORMULA",f:_},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:h},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:re},222:{n:"SHEETNAMELP",f:q},65535:{n:""}},j={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:F},23:{n:"NUMBER17",f:R},24:{n:"NUMBER18",f:M},25:{n:"FORMULA19",f:H},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:oe},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:P},38:{n:"??"},39:{n:"NUMBER27",f:O},40:{n:"FORMULA28",f:B},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:re},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:X},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:i,book_to_wk3:r,to_workbook:e}})(),Rwe=/^\s|\s$|[\t\n\r]/;function gee(n,e){if(!e.bookSST)return"";var t=[Er];t[t.length]=vt("sst",null,{xmlns:j1[0],count:n.Count,uniqueCount:n.Unique});for(var i=0;i!=n.length;++i)if(n[i]!=null){var r=n[i],s="<si>";r.r?s+=r.r:(s+="<t",r.t||(r.t=""),r.t.match(Rwe)&&(s+=' xml:space="preserve"'),s+=">"+ni(r.t)+"</t>"),s+="</si>",t[t.length]=s}return t.length>2&&(t[t.length]="</sst>",t[1]=t[1].replace("/>",">")),t.join("")}function Nwe(n){return[n.read_shift(4),n.read_shift(4)]}function kwe(n,e){return e||(e=tt(8)),e.write_shift(4,n.Count),e.write_shift(4,n.Unique),e}var Mwe=EEe;function Fwe(n){var e=Fa();lt(e,159,kwe(n));for(var t=0;t<n.length;++t)lt(e,19,Mwe(n[t]));return lt(e,160),e.end()}function Uwe(n){for(var e=[],t=n.split(""),i=0;i<t.length;++i)e[i]=t[i].charCodeAt(0);return e}function mee(n){var e=0,t,i=Uwe(n),r=i.length+1,s,a,o,l,c;for(t=Wm(r),t[0]=i.length,s=1;s!=r;++s)t[s]=i[s-1];for(s=r-1;s>=0;--s)a=t[s],o=(e&16384)===0?0:1,l=e<<1&32767,c=o|l,e=c^a;return e^52811}var Pwe=(function(){function n(r,s){switch(s.type){case"base64":return e(Vh(r),s);case"binary":return e(r,s);case"buffer":return e(Vn&&Buffer.isBuffer(r)?r.toString("binary"):nE(r),s);case"array":return e(KI(r),s)}throw new Error("Unrecognized type "+s.type)}function e(r,s){var a=s||{},o=a.dense?[]:{},l=r.match(/\\trowd.*?\\row\b/g);if(!l.length)throw new Error("RTF missing table");var c={s:{c:0,r:0},e:{c:0,r:l.length-1}};return l.forEach(function(h,f){Array.isArray(o)&&(o[f]=[]);for(var p=/\\\w+\b/g,y=0,x,v=-1;x=p.exec(h);){switch(x[0]){case"\\cell":var _=h.slice(y,p.lastIndex-x[0].length);if(_[0]==" "&&(_=_.slice(1)),++v,_.length){var E={v:_,t:"s"};Array.isArray(o)?o[f][v]=E:o[ii({r:f,c:v})]=E}break}y=p.lastIndex}v>c.e.c&&(c.e.c=v)}),o["!ref"]=br(c),o}function t(r,s){return n0(n(r,s),s)}function i(r){for(var s=["{\\rtf1\\ansi"],a=Ri(r["!ref"]),o,l=Array.isArray(r),c=a.s.r;c<=a.e.r;++c){s.push("\\trowd\\trautofit1");for(var h=a.s.c;h<=a.e.c;++h)s.push("\\cellx"+(h+1));for(s.push("\\pard\\intbl"),h=a.s.c;h<=a.e.c;++h){var f=ii({r:c,c:h});o=l?(r[c]||[])[h]:r[f],!(!o||o.v==null&&(!o.f||o.F))&&(s.push(" "+(o.w||(Wh(o),o.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:t,to_sheet:n,from_sheet:i}})();function lG(n){for(var e=0,t=1;e!=3;++e)t=t*256+(n[e]>255?255:n[e]<0?0:n[e]);return t.toString(16).toUpperCase().slice(1)}var Lwe=6,Rh=Lwe;function nC(n){return Math.floor((n+Math.round(128/Rh)/256)*Rh)}function iC(n){return Math.floor((n-5)/Rh*100+.5)/100}function ZU(n){return Math.round((n*Rh+5)/Rh*256)/256}function ML(n){n.width?(n.wpx=nC(n.width),n.wch=iC(n.wpx),n.MDW=Rh):n.wpx?(n.wch=iC(n.wpx),n.width=ZU(n.wch),n.MDW=Rh):typeof n.wch=="number"&&(n.width=ZU(n.wch),n.wpx=nC(n.width),n.MDW=Rh),n.customWidth&&delete n.customWidth}var Owe=96,yee=Owe;function rC(n){return n*96/yee}function vee(n){return n*yee/96}function Bwe(n){var e=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var i=t[0];i<=t[1];++i)n[i]!=null&&(e[e.length]=vt("numFmt",null,{numFmtId:i,formatCode:ni(n[i])}))}),e.length===1?"":(e[e.length]="</numFmts>",e[0]=vt("numFmts",null,{count:e.length-2}).replace("/>",">"),e.join(""))}function Vwe(n){var e=[];return e[e.length]=vt("cellXfs",null),n.forEach(function(t){e[e.length]=vt("xf",null,t)}),e[e.length]="</cellXfs>",e.length===2?"":(e[0]=vt("cellXfs",null,{count:e.length-2}).replace("/>",">"),e.join(""))}function _ee(n,e){var t=[Er,vt("styleSheet",null,{xmlns:j1[0],"xmlns:vt":Qr.vt})],i;return n.SSF&&(i=Bwe(n.SSF))!=null&&(t[t.length]=i),t[t.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',t[t.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',t[t.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',t[t.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(i=Vwe(e.cellXfs))&&(t[t.length]=i),t[t.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',t[t.length]='<dxfs count="0"/>',t[t.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',t.length>2&&(t[t.length]="</styleSheet>",t[1]=t[1].replace("/>",">")),t.join("")}function Wwe(n,e){var t=n.read_shift(2),i=$s(n);return[t,i]}function Hwe(n,e,t){t||(t=tt(6+4*e.length)),t.write_shift(2,n),ns(e,t);var i=t.length>t.l?t.slice(0,t.l):t;return t.l==null&&(t.l=t.length),i}function zwe(n,e,t){var i={};i.sz=n.read_shift(2)/20;var r=REe(n);r.fItalic&&(i.italic=1),r.fCondense&&(i.condense=1),r.fExtend&&(i.extend=1),r.fShadow&&(i.shadow=1),r.fOutline&&(i.outline=1),r.fStrikeout&&(i.strike=1);var s=n.read_shift(2);switch(s===700&&(i.bold=1),n.read_shift(2)){case 1:i.vertAlign="superscript";break;case 2:i.vertAlign="subscript";break}var a=n.read_shift(1);a!=0&&(i.underline=a);var o=n.read_shift(1);o>0&&(i.family=o);var l=n.read_shift(1);switch(l>0&&(i.charset=l),n.l++,i.color=IEe(n),n.read_shift(1)){case 1:i.scheme="major";break;case 2:i.scheme="minor";break}return i.name=$s(n),i}function Gwe(n,e){e||(e=tt(153)),e.write_shift(2,n.sz*20),NEe(n,e),e.write_shift(2,n.bold?700:400);var t=0;n.vertAlign=="superscript"?t=1:n.vertAlign=="subscript"&&(t=2),e.write_shift(2,t),e.write_shift(1,n.underline||0),e.write_shift(1,n.family||0),e.write_shift(1,n.charset||0),e.write_shift(1,0),eC(n.color,e);var i=0;return i=2,e.write_shift(1,i),ns(n.name,e),e.length>e.l?e.slice(0,e.l):e}var qwe=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],hM,$we=hu;function cG(n,e){e||(e=tt(84)),hM||(hM=bL(qwe));var t=hM[n.patternType];t==null&&(t=40),e.write_shift(4,t);var i=0;if(t!=40)for(eC({auto:1},e),eC({auto:1},e);i<12;++i)e.write_shift(4,0);else{for(;i<4;++i)e.write_shift(4,0);for(;i<12;++i)e.write_shift(4,0)}return e.length>e.l?e.slice(0,e.l):e}function jwe(n,e){var t=n.l+e,i=n.read_shift(2),r=n.read_shift(2);return n.l=t,{ixfe:i,numFmtId:r}}function xee(n,e,t){t||(t=tt(16)),t.write_shift(2,e||0),t.write_shift(2,n.numFmtId||0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);var i=0;return t.write_shift(1,i),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(1,0),t}function vx(n,e){return e||(e=tt(10)),e.write_shift(1,0),e.write_shift(1,0),e.write_shift(4,0),e.write_shift(4,0),e}var Xwe=hu;function Kwe(n,e){return e||(e=tt(51)),e.write_shift(1,0),vx(null,e),vx(null,e),vx(null,e),vx(null,e),vx(null,e),e.length>e.l?e.slice(0,e.l):e}function Ywe(n,e){return e||(e=tt(52)),e.write_shift(4,n.xfId),e.write_shift(2,1),e.write_shift(1,0),e.write_shift(1,0),ZD(n.name||"",e),e.length>e.l?e.slice(0,e.l):e}function Jwe(n,e,t){var i=tt(2052);return i.write_shift(4,n),ZD(e,i),ZD(t,i),i.length>i.l?i.slice(0,i.l):i}function Qwe(n,e){if(e){var t=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(i){for(var r=i[0];r<=i[1];++r)e[r]!=null&&++t}),t!=0&&(lt(n,615,ic(t)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(i){for(var r=i[0];r<=i[1];++r)e[r]!=null&&lt(n,44,Hwe(r,e[r]))}),lt(n,616))}}function Zwe(n){var e=1;lt(n,611,ic(e)),lt(n,43,Gwe({sz:12,color:{theme:1},name:"Calibri",family:2})),lt(n,612)}function eAe(n){var e=2;lt(n,603,ic(e)),lt(n,45,cG({patternType:"none"})),lt(n,45,cG({patternType:"gray125"})),lt(n,604)}function tAe(n){var e=1;lt(n,613,ic(e)),lt(n,46,Kwe()),lt(n,614)}function nAe(n){var e=1;lt(n,626,ic(e)),lt(n,47,xee({numFmtId:0},65535)),lt(n,627)}function iAe(n,e){lt(n,617,ic(e.length)),e.forEach(function(t){lt(n,47,xee(t,0))}),lt(n,618)}function rAe(n){var e=1;lt(n,619,ic(e)),lt(n,48,Ywe({xfId:0,name:"Normal"})),lt(n,620)}function sAe(n){var e=0;lt(n,505,ic(e)),lt(n,506)}function aAe(n){var e=0;lt(n,508,Jwe(e,"TableStyleMedium9","PivotStyleMedium4")),lt(n,509)}function oAe(n,e){var t=Fa();return lt(t,278),Qwe(t,n.SSF),Zwe(t),eAe(t),tAe(t),nAe(t),iAe(t,e.cellXfs),rAe(t),sAe(t),aAe(t),lt(t,279),t.end()}function bee(n,e){if(e&&e.themeXLSX)return e.themeXLSX;if(n&&typeof n.raw=="string")return n.raw;var t=[Er];return t[t.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',t[t.length]="<a:themeElements>",t[t.length]='<a:clrScheme name="Office">',t[t.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',t[t.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',t[t.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',t[t.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',t[t.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',t[t.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',t[t.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',t[t.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',t[t.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',t[t.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',t[t.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',t[t.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',t[t.length]="</a:clrScheme>",t[t.length]='<a:fontScheme name="Office">',t[t.length]="<a:majorFont>",t[t.length]='<a:latin typeface="Cambria"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',t[t.length]='<a:font script="Hang" typeface="맑은 고딕"/>',t[t.length]='<a:font script="Hans" typeface="宋体"/>',t[t.length]='<a:font script="Hant" typeface="新細明體"/>',t[t.length]='<a:font script="Arab" typeface="Times New Roman"/>',t[t.length]='<a:font script="Hebr" typeface="Times New Roman"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="MoolBoran"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:majorFont>",t[t.length]="<a:minorFont>",t[t.length]='<a:latin typeface="Calibri"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',t[t.length]='<a:font script="Hang" typeface="맑은 고딕"/>',t[t.length]='<a:font script="Hans" typeface="宋体"/>',t[t.length]='<a:font script="Hant" typeface="新細明體"/>',t[t.length]='<a:font script="Arab" typeface="Arial"/>',t[t.length]='<a:font script="Hebr" typeface="Arial"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Arial"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:minorFont>",t[t.length]="</a:fontScheme>",t[t.length]='<a:fmtScheme name="Office">',t[t.length]="<a:fillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="1"/>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="0"/>',t[t.length]="</a:gradFill>",t[t.length]="</a:fillStyleLst>",t[t.length]="<a:lnStyleLst>",t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]="</a:lnStyleLst>",t[t.length]="<a:effectStyleLst>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',t[t.length]="</a:effectStyle>",t[t.length]="</a:effectStyleLst>",t[t.length]="<a:bgFillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]="</a:bgFillStyleLst>",t[t.length]="</a:fmtScheme>",t[t.length]="</a:themeElements>",t[t.length]="<a:objectDefaults>",t[t.length]="<a:spDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',t[t.length]="</a:spDef>",t[t.length]="<a:lnDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',t[t.length]="</a:lnDef>",t[t.length]="</a:objectDefaults>",t[t.length]="<a:extraClrSchemeLst/>",t[t.length]="</a:theme>",t.join("")}function lAe(n,e){return{flags:n.read_shift(4),version:n.read_shift(4),name:$s(n)}}function cAe(n){var e=tt(12+2*n.name.length);return e.write_shift(4,n.flags),e.write_shift(4,n.version),ns(n.name,e),e.slice(0,e.l)}function uAe(n){for(var e=[],t=n.read_shift(4);t-- >0;)e.push([n.read_shift(4),n.read_shift(4)]);return e}function hAe(n){var e=tt(4+8*n.length);e.write_shift(4,n.length);for(var t=0;t<n.length;++t)e.write_shift(4,n[t][0]),e.write_shift(4,n[t][1]);return e}function dAe(n,e){var t=tt(8+2*e.length);return t.write_shift(4,n),ns(e,t),t.slice(0,t.l)}function fAe(n){return n.l+=4,n.read_shift(4)!=0}function pAe(n,e){var t=tt(8);return t.write_shift(4,n),t.write_shift(4,1),t}function gAe(){var n=Fa();return lt(n,332),lt(n,334,ic(1)),lt(n,335,cAe({name:"XLDAPR",version:12e4,flags:3496657072})),lt(n,336),lt(n,339,dAe(1,"XLDAPR")),lt(n,52),lt(n,35,ic(514)),lt(n,4096,ic(0)),lt(n,4097,sl(1)),lt(n,36),lt(n,53),lt(n,340),lt(n,337,pAe(1)),lt(n,51,hAe([[1,0]])),lt(n,338),lt(n,333),n.end()}function Tee(){var n=[Er];return n.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
  <metadataTypes count="1">
    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>
  </metadataTypes>
  <futureMetadata name="XLDAPR" count="1">
    <bk>
      <extLst>
        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">
          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>
        </ext>
      </extLst>
    </bk>
  </futureMetadata>
  <cellMetadata count="1">
    <bk>
      <rc t="1" v="0"/>
    </bk>
  </cellMetadata>
</metadata>`),n.join("")}function mAe(n){var e={};e.i=n.read_shift(4);var t={};t.r=n.read_shift(4),t.c=n.read_shift(4),e.r=ii(t);var i=n.read_shift(1);return i&2&&(e.l="1"),i&8&&(e.a="1"),e}var Ay=1024;function Eee(n,e){for(var t=[21600,21600],i=["m0,0l0",t[1],t[0],t[1],t[0],"0xe"].join(","),r=[vt("xml",null,{"xmlns:v":_o.v,"xmlns:o":_o.o,"xmlns:x":_o.x,"xmlns:mv":_o.mv}).replace(/\/>/,">"),vt("o:shapelayout",vt("o:idmap",null,{"v:ext":"edit",data:n}),{"v:ext":"edit"}),vt("v:shapetype",[vt("v:stroke",null,{joinstyle:"miter"}),vt("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:t.join(","),path:i})];Ay<n*1e3;)Ay+=1e3;return e.forEach(function(s){var a=ts(s[0]),o={color2:"#BEFF82",type:"gradient"};o.type=="gradient"&&(o.angle="-180");var l=o.type=="gradient"?vt("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,c=vt("v:fill",l,o),h={on:"t",obscured:"t"};++Ay,r=r.concat(["<v:shape"+Fb({id:"_x0000_s"+Ay,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(s[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",c,vt("v:shadow",null,h),vt("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",Ss("x:Anchor",[a.c+1,0,a.r+1,0,a.c+3,20,a.r+5,20].join(",")),Ss("x:AutoFill","False"),Ss("x:Row",String(a.r)),Ss("x:Column",String(a.c)),s[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),r.push("</xml>"),r.join("")}function wee(n){var e=[Er,vt("comments",null,{xmlns:j1[0]})],t=[];return e.push("<authors>"),n.forEach(function(i){i[1].forEach(function(r){var s=ni(r.a);t.indexOf(s)==-1&&(t.push(s),e.push("<author>"+s+"</author>")),r.T&&r.ID&&t.indexOf("tc="+r.ID)==-1&&(t.push("tc="+r.ID),e.push("<author>tc="+r.ID+"</author>"))})}),t.length==0&&(t.push("SheetJ5"),e.push("<author>SheetJ5</author>")),e.push("</authors>"),e.push("<commentList>"),n.forEach(function(i){var r=0,s=[];if(i[1][0]&&i[1][0].T&&i[1][0].ID?r=t.indexOf("tc="+i[1][0].ID):i[1].forEach(function(l){l.a&&(r=t.indexOf(ni(l.a))),s.push(l.t||"")}),e.push('<comment ref="'+i[0]+'" authorId="'+r+'"><text>'),s.length<=1)e.push(Ss("t",ni(s[0]||"")));else{for(var a=`Comment:
    `+s[0]+`
`,o=1;o<s.length;++o)a+=`Reply:
    `+s[o]+`
`;e.push(Ss("t",ni(a)))}e.push("</text></comment>")}),e.push("</commentList>"),e.length>2&&(e[e.length]="</comments>",e[1]=e[1].replace("/>",">")),e.join("")}function yAe(n,e,t){var i=[Er,vt("ThreadedComments",null,{xmlns:Qr.TCMNT}).replace(/[\/]>/,">")];return n.forEach(function(r){var s="";(r[1]||[]).forEach(function(a,o){if(!a.T){delete a.ID;return}a.a&&e.indexOf(a.a)==-1&&e.push(a.a);var l={ref:r[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+t.tcid++).slice(-12)+"}"};o==0?s=l.id:l.parentId=s,a.ID=l.id,a.a&&(l.personId="{54EE7950-7262-4200-6969-"+("000000000000"+e.indexOf(a.a)).slice(-12)+"}"),i.push(vt("threadedComment",Ss("text",a.t||""),l))})}),i.push("</ThreadedComments>"),i.join("")}function vAe(n){var e=[Er,vt("personList",null,{xmlns:Qr.TCMNT,"xmlns:x":j1[0]}).replace(/[\/]>/,">")];return n.forEach(function(t,i){e.push(vt("person",null,{displayName:t,id:"{54EE7950-7262-4200-6969-"+("000000000000"+i).slice(-12)+"}",userId:t,providerId:"None"}))}),e.push("</personList>"),e.join("")}function _Ae(n){var e={};e.iauthor=n.read_shift(4);var t=a0(n);return e.rfx=t.s,e.ref=ii(t.s),n.l+=16,e}function xAe(n,e){return e==null&&(e=tt(36)),e.write_shift(4,n[1].iauthor),K1(n[0],e),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e}var bAe=$s;function TAe(n){return ns(n.slice(0,54))}function EAe(n){var e=Fa(),t=[];return lt(e,628),lt(e,630),n.forEach(function(i){i[1].forEach(function(r){t.indexOf(r.a)>-1||(t.push(r.a.slice(0,54)),lt(e,632,TAe(r.a)))})}),lt(e,631),lt(e,633),n.forEach(function(i){i[1].forEach(function(r){r.iauthor=t.indexOf(r.a);var s={s:ts(i[0]),e:ts(i[0])};lt(e,635,xAe([s,r])),r.t&&r.t.length>0&&lt(e,637,AEe(r)),lt(e,636),delete r.iauthor})}),lt(e,634),lt(e,629),e.end()}function wAe(n,e){e.FullPaths.forEach(function(t,i){if(i!=0){var r=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");r.slice(-1)!=="/"&&fi.utils.cfb_add(n,r,e.FileIndex[i].content)}})}var Aee=["xlsb","xlsm","xlam","biff8","xla"],AAe=(function(){var n=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function t(i,r,s,a){var o=!1,l=!1;s.length==0?l=!0:s.charAt(0)=="["&&(l=!0,s=s.slice(1,-1)),a.length==0?o=!0:a.charAt(0)=="["&&(o=!0,a=a.slice(1,-1));var c=s.length>0?parseInt(s,10)|0:0,h=a.length>0?parseInt(a,10)|0:0;return o?h+=e.c:--h,l?c+=e.r:--c,r+(o?"":"$")+qs(h)+(l?"":"$")+Is(c)}return function(r,s){return e=s,r.replace(n,t)}})(),FL=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,UL=(function(){return function(e,t){return e.replace(FL,function(i,r,s,a,o,l){var c=CL(a)-(s?0:t.c),h=DL(l)-(o?0:t.r),f=h==0?"":o?h+1:"["+h+"]",p=c==0?"":s?c+1:"["+c+"]";return r+"R"+f+"C"+p})}})();function SAe(n,e){return n.replace(FL,function(t,i,r,s,a,o){return i+(r=="$"?r+s:qs(CL(s)+e.c))+(a=="$"?a+o:Is(DL(o)+e.r))})}function DAe(n){return n.length!=1}function dr(n){n.l+=1}function sp(n,e){var t=n.read_shift(2);return[t&16383,t>>14&1,t>>15&1]}function See(n,e,t){var i=2;if(t){if(t.biff>=2&&t.biff<=5)return Dee(n);t.biff==12&&(i=4)}var r=n.read_shift(i),s=n.read_shift(i),a=sp(n),o=sp(n);return{s:{r,c:a[0],cRel:a[1],rRel:a[2]},e:{r:s,c:o[0],cRel:o[1],rRel:o[2]}}}function Dee(n){var e=sp(n),t=sp(n),i=n.read_shift(1),r=n.read_shift(1);return{s:{r:e[0],c:i,cRel:e[1],rRel:e[2]},e:{r:t[0],c:r,cRel:t[1],rRel:t[2]}}}function CAe(n,e,t){if(t.biff<8)return Dee(n);var i=n.read_shift(t.biff==12?4:2),r=n.read_shift(t.biff==12?4:2),s=sp(n),a=sp(n);return{s:{r:i,c:s[0],cRel:s[1],rRel:s[2]},e:{r,c:a[0],cRel:a[1],rRel:a[2]}}}function Cee(n,e,t){if(t&&t.biff>=2&&t.biff<=5)return IAe(n);var i=n.read_shift(t&&t.biff==12?4:2),r=sp(n);return{r:i,c:r[0],cRel:r[1],rRel:r[2]}}function IAe(n){var e=sp(n),t=n.read_shift(1);return{r:e[0],c:t,cRel:e[1],rRel:e[2]}}function RAe(n){var e=n.read_shift(2),t=n.read_shift(2);return{r:e,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function NAe(n,e,t){var i=t&&t.biff?t.biff:8;if(i>=2&&i<=5)return kAe(n);var r=n.read_shift(i>=12?4:2),s=n.read_shift(2),a=(s&16384)>>14,o=(s&32768)>>15;if(s&=16383,o==1)for(;r>524287;)r-=1048576;if(a==1)for(;s>8191;)s=s-16384;return{r,c:s,cRel:a,rRel:o}}function kAe(n){var e=n.read_shift(2),t=n.read_shift(1),i=(e&32768)>>15,r=(e&16384)>>14;return e&=16383,i==1&&e>=8192&&(e=e-16384),r==1&&t>=128&&(t=t-256),{r:e,c:t,cRel:r,rRel:i}}function MAe(n,e,t){var i=(n[n.l++]&96)>>5,r=See(n,t.biff>=2&&t.biff<=5?6:8,t);return[i,r]}function FAe(n,e,t){var i=(n[n.l++]&96)>>5,r=n.read_shift(2,"i"),s=8;if(t)switch(t.biff){case 5:n.l+=12,s=6;break;case 12:s=12;break}var a=See(n,s,t);return[i,r,a]}function UAe(n,e,t){var i=(n[n.l++]&96)>>5;return n.l+=t&&t.biff>8?12:t.biff<8?6:8,[i]}function PAe(n,e,t){var i=(n[n.l++]&96)>>5,r=n.read_shift(2),s=8;if(t)switch(t.biff){case 5:n.l+=12,s=6;break;case 12:s=12;break}return n.l+=s,[i,r]}function LAe(n,e,t){var i=(n[n.l++]&96)>>5,r=CAe(n,e-1,t);return[i,r]}function OAe(n,e,t){var i=(n[n.l++]&96)>>5;return n.l+=t.biff==2?6:t.biff==12?14:7,[i]}function uG(n){var e=n[n.l+1]&1,t=1;return n.l+=4,[e,t]}function BAe(n,e,t){n.l+=2;for(var i=n.read_shift(t&&t.biff==2?1:2),r=[],s=0;s<=i;++s)r.push(n.read_shift(t&&t.biff==2?1:2));return r}function VAe(n,e,t){var i=n[n.l+1]&255?1:0;return n.l+=2,[i,n.read_shift(t&&t.biff==2?1:2)]}function WAe(n,e,t){var i=n[n.l+1]&255?1:0;return n.l+=2,[i,n.read_shift(t&&t.biff==2?1:2)]}function HAe(n){var e=n[n.l+1]&255?1:0;return n.l+=2,[e,n.read_shift(2)]}function zAe(n,e,t){var i=n[n.l+1]&255?1:0;return n.l+=t&&t.biff==2?3:4,[i]}function Iee(n){var e=n.read_shift(1),t=n.read_shift(1);return[e,t]}function GAe(n){return n.read_shift(2),Iee(n)}function qAe(n){return n.read_shift(2),Iee(n)}function $Ae(n,e,t){var i=(n[n.l]&96)>>5;n.l+=1;var r=Cee(n,0,t);return[i,r]}function jAe(n,e,t){var i=(n[n.l]&96)>>5;n.l+=1;var r=NAe(n,0,t);return[i,r]}function XAe(n,e,t){var i=(n[n.l]&96)>>5;n.l+=1;var r=n.read_shift(2);t&&t.biff==5&&(n.l+=12);var s=Cee(n,0,t);return[i,r,s]}function KAe(n,e,t){var i=(n[n.l]&96)>>5;n.l+=1;var r=n.read_shift(t&&t.biff<=3?1:2);return[KSe[r],kee[r],i]}function YAe(n,e,t){var i=n[n.l++],r=n.read_shift(1),s=t&&t.biff<=3?[i==88?-1:0,n.read_shift(1)]:JAe(n);return[r,(s[0]===0?kee:XSe)[s[1]]]}function JAe(n){return[n[n.l+1]>>7,n.read_shift(2)&32767]}function QAe(n,e,t){n.l+=t&&t.biff==2?3:4}function ZAe(n,e,t){if(n.l++,t&&t.biff==12)return[n.read_shift(4,"i"),0];var i=n.read_shift(2),r=n.read_shift(t&&t.biff==2?1:2);return[i,r]}function eSe(n){return n.l++,sE[n.read_shift(1)]}function tSe(n){return n.l++,n.read_shift(2)}function nSe(n){return n.l++,n.read_shift(1)!==0}function iSe(n){return n.l++,Y1(n)}function rSe(n,e,t){return n.l++,hee(n,e-1,t)}function sSe(n,e){var t=[n.read_shift(1)];if(e==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break}switch(t[0]){case 4:t[1]=XEe(n,1)?"TRUE":"FALSE",e!=12&&(n.l+=7);break;case 37:case 16:t[1]=sE[n[n.l]],n.l+=e==12?4:8;break;case 0:n.l+=8;break;case 1:t[1]=Y1(n);break;case 2:t[1]=QEe(n,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function aSe(n,e,t){for(var i=n.read_shift(t.biff==12?4:2),r=[],s=0;s!=i;++s)r.push((t.biff==12?a0:twe)(n));return r}function oSe(n,e,t){var i=0,r=0;t.biff==12?(i=n.read_shift(4),r=n.read_shift(4)):(r=1+n.read_shift(1),i=1+n.read_shift(2)),t.biff>=2&&t.biff<8&&(--i,--r==0&&(r=256));for(var s=0,a=[];s!=i&&(a[s]=[]);++s)for(var o=0;o!=r;++o)a[s][o]=sSe(n,t.biff);return a}function lSe(n,e,t){var i=n.read_shift(1)>>>5&3,r=!t||t.biff>=8?4:2,s=n.read_shift(r);switch(t.biff){case 2:n.l+=5;break;case 3:case 4:n.l+=8;break;case 5:n.l+=12;break}return[i,0,s]}function cSe(n,e,t){if(t.biff==5)return uSe(n);var i=n.read_shift(1)>>>5&3,r=n.read_shift(2),s=n.read_shift(4);return[i,r,s]}function uSe(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2,"i");n.l+=8;var i=n.read_shift(2);return n.l+=12,[e,t,i]}function hSe(n,e,t){var i=n.read_shift(1)>>>5&3;n.l+=t&&t.biff==2?3:4;var r=n.read_shift(t&&t.biff==2?1:2);return[i,r]}function dSe(n,e,t){var i=n.read_shift(1)>>>5&3,r=n.read_shift(t&&t.biff==2?1:2);return[i,r]}function fSe(n,e,t){var i=n.read_shift(1)>>>5&3;return n.l+=4,t.biff<8&&n.l--,t.biff==12&&(n.l+=2),[i]}function pSe(n,e,t){var i=(n[n.l++]&96)>>5,r=n.read_shift(2),s=4;if(t)switch(t.biff){case 5:s=15;break;case 12:s=6;break}return n.l+=s,[i,r]}var gSe=hu,mSe=hu,ySe=hu;function aE(n,e,t){return n.l+=2,[RAe(n)]}function PL(n){return n.l+=6,[]}var vSe=aE,_Se=PL,xSe=PL,bSe=aE;function Ree(n){return n.l+=2,[cee(n),n.read_shift(2)&1]}var TSe=aE,ESe=Ree,wSe=PL,ASe=aE,SSe=aE,DSe=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function CSe(n){n.l+=2;var e=n.read_shift(2),t=n.read_shift(2),i=n.read_shift(4),r=n.read_shift(2),s=n.read_shift(2),a=DSe[t>>2&31];return{ixti:e,coltype:t&3,rt:a,idx:i,c:r,C:s}}function ISe(n){return n.l+=2,[n.read_shift(4)]}function RSe(n,e,t){return n.l+=5,n.l+=2,n.l+=t.biff==2?1:4,["PTGSHEET"]}function NSe(n,e,t){return n.l+=t.biff==2?4:5,["PTGENDSHEET"]}function kSe(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function MSe(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function FSe(n){return n.l+=4,[0,0]}var hG={1:{n:"PtgExp",f:ZAe},2:{n:"PtgTbl",f:ySe},3:{n:"PtgAdd",f:dr},4:{n:"PtgSub",f:dr},5:{n:"PtgMul",f:dr},6:{n:"PtgDiv",f:dr},7:{n:"PtgPower",f:dr},8:{n:"PtgConcat",f:dr},9:{n:"PtgLt",f:dr},10:{n:"PtgLe",f:dr},11:{n:"PtgEq",f:dr},12:{n:"PtgGe",f:dr},13:{n:"PtgGt",f:dr},14:{n:"PtgNe",f:dr},15:{n:"PtgIsect",f:dr},16:{n:"PtgUnion",f:dr},17:{n:"PtgRange",f:dr},18:{n:"PtgUplus",f:dr},19:{n:"PtgUminus",f:dr},20:{n:"PtgPercent",f:dr},21:{n:"PtgParen",f:dr},22:{n:"PtgMissArg",f:dr},23:{n:"PtgStr",f:rSe},26:{n:"PtgSheet",f:RSe},27:{n:"PtgEndSheet",f:NSe},28:{n:"PtgErr",f:eSe},29:{n:"PtgBool",f:nSe},30:{n:"PtgInt",f:tSe},31:{n:"PtgNum",f:iSe},32:{n:"PtgArray",f:OAe},33:{n:"PtgFunc",f:KAe},34:{n:"PtgFuncVar",f:YAe},35:{n:"PtgName",f:lSe},36:{n:"PtgRef",f:$Ae},37:{n:"PtgArea",f:MAe},38:{n:"PtgMemArea",f:hSe},39:{n:"PtgMemErr",f:gSe},40:{n:"PtgMemNoMem",f:mSe},41:{n:"PtgMemFunc",f:dSe},42:{n:"PtgRefErr",f:fSe},43:{n:"PtgAreaErr",f:UAe},44:{n:"PtgRefN",f:jAe},45:{n:"PtgAreaN",f:LAe},46:{n:"PtgMemAreaN",f:kSe},47:{n:"PtgMemNoMemN",f:MSe},57:{n:"PtgNameX",f:cSe},58:{n:"PtgRef3d",f:XAe},59:{n:"PtgArea3d",f:FAe},60:{n:"PtgRefErr3d",f:pSe},61:{n:"PtgAreaErr3d",f:PAe},255:{}},USe={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},PSe={1:{n:"PtgElfLel",f:Ree},2:{n:"PtgElfRw",f:ASe},3:{n:"PtgElfCol",f:vSe},6:{n:"PtgElfRwV",f:SSe},7:{n:"PtgElfColV",f:bSe},10:{n:"PtgElfRadical",f:TSe},11:{n:"PtgElfRadicalS",f:wSe},13:{n:"PtgElfColS",f:_Se},15:{n:"PtgElfColSV",f:xSe},16:{n:"PtgElfRadicalLel",f:ESe},25:{n:"PtgList",f:CSe},29:{n:"PtgSxName",f:ISe},255:{}},LSe={0:{n:"PtgAttrNoop",f:FSe},1:{n:"PtgAttrSemi",f:zAe},2:{n:"PtgAttrIf",f:WAe},4:{n:"PtgAttrChoose",f:BAe},8:{n:"PtgAttrGoto",f:VAe},16:{n:"PtgAttrSum",f:QAe},32:{n:"PtgAttrBaxcel",f:uG},33:{n:"PtgAttrBaxcel",f:uG},64:{n:"PtgAttrSpace",f:GAe},65:{n:"PtgAttrSpaceSemi",f:qAe},128:{n:"PtgAttrIfError",f:HAe},255:{}};function OSe(n,e,t,i){if(i.biff<8)return hu(n,e);for(var r=n.l+e,s=[],a=0;a!==t.length;++a)switch(t[a][0]){case"PtgArray":t[a][1]=oSe(n,0,i),s.push(t[a][1]);break;case"PtgMemArea":t[a][2]=aSe(n,t[a][1],i),s.push(t[a][2]);break;case"PtgExp":i&&i.biff==12&&(t[a][1][1]=n.read_shift(4),s.push(t[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[a][0]}return e=r-n.l,e!==0&&s.push(hu(n,e)),s}function BSe(n,e,t){for(var i=n.l+e,r,s,a=[];i!=n.l;)e=i-n.l,s=n[n.l],r=hG[s]||hG[USe[s]],(s===24||s===25)&&(r=(s===24?PSe:LSe)[n[n.l+1]]),!r||!r.f?hu(n,e):a.push([r.n,r.f(n,e,t)]);return a}function VSe(n){for(var e=[],t=0;t<n.length;++t){for(var i=n[t],r=[],s=0;s<i.length;++s){var a=i[s];if(a)switch(a[0]){case 2:r.push('"'+a[1].replace(/"/g,'""')+'"');break;default:r.push(a[1])}else r.push("")}e.push(r.join(","))}return e.join(";")}var WSe={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function HSe(n,e){if(!n&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(n)?"'"+n+"'":n}function Nee(n,e,t){if(!n)return"SH33TJSERR0";if(t.biff>8&&(!n.XTI||!n.XTI[e]))return n.SheetNames[e];if(!n.XTI)return"SH33TJSERR6";var i=n.XTI[e];if(t.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":n.XTI[e-1];if(!i)return"SH33TJSERR1";var r="";if(t.biff>8)switch(n[i[0]][0]){case 357:return r=i[1]==-1?"#REF":n.SheetNames[i[1]],i[1]==i[2]?r:r+":"+n.SheetNames[i[2]];case 358:return t.SID!=null?n.SheetNames[t.SID]:"SH33TJSSAME"+n[i[0]][0];case 355:default:return"SH33TJSSRC"+n[i[0]][0]}switch(n[i[0]][0][0]){case 1025:return r=i[1]==-1?"#REF":n.SheetNames[i[1]]||"SH33TJSERR3",i[1]==i[2]?r:r+":"+n.SheetNames[i[2]];case 14849:return n[i[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return n[i[0]][0][3]?(r=i[1]==-1?"#REF":n[i[0]][0][3][i[1]]||"SH33TJSERR4",i[1]==i[2]?r:r+":"+n[i[0]][0][3][i[2]]):"SH33TJSERR2"}}function dG(n,e,t){var i=Nee(n,e,t);return i=="#REF"?i:HSe(i,t)}function A1(n,e,t,i,r){var s=r&&r.biff||8,a={s:{c:0,r:0}},o=[],l,c,h,f=0,p=0,y,x="";if(!n[0]||!n[0][0])return"";for(var v=-1,_="",E=0,w=n[0].length;E<w;++E){var A=n[0][E];switch(A[0]){case"PtgUminus":o.push("-"+o.pop());break;case"PtgUplus":o.push("+"+o.pop());break;case"PtgPercent":o.push(o.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(l=o.pop(),c=o.pop(),v>=0){switch(n[0][v][1][0]){case 0:_=Ji(" ",n[0][v][1][1]);break;case 1:_=Ji("\r",n[0][v][1][1]);break;default:if(_="",r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][v][1][0])}c=c+_,v=-1}o.push(c+WSe[A[0]]+l);break;case"PtgIsect":l=o.pop(),c=o.pop(),o.push(c+" "+l);break;case"PtgUnion":l=o.pop(),c=o.pop(),o.push(c+","+l);break;case"PtgRange":l=o.pop(),c=o.pop(),o.push(c+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":h=rb(A[1][1],a,r),o.push(sb(h,s));break;case"PtgRefN":h=t?rb(A[1][1],t,r):A[1][1],o.push(sb(h,s));break;case"PtgRef3d":f=A[1][1],h=rb(A[1][2],a,r),x=dG(i,f,r),o.push(x+"!"+sb(h,s));break;case"PtgFunc":case"PtgFuncVar":var N=A[1][0],k=A[1][1];N||(N=0),N&=127;var F=N==0?[]:o.slice(-N);o.length-=N,k==="User"&&(k=F.shift()),o.push(k+"("+F.join(",")+")");break;case"PtgBool":o.push(A[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(A[1]);break;case"PtgNum":o.push(String(A[1]));break;case"PtgStr":o.push('"'+A[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(A[1]);break;case"PtgAreaN":y=Yz(A[1][1],t?{s:t}:a,r),o.push(cM(y,r));break;case"PtgArea":y=Yz(A[1][1],a,r),o.push(cM(y,r));break;case"PtgArea3d":f=A[1][1],y=A[1][2],x=dG(i,f,r),o.push(x+"!"+cM(y,r));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":p=A[1][2];var C=(i.names||[])[p-1]||(i[0]||[])[p],M=C?C.Name:"SH33TJSNAME"+String(p);M&&M.slice(0,6)=="_xlfn."&&!r.xlfn&&(M=M.slice(6)),o.push(M);break;case"PtgNameX":var R=A[1][1];p=A[1][2];var L;if(r.biff<=5)R<0&&(R=-R),i[R]&&(L=i[R][p]);else{var H="";if(((i[R]||[])[0]||[])[0]==14849||(((i[R]||[])[0]||[])[0]==1025?i[R][p]&&i[R][p].itab>0&&(H=i.SheetNames[i[R][p].itab-1]+"!"):H=i.SheetNames[p-1]+"!"),i[R]&&i[R][p])H+=i[R][p].Name;else if(i[0]&&i[0][p])H+=i[0][p].Name;else{var P=(Nee(i,R,r)||"").split(";;");P[p-1]?H=P[p-1]:H+="SH33TJSERRX"}o.push(H);break}L||(L={Name:"SH33TJSERRY"}),o.push(L.Name);break;case"PtgParen":var O="(",B=")";if(v>=0){switch(_="",n[0][v][1][0]){case 2:O=Ji(" ",n[0][v][1][1])+O;break;case 3:O=Ji("\r",n[0][v][1][1])+O;break;case 4:B=Ji(" ",n[0][v][1][1])+B;break;case 5:B=Ji("\r",n[0][v][1][1])+B;break;default:if(r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][v][1][0])}v=-1}o.push(O+o.pop()+B);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":h={c:A[1][1],r:A[1][0]};var re={c:t.c,r:t.r};if(i.sharedf[ii(h)]){var q=i.sharedf[ii(h)];o.push(A1(q,a,re,i,r))}else{var X=!1;for(l=0;l!=i.arrayf.length;++l)if(c=i.arrayf[l],!(h.c<c[0].s.c||h.c>c[0].e.c)&&!(h.r<c[0].s.r||h.r>c[0].e.r)){o.push(A1(c[1],a,re,i,r)),X=!0;break}X||o.push(A[1])}break;case"PtgArray":o.push("{"+VSe(A[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":v=E;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+A[1].idx+"[#"+A[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(A));default:throw new Error("Unrecognized Formula Token: "+String(A))}var oe=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(r.biff!=3&&v>=0&&oe.indexOf(n[0][E][0])==-1){A=n[0][v];var ue=!0;switch(A[1][0]){case 4:ue=!1;case 0:_=Ji(" ",A[1][1]);break;case 5:ue=!1;case 1:_=Ji("\r",A[1][1]);break;default:if(_="",r.WTF)throw new Error("Unexpected PtgAttrSpaceType "+A[1][0])}o.push((ue?_:"")+o.pop()+(ue?"":_)),v=-1}}if(o.length>1&&r.WTF)throw new Error("bad formula stack");return o[0]}function zSe(n){if(n==null){var e=tt(8);return e.write_shift(1,3),e.write_shift(1,0),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,65535),e}else if(typeof n=="number")return Hm(n);return Hm(0)}function GSe(n,e,t,i,r){var s=zm(e,t,r),a=zSe(n.v),o=tt(6),l=33;o.write_shift(2,l),o.write_shift(4,0);for(var c=tt(n.bf.length),h=0;h<n.bf.length;++h)c[h]=n.bf[h];var f=As([s,a,o,c]);return f}function YI(n,e,t){var i=n.read_shift(4),r=BSe(n,i,t),s=n.read_shift(4),a=s>0?OSe(n,s,r,t):null;return[r,a]}var qSe=YI,JI=YI,$Se=YI,jSe=YI,XSe={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},kee={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},KSe={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function YSe(n){var e="of:="+n.replace(FL,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return e.replace(/;/g,"|").replace(/,/g,";")}function JSe(n){return n.replace(/\./,"!")}var ab=typeof Map<"u";function LL(n,e,t){var i=0,r=n.length;if(t){if(ab?t.has(e):Object.prototype.hasOwnProperty.call(t,e)){for(var s=ab?t.get(e):t[e];i<s.length;++i)if(n[s[i]].t===e)return n.Count++,s[i]}}else for(;i<r;++i)if(n[i].t===e)return n.Count++,i;return n[r]={t:e},n.Count++,n.Unique++,t&&(ab?(t.has(e)||t.set(e,[]),t.get(e).push(r)):(Object.prototype.hasOwnProperty.call(t,e)||(t[e]=[]),t[e].push(r))),r}function QI(n,e){var t={min:n+1,max:n+1},i=-1;return e.MDW&&(Rh=e.MDW),e.width!=null?t.customWidth=1:e.wpx!=null?i=iC(e.wpx):e.wch!=null&&(i=e.wch),i>-1?(t.width=ZU(i),t.customWidth=1):e.width!=null&&(t.width=e.width),e.hidden&&(t.hidden=!0),e.level!=null&&(t.outlineLevel=t.level=e.level),t}function Mee(n,e){if(n){var t=[.7,.7,.75,.75,.3,.3];n.left==null&&(n.left=t[0]),n.right==null&&(n.right=t[1]),n.top==null&&(n.top=t[2]),n.bottom==null&&(n.bottom=t[3]),n.header==null&&(n.header=t[4]),n.footer==null&&(n.footer=t[5])}}function wp(n,e,t){var i=t.revssf[e.z!=null?e.z:"General"],r=60,s=n.length;if(i==null&&t.ssf){for(;r<392;++r)if(t.ssf[r]==null){CZ(e.z,r),t.ssf[r]=e.z,t.revssf[e.z]=i=r;break}}for(r=0;r!=s;++r)if(n[r].numFmtId===i)return r;return n[s]={numFmtId:i,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},s}function QSe(n,e,t){if(n&&n["!ref"]){var i=Ri(n["!ref"]);if(i.e.c<i.s.c||i.e.r<i.s.r)throw new Error("Bad range ("+t+"): "+n["!ref"])}}function ZSe(n){if(n.length===0)return"";for(var e='<mergeCells count="'+n.length+'">',t=0;t!=n.length;++t)e+='<mergeCell ref="'+br(n[t])+'"/>';return e+"</mergeCells>"}function eDe(n,e,t,i,r){var s=!1,a={},o=null;if(i.bookType!=="xlsx"&&e.vbaraw){var l=e.SheetNames[t];try{e.Workbook&&(l=e.Workbook.Sheets[t].CodeName||l)}catch{}s=!0,a.codeName=Mb(ni(l))}if(n&&n["!outline"]){var c={summaryBelow:1,summaryRight:1};n["!outline"].above&&(c.summaryBelow=0),n["!outline"].left&&(c.summaryRight=0),o=(o||"")+vt("outlinePr",null,c)}!s&&!o||(r[r.length]=vt("sheetPr",o,a))}var tDe=["objects","scenarios","selectLockedCells","selectUnlockedCells"],nDe=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function iDe(n){var e={sheet:1};return tDe.forEach(function(t){n[t]!=null&&n[t]&&(e[t]="1")}),nDe.forEach(function(t){n[t]!=null&&!n[t]&&(e[t]="0")}),n.password&&(e.password=mee(n.password).toString(16).toUpperCase()),vt("sheetProtection",null,e)}function rDe(n){return Mee(n),vt("pageMargins",null,n)}function sDe(n,e){for(var t=["<cols>"],i,r=0;r!=e.length;++r)(i=e[r])&&(t[t.length]=vt("col",null,QI(r,i)));return t[t.length]="</cols>",t.join("")}function aDe(n,e,t,i){var r=typeof n.ref=="string"?n.ref:br(n.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var s=t.Workbook.Names,a=Do(r);a.s.r==a.e.r&&(a.e.r=Do(e["!ref"]).e.r,r=br(a));for(var o=0;o<s.length;++o){var l=s[o];if(l.Name=="_xlnm._FilterDatabase"&&l.Sheet==i){l.Ref="'"+t.SheetNames[i]+"'!"+r;break}}return o==s.length&&s.push({Name:"_xlnm._FilterDatabase",Sheet:i,Ref:"'"+t.SheetNames[i]+"'!"+r}),vt("autoFilter",null,{ref:r})}function oDe(n,e,t,i){var r={workbookViewId:"0"};return(((i||{}).Workbook||{}).Views||[])[0]&&(r.rightToLeft=i.Workbook.Views[0].RTL?"1":"0"),vt("sheetViews",vt("sheetView",null,r),{})}function lDe(n,e,t,i){if(n.c&&t["!comments"].push([e,n.c]),n.v===void 0&&typeof n.f!="string"||n.t==="z"&&!n.f)return"";var r="",s=n.t,a=n.v;if(n.t!=="z")switch(n.t){case"b":r=n.v?"1":"0";break;case"n":r=""+n.v;break;case"e":r=sE[n.v];break;case"d":i&&i.cellDates?r=ha(n.v,-1).toISOString():(n=Pa(n),n.t="n",r=""+(n.v=Ua(ha(n.v)))),typeof n.z>"u"&&(n.z=Qi[14]);break;default:r=n.v;break}var o=Ss("v",ni(r)),l={r:e},c=wp(i.cellXfs,n,i);switch(c!==0&&(l.s=c),n.t){case"n":break;case"d":l.t="d";break;case"b":l.t="b";break;case"e":l.t="e";break;case"z":break;default:if(n.v==null){delete n.t;break}if(n.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(i&&i.bookSST){o=Ss("v",""+LL(i.Strings,n.v,i.revStrings)),l.t="s";break}l.t="str";break}if(n.t!=s&&(n.t=s,n.v=a),typeof n.f=="string"&&n.f){var h=n.F&&n.F.slice(0,e.length)==e?{t:"array",ref:n.F}:null;o=vt("f",ni(n.f),h)+(n.v!=null?o:"")}return n.l&&t["!links"].push([e,n.l]),n.D&&(l.cm=1),vt("c",o,l)}function cDe(n,e,t,i){var r=[],s=[],a=Ri(n["!ref"]),o="",l,c="",h=[],f=0,p=0,y=n["!rows"],x=Array.isArray(n),v={r:c},_,E=-1;for(p=a.s.c;p<=a.e.c;++p)h[p]=qs(p);for(f=a.s.r;f<=a.e.r;++f){for(s=[],c=Is(f),p=a.s.c;p<=a.e.c;++p){l=h[p]+c;var w=x?(n[f]||[])[p]:n[l];w!==void 0&&(o=lDe(w,l,n,e))!=null&&s.push(o)}(s.length>0||y&&y[f])&&(v={r:c},y&&y[f]&&(_=y[f],_.hidden&&(v.hidden=1),E=-1,_.hpx?E=rC(_.hpx):_.hpt&&(E=_.hpt),E>-1&&(v.ht=E,v.customHeight=1),_.level&&(v.outlineLevel=_.level)),r[r.length]=vt("row",s.join(""),v))}if(y)for(;f<y.length;++f)y&&y[f]&&(v={r:f+1},_=y[f],_.hidden&&(v.hidden=1),E=-1,_.hpx?E=rC(_.hpx):_.hpt&&(E=_.hpt),E>-1&&(v.ht=E,v.customHeight=1),_.level&&(v.outlineLevel=_.level),r[r.length]=vt("row","",v));return r.join("")}function Fee(n,e,t,i){var r=[Er,vt("worksheet",null,{xmlns:j1[0],"xmlns:r":Qr.r})],s=t.SheetNames[n],a=0,o="",l=t.Sheets[s];l==null&&(l={});var c=l["!ref"]||"A1",h=Ri(c);if(h.e.c>16383||h.e.r>1048575){if(e.WTF)throw new Error("Range "+c+" exceeds format limit A1:XFD1048576");h.e.c=Math.min(h.e.c,16383),h.e.r=Math.min(h.e.c,1048575),c=br(h)}i||(i={}),l["!comments"]=[];var f=[];eDe(l,t,n,e,r),r[r.length]=vt("dimension",null,{ref:c}),r[r.length]=oDe(l,e,n,t),e.sheetFormat&&(r[r.length]=vt("sheetFormatPr",null,{defaultRowHeight:e.sheetFormat.defaultRowHeight||"16",baseColWidth:e.sheetFormat.baseColWidth||"10",outlineLevelRow:e.sheetFormat.outlineLevelRow||"7"})),l["!cols"]!=null&&l["!cols"].length>0&&(r[r.length]=sDe(l,l["!cols"])),r[a=r.length]="<sheetData/>",l["!links"]=[],l["!ref"]!=null&&(o=cDe(l,e),o.length>0&&(r[r.length]=o)),r.length>a+1&&(r[r.length]="</sheetData>",r[a]=r[a].replace("/>",">")),l["!protect"]&&(r[r.length]=iDe(l["!protect"])),l["!autofilter"]!=null&&(r[r.length]=aDe(l["!autofilter"],l,t,n)),l["!merges"]!=null&&l["!merges"].length>0&&(r[r.length]=ZSe(l["!merges"]));var p=-1,y,x=-1;return l["!links"].length>0&&(r[r.length]="<hyperlinks>",l["!links"].forEach(function(v){v[1].Target&&(y={ref:v[0]},v[1].Target.charAt(0)!="#"&&(x=ei(i,-1,ni(v[1].Target).replace(/#.*$/,""),Mn.HLINK),y["r:id"]="rId"+x),(p=v[1].Target.indexOf("#"))>-1&&(y.location=ni(v[1].Target.slice(p+1))),v[1].Tooltip&&(y.tooltip=ni(v[1].Tooltip)),r[r.length]=vt("hyperlink",null,y))}),r[r.length]="</hyperlinks>"),delete l["!links"],l["!margins"]!=null&&(r[r.length]=rDe(l["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&(r[r.length]=Ss("ignoredErrors",vt("ignoredError",null,{numberStoredAsText:1,sqref:c}))),f.length>0&&(x=ei(i,-1,"../drawings/drawing"+(n+1)+".xml",Mn.DRAW),r[r.length]=vt("drawing",null,{"r:id":"rId"+x}),l["!drawing"]=f),l["!comments"].length>0&&(x=ei(i,-1,"../drawings/vmlDrawing"+(n+1)+".vml",Mn.VML),r[r.length]=vt("legacyDrawing",null,{"r:id":"rId"+x}),l["!legacy"]=x),r.length>1&&(r[r.length]="</worksheet>",r[1]=r[1].replace("/>",">")),r.join("")}function uDe(n,e){var t={},i=n.l+e;t.r=n.read_shift(4),n.l+=4;var r=n.read_shift(2);n.l+=1;var s=n.read_shift(1);return n.l=i,s&7&&(t.level=s&7),s&16&&(t.hidden=!0),s&32&&(t.hpt=r/20),t}function hDe(n,e,t){var i=tt(145),r=(t["!rows"]||[])[n]||{};i.write_shift(4,n),i.write_shift(4,0);var s=320;r.hpx?s=rC(r.hpx)*20:r.hpt&&(s=r.hpt*20),i.write_shift(2,s),i.write_shift(1,0);var a=0;r.level&&(a|=r.level),r.hidden&&(a|=16),(r.hpx||r.hpt)&&(a|=32),i.write_shift(1,a),i.write_shift(1,0);var o=0,l=i.l;i.l+=4;for(var c={r:n,c:0},h=0;h<16;++h)if(!(e.s.c>h+1<<10||e.e.c<h<<10)){for(var f=-1,p=-1,y=h<<10;y<h+1<<10;++y){c.c=y;var x=Array.isArray(t)?(t[c.r]||[])[c.c]:t[ii(c)];x&&(f<0&&(f=y),p=y)}f<0||(++o,i.write_shift(4,f),i.write_shift(4,p))}var v=i.l;return i.l=l,i.write_shift(4,o),i.l=v,i.length>i.l?i.slice(0,i.l):i}function dDe(n,e,t,i){var r=hDe(i,t,e);(r.length>17||(e["!rows"]||[])[i])&&lt(n,0,r)}var fDe=a0,pDe=K1;function gDe(){}function mDe(n,e){var t={},i=n[n.l];return++n.l,t.above=!(i&64),t.left=!(i&128),n.l+=18,t.name=SEe(n),t}function yDe(n,e,t){t==null&&(t=tt(84+4*n.length));var i=192;e&&(e.above&&(i&=-65),e.left&&(i&=-129)),t.write_shift(1,i);for(var r=1;r<3;++r)t.write_shift(1,0);return eC({auto:1},t),t.write_shift(-4,-1),t.write_shift(-4,-1),KZ(n,t),t.slice(0,t.l)}function vDe(n){var e=yl(n);return[e]}function _De(n,e,t){return t==null&&(t=tt(8)),i0(e,t)}function xDe(n){var e=r0(n);return[e]}function bDe(n,e,t){return t==null&&(t=tt(4)),s0(e,t)}function TDe(n){var e=yl(n),t=n.read_shift(1);return[e,t,"b"]}function EDe(n,e,t){return t==null&&(t=tt(9)),i0(e,t),t.write_shift(1,n.v?1:0),t}function wDe(n){var e=r0(n),t=n.read_shift(1);return[e,t,"b"]}function ADe(n,e,t){return t==null&&(t=tt(5)),s0(e,t),t.write_shift(1,n.v?1:0),t}function SDe(n){var e=yl(n),t=n.read_shift(1);return[e,t,"e"]}function DDe(n,e,t){return t==null&&(t=tt(9)),i0(e,t),t.write_shift(1,n.v),t}function CDe(n){var e=r0(n),t=n.read_shift(1);return[e,t,"e"]}function IDe(n,e,t){return t==null&&(t=tt(8)),s0(e,t),t.write_shift(1,n.v),t.write_shift(2,0),t.write_shift(1,0),t}function RDe(n){var e=yl(n),t=n.read_shift(4);return[e,t,"s"]}function NDe(n,e,t){return t==null&&(t=tt(12)),i0(e,t),t.write_shift(4,e.v),t}function kDe(n){var e=r0(n),t=n.read_shift(4);return[e,t,"s"]}function MDe(n,e,t){return t==null&&(t=tt(8)),s0(e,t),t.write_shift(4,e.v),t}function FDe(n){var e=yl(n),t=Y1(n);return[e,t,"n"]}function UDe(n,e,t){return t==null&&(t=tt(16)),i0(e,t),Hm(n.v,t),t}function PDe(n){var e=r0(n),t=Y1(n);return[e,t,"n"]}function LDe(n,e,t){return t==null&&(t=tt(12)),s0(e,t),Hm(n.v,t),t}function ODe(n){var e=yl(n),t=YZ(n);return[e,t,"n"]}function BDe(n,e,t){return t==null&&(t=tt(12)),i0(e,t),JZ(n.v,t),t}function VDe(n){var e=r0(n),t=YZ(n);return[e,t,"n"]}function WDe(n,e,t){return t==null&&(t=tt(8)),s0(e,t),JZ(n.v,t),t}function HDe(n){var e=yl(n),t=IL(n);return[e,t,"is"]}function zDe(n){var e=yl(n),t=$s(n);return[e,t,"str"]}function GDe(n,e,t){return t==null&&(t=tt(12+4*n.v.length)),i0(e,t),ns(n.v,t),t.length>t.l?t.slice(0,t.l):t}function qDe(n){var e=r0(n),t=$s(n);return[e,t,"str"]}function $De(n,e,t){return t==null&&(t=tt(8+4*n.v.length)),s0(e,t),ns(n.v,t),t.length>t.l?t.slice(0,t.l):t}function jDe(n,e,t){var i=n.l+e,r=yl(n);r.r=t["!row"];var s=n.read_shift(1),a=[r,s,"b"];if(t.cellFormula){n.l+=2;var o=JI(n,i-n.l,t);a[3]=A1(o,null,r,t.supbooks,t)}else n.l=i;return a}function XDe(n,e,t){var i=n.l+e,r=yl(n);r.r=t["!row"];var s=n.read_shift(1),a=[r,s,"e"];if(t.cellFormula){n.l+=2;var o=JI(n,i-n.l,t);a[3]=A1(o,null,r,t.supbooks,t)}else n.l=i;return a}function KDe(n,e,t){var i=n.l+e,r=yl(n);r.r=t["!row"];var s=Y1(n),a=[r,s,"n"];if(t.cellFormula){n.l+=2;var o=JI(n,i-n.l,t);a[3]=A1(o,null,r,t.supbooks,t)}else n.l=i;return a}function YDe(n,e,t){var i=n.l+e,r=yl(n);r.r=t["!row"];var s=$s(n),a=[r,s,"str"];if(t.cellFormula){n.l+=2;var o=JI(n,i-n.l,t);a[3]=A1(o,null,r,t.supbooks,t)}else n.l=i;return a}var JDe=a0,QDe=K1;function ZDe(n,e){return e==null&&(e=tt(4)),e.write_shift(4,n),e}function eCe(n,e){var t=n.l+e,i=a0(n),r=RL(n),s=$s(n),a=$s(n),o=$s(n);n.l=t;var l={rfx:i,relId:r,loc:s,display:o};return a&&(l.Tooltip=a),l}function tCe(n,e){var t=tt(50+4*(n[1].Target.length+(n[1].Tooltip||"").length));K1({s:ts(n[0]),e:ts(n[0])},t),NL("rId"+e,t);var i=n[1].Target.indexOf("#"),r=i==-1?"":n[1].Target.slice(i+1);return ns(r||"",t),ns(n[1].Tooltip||"",t),ns("",t),t.slice(0,t.l)}function nCe(){}function iCe(n,e,t){var i=n.l+e,r=QZ(n),s=n.read_shift(1),a=[r];if(a[2]=s,t.cellFormula){var o=qSe(n,i-n.l,t);a[1]=o}else n.l=i;return a}function rCe(n,e,t){var i=n.l+e,r=a0(n),s=[r];if(t.cellFormula){var a=jSe(n,i-n.l,t);s[1]=a,n.l=i}else n.l=i;return s}function sCe(n,e,t){t==null&&(t=tt(18));var i=QI(n,e);t.write_shift(-4,n),t.write_shift(-4,n),t.write_shift(4,(i.width||10)*256),t.write_shift(4,0);var r=0;return e.hidden&&(r|=1),typeof i.width=="number"&&(r|=2),e.level&&(r|=e.level<<8),t.write_shift(2,r),t}var Uee=["left","right","top","bottom","header","footer"];function aCe(n){var e={};return Uee.forEach(function(t){e[t]=Y1(n)}),e}function oCe(n,e){return e==null&&(e=tt(48)),Mee(n),Uee.forEach(function(t){Hm(n[t],e)}),e}function lCe(n){var e=n.read_shift(2);return n.l+=28,{RTL:e&32}}function cCe(n,e,t){t==null&&(t=tt(30));var i=924;return(((e||{}).Views||[])[0]||{}).RTL&&(i|=32),t.write_shift(2,i),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,100),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(4,0),t}function uCe(n){var e=tt(24);return e.write_shift(4,4),e.write_shift(4,1),K1(n,e),e}function hCe(n,e){return e==null&&(e=tt(66)),e.write_shift(2,n.password?mee(n.password):0),e.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(t){t[1]?e.write_shift(4,n[t[0]]!=null&&!n[t[0]]?1:0):e.write_shift(4,n[t[0]]!=null&&n[t[0]]?0:1)}),e}function dCe(){}function fCe(){}function pCe(n,e,t,i,r,s,a){if(e.v===void 0)return!1;var o="";switch(e.t){case"b":o=e.v?"1":"0";break;case"d":e=Pa(e),e.z=e.z||Qi[14],e.v=Ua(ha(e.v)),e.t="n";break;case"n":case"e":o=""+e.v;break;default:o=e.v;break}var l={r:t,c:i};switch(l.s=wp(r.cellXfs,e,r),e.l&&s["!links"].push([ii(l),e.l]),e.c&&s["!comments"].push([ii(l),e.c]),e.t){case"s":case"str":return r.bookSST?(o=LL(r.Strings,e.v,r.revStrings),l.t="s",l.v=o,a?lt(n,18,MDe(e,l)):lt(n,7,NDe(e,l))):(l.t="str",a?lt(n,17,$De(e,l)):lt(n,6,GDe(e,l))),!0;case"n":return e.v==(e.v|0)&&e.v>-1e3&&e.v<1e3?a?lt(n,13,WDe(e,l)):lt(n,2,BDe(e,l)):a?lt(n,16,LDe(e,l)):lt(n,5,UDe(e,l)),!0;case"b":return l.t="b",a?lt(n,15,ADe(e,l)):lt(n,4,EDe(e,l)),!0;case"e":return l.t="e",a?lt(n,14,IDe(e,l)):lt(n,3,DDe(e,l)),!0}return a?lt(n,12,bDe(e,l)):lt(n,1,_De(e,l)),!0}function gCe(n,e,t,i){var r=Ri(e["!ref"]||"A1"),s,a="",o=[];lt(n,145);var l=Array.isArray(e),c=r.e.r;e["!rows"]&&(c=Math.max(r.e.r,e["!rows"].length-1));for(var h=r.s.r;h<=c;++h){a=Is(h),dDe(n,e,r,h);var f=!1;if(h<=r.e.r)for(var p=r.s.c;p<=r.e.c;++p){h===r.s.r&&(o[p]=qs(p)),s=o[p]+a;var y=l?(e[h]||[])[p]:e[s];if(!y){f=!1;continue}f=pCe(n,y,h,p,i,e,f)}}lt(n,146)}function mCe(n,e){!e||!e["!merges"]||(lt(n,177,ZDe(e["!merges"].length)),e["!merges"].forEach(function(t){lt(n,176,QDe(t))}),lt(n,178))}function yCe(n,e){!e||!e["!cols"]||(lt(n,390),e["!cols"].forEach(function(t,i){t&&lt(n,60,sCe(i,t))}),lt(n,391))}function vCe(n,e){!e||!e["!ref"]||(lt(n,648),lt(n,649,uCe(Ri(e["!ref"]))),lt(n,650))}function _Ce(n,e,t){e["!links"].forEach(function(i){if(i[1].Target){var r=ei(t,-1,i[1].Target.replace(/#.*$/,""),Mn.HLINK);lt(n,494,tCe(i,r))}}),delete e["!links"]}function xCe(n,e,t,i){if(e["!comments"].length>0){var r=ei(i,-1,"../drawings/vmlDrawing"+(t+1)+".vml",Mn.VML);lt(n,551,NL("rId"+r)),e["!legacy"]=r}}function bCe(n,e,t,i){if(e["!autofilter"]){var r=e["!autofilter"],s=typeof r.ref=="string"?r.ref:br(r.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var a=t.Workbook.Names,o=Do(s);o.s.r==o.e.r&&(o.e.r=Do(e["!ref"]).e.r,s=br(o));for(var l=0;l<a.length;++l){var c=a[l];if(c.Name=="_xlnm._FilterDatabase"&&c.Sheet==i){c.Ref="'"+t.SheetNames[i]+"'!"+s;break}}l==a.length&&a.push({Name:"_xlnm._FilterDatabase",Sheet:i,Ref:"'"+t.SheetNames[i]+"'!"+s}),lt(n,161,K1(Ri(s))),lt(n,162)}}function TCe(n,e,t){lt(n,133),lt(n,137,cCe(e,t)),lt(n,138),lt(n,134)}function ECe(n,e){e["!protect"]&&lt(n,535,hCe(e["!protect"]))}function wCe(n,e,t,i){var r=Fa(),s=t.SheetNames[n],a=t.Sheets[s]||{},o=s;try{t&&t.Workbook&&(o=t.Workbook.Sheets[n].CodeName||o)}catch{}var l=Ri(a["!ref"]||"A1");if(l.e.c>16383||l.e.r>1048575){if(e.WTF)throw new Error("Range "+(a["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");l.e.c=Math.min(l.e.c,16383),l.e.r=Math.min(l.e.c,1048575)}return a["!links"]=[],a["!comments"]=[],lt(r,129),(t.vbaraw||a["!outline"])&&lt(r,147,yDe(o,a["!outline"])),lt(r,148,pDe(l)),TCe(r,a,t.Workbook),yCe(r,a),gCe(r,a,n,e),ECe(r,a),bCe(r,a,t,n),mCe(r,a),_Ce(r,a,i),a["!margins"]&&lt(r,476,oCe(a["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&vCe(r,a),xCe(r,a,n,i),lt(r,130),r.end()}function ACe(n,e){n.l+=10;var t=$s(n);return{name:t}}var SCe=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function DCe(n){return!n.Workbook||!n.Workbook.WBProps?"false":rEe(n.Workbook.WBProps.date1904)?"true":"false"}var CCe="][*?/\\".split("");function Pee(n,e){if(n.length>31)throw new Error("Sheet names cannot exceed 31 chars");var t=!0;return CCe.forEach(function(i){if(n.indexOf(i)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),t}function ICe(n,e,t){n.forEach(function(i,r){Pee(i);for(var s=0;s<r;++s)if(i==n[s])throw new Error("Duplicate Sheet Name: "+i);if(t){var a=e&&e[r]&&e[r].CodeName||i;if(a.charCodeAt(0)==95&&a.length>22)throw new Error("Bad Code Name: Worksheet"+a)}})}function RCe(n){if(!n||!n.SheetNames||!n.Sheets)throw new Error("Invalid Workbook");if(!n.SheetNames.length)throw new Error("Workbook is empty");var e=n.Workbook&&n.Workbook.Sheets||[];ICe(n.SheetNames,e,!!n.vbaraw);for(var t=0;t<n.SheetNames.length;++t)QSe(n.Sheets[n.SheetNames[t]],n.SheetNames[t],t)}function Lee(n){var e=[Er];e[e.length]=vt("workbook",null,{xmlns:j1[0],"xmlns:r":Qr.r});var t=n.Workbook&&(n.Workbook.Names||[]).length>0,i={codeName:"ThisWorkbook"};n.Workbook&&n.Workbook.WBProps&&(SCe.forEach(function(o){n.Workbook.WBProps[o[0]]!=null&&n.Workbook.WBProps[o[0]]!=o[1]&&(i[o[0]]=n.Workbook.WBProps[o[0]])}),n.Workbook.WBProps.CodeName&&(i.codeName=n.Workbook.WBProps.CodeName,delete i.CodeName)),e[e.length]=vt("workbookPr",null,i);var r=n.Workbook&&n.Workbook.Sheets||[],s=0;if(r&&r[0]&&r[0].Hidden){for(e[e.length]="<bookViews>",s=0;s!=n.SheetNames.length&&!(!r[s]||!r[s].Hidden);++s);s==n.SheetNames.length&&(s=0),e[e.length]='<workbookView firstSheet="'+s+'" activeTab="'+s+'"/>',e[e.length]="</bookViews>"}for(e[e.length]="<sheets>",s=0;s!=n.SheetNames.length;++s){var a={name:ni(n.SheetNames[s].slice(0,31))};if(a.sheetId=""+(s+1),a["r:id"]="rId"+(s+1),r[s])switch(r[s].Hidden){case 1:a.state="hidden";break;case 2:a.state="veryHidden";break}e[e.length]=vt("sheet",null,a)}return e[e.length]="</sheets>",t&&(e[e.length]="<definedNames>",n.Workbook&&n.Workbook.Names&&n.Workbook.Names.forEach(function(o){var l={name:o.Name};o.Comment&&(l.comment=o.Comment),o.Sheet!=null&&(l.localSheetId=""+o.Sheet),o.Hidden&&(l.hidden="1"),o.Ref&&(e[e.length]=vt("definedName",ni(o.Ref),l))}),e[e.length]="</definedNames>"),e.length>2&&(e[e.length]="</workbook>",e[1]=e[1].replace("/>",">")),e.join("")}function NCe(n,e){var t={};return t.Hidden=n.read_shift(4),t.iTabID=n.read_shift(4),t.strRelID=QU(n),t.name=$s(n),t}function kCe(n,e){return e||(e=tt(127)),e.write_shift(4,n.Hidden),e.write_shift(4,n.iTabID),NL(n.strRelID,e),ns(n.name.slice(0,31),e),e.length>e.l?e.slice(0,e.l):e}function MCe(n,e){var t={},i=n.read_shift(4);t.defaultThemeVersion=n.read_shift(4);var r=e>8?$s(n):"";return r.length>0&&(t.CodeName=r),t.autoCompressPictures=!!(i&65536),t.backupFile=!!(i&64),t.checkCompatibility=!!(i&4096),t.date1904=!!(i&1),t.filterPrivacy=!!(i&8),t.hidePivotFieldList=!!(i&1024),t.promptedSolutions=!!(i&16),t.publishItems=!!(i&2048),t.refreshAllConnections=!!(i&262144),t.saveExternalLinkValues=!!(i&128),t.showBorderUnselectedTables=!!(i&4),t.showInkAnnotation=!!(i&32),t.showObjects=["all","placeholders","none"][i>>13&3],t.showPivotChartFilter=!!(i&32768),t.updateLinks=["userSet","never","always"][i>>8&3],t}function FCe(n,e){e||(e=tt(72));var t=0;return n&&n.filterPrivacy&&(t|=8),e.write_shift(4,t),e.write_shift(4,0),KZ(n&&n.CodeName||"ThisWorkbook",e),e.slice(0,e.l)}function UCe(n,e,t){var i=n.l+e;n.l+=4,n.l+=1;var r=n.read_shift(4),s=DEe(n),a=$Se(n,0,t),o=RL(n);n.l=i;var l={Name:s,Ptg:a};return r<268435455&&(l.Sheet=r),o&&(l.Comment=o),l}function PCe(n,e){lt(n,143);for(var t=0;t!=e.SheetNames.length;++t){var i=e.Workbook&&e.Workbook.Sheets&&e.Workbook.Sheets[t]&&e.Workbook.Sheets[t].Hidden||0,r={Hidden:i,iTabID:t+1,strRelID:"rId"+(t+1),name:e.SheetNames[t]};lt(n,156,kCe(r))}lt(n,144)}function LCe(n,e){e||(e=tt(127));for(var t=0;t!=4;++t)e.write_shift(4,0);return ns("SheetJS",e),ns($D.version,e),ns($D.version,e),ns("7262",e),e.length>e.l?e.slice(0,e.l):e}function OCe(n,e){e||(e=tt(29)),e.write_shift(-4,0),e.write_shift(-4,460),e.write_shift(4,28800),e.write_shift(4,17600),e.write_shift(4,500),e.write_shift(4,n),e.write_shift(4,n);var t=120;return e.write_shift(1,t),e.length>e.l?e.slice(0,e.l):e}function BCe(n,e){if(!(!e.Workbook||!e.Workbook.Sheets)){for(var t=e.Workbook.Sheets,i=0,r=-1,s=-1;i<t.length;++i)!t[i]||!t[i].Hidden&&r==-1?r=i:t[i].Hidden==1&&s==-1&&(s=i);s>r||(lt(n,135),lt(n,158,OCe(r)),lt(n,136))}}function VCe(n,e){var t=Fa();return lt(t,131),lt(t,128,LCe()),lt(t,153,FCe(n.Workbook&&n.Workbook.WBProps||null)),BCe(t,n),PCe(t,n),lt(t,132),t.end()}function WCe(n,e,t){return(e.slice(-4)===".bin"?VCe:Lee)(n)}function HCe(n,e,t,i,r){return(e.slice(-4)===".bin"?wCe:Fee)(n,t,i,r)}function zCe(n,e,t){return(e.slice(-4)===".bin"?oAe:_ee)(n,t)}function GCe(n,e,t){return(e.slice(-4)===".bin"?Fwe:gee)(n,t)}function qCe(n,e,t){return(e.slice(-4)===".bin"?EAe:wee)(n)}function $Ce(n){return(n.slice(-4)===".bin"?gAe:Tee)()}function jCe(n,e){var t=[];return n.Props&&t.push(zEe(n.Props,e)),n.Custprops&&t.push(GEe(n.Props,n.Custprops)),t.join("")}function XCe(){return""}function KCe(n,e){var t=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return e.cellXfs.forEach(function(i,r){var s=[];s.push(vt("NumberFormat",null,{"ss:Format":ni(Qi[i.numFmtId])}));var a={"ss:ID":"s"+(21+r)};t.push(vt("Style",s.join(""),a))}),vt("Styles",t.join(""))}function Oee(n){return vt("NamedRange",null,{"ss:Name":n.Name,"ss:RefersTo":"="+UL(n.Ref,{r:0,c:0})})}function YCe(n){if(!((n||{}).Workbook||{}).Names)return"";for(var e=n.Workbook.Names,t=[],i=0;i<e.length;++i){var r=e[i];r.Sheet==null&&(r.Name.match(/^_xlfn\./)||t.push(Oee(r)))}return vt("Names",t.join(""))}function JCe(n,e,t,i){if(!n||!((i||{}).Workbook||{}).Names)return"";for(var r=i.Workbook.Names,s=[],a=0;a<r.length;++a){var o=r[a];o.Sheet==t&&(o.Name.match(/^_xlfn\./)||s.push(Oee(o)))}return s.join("")}function QCe(n,e,t,i){if(!n)return"";var r=[];if(n["!margins"]&&(r.push("<PageSetup>"),n["!margins"].header&&r.push(vt("Header",null,{"x:Margin":n["!margins"].header})),n["!margins"].footer&&r.push(vt("Footer",null,{"x:Margin":n["!margins"].footer})),r.push(vt("PageMargins",null,{"x:Bottom":n["!margins"].bottom||"0.75","x:Left":n["!margins"].left||"0.7","x:Right":n["!margins"].right||"0.7","x:Top":n["!margins"].top||"0.75"})),r.push("</PageSetup>")),i&&i.Workbook&&i.Workbook.Sheets&&i.Workbook.Sheets[t])if(i.Workbook.Sheets[t].Hidden)r.push(vt("Visible",i.Workbook.Sheets[t].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var s=0;s<t&&!(i.Workbook.Sheets[s]&&!i.Workbook.Sheets[s].Hidden);++s);s==t&&r.push("<Selected/>")}return((((i||{}).Workbook||{}).Views||[])[0]||{}).RTL&&r.push("<DisplayRightToLeft/>"),n["!protect"]&&(r.push(Ss("ProtectContents","True")),n["!protect"].objects&&r.push(Ss("ProtectObjects","True")),n["!protect"].scenarios&&r.push(Ss("ProtectScenarios","True")),n["!protect"].selectLockedCells!=null&&!n["!protect"].selectLockedCells?r.push(Ss("EnableSelection","NoSelection")):n["!protect"].selectUnlockedCells!=null&&!n["!protect"].selectUnlockedCells&&r.push(Ss("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(a){n["!protect"][a[0]]&&r.push("<"+a[1]+"/>")})),r.length==0?"":vt("WorksheetOptions",r.join(""),{xmlns:_o.x})}function ZCe(n){return n.map(function(e){var t=iEe(e.t||""),i=vt("ss:Data",t,{xmlns:"http://www.w3.org/TR/REC-html40"});return vt("Comment",i,{"ss:Author":e.a})}).join("")}function eIe(n,e,t,i,r,s,a){if(!n||n.v==null&&n.f==null)return"";var o={};if(n.f&&(o["ss:Formula"]="="+ni(UL(n.f,a))),n.F&&n.F.slice(0,e.length)==e){var l=ts(n.F.slice(e.length+1));o["ss:ArrayRange"]="RC:R"+(l.r==a.r?"":"["+(l.r-a.r)+"]")+"C"+(l.c==a.c?"":"["+(l.c-a.c)+"]")}if(n.l&&n.l.Target&&(o["ss:HRef"]=ni(n.l.Target),n.l.Tooltip&&(o["x:HRefScreenTip"]=ni(n.l.Tooltip))),t["!merges"])for(var c=t["!merges"],h=0;h!=c.length;++h)c[h].s.c!=a.c||c[h].s.r!=a.r||(c[h].e.c>c[h].s.c&&(o["ss:MergeAcross"]=c[h].e.c-c[h].s.c),c[h].e.r>c[h].s.r&&(o["ss:MergeDown"]=c[h].e.r-c[h].s.r));var f="",p="";switch(n.t){case"z":if(!i.sheetStubs)return"";break;case"n":f="Number",p=String(n.v);break;case"b":f="Boolean",p=n.v?"1":"0";break;case"e":f="Error",p=sE[n.v];break;case"d":f="DateTime",p=new Date(n.v).toISOString(),n.z==null&&(n.z=n.z||Qi[14]);break;case"s":f="String",p=nEe(n.v||"");break}var y=wp(i.cellXfs,n,i);o["ss:StyleID"]="s"+(21+y),o["ss:Index"]=a.c+1;var x=n.v!=null?p:"",v=n.t=="z"?"":'<Data ss:Type="'+f+'">'+x+"</Data>";return(n.c||[]).length>0&&(v+=ZCe(n.c)),vt("Cell",v,o)}function tIe(n,e){var t='<Row ss:Index="'+(n+1)+'"';return e&&(e.hpt&&!e.hpx&&(e.hpx=vee(e.hpt)),e.hpx&&(t+=' ss:AutoFitHeight="0" ss:Height="'+e.hpx+'"'),e.hidden&&(t+=' ss:Hidden="1"')),t+">"}function nIe(n,e,t,i){if(!n["!ref"])return"";var r=Ri(n["!ref"]),s=n["!merges"]||[],a=0,o=[];n["!cols"]&&n["!cols"].forEach(function(_,E){ML(_);var w=!!_.width,A=QI(E,_),N={"ss:Index":E+1};w&&(N["ss:Width"]=nC(A.width)),_.hidden&&(N["ss:Hidden"]="1"),o.push(vt("Column",null,N))});for(var l=Array.isArray(n),c=r.s.r;c<=r.e.r;++c){for(var h=[tIe(c,(n["!rows"]||[])[c])],f=r.s.c;f<=r.e.c;++f){var p=!1;for(a=0;a!=s.length;++a)if(!(s[a].s.c>f)&&!(s[a].s.r>c)&&!(s[a].e.c<f)&&!(s[a].e.r<c)){(s[a].s.c!=f||s[a].s.r!=c)&&(p=!0);break}if(!p){var y={r:c,c:f},x=ii(y),v=l?(n[c]||[])[f]:n[x];h.push(eIe(v,x,n,e,t,i,y))}}h.push("</Row>"),h.length>2&&o.push(h.join(""))}return o.join("")}function iIe(n,e,t){var i=[],r=t.SheetNames[n],s=t.Sheets[r],a=s?JCe(s,e,n,t):"";return a.length>0&&i.push("<Names>"+a+"</Names>"),a=s?nIe(s,e,n,t):"",a.length>0&&i.push("<Table>"+a+"</Table>"),i.push(QCe(s,e,n,t)),i.join("")}function rIe(n,e){e||(e={}),n.SSF||(n.SSF=Pa(Qi)),n.SSF&&(jI(),$I(n.SSF),e.revssf=XI(n.SSF),e.revssf[n.SSF[65535]]=0,e.ssf=n.SSF,e.cellXfs=[],wp(e.cellXfs,{},{revssf:{General:0}}));var t=[];t.push(jCe(n,e)),t.push(XCe()),t.push(""),t.push("");for(var i=0;i<n.SheetNames.length;++i)t.push(vt("Worksheet",iIe(i,e,n),{"ss:Name":ni(n.SheetNames[i])}));return t[2]=KCe(n,e),t[3]=YCe(n),Er+vt("Workbook",t.join(""),{xmlns:_o.ss,"xmlns:o":_o.o,"xmlns:x":_o.x,"xmlns:ss":_o.ss,"xmlns:dt":_o.dt,"xmlns:html":_o.html})}var dM={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function sIe(n,e){var t=[],i=[],r=[],s=0,a,o=Bz(Qz,"n"),l=Bz(Zz,"n");if(n.Props)for(a=Rs(n.Props),s=0;s<a.length;++s)(Object.prototype.hasOwnProperty.call(o,a[s])?t:Object.prototype.hasOwnProperty.call(l,a[s])?i:r).push([a[s],n.Props[a[s]]]);if(n.Custprops)for(a=Rs(n.Custprops),s=0;s<a.length;++s)Object.prototype.hasOwnProperty.call(n.Props||{},a[s])||(Object.prototype.hasOwnProperty.call(o,a[s])?t:Object.prototype.hasOwnProperty.call(l,a[s])?i:r).push([a[s],n.Custprops[a[s]]]);var c=[];for(s=0;s<r.length;++s)lee.indexOf(r[s][0])>-1||see.indexOf(r[s][0])>-1||r[s][1]!=null&&c.push(r[s]);i.length&&fi.utils.cfb_add(e,"/SummaryInformation",rG(i,dM.SI,l,Zz)),(t.length||c.length)&&fi.utils.cfb_add(e,"/DocumentSummaryInformation",rG(t,dM.DSI,o,Qz,c.length?c:null,dM.UDI))}function aIe(n,e){var t=e||{},i=fi.utils.cfb_new({root:"R"}),r="/Workbook";switch(t.bookType||"xls"){case"xls":t.bookType="biff8";case"xla":t.bookType||(t.bookType="xla");case"biff8":r="/Workbook",t.biff=8;break;case"biff5":r="/Book",t.biff=5;break;default:throw new Error("invalid type "+t.bookType+" for XLS CFB")}return fi.utils.cfb_add(i,r,Bee(n,t)),t.biff==8&&(n.Props||n.Custprops)&&sIe(n,i),t.biff==8&&n.vbaraw&&wAe(i,fi.read(n.vbaraw,{type:typeof n.vbaraw=="string"?"binary":"buffer"})),i}var oIe={0:{f:uDe},1:{f:vDe},2:{f:ODe},3:{f:SDe},4:{f:TDe},5:{f:FDe},6:{f:zDe},7:{f:RDe},8:{f:YDe},9:{f:KDe},10:{f:jDe},11:{f:XDe},12:{f:xDe},13:{f:VDe},14:{f:CDe},15:{f:wDe},16:{f:PDe},17:{f:qDe},18:{f:kDe},19:{f:IL},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:UCe},40:{},42:{},43:{f:zwe},44:{f:Wwe},45:{f:$we},46:{f:Xwe},47:{f:jwe},48:{},49:{f:xEe},50:{},51:{f:uAe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:bwe},62:{f:HDe},63:{f:mAe},64:{f:dCe},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:hu,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:lCe},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:mDe},148:{f:fDe,p:16},151:{f:nCe},152:{},153:{f:MCe},154:{},155:{},156:{f:NCe},157:{},158:{},159:{T:1,f:Nwe},160:{T:-1},161:{T:1,f:a0},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:JDe},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:lAe},336:{T:-1},337:{f:fAe,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:QU},357:{},358:{},359:{},360:{T:1},361:{},362:{f:gwe},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:iCe},427:{f:rCe},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:aCe},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:gDe},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:eCe},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:QU},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:bAe},633:{T:1},634:{T:-1},635:{T:1,f:_Ae},636:{T:-1},637:{f:wEe},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:ACe},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:fCe},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function _t(n,e,t,i){var r=e;if(!isNaN(r)){var s=i||(t||[]).length||0,a=n.next(4);a.write_shift(2,r),a.write_shift(2,s),s>0&&SL(t)&&n.push(t)}}function lIe(n,e,t,i){var r=(t||[]).length||0;if(r<=8224)return _t(n,e,t,r);var s=e;if(!isNaN(s)){for(var a=t.parts||[],o=0,l=0,c=0;c+(a[o]||8224)<=8224;)c+=a[o]||8224,o++;var h=n.next(4);for(h.write_shift(2,s),h.write_shift(2,c),n.push(t.slice(l,l+c)),l+=c;l<r;){for(h=n.next(4),h.write_shift(2,60),c=0;c+(a[o]||8224)<=8224;)c+=a[o]||8224,o++;h.write_shift(2,c),n.push(t.slice(l,l+c)),l+=c}}}function oE(n,e,t){return n||(n=tt(7)),n.write_shift(2,e),n.write_shift(2,t),n.write_shift(2,0),n.write_shift(1,0),n}function cIe(n,e,t,i){var r=tt(9);return oE(r,n,e),uee(t,i||"b",r),r}function uIe(n,e,t){var i=tt(8+2*t.length);return oE(i,n,e),i.write_shift(1,t.length),i.write_shift(t.length,t,"sbcs"),i.l<i.length?i.slice(0,i.l):i}function hIe(n,e,t,i){if(e.v!=null)switch(e.t){case"d":case"n":var r=e.t=="d"?Ua(ha(e.v)):e.v;r==(r|0)&&r>=0&&r<65536?_t(n,2,Awe(t,i,r)):_t(n,3,wwe(t,i,r));return;case"b":case"e":_t(n,5,cIe(t,i,e.v,e.t));return;case"s":case"str":_t(n,4,uIe(t,i,(e.v||"").slice(0,255)));return}_t(n,1,oE(null,t,i))}function dIe(n,e,t,i){var r=Array.isArray(e),s=Ri(e["!ref"]||"A1"),a,o="",l=[];if(s.e.c>255||s.e.r>16383){if(i.WTF)throw new Error("Range "+(e["!ref"]||"A1")+" exceeds format limit A1:IV16384");s.e.c=Math.min(s.e.c,255),s.e.r=Math.min(s.e.c,16383),a=br(s)}for(var c=s.s.r;c<=s.e.r;++c){o=Is(c);for(var h=s.s.c;h<=s.e.c;++h){c===s.s.r&&(l[h]=qs(h)),a=l[h]+o;var f=r?(e[c]||[])[h]:e[a];f&&hIe(n,f,c,h)}}}function fIe(n,e){for(var t=e||{},i=Fa(),r=0,s=0;s<n.SheetNames.length;++s)n.SheetNames[s]==t.sheet&&(r=s);if(r==0&&t.sheet&&n.SheetNames[0]!=t.sheet)throw new Error("Sheet not found: "+t.sheet);return _t(i,t.biff==4?1033:t.biff==3?521:9,kL(n,16,t)),dIe(i,n.Sheets[n.SheetNames[r]],r,t),_t(i,10),i.end()}function pIe(n,e,t){_t(n,49,owe({sz:12,name:"Arial"},t))}function gIe(n,e,t){e&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(i){for(var r=i[0];r<=i[1];++r)e[r]!=null&&_t(n,1054,uwe(r,e[r],t))})}function mIe(n,e){var t=tt(19);t.write_shift(4,2151),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(2,3),t.write_shift(1,1),t.write_shift(4,0),_t(n,2151,t),t=tt(39),t.write_shift(4,2152),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(2,3),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(2,1),t.write_shift(4,4),t.write_shift(2,0),fee(Ri(e["!ref"]||"A1"),t),t.write_shift(4,4),_t(n,2152,t)}function yIe(n,e){for(var t=0;t<16;++t)_t(n,224,aG({numFmtId:0,style:!0},0,e));e.cellXfs.forEach(function(i){_t(n,224,aG(i,0,e))})}function vIe(n,e){for(var t=0;t<e["!links"].length;++t){var i=e["!links"][t];_t(n,440,vwe(i)),i[1].Tooltip&&_t(n,2048,_we(i))}delete e["!links"]}function _Ie(n,e){if(e){var t=0;e.forEach(function(i,r){++t<=256&&i&&_t(n,125,Twe(QI(r,i),r))})}}function xIe(n,e,t,i,r){var s=16+wp(r.cellXfs,e,r);if(e.v==null&&!e.bf){_t(n,513,zm(t,i,s));return}if(e.bf)_t(n,6,GSe(e,t,i,r,s));else switch(e.t){case"d":case"n":var a=e.t=="d"?Ua(ha(e.v)):e.v;_t(n,515,pwe(t,i,a,s));break;case"b":case"e":_t(n,517,fwe(t,i,e.v,s,r,e.t));break;case"s":case"str":if(r.bookSST){var o=LL(r.Strings,e.v,r.revStrings);_t(n,253,lwe(t,i,o,s))}else _t(n,516,cwe(t,i,(e.v||"").slice(0,255),s,r));break;default:_t(n,513,zm(t,i,s))}}function bIe(n,e,t){var i=Fa(),r=t.SheetNames[n],s=t.Sheets[r]||{},a=(t||{}).Workbook||{},o=(a.Sheets||[])[n]||{},l=Array.isArray(s),c=e.biff==8,h,f="",p=[],y=Ri(s["!ref"]||"A1"),x=c?65536:16384;if(y.e.c>255||y.e.r>=x){if(e.WTF)throw new Error("Range "+(s["!ref"]||"A1")+" exceeds format limit A1:IV16384");y.e.c=Math.min(y.e.c,255),y.e.r=Math.min(y.e.c,x-1)}_t(i,2057,kL(t,16,e)),_t(i,13,sl(1)),_t(i,12,sl(100)),_t(i,15,oa(!0)),_t(i,17,oa(!1)),_t(i,16,Hm(.001)),_t(i,95,oa(!0)),_t(i,42,oa(!1)),_t(i,43,oa(!1)),_t(i,130,sl(1)),_t(i,128,dwe()),_t(i,131,oa(!1)),_t(i,132,oa(!1)),c&&_Ie(i,s["!cols"]),_t(i,512,hwe(y,e)),c&&(s["!links"]=[]);for(var v=y.s.r;v<=y.e.r;++v){f=Is(v);for(var _=y.s.c;_<=y.e.c;++_){v===y.s.r&&(p[_]=qs(_)),h=p[_]+f;var E=l?(s[v]||[])[_]:s[h];E&&(xIe(i,E,v,_,e),c&&E.l&&s["!links"].push([h,E.l]))}}var w=o.CodeName||o.name||r;return c&&_t(i,574,awe((a.Views||[])[0])),c&&(s["!merges"]||[]).length&&_t(i,229,ywe(s["!merges"])),c&&vIe(i,s),_t(i,442,dee(w)),c&&mIe(i,s),_t(i,10),i.end()}function TIe(n,e,t){var i=Fa(),r=(n||{}).Workbook||{},s=r.Sheets||[],a=r.WBProps||{},o=t.biff==8,l=t.biff==5;if(_t(i,2057,kL(n,5,t)),t.bookType=="xla"&&_t(i,135),_t(i,225,o?sl(1200):null),_t(i,193,jEe(2)),l&&_t(i,191),l&&_t(i,192),_t(i,226),_t(i,92,nwe("SheetJS",t)),_t(i,66,sl(o?1200:1252)),o&&_t(i,353,sl(0)),o&&_t(i,448),_t(i,317,Ewe(n.SheetNames.length)),o&&n.vbaraw&&_t(i,211),o&&n.vbaraw){var c=a.CodeName||"ThisWorkbook";_t(i,442,dee(c))}_t(i,156,sl(17)),_t(i,25,oa(!1)),_t(i,18,oa(!1)),_t(i,19,sl(0)),o&&_t(i,431,oa(!1)),o&&_t(i,444,sl(0)),_t(i,61,swe()),_t(i,64,oa(!1)),_t(i,141,sl(0)),_t(i,34,oa(DCe(n)=="true")),_t(i,14,oa(!0)),o&&_t(i,439,oa(!1)),_t(i,218,sl(0)),pIe(i,n,t),gIe(i,n.SSF,t),yIe(i,t),o&&_t(i,352,oa(!1));var h=i.end(),f=Fa();o&&_t(f,140,xwe()),o&&t.Strings&&lIe(f,252,rwe(t.Strings)),_t(f,10);var p=f.end(),y=Fa(),x=0,v=0;for(v=0;v<n.SheetNames.length;++v)x+=(o?12:11)+(o?2:1)*n.SheetNames[v].length;var _=h.length+x+p.length;for(v=0;v<n.SheetNames.length;++v){var E=s[v]||{};_t(y,133,iwe({pos:_,hs:E.Hidden||0,dt:0,name:n.SheetNames[v]},t)),_+=e[v].length}var w=y.end();if(x!=w.length)throw new Error("BS8 "+x+" != "+w.length);var A=[];return h.length&&A.push(h),w.length&&A.push(w),p.length&&A.push(p),As(A)}function EIe(n,e){var t=e||{},i=[];n&&!n.SSF&&(n.SSF=Pa(Qi)),n&&n.SSF&&(jI(),$I(n.SSF),t.revssf=XI(n.SSF),t.revssf[n.SSF[65535]]=0,t.ssf=n.SSF),t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,OL(t),t.cellXfs=[],wp(t.cellXfs,{},{revssf:{General:0}}),n.Props||(n.Props={});for(var r=0;r<n.SheetNames.length;++r)i[i.length]=bIe(r,t,n);return i.unshift(TIe(n,i,t)),As(i)}function Bee(n,e){for(var t=0;t<=n.SheetNames.length;++t){var i=n.Sheets[n.SheetNames[t]];if(!(!i||!i["!ref"])){var r=Do(i["!ref"]);r.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+n.SheetNames[t]+"' extends beyond column IV (255).  Data may be lost.")}}var s=e||{};switch(s.biff||2){case 8:case 5:return EIe(n,e);case 4:case 3:case 2:return fIe(n,e)}throw new Error("invalid type "+s.bookType+" for BIFF")}function wIe(n,e,t,i){for(var r=n["!merges"]||[],s=[],a=e.s.c;a<=e.e.c;++a){for(var o=0,l=0,c=0;c<r.length;++c)if(!(r[c].s.r>t||r[c].s.c>a)&&!(r[c].e.r<t||r[c].e.c<a)){if(r[c].s.r<t||r[c].s.c<a){o=-1;break}o=r[c].e.r-r[c].s.r+1,l=r[c].e.c-r[c].s.c+1;break}if(!(o<0)){var h=ii({r:t,c:a}),f=i.dense?(n[t]||[])[a]:n[h],p=f&&f.v!=null&&(f.h||tEe(f.w||(Wh(f),f.w)||""))||"",y={};o>1&&(y.rowspan=o),l>1&&(y.colspan=l),i.editable?p='<span contenteditable="true">'+p+"</span>":f&&(y["data-t"]=f&&f.t||"z",f.v!=null&&(y["data-v"]=f.v),f.z!=null&&(y["data-z"]=f.z),f.l&&(f.l.Target||"#").charAt(0)!="#"&&(p='<a href="'+f.l.Target+'">'+p+"</a>")),y.id=(i.id||"sjs")+"-"+h,s.push(vt("td",p,y))}}var x="<tr>";return x+s.join("")+"</tr>"}var AIe='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',SIe="</body></html>";function DIe(n,e,t){var i=[];return i.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}function Vee(n,e){var t=e||{},i=t.header!=null?t.header:AIe,r=t.footer!=null?t.footer:SIe,s=[i],a=Do(n["!ref"]);t.dense=Array.isArray(n),s.push(DIe(n,a,t));for(var o=a.s.r;o<=a.e.r;++o)s.push(wIe(n,a,o,t));return s.push("</table>"+r),s.join("")}function Wee(n,e,t){var i=t||{},r=0,s=0;if(i.origin!=null)if(typeof i.origin=="number")r=i.origin;else{var a=typeof i.origin=="string"?ts(i.origin):i.origin;r=a.r,s=a.c}var o=e.getElementsByTagName("tr"),l=Math.min(i.sheetRows||1e7,o.length),c={s:{r:0,c:0},e:{r,c:s}};if(n["!ref"]){var h=Do(n["!ref"]);c.s.r=Math.min(c.s.r,h.s.r),c.s.c=Math.min(c.s.c,h.s.c),c.e.r=Math.max(c.e.r,h.e.r),c.e.c=Math.max(c.e.c,h.e.c),r==-1&&(c.e.r=r=h.e.r+1)}var f=[],p=0,y=n["!rows"]||(n["!rows"]=[]),x=0,v=0,_=0,E=0,w=0,A=0;for(n["!cols"]||(n["!cols"]=[]);x<o.length&&v<l;++x){var N=o[x];if(fG(N)){if(i.display)continue;y[v]={hidden:!0}}var k=N.children;for(_=E=0;_<k.length;++_){var F=k[_];if(!(i.display&&fG(F))){var C=F.hasAttribute("data-v")?F.getAttribute("data-v"):F.hasAttribute("v")?F.getAttribute("v"):sEe(F.innerHTML),M=F.getAttribute("data-z")||F.getAttribute("z");for(p=0;p<f.length;++p){var R=f[p];R.s.c==E+s&&R.s.r<v+r&&v+r<=R.e.r&&(E=R.e.c+1-s,p=-1)}A=+F.getAttribute("colspan")||1,((w=+F.getAttribute("rowspan")||1)>1||A>1)&&f.push({s:{r:v+r,c:E+s},e:{r:v+r+(w||1)-1,c:E+s+(A||1)-1}});var L={t:"s",v:C},H=F.getAttribute("data-t")||F.getAttribute("t")||"";C!=null&&(C.length==0?L.t=H||"z":i.raw||C.trim().length==0||H=="s"||(C==="TRUE"?L={t:"b",v:!0}:C==="FALSE"?L={t:"b",v:!1}:isNaN(Ih(C))?isNaN(kb(C).getDate())||(L={t:"d",v:ha(C)},i.cellDates||(L={t:"n",v:Ua(L.v)}),L.z=i.dateNF||Qi[14]):L={t:"n",v:Ih(C)})),L.z===void 0&&M!=null&&(L.z=M);var P="",O=F.getElementsByTagName("A");if(O&&O.length)for(var B=0;B<O.length&&!(O[B].hasAttribute("href")&&(P=O[B].getAttribute("href"),P.charAt(0)!="#"));++B);P&&P.charAt(0)!="#"&&(L.l={Target:P}),i.dense?(n[v+r]||(n[v+r]=[]),n[v+r][E+s]=L):n[ii({c:E+s,r:v+r})]=L,c.e.c<E+s&&(c.e.c=E+s),E+=A}}++v}return f.length&&(n["!merges"]=(n["!merges"]||[]).concat(f)),c.e.r=Math.max(c.e.r,v-1+r),n["!ref"]=br(c),v>=l&&(n["!fullref"]=br((c.e.r=o.length-x+v-1+r,c))),n}function Hee(n,e){var t=e||{},i=t.dense?[]:{};return Wee(i,n,e)}function CIe(n,e){return n0(Hee(n,e),e)}function fG(n){var e="",t=IIe(n);return t&&(e=t(n).getPropertyValue("display")),e||(e=n.style&&n.style.display),e==="none"}function IIe(n){return n.ownerDocument.defaultView&&typeof n.ownerDocument.defaultView.getComputedStyle=="function"?n.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var RIe=(function(){var n=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),e="<office:document-styles "+Fb({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+n+"</office:document-styles>";return function(){return Er+e}})(),pG=(function(){var n=function(s){return ni(s).replace(/  +/g,function(a){return'<text:s text:c="'+a.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},e=`          <table:table-cell />
`,t=`          <table:covered-table-cell/>
`,i=function(s,a,o){var l=[];l.push('      <table:table table:name="'+ni(a.SheetNames[o])+`" table:style-name="ta1">
`);var c=0,h=0,f=Do(s["!ref"]||"A1"),p=s["!merges"]||[],y=0,x=Array.isArray(s);if(s["!cols"])for(h=0;h<=f.e.c;++h)l.push("        <table:table-column"+(s["!cols"][h]?' table:style-name="co'+s["!cols"][h].ods+'"':"")+`></table:table-column>
`);var v="",_=s["!rows"]||[];for(c=0;c<f.s.r;++c)v=_[c]?' table:style-name="ro'+_[c].ods+'"':"",l.push("        <table:table-row"+v+`></table:table-row>
`);for(;c<=f.e.r;++c){for(v=_[c]?' table:style-name="ro'+_[c].ods+'"':"",l.push("        <table:table-row"+v+`>
`),h=0;h<f.s.c;++h)l.push(e);for(;h<=f.e.c;++h){var E=!1,w={},A="";for(y=0;y!=p.length;++y)if(!(p[y].s.c>h)&&!(p[y].s.r>c)&&!(p[y].e.c<h)&&!(p[y].e.r<c)){(p[y].s.c!=h||p[y].s.r!=c)&&(E=!0),w["table:number-columns-spanned"]=p[y].e.c-p[y].s.c+1,w["table:number-rows-spanned"]=p[y].e.r-p[y].s.r+1;break}if(E){l.push(t);continue}var N=ii({r:c,c:h}),k=x?(s[c]||[])[h]:s[N];if(k&&k.f&&(w["table:formula"]=ni(YSe(k.f)),k.F&&k.F.slice(0,N.length)==N)){var F=Do(k.F);w["table:number-matrix-columns-spanned"]=F.e.c-F.s.c+1,w["table:number-matrix-rows-spanned"]=F.e.r-F.s.r+1}if(!k){l.push(e);continue}switch(k.t){case"b":A=k.v?"TRUE":"FALSE",w["office:value-type"]="boolean",w["office:boolean-value"]=k.v?"true":"false";break;case"n":A=k.w||String(k.v||0),w["office:value-type"]="float",w["office:value"]=k.v||0;break;case"s":case"str":A=k.v==null?"":k.v,w["office:value-type"]="string";break;case"d":A=k.w||ha(k.v).toISOString(),w["office:value-type"]="date",w["office:date-value"]=ha(k.v).toISOString(),w["table:style-name"]="ce1";break;default:l.push(e);continue}var C=n(A);if(k.l&&k.l.Target){var M=k.l.Target;M=M.charAt(0)=="#"?"#"+JSe(M.slice(1)):M,M.charAt(0)!="#"&&!M.match(/^\w+:/)&&(M="../"+M),C=vt("text:a",C,{"xlink:href":M.replace(/&/g,"&amp;")})}l.push("          "+vt("table:table-cell",vt("text:p",C,{}),w)+`
`)}l.push(`        </table:table-row>
`)}return l.push(`      </table:table>
`),l.join("")},r=function(s,a){s.push(` <office:automatic-styles>
`),s.push(`  <number:date-style style:name="N37" number:automatic-order="true">
`),s.push(`   <number:month number:style="long"/>
`),s.push(`   <number:text>/</number:text>
`),s.push(`   <number:day number:style="long"/>
`),s.push(`   <number:text>/</number:text>
`),s.push(`   <number:year/>
`),s.push(`  </number:date-style>
`);var o=0;a.SheetNames.map(function(c){return a.Sheets[c]}).forEach(function(c){if(c&&c["!cols"]){for(var h=0;h<c["!cols"].length;++h)if(c["!cols"][h]){var f=c["!cols"][h];if(f.width==null&&f.wpx==null&&f.wch==null)continue;ML(f),f.ods=o;var p=c["!cols"][h].wpx+"px";s.push('  <style:style style:name="co'+o+`" style:family="table-column">
`),s.push('   <style:table-column-properties fo:break-before="auto" style:column-width="'+p+`"/>
`),s.push(`  </style:style>
`),++o}}});var l=0;a.SheetNames.map(function(c){return a.Sheets[c]}).forEach(function(c){if(c&&c["!rows"]){for(var h=0;h<c["!rows"].length;++h)if(c["!rows"][h]){c["!rows"][h].ods=l;var f=c["!rows"][h].hpx+"px";s.push('  <style:style style:name="ro'+l+`" style:family="table-row">
`),s.push('   <style:table-row-properties fo:break-before="auto" style:row-height="'+f+`"/>
`),s.push(`  </style:style>
`),++l}}}),s.push(`  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">
`),s.push(`   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
`),s.push(`  </style:style>
`),s.push(`  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
`),s.push(` </office:automatic-styles>
`)};return function(a,o){var l=[Er],c=Fb({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),h=Fb({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});o.bookType=="fods"?(l.push("<office:document"+c+h+`>
`),l.push(iee().replace(/office:document-meta/g,"office:meta"))):l.push("<office:document-content"+c+`>
`),r(l,a),l.push(`  <office:body>
`),l.push(`    <office:spreadsheet>
`);for(var f=0;f!=a.SheetNames.length;++f)l.push(i(a.Sheets[a.SheetNames[f]],a,f));return l.push(`    </office:spreadsheet>
`),l.push(`  </office:body>
`),o.bookType=="fods"?l.push("</office:document>"):l.push("</office:document-content>"),l.join("")}})();function zee(n,e){if(e.bookType=="fods")return pG(n,e);var t=TL(),i="",r=[],s=[];return i="mimetype",pn(t,i,"application/vnd.oasis.opendocument.spreadsheet"),i="content.xml",pn(t,i,pG(n,e)),r.push([i,"text/xml"]),s.push([i,"ContentFile"]),i="styles.xml",pn(t,i,RIe(n,e)),r.push([i,"text/xml"]),s.push([i,"StylesFile"]),i="meta.xml",pn(t,i,Er+iee()),r.push([i,"text/xml"]),s.push([i,"MetadataFile"]),i="manifest.rdf",pn(t,i,HEe(s)),r.push([i,"application/rdf+xml"]),i="META-INF/manifest.xml",pn(t,i,VEe(r)),t}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function sC(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function NIe(n){return typeof TextEncoder<"u"?new TextEncoder().encode(n):Xl(Mb(n))}function kIe(n,e){e:for(var t=0;t<=n.length-e.length;++t){for(var i=0;i<e.length;++i)if(n[t+i]!=e[i])continue e;return!0}return!1}function ap(n){var e=n.reduce(function(r,s){return r+s.length},0),t=new Uint8Array(e),i=0;return n.forEach(function(r){t.set(r,i),i+=r.length}),t}function MIe(n,e,t){var i=Math.floor(t==0?0:Math.LOG10E*Math.log(Math.abs(t)))+6176-20,r=t/Math.pow(10,i-6176);n[e+15]|=i>>7,n[e+14]|=(i&127)<<1;for(var s=0;r>=1;++s,r/=256)n[e+s]=r&255;n[e+15]|=t>=0?0:128}function Ub(n,e){var t=e?e[0]:0,i=n[t]&127;e:if(n[t++]>=128&&(i|=(n[t]&127)<<7,n[t++]<128||(i|=(n[t]&127)<<14,n[t++]<128)||(i|=(n[t]&127)<<21,n[t++]<128)||(i+=(n[t]&127)*Math.pow(2,28),++t,n[t++]<128)||(i+=(n[t]&127)*Math.pow(2,35),++t,n[t++]<128)||(i+=(n[t]&127)*Math.pow(2,42),++t,n[t++]<128)))break e;return e&&(e[0]=t),i}function Zn(n){var e=new Uint8Array(7);e[0]=n&127;var t=1;e:if(n>127){if(e[t-1]|=128,e[t]=n>>7&127,++t,n<=16383||(e[t-1]|=128,e[t]=n>>14&127,++t,n<=2097151)||(e[t-1]|=128,e[t]=n>>21&127,++t,n<=268435455)||(e[t-1]|=128,e[t]=n/256>>>21&127,++t,n<=34359738367)||(e[t-1]|=128,e[t]=n/65536>>>21&127,++t,n<=4398046511103))break e;e[t-1]|=128,e[t]=n/16777216>>>21&127,++t}return e.slice(0,t)}function Vy(n){var e=0,t=n[e]&127;e:if(n[e++]>=128){if(t|=(n[e]&127)<<7,n[e++]<128||(t|=(n[e]&127)<<14,n[e++]<128)||(t|=(n[e]&127)<<21,n[e++]<128))break e;t|=(n[e]&127)<<28}return t}function Nr(n){for(var e=[],t=[0];t[0]<n.length;){var i=t[0],r=Ub(n,t),s=r&7;r=Math.floor(r/8);var a=0,o;if(r==0)break;switch(s){case 0:{for(var l=t[0];n[t[0]++]>=128;);o=n.slice(l,t[0])}break;case 5:a=4,o=n.slice(t[0],t[0]+a),t[0]+=a;break;case 1:a=8,o=n.slice(t[0],t[0]+a),t[0]+=a;break;case 2:a=Ub(n,t),o=n.slice(t[0],t[0]+a),t[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(r," at offset ").concat(i))}var c={data:o,type:s};e[r]==null?e[r]=[c]:e[r].push(c)}return e}function ds(n){var e=[];return n.forEach(function(t,i){t.forEach(function(r){r.data&&(e.push(Zn(i*8+r.type)),r.type==2&&e.push(Zn(r.data.length)),e.push(r.data))})}),ap(e)}function Nl(n){for(var e,t=[],i=[0];i[0]<n.length;){var r=Ub(n,i),s=Nr(n.slice(i[0],i[0]+r));i[0]+=r;var a={id:Vy(s[1][0].data),messages:[]};s[2].forEach(function(o){var l=Nr(o.data),c=Vy(l[3][0].data);a.messages.push({meta:l,data:n.slice(i[0],i[0]+c)}),i[0]+=c}),(e=s[3])!=null&&e[0]&&(a.merge=Vy(s[3][0].data)>>>0>0),t.push(a)}return t}function ey(n){var e=[];return n.forEach(function(t){var i=[];i[1]=[{data:Zn(t.id),type:0}],i[2]=[],t.merge!=null&&(i[3]=[{data:Zn(+!!t.merge),type:0}]);var r=[];t.messages.forEach(function(a){r.push(a.data),a.meta[3]=[{type:0,data:Zn(a.data.length)}],i[2].push({data:ds(a.meta),type:2})});var s=ds(i);e.push(Zn(s.length)),e.push(s),r.forEach(function(a){return e.push(a)})}),ap(e)}function FIe(n,e){if(n!=0)throw new Error("Unexpected Snappy chunk type ".concat(n));for(var t=[0],i=Ub(e,t),r=[];t[0]<e.length;){var s=e[t[0]]&3;if(s==0){var a=e[t[0]++]>>2;if(a<60)++a;else{var o=a-59;a=e[t[0]],o>1&&(a|=e[t[0]+1]<<8),o>2&&(a|=e[t[0]+2]<<16),o>3&&(a|=e[t[0]+3]<<24),a>>>=0,a++,t[0]+=o}r.push(e.slice(t[0],t[0]+a)),t[0]+=a;continue}else{var l=0,c=0;if(s==1?(c=(e[t[0]]>>2&7)+4,l=(e[t[0]++]&224)<<3,l|=e[t[0]++]):(c=(e[t[0]++]>>2)+1,s==2?(l=e[t[0]]|e[t[0]+1]<<8,t[0]+=2):(l=(e[t[0]]|e[t[0]+1]<<8|e[t[0]+2]<<16|e[t[0]+3]<<24)>>>0,t[0]+=4)),r=[ap(r)],l==0)throw new Error("Invalid offset 0");if(l>r[0].length)throw new Error("Invalid offset beyond length");if(c>=l)for(r.push(r[0].slice(-l)),c-=l;c>=r[r.length-1].length;)r.push(r[r.length-1]),c-=r[r.length-1].length;r.push(r[0].slice(-l,-l+c))}}var h=ap(r);if(h.length!=i)throw new Error("Unexpected length: ".concat(h.length," != ").concat(i));return h}function kl(n){for(var e=[],t=0;t<n.length;){var i=n[t++],r=n[t]|n[t+1]<<8|n[t+2]<<16;t+=3,e.push(FIe(i,n.slice(t,t+r))),t+=r}if(t!==n.length)throw new Error("data is not a valid framed stream!");return ap(e)}function ty(n){for(var e=[],t=0;t<n.length;){var i=Math.min(n.length-t,268435455),r=new Uint8Array(4);e.push(r);var s=Zn(i),a=s.length;e.push(s),i<=60?(a++,e.push(new Uint8Array([i-1<<2]))):i<=256?(a+=2,e.push(new Uint8Array([240,i-1&255]))):i<=65536?(a+=3,e.push(new Uint8Array([244,i-1&255,i-1>>8&255]))):i<=16777216?(a+=4,e.push(new Uint8Array([248,i-1&255,i-1>>8&255,i-1>>16&255]))):i<=4294967296&&(a+=5,e.push(new Uint8Array([252,i-1&255,i-1>>8&255,i-1>>16&255,i-1>>>24&255]))),e.push(n.slice(t,t+i)),a+=i,r[0]=0,r[1]=a&255,r[2]=a>>8&255,r[3]=a>>16&255,t+=i}return ap(e)}function fM(n,e){var t=new Uint8Array(32),i=sC(t),r=12,s=0;switch(t[0]=5,n.t){case"n":t[1]=2,MIe(t,r,n.v),s|=1,r+=16;break;case"b":t[1]=6,i.setFloat64(r,n.v?1:0,!0),s|=2,r+=8;break;case"s":if(e.indexOf(n.v)==-1)throw new Error("Value ".concat(n.v," missing from SST!"));t[1]=3,i.setUint32(r,e.indexOf(n.v),!0),s|=8,r+=4;break;default:throw"unsupported cell type "+n.t}return i.setUint32(8,s,!0),t.slice(0,r)}function pM(n,e){var t=new Uint8Array(32),i=sC(t),r=12,s=0;switch(t[0]=3,n.t){case"n":t[2]=2,i.setFloat64(r,n.v,!0),s|=32,r+=8;break;case"b":t[2]=6,i.setFloat64(r,n.v?1:0,!0),s|=32,r+=8;break;case"s":if(e.indexOf(n.v)==-1)throw new Error("Value ".concat(n.v," missing from SST!"));t[2]=3,i.setUint32(r,e.indexOf(n.v),!0),s|=16,r+=4;break;default:throw"unsupported cell type "+n.t}return i.setUint32(4,s,!0),t.slice(0,r)}function Ld(n){var e=Nr(n);return Ub(e[1][0].data)}function UIe(n,e,t){var i,r,s,a;if(!((i=n[6])!=null&&i[0])||!((r=n[7])!=null&&r[0]))throw"Mutation only works on post-BNC storages!";var o=((a=(s=n[8])==null?void 0:s[0])==null?void 0:a.data)&&Vy(n[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var l=0,c=sC(n[7][0].data),h=0,f=[],p=sC(n[4][0].data),y=0,x=[],v=0;v<e.length;++v){if(e[v]==null){c.setUint16(v*2,65535,!0),p.setUint16(v*2,65535);continue}c.setUint16(v*2,h,!0),p.setUint16(v*2,y,!0);var _,E;switch(typeof e[v]){case"string":_=fM({t:"s",v:e[v]},t),E=pM({t:"s",v:e[v]},t);break;case"number":_=fM({t:"n",v:e[v]},t),E=pM({t:"n",v:e[v]},t);break;case"boolean":_=fM({t:"b",v:e[v]},t),E=pM({t:"b",v:e[v]},t);break;default:throw new Error("Unsupported value "+e[v])}f.push(_),h+=_.length,x.push(E),y+=E.length,++l}for(n[2][0].data=Zn(l);v<n[7][0].data.length/2;++v)c.setUint16(v*2,65535,!0),p.setUint16(v*2,65535,!0);return n[6][0].data=ap(f),n[3][0].data=ap(x),l}function PIe(n,e){if(!e||!e.numbers)throw new Error("Must pass a `numbers` option -- check the README");var t=n.Sheets[n.SheetNames[0]];n.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var i=Do(t["!ref"]);i.s.r=i.s.c=0;var r=!1;i.e.c>9&&(r=!0,i.e.c=9),i.e.r>49&&(r=!0,i.e.r=49),r&&console.error("The Numbers writer is currently limited to ".concat(br(i)));var s=aC(t,{range:i,header:1}),a=["~Sh33tJ5~"];s.forEach(function(Z){return Z.forEach(function(te){typeof te=="string"&&a.push(te)})});var o={},l=[],c=fi.read(e.numbers,{type:"base64"});c.FileIndex.map(function(Z,te){return[Z,c.FullPaths[te]]}).forEach(function(Z){var te=Z[0],ie=Z[1];if(te.type==2&&te.name.match(/\.iwa/)){var _e=te.content,Ie=kl(_e),Pe=Nl(Ie);Pe.forEach(function(Fe){l.push(Fe.id),o[Fe.id]={deps:[],location:ie,type:Vy(Fe.messages[0].meta[1][0].data)}})}}),l.sort(function(Z,te){return Z-te});var h=l.filter(function(Z){return Z>1}).map(function(Z){return[Z,Zn(Z)]});c.FileIndex.map(function(Z,te){return[Z,c.FullPaths[te]]}).forEach(function(Z){var te=Z[0];if(Z[1],!!te.name.match(/\.iwa/)){var ie=Nl(kl(te.content));ie.forEach(function(_e){_e.messages.forEach(function(Ie){h.forEach(function(Pe){_e.messages.some(function(Fe){return Vy(Fe.meta[1][0].data)!=11006&&kIe(Fe.data,Pe[1])})&&o[Pe[0]].deps.push(_e.id)})})})}});for(var f=fi.find(c,o[1].location),p=Nl(kl(f.content)),y,x=0;x<p.length;++x){var v=p[x];v.id==1&&(y=v)}var _=Ld(Nr(y.messages[0].data)[1][0].data);for(f=fi.find(c,o[_].location),p=Nl(kl(f.content)),x=0;x<p.length;++x)v=p[x],v.id==_&&(y=v);for(_=Ld(Nr(y.messages[0].data)[2][0].data),f=fi.find(c,o[_].location),p=Nl(kl(f.content)),x=0;x<p.length;++x)v=p[x],v.id==_&&(y=v);for(_=Ld(Nr(y.messages[0].data)[2][0].data),f=fi.find(c,o[_].location),p=Nl(kl(f.content)),x=0;x<p.length;++x)v=p[x],v.id==_&&(y=v);var E=Nr(y.messages[0].data);{E[6][0].data=Zn(i.e.r+1),E[7][0].data=Zn(i.e.c+1);var w=Ld(E[46][0].data),A=fi.find(c,o[w].location),N=Nl(kl(A.content));{for(var k=0;k<N.length&&N[k].id!=w;++k);if(N[k].id!=w)throw"Bad ColumnRowUIDMapArchive";var F=Nr(N[k].messages[0].data);F[1]=[],F[2]=[],F[3]=[];for(var C=0;C<=i.e.c;++C){var M=[];M[1]=M[2]=[{type:0,data:Zn(C+420690)}],F[1].push({type:2,data:ds(M)}),F[2].push({type:0,data:Zn(C)}),F[3].push({type:0,data:Zn(C)})}F[4]=[],F[5]=[],F[6]=[];for(var R=0;R<=i.e.r;++R)M=[],M[1]=M[2]=[{type:0,data:Zn(R+726270)}],F[4].push({type:2,data:ds(M)}),F[5].push({type:0,data:Zn(R)}),F[6].push({type:0,data:Zn(R)});N[k].messages[0].data=ds(F)}A.content=ty(ey(N)),A.size=A.content.length,delete E[46];var L=Nr(E[4][0].data);{L[7][0].data=Zn(i.e.r+1);var H=Nr(L[1][0].data),P=Ld(H[2][0].data);A=fi.find(c,o[P].location),N=Nl(kl(A.content));{if(N[0].id!=P)throw"Bad HeaderStorageBucket";var O=Nr(N[0].messages[0].data);for(R=0;R<s.length;++R){var B=Nr(O[2][0].data);B[1][0].data=Zn(R),B[4][0].data=Zn(s[R].length),O[2][R]={type:O[2][0].type,data:ds(B)}}N[0].messages[0].data=ds(O)}A.content=ty(ey(N)),A.size=A.content.length;var re=Ld(L[2][0].data);A=fi.find(c,o[re].location),N=Nl(kl(A.content));{if(N[0].id!=re)throw"Bad HeaderStorageBucket";for(O=Nr(N[0].messages[0].data),C=0;C<=i.e.c;++C)B=Nr(O[2][0].data),B[1][0].data=Zn(C),B[4][0].data=Zn(i.e.r+1),O[2][C]={type:O[2][0].type,data:ds(B)};N[0].messages[0].data=ds(O)}A.content=ty(ey(N)),A.size=A.content.length;var q=Ld(L[4][0].data);(function(){for(var Z=fi.find(c,o[q].location),te=Nl(kl(Z.content)),ie,_e=0;_e<te.length;++_e){var Ie=te[_e];Ie.id==q&&(ie=Ie)}var Pe=Nr(ie.messages[0].data);{Pe[3]=[];var Fe=[];a.forEach(function(gt,Mt){Fe[1]=[{type:0,data:Zn(Mt)}],Fe[2]=[{type:0,data:Zn(1)}],Fe[3]=[{type:2,data:NIe(gt)}],Pe[3].push({type:2,data:ds(Fe)})})}ie.messages[0].data=ds(Pe);var Ge=ey(te),ct=ty(Ge);Z.content=ct,Z.size=Z.content.length})();var X=Nr(L[3][0].data);{var oe=X[1][0];delete X[2];var ue=Nr(oe.data);{var ge=Ld(ue[2][0].data);(function(){for(var Z=fi.find(c,o[ge].location),te=Nl(kl(Z.content)),ie,_e=0;_e<te.length;++_e){var Ie=te[_e];Ie.id==ge&&(ie=Ie)}var Pe=Nr(ie.messages[0].data);{delete Pe[6],delete X[7];var Fe=new Uint8Array(Pe[5][0].data);Pe[5]=[];for(var Ge=0,ct=0;ct<=i.e.r;++ct){var gt=Nr(Fe);Ge+=UIe(gt,s[ct],a),gt[1][0].data=Zn(ct),Pe[5].push({data:ds(gt),type:2})}Pe[1]=[{type:0,data:Zn(i.e.c+1)}],Pe[2]=[{type:0,data:Zn(i.e.r+1)}],Pe[3]=[{type:0,data:Zn(Ge)}],Pe[4]=[{type:0,data:Zn(i.e.r+1)}]}ie.messages[0].data=ds(Pe);var Mt=ey(te),W=ty(Mt);Z.content=W,Z.size=Z.content.length})()}oe.data=ds(ue)}L[3][0].data=ds(X)}E[4][0].data=ds(L)}y.messages[0].data=ds(E);var j=ey(p),G=ty(j);return f.content=G,f.size=f.content.length,c}function LIe(n){return function(t){for(var i=0;i!=n.length;++i){var r=n[i];t[r[0]]===void 0&&(t[r[0]]=r[1]),r[2]==="n"&&(t[r[0]]=Number(t[r[0]]))}}}function OL(n){LIe([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(n)}function OIe(n,e){return e.bookType=="ods"?zee(n,e):e.bookType=="numbers"?PIe(n,e):e.bookType=="xlsb"?BIe(n,e):VIe(n,e)}function BIe(n,e){Ay=1024,n&&!n.SSF&&(n.SSF=Pa(Qi)),n&&n.SSF&&(jI(),$I(n.SSF),e.revssf=XI(n.SSF),e.revssf[n.SSF[65535]]=0,e.ssf=n.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,ab?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var t=e.bookType=="xlsb"?"bin":"xml",i=Aee.indexOf(e.bookType)>-1,r=eee();OL(e=e||{});var s=TL(),a="",o=0;if(e.cellXfs=[],wp(e.cellXfs,{},{revssf:{General:0}}),n.Props||(n.Props={}),a="docProps/core.xml",pn(s,a,ree(n.Props,e)),r.coreprops.push(a),ei(e.rels,2,a,Mn.CORE_PROPS),a="docProps/app.xml",!(n.Props&&n.Props.SheetNames))if(!n.Workbook||!n.Workbook.Sheets)n.Props.SheetNames=n.SheetNames;else{for(var l=[],c=0;c<n.SheetNames.length;++c)(n.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(n.SheetNames[c]);n.Props.SheetNames=l}for(n.Props.Worksheets=n.Props.SheetNames.length,pn(s,a,aee(n.Props)),r.extprops.push(a),ei(e.rels,3,a,Mn.EXT_PROPS),n.Custprops!==n.Props&&Rs(n.Custprops||{}).length>0&&(a="docProps/custom.xml",pn(s,a,oee(n.Custprops)),r.custprops.push(a),ei(e.rels,4,a,Mn.CUST_PROPS)),o=1;o<=n.SheetNames.length;++o){var h={"!id":{}},f=n.Sheets[n.SheetNames[o-1]],p=(f||{})["!type"]||"sheet";switch(p){case"chart":default:a="xl/worksheets/sheet"+o+"."+t,pn(s,a,HCe(o-1,a,e,n,h)),r.sheets.push(a),ei(e.wbrels,-1,"worksheets/sheet"+o+"."+t,Mn.WS[0])}if(f){var y=f["!comments"],x=!1,v="";y&&y.length>0&&(v="xl/comments"+o+"."+t,pn(s,v,qCe(y,v)),r.comments.push(v),ei(h,-1,"../comments"+o+"."+t,Mn.CMNT),x=!0),f["!legacy"]&&x&&pn(s,"xl/drawings/vmlDrawing"+o+".vml",Eee(o,f["!comments"])),delete f["!comments"],delete f["!legacy"]}h["!id"].rId1&&pn(s,nee(a),Oy(h))}return e.Strings!=null&&e.Strings.length>0&&(a="xl/sharedStrings."+t,pn(s,a,GCe(e.Strings,a,e)),r.strs.push(a),ei(e.wbrels,-1,"sharedStrings."+t,Mn.SST)),a="xl/workbook."+t,pn(s,a,WCe(n,a)),r.workbooks.push(a),ei(e.rels,1,a,Mn.WB),a="xl/theme/theme1.xml",pn(s,a,bee(n.Themes,e)),r.themes.push(a),ei(e.wbrels,-1,"theme/theme1.xml",Mn.THEME),a="xl/styles."+t,pn(s,a,zCe(n,a,e)),r.styles.push(a),ei(e.wbrels,-1,"styles."+t,Mn.STY),n.vbaraw&&i&&(a="xl/vbaProject.bin",pn(s,a,n.vbaraw),r.vba.push(a),ei(e.wbrels,-1,"vbaProject.bin",Mn.VBA)),a="xl/metadata."+t,pn(s,a,$Ce(a)),r.metadata.push(a),ei(e.wbrels,-1,"metadata."+t,Mn.XLMETA),pn(s,"[Content_Types].xml",tee(r,e)),pn(s,"_rels/.rels",Oy(e.rels)),pn(s,"xl/_rels/workbook."+t+".rels",Oy(e.wbrels)),delete e.revssf,delete e.ssf,s}function VIe(n,e){Ay=1024,n&&!n.SSF&&(n.SSF=Pa(Qi)),n&&n.SSF&&(jI(),$I(n.SSF),e.revssf=XI(n.SSF),e.revssf[n.SSF[65535]]=0,e.ssf=n.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,ab?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var t="xml",i=Aee.indexOf(e.bookType)>-1,r=eee();OL(e=e||{});var s=TL(),a="",o=0;if(e.cellXfs=[],wp(e.cellXfs,{},{revssf:{General:0}}),n.Props||(n.Props={}),a="docProps/core.xml",pn(s,a,ree(n.Props,e)),r.coreprops.push(a),ei(e.rels,2,a,Mn.CORE_PROPS),a="docProps/app.xml",!(n.Props&&n.Props.SheetNames))if(!n.Workbook||!n.Workbook.Sheets)n.Props.SheetNames=n.SheetNames;else{for(var l=[],c=0;c<n.SheetNames.length;++c)(n.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(n.SheetNames[c]);n.Props.SheetNames=l}n.Props.Worksheets=n.Props.SheetNames.length,pn(s,a,aee(n.Props)),r.extprops.push(a),ei(e.rels,3,a,Mn.EXT_PROPS),n.Custprops!==n.Props&&Rs(n.Custprops||{}).length>0&&(a="docProps/custom.xml",pn(s,a,oee(n.Custprops)),r.custprops.push(a),ei(e.rels,4,a,Mn.CUST_PROPS));var h=["SheetJ5"];for(e.tcid=0,o=1;o<=n.SheetNames.length;++o){var f={"!id":{}},p=n.Sheets[n.SheetNames[o-1]],y=(p||{})["!type"]||"sheet";switch(y){case"chart":default:a="xl/worksheets/sheet"+o+"."+t,pn(s,a,Fee(o-1,e,n,f)),r.sheets.push(a),ei(e.wbrels,-1,"worksheets/sheet"+o+"."+t,Mn.WS[0])}if(p){var x=p["!comments"],v=!1,_="";if(x&&x.length>0){var E=!1;x.forEach(function(w){w[1].forEach(function(A){A.T==!0&&(E=!0)})}),E&&(_="xl/threadedComments/threadedComment"+o+"."+t,pn(s,_,yAe(x,h,e)),r.threadedcomments.push(_),ei(f,-1,"../threadedComments/threadedComment"+o+"."+t,Mn.TCMNT)),_="xl/comments"+o+"."+t,pn(s,_,wee(x)),r.comments.push(_),ei(f,-1,"../comments"+o+"."+t,Mn.CMNT),v=!0}p["!legacy"]&&v&&pn(s,"xl/drawings/vmlDrawing"+o+".vml",Eee(o,p["!comments"])),delete p["!comments"],delete p["!legacy"]}f["!id"].rId1&&pn(s,nee(a),Oy(f))}return e.Strings!=null&&e.Strings.length>0&&(a="xl/sharedStrings."+t,pn(s,a,gee(e.Strings,e)),r.strs.push(a),ei(e.wbrels,-1,"sharedStrings."+t,Mn.SST)),a="xl/workbook."+t,pn(s,a,Lee(n)),r.workbooks.push(a),ei(e.rels,1,a,Mn.WB),a="xl/theme/theme1.xml",pn(s,a,bee(n.Themes,e)),r.themes.push(a),ei(e.wbrels,-1,"theme/theme1.xml",Mn.THEME),a="xl/styles."+t,pn(s,a,_ee(n,e)),r.styles.push(a),ei(e.wbrels,-1,"styles."+t,Mn.STY),n.vbaraw&&i&&(a="xl/vbaProject.bin",pn(s,a,n.vbaraw),r.vba.push(a),ei(e.wbrels,-1,"vbaProject.bin",Mn.VBA)),a="xl/metadata."+t,pn(s,a,Tee()),r.metadata.push(a),ei(e.wbrels,-1,"metadata."+t,Mn.XLMETA),h.length>1&&(a="xl/persons/person.xml",pn(s,a,vAe(h)),r.people.push(a),ei(e.wbrels,-1,"persons/person.xml",Mn.PEOPLE)),pn(s,"[Content_Types].xml",tee(r,e)),pn(s,"_rels/.rels",Oy(e.rels)),pn(s,"xl/_rels/workbook."+t+".rels",Oy(e.wbrels)),delete e.revssf,delete e.ssf,s}function WIe(n,e){var t="";switch((e||{}).type||"base64"){case"buffer":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];case"base64":t=Vh(n.slice(0,12));break;case"binary":t=n;break;case"array":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function Gee(n,e){switch(e.type){case"base64":case"binary":break;case"buffer":case"array":e.type="";break;case"file":return iE(e.file,fi.write(n,{type:Vn?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");default:throw new Error("Unrecognized type "+e.type)}return fi.write(n,e)}function HIe(n,e){var t=Pa(e||{}),i=OIe(n,t);return zIe(i,t)}function zIe(n,e){var t={},i=Vn?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(e.compression&&(t.compression="DEFLATE"),e.password)t.type=i;else switch(e.type){case"base64":t.type="base64";break;case"binary":t.type="string";break;case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");case"buffer":case"file":t.type=i;break;default:throw new Error("Unrecognized type "+e.type)}var r=n.FullPaths?fi.write(n,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[t.type]||t.type,compression:!!e.compression}):n.generate(t);if(typeof Deno<"u"&&typeof r=="string"){if(e.type=="binary"||e.type=="base64")return r;r=new Uint8Array(qI(r))}return e.password&&typeof encrypt_agile<"u"?Gee(encrypt_agile(r,e.password),e):e.type==="file"?iE(e.file,r):e.type=="string"?nb(r):r}function GIe(n,e){var t=e||{},i=aIe(n,t);return Gee(i,t)}function Sc(n,e,t){t||(t="");var i=t+n;switch(e.type){case"base64":return Nb(Mb(i));case"binary":return Mb(i);case"string":return n;case"file":return iE(e.file,i,"utf8");case"buffer":return Vn?Qh(i,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(i):Sc(i,{type:"binary"}).split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function qIe(n,e){switch(e.type){case"base64":return Nb(n);case"binary":return n;case"string":return n;case"file":return iE(e.file,n,"binary");case"buffer":return Vn?Qh(n,"binary"):n.split("").map(function(t){return t.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function SA(n,e){switch(e.type){case"string":case"base64":case"binary":for(var t="",i=0;i<n.length;++i)t+=String.fromCharCode(n[i]);return e.type=="base64"?Nb(t):e.type=="string"?nb(t):t;case"file":return iE(e.file,n);case"buffer":return n;default:throw new Error("Unrecognized type "+e.type)}}function qee(n,e){_Te(),RCe(n);var t=Pa(e||{});if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),t.type=="array"){t.type="binary";var i=qee(n,t);return t.type="array",qI(i)}var r=0;if(t.sheet&&(typeof t.sheet=="number"?r=t.sheet:r=n.SheetNames.indexOf(t.sheet),!n.SheetNames[r]))throw new Error("Sheet not found: "+t.sheet+" : "+typeof t.sheet);switch(t.bookType||"xlsb"){case"xml":case"xlml":return Sc(rIe(n,t),t);case"slk":case"sylk":return Sc(Dwe.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"htm":case"html":return Sc(Vee(n.Sheets[n.SheetNames[r]],t),t);case"txt":return qIe($ee(n.Sheets[n.SheetNames[r]],t),t);case"csv":return Sc(BL(n.Sheets[n.SheetNames[r]],t),t,"\uFEFF");case"dif":return Sc(Cwe.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"dbf":return SA(Swe.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"prn":return Sc(Iwe.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"rtf":return Sc(Pwe.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"eth":return Sc(pee.from_sheet(n.Sheets[n.SheetNames[r]],t),t);case"fods":return Sc(zee(n,t),t);case"wk1":return SA(oG.sheet_to_wk1(n.Sheets[n.SheetNames[r]],t),t);case"wk3":return SA(oG.book_to_wk3(n,t),t);case"biff2":t.biff||(t.biff=2);case"biff3":t.biff||(t.biff=3);case"biff4":return t.biff||(t.biff=4),SA(Bee(n,t),t);case"biff5":t.biff||(t.biff=5);case"biff8":case"xla":case"xls":return t.biff||(t.biff=8),GIe(n,t);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return HIe(n,t);default:throw new Error("Unrecognized bookType |"+t.bookType+"|")}}function $Ie(n){if(!n.bookType){var e={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},t=n.file.slice(n.file.lastIndexOf(".")).toLowerCase();t.match(/^\.[a-z]+$/)&&(n.bookType=t.slice(1)),n.bookType=e[n.bookType]||n.bookType}}function gG(n,e,t){var i={};return i.type="file",i.file=e,$Ie(i),qee(n,i)}function jIe(n,e,t,i,r,s,a,o){var l=Is(t),c=o.defval,h=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),f=!0,p=r===1?[]:{};if(r!==1)if(Object.defineProperty)try{Object.defineProperty(p,"__rowNum__",{value:t,enumerable:!1})}catch{p.__rowNum__=t}else p.__rowNum__=t;if(!a||n[t])for(var y=e.s.c;y<=e.e.c;++y){var x=a?n[t][y]:n[i[y]+l];if(x===void 0||x.t===void 0){if(c===void 0)continue;s[y]!=null&&(p[s[y]]=c);continue}var v=x.v;switch(x.t){case"z":if(v==null)break;continue;case"e":v=v==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+x.t)}if(s[y]!=null){if(v==null)if(x.t=="e"&&v===null)p[s[y]]=null;else if(c!==void 0)p[s[y]]=c;else if(h&&v===null)p[s[y]]=null;else continue;else p[s[y]]=h&&(x.t!=="n"||x.t==="n"&&o.rawNumbers!==!1)?v:Wh(x,v,o);v!=null&&(f=!1)}}return{row:p,isempty:f}}function aC(n,e){if(n==null||n["!ref"]==null)return[];var t={t:"n",v:0},i=0,r=1,s=[],a=0,o="",l={s:{r:0,c:0},e:{r:0,c:0}},c=e||{},h=c.range!=null?c.range:n["!ref"];switch(c.header===1?i=1:c.header==="A"?i=2:Array.isArray(c.header)?i=3:c.header==null&&(i=0),typeof h){case"string":l=Ri(h);break;case"number":l=Ri(n["!ref"]),l.s.r=h;break;default:l=h}i>0&&(r=0);var f=Is(l.s.r),p=[],y=[],x=0,v=0,_=Array.isArray(n),E=l.s.r,w=0,A={};_&&!n[E]&&(n[E]=[]);var N=c.skipHidden&&n["!cols"]||[],k=c.skipHidden&&n["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(N[w]||{}).hidden)switch(p[w]=qs(w),t=_?n[E][w]:n[p[w]+f],i){case 1:s[w]=w-l.s.c;break;case 2:s[w]=p[w];break;case 3:s[w]=c.header[w-l.s.c];break;default:if(t==null&&(t={w:"__EMPTY",t:"s"}),o=a=Wh(t,null,c),v=A[a]||0,!v)A[a]=1;else{do o=a+"_"+v++;while(A[o]);A[a]=v,A[o]=1}s[w]=o}for(E=l.s.r+r;E<=l.e.r;++E)if(!(k[E]||{}).hidden){var F=jIe(n,l,E,p,i,s,_,c);(F.isempty===!1||(i===1?c.blankrows!==!1:c.blankrows))&&(y[x++]=F.row)}return y.length=x,y}var mG=/"/g;function XIe(n,e,t,i,r,s,a,o){for(var l=!0,c=[],h="",f=Is(t),p=e.s.c;p<=e.e.c;++p)if(i[p]){var y=o.dense?(n[t]||[])[p]:n[i[p]+f];if(y==null)h="";else if(y.v!=null){l=!1,h=""+(o.rawNumbers&&y.t=="n"?y.v:Wh(y,null,o));for(var x=0,v=0;x!==h.length;++x)if((v=h.charCodeAt(x))===r||v===s||v===34||o.forceQuotes){h='"'+h.replace(mG,'""')+'"';break}h=="ID"&&(h='"ID"')}else y.f!=null&&!y.F?(l=!1,h="="+y.f,h.indexOf(",")>=0&&(h='"'+h.replace(mG,'""')+'"')):h="";c.push(h)}return o.blankrows===!1&&l?null:c.join(a)}function BL(n,e){var t=[],i=e??{};if(n==null||n["!ref"]==null)return"";var r=Ri(n["!ref"]),s=i.FS!==void 0?i.FS:",",a=s.charCodeAt(0),o=i.RS!==void 0?i.RS:`
`,l=o.charCodeAt(0),c=new RegExp((s=="|"?"\\|":s)+"+$"),h="",f=[];i.dense=Array.isArray(n);for(var p=i.skipHidden&&n["!cols"]||[],y=i.skipHidden&&n["!rows"]||[],x=r.s.c;x<=r.e.c;++x)(p[x]||{}).hidden||(f[x]=qs(x));for(var v=0,_=r.s.r;_<=r.e.r;++_)(y[_]||{}).hidden||(h=XIe(n,r,_,f,a,l,s,i),h!=null&&(i.strip&&(h=h.replace(c,"")),(h||i.blankrows!==!1)&&t.push((v++?o:"")+h)));return delete i.dense,t.join("")}function $ee(n,e){e||(e={}),e.FS="	",e.RS=`
`;var t=BL(n,e);return t}function KIe(n){var e="",t,i="";if(n==null||n["!ref"]==null)return[];var r=Ri(n["!ref"]),s="",a=[],o,l=[],c=Array.isArray(n);for(o=r.s.c;o<=r.e.c;++o)a[o]=qs(o);for(var h=r.s.r;h<=r.e.r;++h)for(s=Is(h),o=r.s.c;o<=r.e.c;++o)if(e=a[o]+s,t=c?(n[h]||[])[o]:n[e],i="",t!==void 0){if(t.F!=null){if(e=t.F,!t.f)continue;i=t.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(t.f!=null)i=t.f;else{if(t.t=="z")continue;if(t.t=="n"&&t.v!=null)i=""+t.v;else if(t.t=="b")i=t.v?"TRUE":"FALSE";else if(t.w!==void 0)i="'"+t.w;else{if(t.v===void 0)continue;t.t=="s"?i="'"+t.v:i=""+t.v}}l[l.length]=e+"="+i}return l}function jee(n,e,t){var i=t||{},r=+!i.skipHeader,s=n||{},a=0,o=0;if(s&&i.origin!=null)if(typeof i.origin=="number")a=i.origin;else{var l=typeof i.origin=="string"?ts(i.origin):i.origin;a=l.r,o=l.c}var c,h={s:{c:0,r:0},e:{c:o,r:a+e.length-1+r}};if(s["!ref"]){var f=Ri(s["!ref"]);h.e.c=Math.max(h.e.c,f.e.c),h.e.r=Math.max(h.e.r,f.e.r),a==-1&&(a=f.e.r+1,h.e.r=a+e.length-1+r)}else a==-1&&(a=0,h.e.r=e.length-1+r);var p=i.header||[],y=0;e.forEach(function(v,_){Rs(v).forEach(function(E){(y=p.indexOf(E))==-1&&(p[y=p.length]=E);var w=v[E],A="z",N="",k=ii({c:o+y,r:a+_+r});c=Pb(s,k),w&&typeof w=="object"&&!(w instanceof Date)?s[k]=w:(typeof w=="number"?A="n":typeof w=="boolean"?A="b":typeof w=="string"?A="s":w instanceof Date?(A="d",i.cellDates||(A="n",w=Ua(w)),N=i.dateNF||Qi[14]):w===null&&i.nullError&&(A="e",w=0),c?(c.t=A,c.v=w,delete c.w,delete c.R,N&&(c.z=N)):s[k]=c={t:A,v:w},N&&(c.z=N))})}),h.e.c=Math.max(h.e.c,o+p.length-1);var x=Is(a);if(r)for(y=0;y<p.length;++y)s[qs(y+o)+x]={t:"s",v:p[y]};return s["!ref"]=br(h),s}function YIe(n,e){return jee(null,n,e)}function Pb(n,e,t){if(typeof e=="string"){if(Array.isArray(n)){var i=ts(e);return n[i.r]||(n[i.r]=[]),n[i.r][i.c]||(n[i.r][i.c]={t:"z"})}return n[e]||(n[e]={t:"z"})}return typeof e!="number"?Pb(n,ii(e)):Pb(n,ii({r:e,c:t||0}))}function JIe(n,e){if(typeof e=="number"){if(e>=0&&n.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var t=n.SheetNames.indexOf(e);if(t>-1)return t;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function QIe(){return{SheetNames:[],Sheets:{}}}function ZIe(n,e,t,i){var r=1;if(!t)for(;r<=65535&&n.SheetNames.indexOf(t="Sheet"+r)!=-1;++r,t=void 0);if(!t||n.SheetNames.length>=65535)throw new Error("Too many worksheets");if(i&&n.SheetNames.indexOf(t)>=0){var s=t.match(/(^.*?)(\d+)$/);r=s&&+s[2]||0;var a=s&&s[1]||t;for(++r;r<=65535&&n.SheetNames.indexOf(t=a+r)!=-1;++r);}if(Pee(t),n.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return n.SheetNames.push(t),n.Sheets[t]=e,t}function eRe(n,e,t){n.Workbook||(n.Workbook={}),n.Workbook.Sheets||(n.Workbook.Sheets=[]);var i=JIe(n,e);switch(n.Workbook.Sheets[i]||(n.Workbook.Sheets[i]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}n.Workbook.Sheets[i].Hidden=t}function tRe(n,e){return n.z=e,n}function Xee(n,e,t){return e?(n.l={Target:e},t&&(n.l.Tooltip=t)):delete n.l,n}function nRe(n,e,t){return Xee(n,"#"+e,t)}function iRe(n,e,t){n.c||(n.c=[]),n.c.push({t:e,a:t||"SheetJS"})}function rRe(n,e,t,i){for(var r=typeof e!="string"?e:Ri(e),s=typeof e=="string"?e:br(e),a=r.s.r;a<=r.e.r;++a)for(var o=r.s.c;o<=r.e.c;++o){var l=Pb(n,a,o);l.t="n",l.F=s,delete l.v,a==r.s.r&&o==r.s.c&&(l.f=t,i&&(l.D=!0))}return n}var ny={encode_col:qs,encode_row:Is,encode_cell:ii,encode_range:br,decode_col:CL,decode_row:DL,split_cell:_Ee,decode_cell:ts,decode_range:Do,format_cell:Wh,sheet_add_aoa:XZ,sheet_add_json:jee,sheet_add_dom:Wee,aoa_to_sheet:X1,json_to_sheet:YIe,table_to_sheet:Hee,table_to_book:CIe,sheet_to_csv:BL,sheet_to_txt:$ee,sheet_to_json:aC,sheet_to_html:Vee,sheet_to_formulae:KIe,sheet_to_row_object_array:aC,sheet_get_cell:Pb,book_new:QIe,book_append_sheet:ZIe,book_set_sheet_visibility:eRe,cell_set_number_format:tRe,cell_set_hyperlink:Xee,cell_set_internal_link:nRe,cell_add_comment:iRe,sheet_set_array_formula:rRe,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const sRe=()=>{};var yG={};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Kee=function(n){const e=[];let t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},aRe=function(n){const e=[];let t=0,i=0;for(;t<n.length;){const r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){const s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){const s=n[t++],a=n[t++],o=n[t++],l=((r&7)<<18|(s&63)<<12|(a&63)<<6|o&63)-65536;e[i++]=String.fromCharCode(55296+(l>>10)),e[i++]=String.fromCharCode(56320+(l&1023))}else{const s=n[t++],a=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|a&63)}}return e.join("")},Yee={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){const s=n[r],a=r+1<n.length,o=a?n[r+1]:0,l=r+2<n.length,c=l?n[r+2]:0,h=s>>2,f=(s&3)<<4|o>>4;let p=(o&15)<<2|c>>6,y=c&63;l||(y=64,a||(p=64)),i.push(t[h],t[f],t[p],t[y])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Kee(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):aRe(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){const s=t[n.charAt(r++)],o=r<n.length?t[n.charAt(r)]:0;++r;const c=r<n.length?t[n.charAt(r)]:64;++r;const f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||o==null||c==null||f==null)throw new oRe;const p=s<<2|o>>4;if(i.push(p),c!==64){const y=o<<4&240|c>>2;if(i.push(y),f!==64){const x=c<<6&192|f;i.push(x)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class oRe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const lRe=function(n){const e=Kee(n);return Yee.encodeByteArray(e,!0)},oC=function(n){return lRe(n).replace(/\./g,"")},Jee=function(n){try{return Yee.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function cRe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const uRe=()=>cRe().__FIREBASE_DEFAULTS__,hRe=()=>{if(typeof process>"u"||typeof yG>"u")return;const n=yG.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},dRe=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Jee(n[1]);return e&&JSON.parse(e)},ZI=()=>{try{return sRe()||uRe()||hRe()||dRe()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Qee=n=>{var e,t;return(t=(e=ZI())==null?void 0:e.emulatorHosts)==null?void 0:t[n]},fRe=n=>{const e=Qee(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},Zee=()=>{var n;return(n=ZI())==null?void 0:n.config},ete=n=>{var e;return(e=ZI())==null?void 0:e[`_${n}`]};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class pRe{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function gRe(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},i=e||"demo-project",r=n.iat||0,s=n.sub||n.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a={iss:`https://securetoken.google.com/${i}`,aud:i,iat:r,exp:r+3600,auth_time:r,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...n};return[oC(JSON.stringify(t)),oC(JSON.stringify(a)),""].join(".")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Xs(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function mRe(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xs())}function yRe(){var e;const n=(e=ZI())==null?void 0:e.forceEnvironment;if(n==="node")return!0;if(n==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function vRe(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function _Re(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function xRe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function bRe(){const n=Xs();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function TRe(){return!yRe()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function ERe(){try{return typeof indexedDB=="object"}catch{return!1}}function wRe(){return new Promise((n,e)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)==null?void 0:s.message)||"")}}catch(t){e(t)}})}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const ARe="FirebaseError";class Zh extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=ARe,Object.setPrototypeOf(this,Zh.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,lE.prototype.create)}}class lE{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){const i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],a=s?SRe(s,i):"Error",o=`${this.serviceName}: ${a} (${r}).`;return new Zh(r,o,i)}}function SRe(n,e){return n.replace(DRe,(t,i)=>{const r=e[i];return r!=null?String(r):`<${i}?>`})}const DRe=/\{\$([^}]+)}/g;function CRe(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Gm(n,e){if(n===e)return!0;const t=Object.keys(n),i=Object.keys(e);for(const r of t){if(!i.includes(r))return!1;const s=n[r],a=e[r];if(vG(s)&&vG(a)){if(!Gm(s,a))return!1}else if(s!==a)return!1}for(const r of i)if(!t.includes(r))return!1;return!0}function vG(n){return n!==null&&typeof n=="object"}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function cE(n){const e=[];for(const[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function IRe(n,e){const t=new RRe(n,e);return t.subscribe.bind(t)}class RRe{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");NRe(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=gM),r.error===void 0&&(r.error=gM),r.complete===void 0&&(r.complete=gM);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function NRe(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function gM(){}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function La(n){return n&&n._delegate?n._delegate:n}/**
 * @license
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function uE(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function tte(n){return(await fetch(n,{credentials:"include"})).ok}class qm{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const lg="[DEFAULT]";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class kRe{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const i=new pRe;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(e==null?void 0:e.optional)??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(r){if(i)return null;throw r}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(FRe(e))try{this.getOrInitializeService({instanceIdentifier:lg})}catch{}for(const[t,i]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=lg){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=lg){return this.instances.has(e)}getOptions(e=lg){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(const[s,a]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(s);i===o&&a.resolve(r)}return r}onInit(e,t){const i=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(i)??new Set;r.add(e),this.onInitCallbacks.set(i,r);const s=this.instances.get(i);return s&&e(s,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:MRe(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=lg){return this.component?this.component.multipleInstances?e:lg:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function MRe(n){return n===lg?void 0:n}function FRe(n){return n.instantiationMode==="EAGER"}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class URe{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new kRe(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var En;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(En||(En={}));const PRe={debug:En.DEBUG,verbose:En.VERBOSE,info:En.INFO,warn:En.WARN,error:En.ERROR,silent:En.SILENT},LRe=En.INFO,ORe={[En.DEBUG]:"log",[En.VERBOSE]:"log",[En.INFO]:"info",[En.WARN]:"warn",[En.ERROR]:"error"},BRe=(n,e,...t)=>{if(e<n.logLevel)return;const i=new Date().toISOString(),r=ORe[e];if(r)console[r](`[${i}]  ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class VL{constructor(e){this.name=e,this._logLevel=LRe,this._logHandler=BRe,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in En))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?PRe[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,En.DEBUG,...e),this._logHandler(this,En.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,En.VERBOSE,...e),this._logHandler(this,En.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,En.INFO,...e),this._logHandler(this,En.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,En.WARN,...e),this._logHandler(this,En.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,En.ERROR,...e),this._logHandler(this,En.ERROR,...e)}}const VRe=(n,e)=>e.some(t=>n instanceof t);let _G,xG;function WRe(){return _G||(_G=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function HRe(){return xG||(xG=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const nte=new WeakMap,eP=new WeakMap,ite=new WeakMap,mM=new WeakMap,WL=new WeakMap;function zRe(n){const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",a)},s=()=>{t(jf(n.result)),r()},a=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",a)});return e.then(t=>{t instanceof IDBCursor&&nte.set(t,n)}).catch(()=>{}),WL.set(e,n),e}function GRe(n){if(eP.has(n))return;const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",a),n.removeEventListener("abort",a)},s=()=>{t(),r()},a=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",a),n.addEventListener("abort",a)});eP.set(n,e)}let tP={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return eP.get(n);if(e==="objectStoreNames")return n.objectStoreNames||ite.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return jf(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function qRe(n){tP=n(tP)}function $Re(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(yM(this),e,...t);return ite.set(i,e.sort?e.sort():[e]),jf(i)}:HRe().includes(n)?function(...e){return n.apply(yM(this),e),jf(nte.get(this))}:function(...e){return jf(n.apply(yM(this),e))}}function jRe(n){return typeof n=="function"?$Re(n):(n instanceof IDBTransaction&&GRe(n),VRe(n,WRe())?new Proxy(n,tP):n)}function jf(n){if(n instanceof IDBRequest)return zRe(n);if(mM.has(n))return mM.get(n);const e=jRe(n);return e!==n&&(mM.set(n,e),WL.set(e,n)),e}const yM=n=>WL.get(n);function XRe(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){const a=indexedDB.open(n,e),o=jf(a);return i&&a.addEventListener("upgradeneeded",l=>{i(jf(a.result),l.oldVersion,l.newVersion,jf(a.transaction),l)}),t&&a.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),o.then(l=>{s&&l.addEventListener("close",()=>s()),r&&l.addEventListener("versionchange",c=>r(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}const KRe=["get","getKey","getAll","getAllKeys","count"],YRe=["put","add","delete","clear"],vM=new Map;function bG(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(vM.get(e))return vM.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,r=YRe.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||KRe.includes(t)))return;const s=async function(a,...o){const l=this.transaction(a,r?"readwrite":"readonly");let c=l.store;return i&&(c=c.index(o.shift())),(await Promise.all([c[t](...o),r&&l.done]))[0]};return vM.set(e,s),s}qRe(n=>({...n,get:(e,t,i)=>bG(e,t)||n.get(e,t,i),has:(e,t)=>!!bG(e,t)||n.has(e,t)}));/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class JRe{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(QRe(t)){const i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}}function QRe(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const nP="@firebase/app",TG="0.14.10";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Hh=new VL("@firebase/app"),ZRe="@firebase/app-compat",eNe="@firebase/analytics-compat",tNe="@firebase/analytics",nNe="@firebase/app-check-compat",iNe="@firebase/app-check",rNe="@firebase/auth",sNe="@firebase/auth-compat",aNe="@firebase/database",oNe="@firebase/data-connect",lNe="@firebase/database-compat",cNe="@firebase/functions",uNe="@firebase/functions-compat",hNe="@firebase/installations",dNe="@firebase/installations-compat",fNe="@firebase/messaging",pNe="@firebase/messaging-compat",gNe="@firebase/performance",mNe="@firebase/performance-compat",yNe="@firebase/remote-config",vNe="@firebase/remote-config-compat",_Ne="@firebase/storage",xNe="@firebase/storage-compat",bNe="@firebase/firestore",TNe="@firebase/ai",ENe="@firebase/firestore-compat",wNe="firebase",ANe="12.11.0";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const iP="[DEFAULT]",SNe={[nP]:"fire-core",[ZRe]:"fire-core-compat",[tNe]:"fire-analytics",[eNe]:"fire-analytics-compat",[iNe]:"fire-app-check",[nNe]:"fire-app-check-compat",[rNe]:"fire-auth",[sNe]:"fire-auth-compat",[aNe]:"fire-rtdb",[oNe]:"fire-data-connect",[lNe]:"fire-rtdb-compat",[cNe]:"fire-fn",[uNe]:"fire-fn-compat",[hNe]:"fire-iid",[dNe]:"fire-iid-compat",[fNe]:"fire-fcm",[pNe]:"fire-fcm-compat",[gNe]:"fire-perf",[mNe]:"fire-perf-compat",[yNe]:"fire-rc",[vNe]:"fire-rc-compat",[_Ne]:"fire-gcs",[xNe]:"fire-gcs-compat",[bNe]:"fire-fst",[ENe]:"fire-fst-compat",[TNe]:"fire-vertex","fire-js":"fire-js",[wNe]:"fire-js-all"};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const lC=new Map,DNe=new Map,rP=new Map;function EG(n,e){try{n.container.addComponent(e)}catch(t){Hh.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function S1(n){const e=n.name;if(rP.has(e))return Hh.debug(`There were multiple attempts to register component ${e}.`),!1;rP.set(e,n);for(const t of lC.values())EG(t,n);for(const t of DNe.values())EG(t,n);return!0}function HL(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Kl(n){return n==null?!1:n.settings!==void 0}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const CNe={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Xf=new lE("app","Firebase",CNe);/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class INe{constructor(e,t,i){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new qm("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Xf.create("app-deleted",{appName:this._name})}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const J1=ANe;function rte(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i={name:iP,automaticDataCollectionEnabled:!0,...e},r=i.name;if(typeof r!="string"||!r)throw Xf.create("bad-app-name",{appName:String(r)});if(t||(t=Zee()),!t)throw Xf.create("no-options");const s=lC.get(r);if(s){if(Gm(t,s.options)&&Gm(i,s.config))return s;throw Xf.create("duplicate-app",{appName:r})}const a=new URe(r);for(const l of rP.values())a.addComponent(l);const o=new INe(t,i,a);return lC.set(r,o),o}function ste(n=iP){const e=lC.get(n);if(!e&&n===iP&&Zee())return rte();if(!e)throw Xf.create("no-app",{appName:n});return e}function Kf(n,e,t){let i=SNe[n]??n;t&&(i+=`-${t}`);const r=i.match(/\s|\//),s=e.match(/\s|\//);if(r||s){const a=[`Unable to register library "${i}" with version "${e}":`];r&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Hh.warn(a.join(" "));return}S1(new qm(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const RNe="firebase-heartbeat-database",NNe=1,Lb="firebase-heartbeat-store";let _M=null;function ate(){return _M||(_M=XRe(RNe,NNe,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(Lb)}catch(t){console.warn(t)}}}}).catch(n=>{throw Xf.create("idb-open",{originalErrorMessage:n.message})})),_M}async function kNe(n){try{const t=(await ate()).transaction(Lb),i=await t.objectStore(Lb).get(ote(n));return await t.done,i}catch(e){if(e instanceof Zh)Hh.warn(e.message);else{const t=Xf.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Hh.warn(t.message)}}}async function wG(n,e){try{const i=(await ate()).transaction(Lb,"readwrite");await i.objectStore(Lb).put(e,ote(n)),await i.done}catch(t){if(t instanceof Zh)Hh.warn(t.message);else{const i=Xf.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});Hh.warn(i.message)}}}function ote(n){return`${n.name}!${n.options.appId}`}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const MNe=1024,FNe=30;class UNe{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new LNe(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){var e,t;try{const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=AG();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(a=>a.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats.length>FNe){const a=ONe(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(a,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(i){Hh.warn(i)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=AG(),{heartbeatsToSend:i,unsentEntries:r}=PNe(this._heartbeatsCache.heartbeats),s=oC(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return Hh.warn(t),""}}}function AG(){return new Date().toISOString().substring(0,10)}function PNe(n,e=MNe){const t=[];let i=n.slice();for(const r of n){const s=t.find(a=>a.agent===r.agent);if(s){if(s.dates.push(r.date),SG(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),SG(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}class LNe{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ERe()?wRe().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await kNe(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return wG(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const i=await this.read();return wG(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function SG(n){return oC(JSON.stringify({version:2,heartbeats:n})).length}function ONe(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let i=1;i<n.length;i++)n[i].date<t&&(t=n[i].date,e=i);return e}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function BNe(n){S1(new qm("platform-logger",e=>new JRe(e),"PRIVATE")),S1(new qm("heartbeat",e=>new UNe(e),"PRIVATE")),Kf(nP,TG,n),Kf(nP,TG,"esm2020"),Kf("fire-js","")}BNe("");var VNe="firebase",WNe="12.11.0";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Kf(VNe,WNe,"app");function lte(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const HNe=lte,cte=new lE("auth","Firebase",lte());/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const cC=new VL("@firebase/auth");function zNe(n,...e){cC.logLevel<=En.WARN&&cC.warn(`Auth (${J1}): ${n}`,...e)}function KS(n,...e){cC.logLevel<=En.ERROR&&cC.error(`Auth (${J1}): ${n}`,...e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function du(n,...e){throw GL(n,...e)}function rc(n,...e){return GL(n,...e)}function zL(n,e,t){const i={...HNe(),[e]:t};return new lE("auth","Firebase",i).create(e,{appName:n.name})}function Um(n){return zL(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function GNe(n,e,t){const i=t;if(!(e instanceof i))throw i.name!==e.constructor.name&&du(n,"argument-error"),zL(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function GL(n,...e){if(typeof n!="string"){const t=e[0],i=[...e.slice(1)];return i[0]&&(i[0].appName=n.name),n._errorFactory.create(t,...i)}return cte.create(n,...e)}function Jt(n,e,...t){if(!n)throw GL(e,...t)}function Sh(n){const e="INTERNAL ASSERTION FAILED: "+n;throw KS(e),new Error(e)}function zh(n,e){n||Sh(e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function sP(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.href)||""}function qNe(){return DG()==="http:"||DG()==="https:"}function DG(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.protocol)||null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function $Ne(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(qNe()||_Re()||"connection"in navigator)?navigator.onLine:!0}function jNe(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class hE{constructor(e,t){this.shortDelay=e,this.longDelay=t,zh(t>e,"Short delay should be less than long delay!"),this.isMobile=mRe()||xRe()}get(){return $Ne()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function qL(n,e){zh(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ute{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Sh("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Sh("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Sh("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const XNe={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const KNe=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],YNe=new hE(3e4,6e4);function $L(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function Q1(n,e,t,i,r={}){return hte(n,r,async()=>{let s={},a={};i&&(e==="GET"?a=i:s={body:JSON.stringify(i)});const o=cE({key:n.config.apiKey,...a}).slice(1),l=await n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c={method:e,headers:l,...s};return vRe()||(c.referrerPolicy="no-referrer"),n.emulatorConfig&&uE(n.emulatorConfig.host)&&(c.credentials="include"),ute.fetch()(await dte(n,n.config.apiHost,t,o),c)})}async function hte(n,e,t){n._canInitEmulator=!1;const i={...XNe,...e};try{const r=new QNe(n),s=await Promise.race([t(),r.promise]);r.clearNetworkTimeout();const a=await s.json();if("needConfirmation"in a)throw DA(n,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{const o=s.ok?a.errorMessage:a.error.message,[l,c]=o.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw DA(n,"credential-already-in-use",a);if(l==="EMAIL_EXISTS")throw DA(n,"email-already-in-use",a);if(l==="USER_DISABLED")throw DA(n,"user-disabled",a);const h=i[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw zL(n,h,c);du(n,h)}}catch(r){if(r instanceof Zh)throw r;du(n,"network-request-failed",{message:String(r)})}}async function JNe(n,e,t,i,r={}){const s=await Q1(n,e,t,i,r);return"mfaPendingCredential"in s&&du(n,"multi-factor-auth-required",{_serverResponse:s}),s}async function dte(n,e,t,i){const r=`${e}${t}?${i}`,s=n,a=s.config.emulator?qL(n.config,r):`${n.config.apiScheme}://${r}`;return KNe.includes(t)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(a).toString():a}class QNe{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(rc(this.auth,"network-request-failed")),YNe.get())})}}function DA(n,e,t){const i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);const r=rc(n,e,i);return r.customData._tokenResponse=t,r}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ZNe(n,e){return Q1(n,"POST","/v1/accounts:delete",e)}async function uC(n,e){return Q1(n,"POST","/v1/accounts:lookup",e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ob(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function eke(n,e=!1){const t=La(n),i=await t.getIdToken(e),r=jL(i);Jt(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");const s=typeof r.firebase=="object"?r.firebase:void 0,a=s==null?void 0:s.sign_in_provider;return{claims:r,token:i,authTime:ob(xM(r.auth_time)),issuedAtTime:ob(xM(r.iat)),expirationTime:ob(xM(r.exp)),signInProvider:a||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function xM(n){return Number(n)*1e3}function jL(n){const[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return KS("JWT malformed, contained fewer than 3 sections"),null;try{const r=Jee(t);return r?JSON.parse(r):(KS("Failed to decode base64 JWT payload"),null)}catch(r){return KS("Caught error parsing JWT payload as JSON",r==null?void 0:r.toString()),null}}function CG(n){const e=jL(n);return Jt(e,"internal-error"),Jt(typeof e.exp<"u","internal-error"),Jt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Ob(n,e,t=!1){if(t)return e;try{return await e}catch(i){throw i instanceof Zh&&tke(i)&&n.auth.currentUser===n&&await n.auth.signOut(),i}}function tke({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nke{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}else{this.errorBackoff=3e4;const i=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aP{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ob(this.lastLoginAt),this.creationTime=ob(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function hC(n){var f;const e=n.auth,t=await n.getIdToken(),i=await Ob(n,uC(e,{idToken:t}));Jt(i==null?void 0:i.users.length,e,"internal-error");const r=i.users[0];n._notifyReloadListener(r);const s=(f=r.providerUserInfo)!=null&&f.length?fte(r.providerUserInfo):[],a=rke(n.providerData,s),o=n.isAnonymous,l=!(n.email&&r.passwordHash)&&!(a!=null&&a.length),c=o?l:!1,h={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new aP(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(n,h)}async function ike(n){const e=La(n);await hC(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function rke(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function fte(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ske(n,e){const t=await hte(n,{},async()=>{const i=cE({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:s}=n.config,a=await dte(n,r,"/v1/token",`key=${s}`),o=await n._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:o,body:i};return n.emulatorConfig&&uE(n.emulatorConfig.host)&&(l.credentials="include"),ute.fetch()(a,l)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function ake(n,e){return Q1(n,"POST","/v2/accounts:revokeToken",$L(n,e))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Wy{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Jt(e.idToken,"internal-error"),Jt(typeof e.idToken<"u","internal-error"),Jt(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):CG(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Jt(e.length!==0,"internal-error");const t=CG(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(Jt(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:i,refreshToken:r,expiresIn:s}=await ske(e,t);this.updateTokensAndExpiration(i,r,Number(s))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+i*1e3}static fromJSON(e,t){const{refreshToken:i,accessToken:r,expirationTime:s}=t,a=new Wy;return i&&(Jt(typeof i=="string","internal-error",{appName:e}),a.refreshToken=i),r&&(Jt(typeof r=="string","internal-error",{appName:e}),a.accessToken=r),s&&(Jt(typeof s=="number","internal-error",{appName:e}),a.expirationTime=s),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Wy,this.toJSON())}_performRefresh(){return Sh("not implemented")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Od(n,e){Jt(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class Jl{constructor({uid:e,auth:t,stsTokenManager:i,...r}){this.providerId="firebase",this.proactiveRefresh=new nke(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new aP(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){const t=await Ob(this,this.stsTokenManager.getToken(this.auth,e));return Jt(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return eke(this,e)}reload(){return ike(this)}_assign(e){this!==e&&(Jt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Jl({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){Jt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await hC(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Kl(this.auth.app))return Promise.reject(Um(this.auth));const e=await this.getIdToken();return await Ob(this,ZNe(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const i=t.displayName??void 0,r=t.email??void 0,s=t.phoneNumber??void 0,a=t.photoURL??void 0,o=t.tenantId??void 0,l=t._redirectEventId??void 0,c=t.createdAt??void 0,h=t.lastLoginAt??void 0,{uid:f,emailVerified:p,isAnonymous:y,providerData:x,stsTokenManager:v}=t;Jt(f&&v,e,"internal-error");const _=Wy.fromJSON(this.name,v);Jt(typeof f=="string",e,"internal-error"),Od(i,e.name),Od(r,e.name),Jt(typeof p=="boolean",e,"internal-error"),Jt(typeof y=="boolean",e,"internal-error"),Od(s,e.name),Od(a,e.name),Od(o,e.name),Od(l,e.name),Od(c,e.name),Od(h,e.name);const E=new Jl({uid:f,auth:e,email:r,emailVerified:p,displayName:i,isAnonymous:y,photoURL:a,phoneNumber:s,tenantId:o,stsTokenManager:_,createdAt:c,lastLoginAt:h});return x&&Array.isArray(x)&&(E.providerData=x.map(w=>({...w}))),l&&(E._redirectEventId=l),E}static async _fromIdTokenResponse(e,t,i=!1){const r=new Wy;r.updateFromServerResponse(t);const s=new Jl({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await hC(s),s}static async _fromGetAccountInfoResponse(e,t,i){const r=t.users[0];Jt(r.localId!==void 0,"internal-error");const s=r.providerUserInfo!==void 0?fte(r.providerUserInfo):[],a=!(r.email&&r.passwordHash)&&!(s!=null&&s.length),o=new Wy;o.updateFromIdToken(i);const l=new Jl({uid:r.localId,auth:e,stsTokenManager:o,isAnonymous:a}),c={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new aP(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(s!=null&&s.length)};return Object.assign(l,c),l}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const IG=new Map;function Dh(n){zh(n instanceof Function,"Expected a class definition");let e=IG.get(n);return e?(zh(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,IG.set(n,e),e)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class pte{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}pte.type="NONE";const RG=pte;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function YS(n,e,t){return`firebase:${n}:${e}:${t}`}class Hy{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const{config:r,name:s}=this.auth;this.fullUserKey=YS(this.userKey,r.apiKey,s),this.fullPersistenceKey=YS("persistence",r.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const t=await uC(this.auth,{idToken:e}).catch(()=>{});return t?Jl._fromGetAccountInfoResponse(this.auth,t,e):null}return Jl._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,i="authUser"){if(!t.length)return new Hy(Dh(RG),e,i);const r=(await Promise.all(t.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=r[0]||Dh(RG);const a=YS(i,e.config.apiKey,e.name);let o=null;for(const c of t)try{const h=await c._get(a);if(h){let f;if(typeof h=="string"){const p=await uC(e,{idToken:h}).catch(()=>{});if(!p)break;f=await Jl._fromGetAccountInfoResponse(e,p,h)}else f=Jl._fromJSON(e,h);c!==s&&(o=f),s=c;break}}catch{}const l=r.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new Hy(s,e,i):(s=l[0],o&&await s._set(a,o.toJSON()),await Promise.all(t.map(async c=>{if(c!==s)try{await c._remove(a)}catch{}})),new Hy(s,e,i))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function NG(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(vte(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(gte(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(xte(e))return"Blackberry";if(bte(e))return"Webos";if(mte(e))return"Safari";if((e.includes("chrome/")||yte(e))&&!e.includes("edge/"))return"Chrome";if(_te(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if((i==null?void 0:i.length)===2)return i[1]}return"Other"}function gte(n=Xs()){return/firefox\//i.test(n)}function mte(n=Xs()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function yte(n=Xs()){return/crios\//i.test(n)}function vte(n=Xs()){return/iemobile/i.test(n)}function _te(n=Xs()){return/android/i.test(n)}function xte(n=Xs()){return/blackberry/i.test(n)}function bte(n=Xs()){return/webos/i.test(n)}function XL(n=Xs()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function oke(n=Xs()){var e;return XL(n)&&!!((e=window.navigator)!=null&&e.standalone)}function lke(){return bRe()&&document.documentMode===10}function Tte(n=Xs()){return XL(n)||_te(n)||bte(n)||xte(n)||/windows phone/i.test(n)||vte(n)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Ete(n,e=[]){let t;switch(n){case"Browser":t=NG(Xs());break;case"Worker":t=`${NG(Xs())}-${n}`;break;default:t=n}const i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${J1}/${i}`}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class cke{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const i=s=>new Promise((a,o)=>{try{const l=e(s);a(l)}catch(l){o(l)}});i.onAbort=t,this.queue.push(i);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(i){t.reverse();for(const r of t)try{r()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:i==null?void 0:i.message})}}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function uke(n,e={}){return Q1(n,"GET","/v2/passwordPolicy",$L(n,e))}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const hke=6;class dke{constructor(e){var i;const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??hke,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((i=e.allowedNonAlphanumericCharacters)==null?void 0:i.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const i=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let i;for(let r=0;r<e.length;r++)i=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,r,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class fke{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new kG(this),this.idTokenSubscription=new kG(this),this.beforeStateQueue=new cke(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=cte,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Dh(t)),this._initializationPromise=this.queue(async()=>{var i,r,s;if(!this._deleted&&(this.persistenceManager=await Hy.create(this,e),(i=this._resolvePersistenceManagerAvailable)==null||i.call(this),!this._deleted)){if((r=this._popupRedirectResolver)!=null&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((s=this.currentUser)==null?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await uC(this,{idToken:e}),i=await Jl._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var s;if(Kl(this.app)){const a=this.app.settings.authIdToken;return a?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(a).then(o,o))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let i=t,r=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const a=(s=this.redirectUser)==null?void 0:s._redirectEventId,o=i==null?void 0:i._redirectEventId,l=await this.tryRedirectSignIn(e);(!a||a===o)&&(l!=null&&l.user)&&(i=l.user,r=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(r)try{await this.beforeStateQueue.runMiddleware(i)}catch(a){i=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(a))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Jt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await hC(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=jNe()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Kl(this.app))return Promise.reject(Um(this));const t=e?La(e):null;return t&&Jt(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Jt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Kl(this.app)?Promise.reject(Um(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Kl(this.app)?Promise.reject(Um(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Dh(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await uke(this),t=new dke(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new lE("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await ake(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Dh(e)||this._popupRedirectResolver;Jt(t,this,"argument-error"),this.redirectPersistenceManager=await Hy.create(this,[Dh(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)==null?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)==null?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((t=this.currentUser)==null?void 0:t.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let a=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Jt(o,this,"internal-error"),o.then(()=>{a||s(this.currentUser)}),typeof t=="function"){const l=e.addObserver(t,i,r);return()=>{a=!0,l()}}else{const l=e.addObserver(t);return()=>{a=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Jt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Ete(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var r;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await((r=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:r.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const i=await this._getAppCheckToken();return i&&(e["X-Firebase-AppCheck"]=i),e}async _getAppCheckToken(){var t;if(Kl(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:t.getToken());return e!=null&&e.error&&zNe(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function eR(n){return La(n)}class kG{constructor(e){this.auth=e,this.observer=null,this.addObserver=IRe(t=>this.observer=t)}get next(){return Jt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let KL={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function pke(n){KL=n}function gke(n){return KL.loadJS(n)}function mke(){return KL.gapiScript}function yke(n){return`__${n}${Math.floor(Math.random()*1e6)}`}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function vke(n,e){const t=HL(n,"auth");if(t.isInitialized()){const r=t.getImmediate(),s=t.getOptions();if(Gm(s,e??{}))return r;du(r,"already-initialized")}return t.initialize({options:e})}function _ke(n,e){const t=(e==null?void 0:e.persistence)||[],i=(Array.isArray(t)?t:[t]).map(Dh);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e==null?void 0:e.popupRedirectResolver)}function xke(n,e,t){const i=eR(n);Jt(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");const r=!1,s=wte(e),{host:a,port:o}=bke(e),l=o===null?"":`:${o}`,c={url:`${s}//${a}${l}/`},h=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:r})});if(!i._canInitEmulator){Jt(i.config.emulator&&i.emulatorConfig,i,"emulator-config-failed"),Jt(Gm(c,i.config.emulator)&&Gm(h,i.emulatorConfig),i,"emulator-config-failed");return}i.config.emulator=c,i.emulatorConfig=h,i.settings.appVerificationDisabledForTesting=!0,uE(a)?tte(`${s}//${a}${l}`):Tke()}function wte(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function bke(n){const e=wte(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){const s=r[1];return{host:s,port:MG(i.substr(s.length+1))}}else{const[s,a]=i.split(":");return{host:s,port:MG(a)}}}function MG(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Tke(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Ate{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Sh("not implemented")}_getIdTokenResponse(e){return Sh("not implemented")}_linkToIdToken(e,t){return Sh("not implemented")}_getReauthenticationResolver(e){return Sh("not implemented")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function zy(n,e){return JNe(n,"POST","/v1/accounts:signInWithIdp",$L(n,e))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Eke="http://localhost";class $m extends Ate{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new $m(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):du("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:i,signInMethod:r,...s}=t;if(!i||!r)return null;const a=new $m(i,r);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){const t=this.buildRequest();return zy(e,t)}_linkToIdToken(e,t){const i=this.buildRequest();return i.idToken=t,zy(e,i)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,zy(e,t)}buildRequest(){const e={requestUri:Eke,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=cE(t)}return e}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class YL{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class dE extends YL{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class zd extends dE{constructor(){super("facebook.com")}static credential(e){return $m._fromParams({providerId:zd.PROVIDER_ID,signInMethod:zd.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return zd.credentialFromTaggedObject(e)}static credentialFromError(e){return zd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return zd.credential(e.oauthAccessToken)}catch{return null}}}zd.FACEBOOK_SIGN_IN_METHOD="facebook.com";zd.PROVIDER_ID="facebook.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Ah extends dE{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return $m._fromParams({providerId:Ah.PROVIDER_ID,signInMethod:Ah.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Ah.credentialFromTaggedObject(e)}static credentialFromError(e){return Ah.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:i}=e;if(!t&&!i)return null;try{return Ah.credential(t,i)}catch{return null}}}Ah.GOOGLE_SIGN_IN_METHOD="google.com";Ah.PROVIDER_ID="google.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Gd extends dE{constructor(){super("github.com")}static credential(e){return $m._fromParams({providerId:Gd.PROVIDER_ID,signInMethod:Gd.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Gd.credentialFromTaggedObject(e)}static credentialFromError(e){return Gd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Gd.credential(e.oauthAccessToken)}catch{return null}}}Gd.GITHUB_SIGN_IN_METHOD="github.com";Gd.PROVIDER_ID="github.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class qd extends dE{constructor(){super("twitter.com")}static credential(e,t){return $m._fromParams({providerId:qd.PROVIDER_ID,signInMethod:qd.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return qd.credentialFromTaggedObject(e)}static credentialFromError(e){return qd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:i}=e;if(!t||!i)return null;try{return qd.credential(t,i)}catch{return null}}}qd.TWITTER_SIGN_IN_METHOD="twitter.com";qd.PROVIDER_ID="twitter.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class D1{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,r=!1){const s=await Jl._fromIdTokenResponse(e,i,r),a=FG(i);return new D1({user:s,providerId:a,_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){await e._updateTokensIfNecessary(i,!0);const r=FG(i);return new D1({user:e,providerId:r,_tokenResponse:i,operationType:t})}}function FG(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class dC extends Zh{constructor(e,t,i,r){super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,dC.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new dC(e,t,i,r)}}function Ste(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?dC._fromErrorAndOperation(n,s,e,i):s})}async function wke(n,e,t=!1){const i=await Ob(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return D1._forOperation(n,"link",i)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Ake(n,e,t=!1){const{auth:i}=n;if(Kl(i.app))return Promise.reject(Um(i));const r="reauthenticate";try{const s=await Ob(n,Ste(i,r,e,n),t);Jt(s.idToken,i,"internal-error");const a=jL(s.idToken);Jt(a,i,"internal-error");const{sub:o}=a;return Jt(n.uid===o,i,"user-mismatch"),D1._forOperation(n,r,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&du(i,"user-mismatch"),s}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Ske(n,e,t=!1){if(Kl(n.app))return Promise.reject(Um(n));const i="signIn",r=await Ste(n,i,e),s=await D1._fromIdTokenResponse(n,i,r);return t||await n._updateCurrentUser(s.user),s}function Dke(n,e,t,i){return La(n).onIdTokenChanged(e,t,i)}function Cke(n,e,t){return La(n).beforeAuthStateChanged(e,t)}function Ike(n,e,t,i){return La(n).onAuthStateChanged(e,t,i)}function Rke(n){return La(n).signOut()}const fC="__sak";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Dte{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(fC,"1"),this.storage.removeItem(fC),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Nke=1e3,kke=10;class Cte extends Dte{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Tte(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),r=this.localCache[t];i!==r&&e(t,r,i)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((a,o,l)=>{this.notifyListeners(a,l)});return}const i=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const a=this.storage.getItem(i);!t&&this.localCache[i]===a||this.notifyListeners(i,a)},s=this.storage.getItem(i);lke()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,kke):r()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},Nke)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Cte.type="LOCAL";const Mke=Cte;/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Ite extends Dte{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Ite.type="SESSION";const Rte=Ite;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Fke(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tR{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(r=>r.isListeningto(e));if(t)return t;const i=new tR(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:i,eventType:r,data:s}=t.data,a=this.handlersMap[r];if(!(a!=null&&a.size))return;t.ports[0].postMessage({status:"ack",eventId:i,eventType:r});const o=Array.from(a).map(async c=>c(t.origin,s)),l=await Fke(o);t.ports[0].postMessage({status:"done",eventId:i,eventType:r,response:l})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}tR.receivers=[];/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function JL(n="",e=10){let t="";for(let i=0;i<e;i++)t+=Math.floor(Math.random()*10);return n+t}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Uke{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,i=50){const r=typeof MessageChannel<"u"?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let s,a;return new Promise((o,l)=>{const c=JL("",20);r.port1.start();const h=setTimeout(()=>{l(new Error("unsupported_event"))},i);a={messageChannel:r,onMessage(f){const p=f;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(h),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),o(p.data.response);break;default:clearTimeout(h),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(a),r.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function su(){return window}function Pke(n){su().location.href=n}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Nte(){return typeof su().WorkerGlobalScope<"u"&&typeof su().importScripts=="function"}async function Lke(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Oke(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)==null?void 0:n.controller)||null}function Bke(){return Nte()?self:null}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const kte="firebaseLocalStorageDb",Vke=1,pC="firebaseLocalStorage",Mte="fbase_key";class fE{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function nR(n,e){return n.transaction([pC],e?"readwrite":"readonly").objectStore(pC)}function Wke(){const n=indexedDB.deleteDatabase(kte);return new fE(n).toPromise()}function oP(){const n=indexedDB.open(kte,Vke);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const i=n.result;try{i.createObjectStore(pC,{keyPath:Mte})}catch(r){t(r)}}),n.addEventListener("success",async()=>{const i=n.result;i.objectStoreNames.contains(pC)?e(i):(i.close(),await Wke(),e(await oP()))})})}async function UG(n,e,t){const i=nR(n,!0).put({[Mte]:e,value:t});return new fE(i).toPromise()}async function Hke(n,e){const t=nR(n,!1).get(e),i=await new fE(t).toPromise();return i===void 0?null:i.value}function PG(n,e){const t=nR(n,!0).delete(e);return new fE(t).toPromise()}const zke=800,Gke=3;class Fte{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await oP(),this.db)}async _withRetries(e){let t=0;for(;;)try{const i=await this._openDb();return await e(i)}catch(i){if(t++>Gke)throw i;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Nte()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=tR._getInstance(Bke()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var t,i;if(this.activeServiceWorker=await Lke(),!this.activeServiceWorker)return;this.sender=new Uke(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(t=e[0])!=null&&t.fulfilled&&(i=e[0])!=null&&i.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Oke()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await oP();return await UG(e,fC,"1"),await PG(e,fC),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>UG(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(i=>Hke(i,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>PG(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(r=>{const s=nR(r,!1).getAll();return new fE(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],i=new Set;if(e.length!==0)for(const{fbase_key:r,value:s}of e)i.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(s)&&(this.notifyListeners(r,s),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!i.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),zke)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Fte.type="LOCAL";const qke=Fte;new hE(3e4,6e4);/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Ute(n,e){return e?Dh(e):(Jt(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class QL extends Ate{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return zy(e,this._buildIdpRequest())}_linkToIdToken(e,t){return zy(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return zy(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function $ke(n){return Ske(n.auth,new QL(n),n.bypassAuthState)}function jke(n){const{auth:e,user:t}=n;return Jt(t,e,"internal-error"),Ake(t,new QL(n),n.bypassAuthState)}async function Xke(n){const{auth:e,user:t}=n;return Jt(t,e,"internal-error"),wke(t,new QL(n),n.bypassAuthState)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Pte{constructor(e,t,i,r,s=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:i,postBody:r,tenantId:s,error:a,type:o}=e;if(a){this.reject(a);return}const l={auth:this.auth,requestUri:t,sessionId:i,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return $ke;case"linkViaPopup":case"linkViaRedirect":return Xke;case"reauthViaPopup":case"reauthViaRedirect":return jke;default:du(this.auth,"internal-error")}}resolve(e){zh(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){zh(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Kke=new hE(2e3,1e4);async function Yke(n,e,t){if(Kl(n.app))return Promise.reject(rc(n,"operation-not-supported-in-this-environment"));const i=eR(n);GNe(n,e,YL);const r=Ute(i,t);return new yg(i,"signInViaPopup",e,r).executeNotNull()}class yg extends Pte{constructor(e,t,i,r,s){super(e,t,r,s),this.provider=i,this.authWindow=null,this.pollId=null,yg.currentPopupAction&&yg.currentPopupAction.cancel(),yg.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Jt(e,this.auth,"internal-error"),e}async onExecution(){zh(this.filter.length===1,"Popup operations only handle one event");const e=JL();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(rc(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(rc(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,yg.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,i;if((i=(t=this.authWindow)==null?void 0:t.window)!=null&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(rc(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Kke.get())};e()}}yg.currentPopupAction=null;/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Jke="pendingRedirect",JS=new Map;class Qke extends Pte{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=JS.get(this.auth._key());if(!e){try{const i=await Zke(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}JS.set(this.auth._key(),e)}return this.bypassAuthState||JS.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Zke(n,e){const t=n3e(e),i=t3e(n);if(!await i._isAvailable())return!1;const r=await i._get(t)==="true";return await i._remove(t),r}function e3e(n,e){JS.set(n._key(),e)}function t3e(n){return Dh(n._redirectPersistence)}function n3e(n){return YS(Jke,n.config.apiKey,n.name)}async function i3e(n,e,t=!1){if(Kl(n.app))return Promise.reject(Um(n));const i=eR(n),r=Ute(i,e),a=await new Qke(i,r,t).execute();return a&&!t&&(delete a.user._redirectEventId,await i._persistUserIfCurrent(a.user),await i._setRedirectUser(null,e)),a}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const r3e=600*1e3;class s3e{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!a3e(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!Lte(e)){const r=((i=e.error.code)==null?void 0:i.split("auth/")[1])||"internal-error";t.onError(rc(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=r3e&&this.cachedEventUids.clear(),this.cachedEventUids.has(LG(e))}saveEventToCache(e){this.cachedEventUids.add(LG(e)),this.lastProcessedEventTime=Date.now()}}function LG(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Lte({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function a3e(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Lte(n);default:return!1}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function o3e(n,e={}){return Q1(n,"GET","/v1/projects",e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const l3e=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,c3e=/^https?/;async function u3e(n){if(n.config.emulator)return;const{authorizedDomains:e}=await o3e(n);for(const t of e)try{if(h3e(t))return}catch{}du(n,"unauthorized-domain")}function h3e(n){const e=sP(),{protocol:t,hostname:i}=new URL(e);if(n.startsWith("chrome-extension://")){const a=new URL(n);return a.hostname===""&&i===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&a.hostname===i}if(!c3e.test(t))return!1;if(l3e.test(n))return i===n;const r=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(i)}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const d3e=new hE(3e4,6e4);function OG(){const n=su().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function f3e(n){return new Promise((e,t)=>{var r,s,a;function i(){OG(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{OG(),t(rc(n,"network-request-failed"))},timeout:d3e.get()})}if((s=(r=su().gapi)==null?void 0:r.iframes)!=null&&s.Iframe)e(gapi.iframes.getContext());else if((a=su().gapi)!=null&&a.load)i();else{const o=yke("iframefcb");return su()[o]=()=>{gapi.load?i():t(rc(n,"network-request-failed"))},gke(`${mke()}?onload=${o}`).catch(l=>t(l))}}).catch(e=>{throw QS=null,e})}let QS=null;function p3e(n){return QS=QS||f3e(n),QS}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const g3e=new hE(5e3,15e3),m3e="__/auth/iframe",y3e="emulator/auth/iframe",v3e={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},_3e=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function x3e(n){const e=n.config;Jt(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?qL(e,y3e):`https://${n.config.authDomain}/${m3e}`,i={apiKey:e.apiKey,appName:n.name,v:J1},r=_3e.get(n.config.apiHost);r&&(i.eid=r);const s=n._getFrameworks();return s.length&&(i.fw=s.join(",")),`${t}?${cE(i).slice(1)}`}async function b3e(n){const e=await p3e(n),t=su().gapi;return Jt(t,n,"internal-error"),e.open({where:document.body,url:x3e(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:v3e,dontclear:!0},i=>new Promise(async(r,s)=>{await i.restyle({setHideOnLeave:!1});const a=rc(n,"network-request-failed"),o=su().setTimeout(()=>{s(a)},g3e.get());function l(){su().clearTimeout(o),r(i)}i.ping(l).then(l,()=>{s(a)})}))}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const T3e={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},E3e=500,w3e=600,A3e="_blank",S3e="http://localhost";class BG{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function D3e(n,e,t,i=E3e,r=w3e){const s=Math.max((window.screen.availHeight-r)/2,0).toString(),a=Math.max((window.screen.availWidth-i)/2,0).toString();let o="";const l={...T3e,width:i.toString(),height:r.toString(),top:s,left:a},c=Xs().toLowerCase();t&&(o=yte(c)?A3e:t),gte(c)&&(e=e||S3e,l.scrollbars="yes");const h=Object.entries(l).reduce((p,[y,x])=>`${p}${y}=${x},`,"");if(oke(c)&&o!=="_self")return C3e(e||"",o),new BG(null);const f=window.open(e||"",o,h);Jt(f,n,"popup-blocked");try{f.focus()}catch{}return new BG(f)}function C3e(n,e){const t=document.createElement("a");t.href=n,t.target=e;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const I3e="__/auth/handler",R3e="emulator/auth/handler",N3e=encodeURIComponent("fac");async function VG(n,e,t,i,r,s){Jt(n.config.authDomain,n,"auth-domain-config-required"),Jt(n.config.apiKey,n,"invalid-api-key");const a={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:J1,eventId:r};if(e instanceof YL){e.setDefaultLanguage(n.languageCode),a.providerId=e.providerId||"",CRe(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,f]of Object.entries({}))a[h]=f}if(e instanceof dE){const h=e.getScopes().filter(f=>f!=="");h.length>0&&(a.scopes=h.join(","))}n.tenantId&&(a.tid=n.tenantId);const o=a;for(const h of Object.keys(o))o[h]===void 0&&delete o[h];const l=await n._getAppCheckToken(),c=l?`#${N3e}=${encodeURIComponent(l)}`:"";return`${k3e(n)}?${cE(o).slice(1)}${c}`}function k3e({config:n}){return n.emulator?qL(n,R3e):`https://${n.authDomain}/${I3e}`}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const bM="webStorageSupport";class M3e{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Rte,this._completeRedirectFn=i3e,this._overrideRedirectResult=e3e}async _openPopup(e,t,i,r){var a;zh((a=this.eventManagers[e._key()])==null?void 0:a.manager,"_initialize() not called before _openPopup()");const s=await VG(e,t,i,sP(),r);return D3e(e,s,JL())}async _openRedirect(e,t,i,r){await this._originValidation(e);const s=await VG(e,t,i,sP(),r);return Pke(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:r,promise:s}=this.eventManagers[t];return r?Promise.resolve(r):(zh(s,"If manager is not set, promise should be"),s)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await b3e(e),i=new s3e(e);return t.register("authEvent",r=>(Jt(r==null?void 0:r.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(bM,{type:bM},r=>{var a;const s=(a=r==null?void 0:r[0])==null?void 0:a[bM];s!==void 0&&t(!!s),du(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=u3e(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Tte()||mte()||XL()}}const F3e=M3e;var WG="@firebase/auth",HG="1.12.2";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class U3e{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(i=>{e((i==null?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Jt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function P3e(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function L3e(n){S1(new qm("auth",(e,{options:t})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:o}=i.options;Jt(a&&!a.includes(":"),"invalid-api-key",{appName:i.name});const l={apiKey:a,authDomain:o,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ete(n)},c=new fke(i,r,s,l);return _ke(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),S1(new qm("auth-internal",e=>{const t=eR(e.getProvider("auth").getImmediate());return(i=>new U3e(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Kf(WG,HG,P3e(n)),Kf(WG,HG,"esm2020")}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const O3e=300,B3e=ete("authIdTokenMaxAge")||O3e;let zG=null;const V3e=n=>async e=>{const t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>B3e)return;const r=t==null?void 0:t.token;zG!==r&&(zG=r,await fetch(n,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function W3e(n=ste()){const e=HL(n,"auth");if(e.isInitialized())return e.getImmediate();const t=vke(n,{popupRedirectResolver:F3e,persistence:[qke,Mke,Rte]}),i=ete("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(i,location.origin);if(location.origin===s.origin){const a=V3e(s.toString());Cke(t,a,()=>a(t.currentUser)),Dke(t,o=>a(o))}}const r=Qee("auth");return r&&xke(t,`http://${r}`),t}function H3e(){var n;return((n=document.getElementsByTagName("head"))==null?void 0:n[0])??document}pke({loadJS(n){return new Promise((e,t)=>{const i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{const s=rc("internal-error");s.customData=r,t(s)},i.type="text/javascript",i.charset="UTF-8",H3e().appendChild(i)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});L3e("Browser");var GG=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/var Yf,Ote;(function(){var n;/** @license

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/function e(C,M){function R(){}R.prototype=M.prototype,C.F=M.prototype,C.prototype=new R,C.prototype.constructor=C,C.D=function(L,H,P){for(var O=Array(arguments.length-2),B=2;B<arguments.length;B++)O[B-2]=arguments[B];return M.prototype[H].apply(L,O)}}function t(){this.blockSize=-1}function i(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}e(i,t),i.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function r(C,M,R){R||(R=0);const L=Array(16);if(typeof M=="string")for(var H=0;H<16;++H)L[H]=M.charCodeAt(R++)|M.charCodeAt(R++)<<8|M.charCodeAt(R++)<<16|M.charCodeAt(R++)<<24;else for(H=0;H<16;++H)L[H]=M[R++]|M[R++]<<8|M[R++]<<16|M[R++]<<24;M=C.g[0],R=C.g[1],H=C.g[2];let P=C.g[3],O;O=M+(P^R&(H^P))+L[0]+3614090360&4294967295,M=R+(O<<7&4294967295|O>>>25),O=P+(H^M&(R^H))+L[1]+3905402710&4294967295,P=M+(O<<12&4294967295|O>>>20),O=H+(R^P&(M^R))+L[2]+606105819&4294967295,H=P+(O<<17&4294967295|O>>>15),O=R+(M^H&(P^M))+L[3]+3250441966&4294967295,R=H+(O<<22&4294967295|O>>>10),O=M+(P^R&(H^P))+L[4]+4118548399&4294967295,M=R+(O<<7&4294967295|O>>>25),O=P+(H^M&(R^H))+L[5]+1200080426&4294967295,P=M+(O<<12&4294967295|O>>>20),O=H+(R^P&(M^R))+L[6]+2821735955&4294967295,H=P+(O<<17&4294967295|O>>>15),O=R+(M^H&(P^M))+L[7]+4249261313&4294967295,R=H+(O<<22&4294967295|O>>>10),O=M+(P^R&(H^P))+L[8]+1770035416&4294967295,M=R+(O<<7&4294967295|O>>>25),O=P+(H^M&(R^H))+L[9]+2336552879&4294967295,P=M+(O<<12&4294967295|O>>>20),O=H+(R^P&(M^R))+L[10]+4294925233&4294967295,H=P+(O<<17&4294967295|O>>>15),O=R+(M^H&(P^M))+L[11]+2304563134&4294967295,R=H+(O<<22&4294967295|O>>>10),O=M+(P^R&(H^P))+L[12]+1804603682&4294967295,M=R+(O<<7&4294967295|O>>>25),O=P+(H^M&(R^H))+L[13]+4254626195&4294967295,P=M+(O<<12&4294967295|O>>>20),O=H+(R^P&(M^R))+L[14]+2792965006&4294967295,H=P+(O<<17&4294967295|O>>>15),O=R+(M^H&(P^M))+L[15]+1236535329&4294967295,R=H+(O<<22&4294967295|O>>>10),O=M+(H^P&(R^H))+L[1]+4129170786&4294967295,M=R+(O<<5&4294967295|O>>>27),O=P+(R^H&(M^R))+L[6]+3225465664&4294967295,P=M+(O<<9&4294967295|O>>>23),O=H+(M^R&(P^M))+L[11]+643717713&4294967295,H=P+(O<<14&4294967295|O>>>18),O=R+(P^M&(H^P))+L[0]+3921069994&4294967295,R=H+(O<<20&4294967295|O>>>12),O=M+(H^P&(R^H))+L[5]+3593408605&4294967295,M=R+(O<<5&4294967295|O>>>27),O=P+(R^H&(M^R))+L[10]+38016083&4294967295,P=M+(O<<9&4294967295|O>>>23),O=H+(M^R&(P^M))+L[15]+3634488961&4294967295,H=P+(O<<14&4294967295|O>>>18),O=R+(P^M&(H^P))+L[4]+3889429448&4294967295,R=H+(O<<20&4294967295|O>>>12),O=M+(H^P&(R^H))+L[9]+568446438&4294967295,M=R+(O<<5&4294967295|O>>>27),O=P+(R^H&(M^R))+L[14]+3275163606&4294967295,P=M+(O<<9&4294967295|O>>>23),O=H+(M^R&(P^M))+L[3]+4107603335&4294967295,H=P+(O<<14&4294967295|O>>>18),O=R+(P^M&(H^P))+L[8]+1163531501&4294967295,R=H+(O<<20&4294967295|O>>>12),O=M+(H^P&(R^H))+L[13]+2850285829&4294967295,M=R+(O<<5&4294967295|O>>>27),O=P+(R^H&(M^R))+L[2]+4243563512&4294967295,P=M+(O<<9&4294967295|O>>>23),O=H+(M^R&(P^M))+L[7]+1735328473&4294967295,H=P+(O<<14&4294967295|O>>>18),O=R+(P^M&(H^P))+L[12]+2368359562&4294967295,R=H+(O<<20&4294967295|O>>>12),O=M+(R^H^P)+L[5]+4294588738&4294967295,M=R+(O<<4&4294967295|O>>>28),O=P+(M^R^H)+L[8]+2272392833&4294967295,P=M+(O<<11&4294967295|O>>>21),O=H+(P^M^R)+L[11]+1839030562&4294967295,H=P+(O<<16&4294967295|O>>>16),O=R+(H^P^M)+L[14]+4259657740&4294967295,R=H+(O<<23&4294967295|O>>>9),O=M+(R^H^P)+L[1]+2763975236&4294967295,M=R+(O<<4&4294967295|O>>>28),O=P+(M^R^H)+L[4]+1272893353&4294967295,P=M+(O<<11&4294967295|O>>>21),O=H+(P^M^R)+L[7]+4139469664&4294967295,H=P+(O<<16&4294967295|O>>>16),O=R+(H^P^M)+L[10]+3200236656&4294967295,R=H+(O<<23&4294967295|O>>>9),O=M+(R^H^P)+L[13]+681279174&4294967295,M=R+(O<<4&4294967295|O>>>28),O=P+(M^R^H)+L[0]+3936430074&4294967295,P=M+(O<<11&4294967295|O>>>21),O=H+(P^M^R)+L[3]+3572445317&4294967295,H=P+(O<<16&4294967295|O>>>16),O=R+(H^P^M)+L[6]+76029189&4294967295,R=H+(O<<23&4294967295|O>>>9),O=M+(R^H^P)+L[9]+3654602809&4294967295,M=R+(O<<4&4294967295|O>>>28),O=P+(M^R^H)+L[12]+3873151461&4294967295,P=M+(O<<11&4294967295|O>>>21),O=H+(P^M^R)+L[15]+530742520&4294967295,H=P+(O<<16&4294967295|O>>>16),O=R+(H^P^M)+L[2]+3299628645&4294967295,R=H+(O<<23&4294967295|O>>>9),O=M+(H^(R|~P))+L[0]+4096336452&4294967295,M=R+(O<<6&4294967295|O>>>26),O=P+(R^(M|~H))+L[7]+1126891415&4294967295,P=M+(O<<10&4294967295|O>>>22),O=H+(M^(P|~R))+L[14]+2878612391&4294967295,H=P+(O<<15&4294967295|O>>>17),O=R+(P^(H|~M))+L[5]+4237533241&4294967295,R=H+(O<<21&4294967295|O>>>11),O=M+(H^(R|~P))+L[12]+1700485571&4294967295,M=R+(O<<6&4294967295|O>>>26),O=P+(R^(M|~H))+L[3]+2399980690&4294967295,P=M+(O<<10&4294967295|O>>>22),O=H+(M^(P|~R))+L[10]+4293915773&4294967295,H=P+(O<<15&4294967295|O>>>17),O=R+(P^(H|~M))+L[1]+2240044497&4294967295,R=H+(O<<21&4294967295|O>>>11),O=M+(H^(R|~P))+L[8]+1873313359&4294967295,M=R+(O<<6&4294967295|O>>>26),O=P+(R^(M|~H))+L[15]+4264355552&4294967295,P=M+(O<<10&4294967295|O>>>22),O=H+(M^(P|~R))+L[6]+2734768916&4294967295,H=P+(O<<15&4294967295|O>>>17),O=R+(P^(H|~M))+L[13]+1309151649&4294967295,R=H+(O<<21&4294967295|O>>>11),O=M+(H^(R|~P))+L[4]+4149444226&4294967295,M=R+(O<<6&4294967295|O>>>26),O=P+(R^(M|~H))+L[11]+3174756917&4294967295,P=M+(O<<10&4294967295|O>>>22),O=H+(M^(P|~R))+L[2]+718787259&4294967295,H=P+(O<<15&4294967295|O>>>17),O=R+(P^(H|~M))+L[9]+3951481745&4294967295,C.g[0]=C.g[0]+M&4294967295,C.g[1]=C.g[1]+(H+(O<<21&4294967295|O>>>11))&4294967295,C.g[2]=C.g[2]+H&4294967295,C.g[3]=C.g[3]+P&4294967295}i.prototype.v=function(C,M){M===void 0&&(M=C.length);const R=M-this.blockSize,L=this.C;let H=this.h,P=0;for(;P<M;){if(H==0)for(;P<=R;)r(this,C,P),P+=this.blockSize;if(typeof C=="string"){for(;P<M;)if(L[H++]=C.charCodeAt(P++),H==this.blockSize){r(this,L),H=0;break}}else for(;P<M;)if(L[H++]=C[P++],H==this.blockSize){r(this,L),H=0;break}}this.h=H,this.o+=M},i.prototype.A=function(){var C=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);C[0]=128;for(var M=1;M<C.length-8;++M)C[M]=0;M=this.o*8;for(var R=C.length-8;R<C.length;++R)C[R]=M&255,M/=256;for(this.v(C),C=Array(16),M=0,R=0;R<4;++R)for(let L=0;L<32;L+=8)C[M++]=this.g[R]>>>L&255;return C};function s(C,M){var R=o;return Object.prototype.hasOwnProperty.call(R,C)?R[C]:R[C]=M(C)}function a(C,M){this.h=M;const R=[];let L=!0;for(let H=C.length-1;H>=0;H--){const P=C[H]|0;L&&P==M||(R[H]=P,L=!1)}this.g=R}var o={};function l(C){return-128<=C&&C<128?s(C,function(M){return new a([M|0],M<0?-1:0)}):new a([C|0],C<0?-1:0)}function c(C){if(isNaN(C)||!isFinite(C))return f;if(C<0)return _(c(-C));const M=[];let R=1;for(let L=0;C>=R;L++)M[L]=C/R|0,R*=4294967296;return new a(M,0)}function h(C,M){if(C.length==0)throw Error("number format error: empty string");if(M=M||10,M<2||36<M)throw Error("radix out of range: "+M);if(C.charAt(0)=="-")return _(h(C.substring(1),M));if(C.indexOf("-")>=0)throw Error('number format error: interior "-" character');const R=c(Math.pow(M,8));let L=f;for(let P=0;P<C.length;P+=8){var H=Math.min(8,C.length-P);const O=parseInt(C.substring(P,P+H),M);H<8?(H=c(Math.pow(M,H)),L=L.j(H).add(c(O))):(L=L.j(R),L=L.add(c(O)))}return L}var f=l(0),p=l(1),y=l(16777216);n=a.prototype,n.m=function(){if(v(this))return-_(this).m();let C=0,M=1;for(let R=0;R<this.g.length;R++){const L=this.i(R);C+=(L>=0?L:4294967296+L)*M,M*=4294967296}return C},n.toString=function(C){if(C=C||10,C<2||36<C)throw Error("radix out of range: "+C);if(x(this))return"0";if(v(this))return"-"+_(this).toString(C);const M=c(Math.pow(C,6));var R=this;let L="";for(;;){const H=N(R,M).g;R=E(R,H.j(M));let P=((R.g.length>0?R.g[0]:R.h)>>>0).toString(C);if(R=H,x(R))return P+L;for(;P.length<6;)P="0"+P;L=P+L}},n.i=function(C){return C<0?0:C<this.g.length?this.g[C]:this.h};function x(C){if(C.h!=0)return!1;for(let M=0;M<C.g.length;M++)if(C.g[M]!=0)return!1;return!0}function v(C){return C.h==-1}n.l=function(C){return C=E(this,C),v(C)?-1:x(C)?0:1};function _(C){const M=C.g.length,R=[];for(let L=0;L<M;L++)R[L]=~C.g[L];return new a(R,~C.h).add(p)}n.abs=function(){return v(this)?_(this):this},n.add=function(C){const M=Math.max(this.g.length,C.g.length),R=[];let L=0;for(let H=0;H<=M;H++){let P=L+(this.i(H)&65535)+(C.i(H)&65535),O=(P>>>16)+(this.i(H)>>>16)+(C.i(H)>>>16);L=O>>>16,P&=65535,O&=65535,R[H]=O<<16|P}return new a(R,R[R.length-1]&-2147483648?-1:0)};function E(C,M){return C.add(_(M))}n.j=function(C){if(x(this)||x(C))return f;if(v(this))return v(C)?_(this).j(_(C)):_(_(this).j(C));if(v(C))return _(this.j(_(C)));if(this.l(y)<0&&C.l(y)<0)return c(this.m()*C.m());const M=this.g.length+C.g.length,R=[];for(var L=0;L<2*M;L++)R[L]=0;for(L=0;L<this.g.length;L++)for(let H=0;H<C.g.length;H++){const P=this.i(L)>>>16,O=this.i(L)&65535,B=C.i(H)>>>16,re=C.i(H)&65535;R[2*L+2*H]+=O*re,w(R,2*L+2*H),R[2*L+2*H+1]+=P*re,w(R,2*L+2*H+1),R[2*L+2*H+1]+=O*B,w(R,2*L+2*H+1),R[2*L+2*H+2]+=P*B,w(R,2*L+2*H+2)}for(C=0;C<M;C++)R[C]=R[2*C+1]<<16|R[2*C];for(C=M;C<2*M;C++)R[C]=0;return new a(R,0)};function w(C,M){for(;(C[M]&65535)!=C[M];)C[M+1]+=C[M]>>>16,C[M]&=65535,M++}function A(C,M){this.g=C,this.h=M}function N(C,M){if(x(M))throw Error("division by zero");if(x(C))return new A(f,f);if(v(C))return M=N(_(C),M),new A(_(M.g),_(M.h));if(v(M))return M=N(C,_(M)),new A(_(M.g),M.h);if(C.g.length>30){if(v(C)||v(M))throw Error("slowDivide_ only works with positive integers.");for(var R=p,L=M;L.l(C)<=0;)R=k(R),L=k(L);var H=F(R,1),P=F(L,1);for(L=F(L,2),R=F(R,2);!x(L);){var O=P.add(L);O.l(C)<=0&&(H=H.add(R),P=O),L=F(L,1),R=F(R,1)}return M=E(C,H.j(M)),new A(H,M)}for(H=f;C.l(M)>=0;){for(R=Math.max(1,Math.floor(C.m()/M.m())),L=Math.ceil(Math.log(R)/Math.LN2),L=L<=48?1:Math.pow(2,L-48),P=c(R),O=P.j(M);v(O)||O.l(C)>0;)R-=L,P=c(R),O=P.j(M);x(P)&&(P=p),H=H.add(P),C=E(C,O)}return new A(H,C)}n.B=function(C){return N(this,C).h},n.and=function(C){const M=Math.max(this.g.length,C.g.length),R=[];for(let L=0;L<M;L++)R[L]=this.i(L)&C.i(L);return new a(R,this.h&C.h)},n.or=function(C){const M=Math.max(this.g.length,C.g.length),R=[];for(let L=0;L<M;L++)R[L]=this.i(L)|C.i(L);return new a(R,this.h|C.h)},n.xor=function(C){const M=Math.max(this.g.length,C.g.length),R=[];for(let L=0;L<M;L++)R[L]=this.i(L)^C.i(L);return new a(R,this.h^C.h)};function k(C){const M=C.g.length+1,R=[];for(let L=0;L<M;L++)R[L]=C.i(L)<<1|C.i(L-1)>>>31;return new a(R,C.h)}function F(C,M){const R=M>>5;M%=32;const L=C.g.length-R,H=[];for(let P=0;P<L;P++)H[P]=M>0?C.i(P+R)>>>M|C.i(P+R+1)<<32-M:C.i(P+R);return new a(H,C.h)}i.prototype.digest=i.prototype.A,i.prototype.reset=i.prototype.u,i.prototype.update=i.prototype.v,Ote=i,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.B,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=c,a.fromString=h,Yf=a}).apply(typeof GG<"u"?GG:typeof self<"u"?self:typeof window<"u"?window:{});var CA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/var Bte,Xx,Vte,ZS,lP,Wte,Hte,zte;(function(){var n,e=Object.defineProperty;function t(D){D=[typeof globalThis=="object"&&globalThis,D,typeof window=="object"&&window,typeof self=="object"&&self,typeof CA=="object"&&CA];for(var z=0;z<D.length;++z){var ee=D[z];if(ee&&ee.Math==Math)return ee}throw Error("Cannot find global object")}var i=t(this);function r(D,z){if(z)e:{var ee=i;D=D.split(".");for(var pe=0;pe<D.length-1;pe++){var Be=D[pe];if(!(Be in ee))break e;ee=ee[Be]}D=D[D.length-1],pe=ee[D],z=z(pe),z!=pe&&z!=null&&e(ee,D,{configurable:!0,writable:!0,value:z})}}r("Symbol.dispose",function(D){return D||Symbol("Symbol.dispose")}),r("Array.prototype.values",function(D){return D||function(){return this[Symbol.iterator]()}}),r("Object.entries",function(D){return D||function(z){var ee=[],pe;for(pe in z)Object.prototype.hasOwnProperty.call(z,pe)&&ee.push([pe,z[pe]]);return ee}});/** @license

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/var s=s||{},a=this||self;function o(D){var z=typeof D;return z=="object"&&D!=null||z=="function"}function l(D,z,ee){return D.call.apply(D.bind,arguments)}function c(D,z,ee){return c=l,c.apply(null,arguments)}function h(D,z){var ee=Array.prototype.slice.call(arguments,1);return function(){var pe=ee.slice();return pe.push.apply(pe,arguments),D.apply(this,pe)}}function f(D,z){function ee(){}ee.prototype=z.prototype,D.Z=z.prototype,D.prototype=new ee,D.prototype.constructor=D,D.Ob=function(pe,Be,Qe){for(var xt=Array(arguments.length-2),ln=2;ln<arguments.length;ln++)xt[ln-2]=arguments[ln];return z.prototype[Be].apply(pe,xt)}}var p=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?D=>D&&AsyncContext.Snapshot.wrap(D):D=>D;function y(D){const z=D.length;if(z>0){const ee=Array(z);for(let pe=0;pe<z;pe++)ee[pe]=D[pe];return ee}return[]}function x(D,z){for(let pe=1;pe<arguments.length;pe++){const Be=arguments[pe];var ee=typeof Be;if(ee=ee!="object"?ee:Be?Array.isArray(Be)?"array":ee:"null",ee=="array"||ee=="object"&&typeof Be.length=="number"){ee=D.length||0;const Qe=Be.length||0;D.length=ee+Qe;for(let xt=0;xt<Qe;xt++)D[ee+xt]=Be[xt]}else D.push(Be)}}class v{constructor(z,ee){this.i=z,this.j=ee,this.h=0,this.g=null}get(){let z;return this.h>0?(this.h--,z=this.g,this.g=z.next,z.next=null):z=this.i(),z}}function _(D){a.setTimeout(()=>{throw D},0)}function E(){var D=C;let z=null;return D.g&&(z=D.g,D.g=D.g.next,D.g||(D.h=null),z.next=null),z}class w{constructor(){this.h=this.g=null}add(z,ee){const pe=A.get();pe.set(z,ee),this.h?this.h.next=pe:this.g=pe,this.h=pe}}var A=new v(()=>new N,D=>D.reset());class N{constructor(){this.next=this.g=this.h=null}set(z,ee){this.h=z,this.g=ee,this.next=null}reset(){this.next=this.g=this.h=null}}let k,F=!1,C=new w,M=()=>{const D=Promise.resolve(void 0);k=()=>{D.then(R)}};function R(){for(var D;D=E();){try{D.h.call(D.g)}catch(ee){_(ee)}var z=A;z.j(D),z.h<100&&(z.h++,D.next=z.g,z.g=D)}F=!1}function L(){this.u=this.u,this.C=this.C}L.prototype.u=!1,L.prototype.dispose=function(){this.u||(this.u=!0,this.N())},L.prototype[Symbol.dispose]=function(){this.dispose()},L.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function H(D,z){this.type=D,this.g=this.target=z,this.defaultPrevented=!1}H.prototype.h=function(){this.defaultPrevented=!0};var P=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var D=!1,z=Object.defineProperty({},"passive",{get:function(){D=!0}});try{const ee=()=>{};a.addEventListener("test",ee,z),a.removeEventListener("test",ee,z)}catch{}return D})();function O(D){return/^[\s\xa0]*$/.test(D)}function B(D,z){H.call(this,D?D.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,D&&this.init(D,z)}f(B,H),B.prototype.init=function(D,z){const ee=this.type=D.type,pe=D.changedTouches&&D.changedTouches.length?D.changedTouches[0]:null;this.target=D.target||D.srcElement,this.g=z,z=D.relatedTarget,z||(ee=="mouseover"?z=D.fromElement:ee=="mouseout"&&(z=D.toElement)),this.relatedTarget=z,pe?(this.clientX=pe.clientX!==void 0?pe.clientX:pe.pageX,this.clientY=pe.clientY!==void 0?pe.clientY:pe.pageY,this.screenX=pe.screenX||0,this.screenY=pe.screenY||0):(this.clientX=D.clientX!==void 0?D.clientX:D.pageX,this.clientY=D.clientY!==void 0?D.clientY:D.pageY,this.screenX=D.screenX||0,this.screenY=D.screenY||0),this.button=D.button,this.key=D.key||"",this.ctrlKey=D.ctrlKey,this.altKey=D.altKey,this.shiftKey=D.shiftKey,this.metaKey=D.metaKey,this.pointerId=D.pointerId||0,this.pointerType=D.pointerType,this.state=D.state,this.i=D,D.defaultPrevented&&B.Z.h.call(this)},B.prototype.h=function(){B.Z.h.call(this);const D=this.i;D.preventDefault?D.preventDefault():D.returnValue=!1};var re="closure_listenable_"+(Math.random()*1e6|0),q=0;function X(D,z,ee,pe,Be){this.listener=D,this.proxy=null,this.src=z,this.type=ee,this.capture=!!pe,this.ha=Be,this.key=++q,this.da=this.fa=!1}function oe(D){D.da=!0,D.listener=null,D.proxy=null,D.src=null,D.ha=null}function ue(D,z,ee){for(const pe in D)z.call(ee,D[pe],pe,D)}function ge(D,z){for(const ee in D)z.call(void 0,D[ee],ee,D)}function j(D){const z={};for(const ee in D)z[ee]=D[ee];return z}const G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Z(D,z){let ee,pe;for(let Be=1;Be<arguments.length;Be++){pe=arguments[Be];for(ee in pe)D[ee]=pe[ee];for(let Qe=0;Qe<G.length;Qe++)ee=G[Qe],Object.prototype.hasOwnProperty.call(pe,ee)&&(D[ee]=pe[ee])}}function te(D){this.src=D,this.g={},this.h=0}te.prototype.add=function(D,z,ee,pe,Be){const Qe=D.toString();D=this.g[Qe],D||(D=this.g[Qe]=[],this.h++);const xt=_e(D,z,pe,Be);return xt>-1?(z=D[xt],ee||(z.fa=!1)):(z=new X(z,this.src,Qe,!!pe,Be),z.fa=ee,D.push(z)),z};function ie(D,z){const ee=z.type;if(ee in D.g){var pe=D.g[ee],Be=Array.prototype.indexOf.call(pe,z,void 0),Qe;(Qe=Be>=0)&&Array.prototype.splice.call(pe,Be,1),Qe&&(oe(z),D.g[ee].length==0&&(delete D.g[ee],D.h--))}}function _e(D,z,ee,pe){for(let Be=0;Be<D.length;++Be){const Qe=D[Be];if(!Qe.da&&Qe.listener==z&&Qe.capture==!!ee&&Qe.ha==pe)return Be}return-1}var Ie="closure_lm_"+(Math.random()*1e6|0),Pe={};function Fe(D,z,ee,pe,Be){if(Array.isArray(z)){for(let Qe=0;Qe<z.length;Qe++)Fe(D,z[Qe],ee,pe,Be);return null}return ee=he(ee),D&&D[re]?D.J(z,ee,o(pe)?!!pe.capture:!1,Be):Ge(D,z,ee,!1,pe,Be)}function Ge(D,z,ee,pe,Be,Qe){if(!z)throw Error("Invalid event type");const xt=o(Be)?!!Be.capture:!!Be;let ln=Te(D);if(ln||(D[Ie]=ln=new te(D)),ee=ln.add(z,ee,pe,xt,Qe),ee.proxy)return ee;if(pe=ct(),ee.proxy=pe,pe.src=D,pe.listener=ee,D.addEventListener)P||(Be=xt),Be===void 0&&(Be=!1),D.addEventListener(z.toString(),pe,Be);else if(D.attachEvent)D.attachEvent(W(z.toString()),pe);else if(D.addListener&&D.removeListener)D.addListener(pe);else throw Error("addEventListener and attachEvent are unavailable.");return ee}function ct(){function D(ee){return z.call(D.src,D.listener,ee)}const z=Re;return D}function gt(D,z,ee,pe,Be){if(Array.isArray(z))for(var Qe=0;Qe<z.length;Qe++)gt(D,z[Qe],ee,pe,Be);else pe=o(pe)?!!pe.capture:!!pe,ee=he(ee),D&&D[re]?(D=D.i,Qe=String(z).toString(),Qe in D.g&&(z=D.g[Qe],ee=_e(z,ee,pe,Be),ee>-1&&(oe(z[ee]),Array.prototype.splice.call(z,ee,1),z.length==0&&(delete D.g[Qe],D.h--)))):D&&(D=Te(D))&&(z=D.g[z.toString()],D=-1,z&&(D=_e(z,ee,pe,Be)),(ee=D>-1?z[D]:null)&&Mt(ee))}function Mt(D){if(typeof D!="number"&&D&&!D.da){var z=D.src;if(z&&z[re])ie(z.i,D);else{var ee=D.type,pe=D.proxy;z.removeEventListener?z.removeEventListener(ee,pe,D.capture):z.detachEvent?z.detachEvent(W(ee),pe):z.addListener&&z.removeListener&&z.removeListener(pe),(ee=Te(z))?(ie(ee,D),ee.h==0&&(ee.src=null,z[Ie]=null)):oe(D)}}}function W(D){return D in Pe?Pe[D]:Pe[D]="on"+D}function Re(D,z){if(D.da)D=!0;else{z=new B(z,this);const ee=D.listener,pe=D.ha||D.src;D.fa&&Mt(D),D=ee.call(pe,z)}return D}function Te(D){return D=D[Ie],D instanceof te?D:null}var ae="__closure_events_fn_"+(Math.random()*1e9>>>0);function he(D){return typeof D=="function"?D:(D[ae]||(D[ae]=function(z){return D.handleEvent(z)}),D[ae])}function we(){L.call(this),this.i=new te(this),this.M=this,this.G=null}f(we,L),we.prototype[re]=!0,we.prototype.removeEventListener=function(D,z,ee,pe){gt(this,D,z,ee,pe)};function Le(D,z){var ee,pe=D.G;if(pe)for(ee=[];pe;pe=pe.G)ee.push(pe);if(D=D.M,pe=z.type||z,typeof z=="string")z=new H(z,D);else if(z instanceof H)z.target=z.target||D;else{var Be=z;z=new H(pe,D),Z(z,Be)}Be=!0;let Qe,xt;if(ee)for(xt=ee.length-1;xt>=0;xt--)Qe=z.g=ee[xt],Be=$e(Qe,pe,!0,z)&&Be;if(Qe=z.g=D,Be=$e(Qe,pe,!0,z)&&Be,Be=$e(Qe,pe,!1,z)&&Be,ee)for(xt=0;xt<ee.length;xt++)Qe=z.g=ee[xt],Be=$e(Qe,pe,!1,z)&&Be}we.prototype.N=function(){if(we.Z.N.call(this),this.i){var D=this.i;for(const z in D.g){const ee=D.g[z];for(let pe=0;pe<ee.length;pe++)oe(ee[pe]);delete D.g[z],D.h--}}this.G=null},we.prototype.J=function(D,z,ee,pe){return this.i.add(String(D),z,!1,ee,pe)},we.prototype.K=function(D,z,ee,pe){return this.i.add(String(D),z,!0,ee,pe)};function $e(D,z,ee,pe){if(z=D.i.g[String(z)],!z)return!0;z=z.concat();let Be=!0;for(let Qe=0;Qe<z.length;++Qe){const xt=z[Qe];if(xt&&!xt.da&&xt.capture==ee){const ln=xt.listener,Zi=xt.ha||xt.src;xt.fa&&ie(D.i,xt),Be=ln.call(Zi,pe)!==!1&&Be}}return Be&&!pe.defaultPrevented}function Ce(D,z){if(typeof D!="function")if(D&&typeof D.handleEvent=="function")D=c(D.handleEvent,D);else throw Error("Invalid listener argument");return Number(z)>2147483647?-1:a.setTimeout(D,z||0)}function be(D){D.g=Ce(()=>{D.g=null,D.i&&(D.i=!1,be(D))},D.l);const z=D.h;D.h=null,D.m.apply(null,z)}class Ee extends L{constructor(z,ee){super(),this.m=z,this.l=ee,this.h=null,this.i=!1,this.g=null}j(z){this.h=arguments,this.g?this.i=!0:be(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Me(D){L.call(this),this.h=D,this.g={}}f(Me,L);var Xe=[];function dt(D){ue(D.g,function(z,ee){this.g.hasOwnProperty(ee)&&Mt(z)},D),D.g={}}Me.prototype.N=function(){Me.Z.N.call(this),dt(this)},Me.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var bt=a.JSON.stringify,zt=a.JSON.parse,Nt=class{stringify(D){return a.JSON.stringify(D,void 0)}parse(D){return a.JSON.parse(D,void 0)}};function Gt(){}function on(){}var ke={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function xe(){H.call(this,"d")}f(xe,H);function Ye(){H.call(this,"c")}f(Ye,H);var Je={},pt=null;function mt(){return pt=pt||new we}Je.Ia="serverreachability";function Yt(D){H.call(this,Je.Ia,D)}f(Yt,H);function Kt(D){const z=mt();Le(z,new Yt(z))}Je.STAT_EVENT="statevent";function jt(D,z){H.call(this,Je.STAT_EVENT,D),this.stat=z}f(jt,H);function ne(D){const z=mt();Le(z,new jt(z,D))}Je.Ja="timingevent";function le(D,z){H.call(this,Je.Ja,D),this.size=z}f(le,H);function Ae(D,z){if(typeof D!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){D()},z)}function Oe(){this.g=!0}Oe.prototype.ua=function(){this.g=!1};function ft(D,z,ee,pe,Be,Qe){D.info(function(){if(D.g)if(Qe){var xt="",ln=Qe.split("&");for(let Pn=0;Pn<ln.length;Pn++){var Zi=ln[Pn].split("=");if(Zi.length>1){const Mi=Zi[0];Zi=Zi[1];const No=Mi.split("_");xt=No.length>=2&&No[1]=="type"?xt+(Mi+"="+Zi+"&"):xt+(Mi+"=redacted&")}}}else xt=null;else xt=Qe;return"XMLHTTP REQ ("+pe+") [attempt "+Be+"]: "+z+`
`+ee+`
`+xt})}function Ht(D,z,ee,pe,Be,Qe,xt){D.info(function(){return"XMLHTTP RESP ("+pe+") [ attempt "+Be+"]: "+z+`
`+ee+`
`+Qe+" "+xt})}function mn(D,z,ee,pe){D.info(function(){return"XMLHTTP TEXT ("+z+"): "+ss(D,ee)+(pe?" "+pe:"")})}function ki(D,z){D.info(function(){return"TIMEOUT: "+z})}Oe.prototype.info=function(){};function ss(D,z){if(!D.g)return z;if(!z)return null;try{const Qe=JSON.parse(z);if(Qe){for(D=0;D<Qe.length;D++)if(Array.isArray(Qe[D])){var ee=Qe[D];if(!(ee.length<2)){var pe=ee[1];if(Array.isArray(pe)&&!(pe.length<1)){var Be=pe[0];if(Be!="noop"&&Be!="stop"&&Be!="close")for(let xt=1;xt<pe.length;xt++)pe[xt]=""}}}}return bt(Qe)}catch{return z}}var Br={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},wr={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},Ys;function as(){}f(as,Gt),as.prototype.g=function(){return new XMLHttpRequest},Ys=new as;function Ar(D){return encodeURIComponent(String(D))}function se(D){var z=1;D=D.split(":");const ee=[];for(;z>0&&D.length;)ee.push(D.shift()),z--;return D.length&&ee.push(D.join(":")),ee}function me(D,z,ee,pe){this.j=D,this.i=z,this.l=ee,this.S=pe||1,this.V=new Me(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new fe}function fe(){this.i=null,this.g="",this.h=!1}var de={},ye={};function ve(D,z,ee){D.M=1,D.A=Ap(ar(z)),D.u=ee,D.R=!0,Ve(D,null)}function Ve(D,z){D.F=Date.now(),qe(D),D.B=ar(D.A);var ee=D.B,pe=D.S;Array.isArray(pe)||(pe=[String(pe)]),f0(ee.i,"t",pe),D.C=0,ee=D.j.L,D.h=new fe,D.g=kE(D.j,ee?z:null,!D.u),D.P>0&&(D.O=new Ee(c(D.Y,D,D.g),D.P)),z=D.V,ee=D.g,pe=D.ba;var Be="readystatechange";Array.isArray(Be)||(Be&&(Xe[0]=Be.toString()),Be=Xe);for(let Qe=0;Qe<Be.length;Qe++){const xt=Fe(ee,Be[Qe],pe||z.handleEvent,!1,z.h||z);if(!xt)break;z.g[xt.key]=xt}z=D.J?j(D.J):{},D.u?(D.v||(D.v="POST"),z["Content-Type"]="application/x-www-form-urlencoded",D.g.ea(D.B,D.v,D.u,z)):(D.v="GET",D.g.ea(D.B,D.v,null,z)),Kt(),ft(D.i,D.v,D.B,D.l,D.S,D.u)}me.prototype.ba=function(D){D=D.target;const z=this.O;z&&Tl(D)==3?z.j():this.Y(D)},me.prototype.Y=function(D){try{if(D==this.g)e:{const ln=Tl(this.g),Zi=this.g.ya(),Pn=this.g.ca();if(!(ln<3)&&(ln!=3||this.g&&(this.h.h||this.g.la()||os(this.g)))){this.K||ln!=4||Zi==7||(Zi==8||Pn<=0?Kt(3):Kt(2)),yt(this);var z=this.g.ca();this.X=z;var ee=nt(this);if(this.o=z==200,Ht(this.i,this.v,this.B,this.l,this.S,ln,z),this.o){if(this.U&&!this.L){t:{if(this.g){var pe,Be=this.g;if((pe=Be.g?Be.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!O(pe)){var Qe=pe;break t}}Qe=null}if(D=Qe)mn(this.i,this.l,D,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Tt(this,D);else{this.o=!1,this.m=3,ne(12),ut(this),Et(this);break e}}if(this.R){D=!0;let Mi;for(;!this.K&&this.C<ee.length;)if(Mi=je(this,ee),Mi==ye){ln==4&&(this.m=4,ne(14),D=!1),mn(this.i,this.l,null,"[Incomplete Response]");break}else if(Mi==de){this.m=4,ne(15),mn(this.i,this.l,ee,"[Invalid Chunk]"),D=!1;break}else mn(this.i,this.l,Mi,null),Tt(this,Mi);if(He(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),ln!=4||ee.length!=0||this.h.h||(this.m=1,ne(16),D=!1),this.o=this.o&&D,!D)mn(this.i,this.l,ee,"[Invalid Chunked Response]"),ut(this),Et(this);else if(ee.length>0&&!this.W){this.W=!0;var xt=this.j;xt.g==this&&xt.aa&&!xt.P&&(xt.j.info("Great, no buffering proxy detected. Bytes received: "+ee.length),f_(xt),xt.P=!0,ne(11))}}else mn(this.i,this.l,ee,null),Tt(this,ee);ln==4&&ut(this),this.o&&!this.K&&(ln==4?CE(this.j,this):(this.o=!1,qe(this)))}else vu(this.g),z==400&&ee.indexOf("Unknown SID")>0?(this.m=3,ne(12)):(this.m=0,ne(13)),ut(this),Et(this)}}}catch{}finally{}};function nt(D){if(!He(D))return D.g.la();const z=os(D.g);if(z==="")return"";let ee="";const pe=z.length,Be=Tl(D.g)==4;if(!D.h.i){if(typeof TextDecoder>"u")return ut(D),Et(D),"";D.h.i=new a.TextDecoder}for(let Qe=0;Qe<pe;Qe++)D.h.h=!0,ee+=D.h.i.decode(z[Qe],{stream:!(Be&&Qe==pe-1)});return z.length=0,D.h.g+=ee,D.C=0,D.h.g}function He(D){return D.g?D.v=="GET"&&D.M!=2&&D.j.Aa:!1}function je(D,z){var ee=D.C,pe=z.indexOf(`
`,ee);return pe==-1?ye:(ee=Number(z.substring(ee,pe)),isNaN(ee)?de:(pe+=1,pe+ee>z.length?ye:(z=z.slice(pe,pe+ee),D.C=pe+ee,z)))}me.prototype.cancel=function(){this.K=!0,ut(this)};function qe(D){D.T=Date.now()+D.H,ht(D,D.H)}function ht(D,z){if(D.D!=null)throw Error("WatchDog timer not null");D.D=Ae(c(D.aa,D),z)}function yt(D){D.D&&(a.clearTimeout(D.D),D.D=null)}me.prototype.aa=function(){this.D=null;const D=Date.now();D-this.T>=0?(ki(this.i,this.B),this.M!=2&&(Kt(),ne(17)),ut(this),this.m=2,Et(this)):ht(this,this.T-D)};function Et(D){D.j.I==0||D.K||CE(D.j,D)}function ut(D){yt(D);var z=D.O;z&&typeof z.dispose=="function"&&z.dispose(),D.O=null,dt(D.V),D.g&&(z=D.g,D.g=null,z.abort(),z.dispose())}function Tt(D,z){try{var ee=D.j;if(ee.I!=0&&(ee.g==D||Ns(ee.h,D))){if(!D.L&&Ns(ee.h,D)&&ee.I==3){try{var pe=ee.Ba.g.parse(z)}catch{pe=null}if(Array.isArray(pe)&&pe.length==3){var Be=pe;if(Be[0]==0){e:if(!ee.v){if(ee.g)if(ee.g.F+3e3<D.F)v0(ee),ld(ee);else break e;kp(ee),ne(18)}}else ee.xa=Be[1],0<ee.xa-ee.K&&Be[2]<37500&&ee.F&&ee.A==0&&!ee.C&&(ee.C=Ae(c(ee.Va,ee),6e3));gi(ee.h)<=1&&ee.ta&&(ee.ta=void 0)}else gc(ee,11)}else if((D.L||ee.g==D)&&v0(ee),!O(z))for(Be=ee.Ba.g.parse(z),z=0;z<Be.length;z++){let Pn=Be[z];const Mi=Pn[0];if(!(Mi<=ee.K))if(ee.K=Mi,Pn=Pn[1],ee.I==2)if(Pn[0]=="c"){ee.M=Pn[1],ee.ba=Pn[2];const No=Pn[3];No!=null&&(ee.ka=No,ee.j.info("VER="+ee.ka));const mc=Pn[4];mc!=null&&(ee.za=mc,ee.j.info("SVER="+ee.za));const El=Pn[5];El!=null&&typeof El=="number"&&El>0&&(pe=1.5*El,ee.O=pe,ee.j.info("backChannelRequestTimeoutMs_="+pe)),pe=ee;const wl=D.g;if(wl){const Mp=wl.g?wl.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Mp){var Qe=pe.h;Qe.g||Mp.indexOf("spdy")==-1&&Mp.indexOf("quic")==-1&&Mp.indexOf("h2")==-1||(Qe.j=Qe.l,Qe.g=new Set,Qe.h&&(vl(Qe,Qe.h),Qe.h=null))}if(pe.G){const _0=wl.g?wl.g.getResponseHeader("X-HTTP-Session-Id"):null;_0&&(pe.wa=_0,jn(pe.J,pe.G,_0))}}ee.I=3,ee.l&&ee.l.ra(),ee.aa&&(ee.T=Date.now()-D.F,ee.j.info("Handshake RTT: "+ee.T+"ms")),pe=ee;var xt=D;if(pe.na=NE(pe,pe.L?pe.ba:null,pe.W),xt.L){_l(pe.h,xt);var ln=xt,Zi=pe.O;Zi&&(ln.H=Zi),ln.D&&(yt(ln),qe(ln)),pe.g=xt}else SE(pe);ee.i.length>0&&pc(ee)}else Pn[0]!="stop"&&Pn[0]!="close"||gc(ee,7);else ee.I==3&&(Pn[0]=="stop"||Pn[0]=="close"?Pn[0]=="stop"?gc(ee,7):h_(ee):Pn[0]!="noop"&&ee.l&&ee.l.qa(Pn),ee.A=0)}}Kt(4)}catch{}}var Ft=class{constructor(D,z){this.g=D,this.map=z}};function qn(D){this.l=D||10,a.PerformanceNavigationTiming?(D=a.performance.getEntriesByType("navigation"),D=D.length>0&&(D[0].nextHopProtocol=="hq"||D[0].nextHopProtocol=="h2")):D=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=D?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function $n(D){return D.h?!0:D.g?D.g.size>=D.j:!1}function gi(D){return D.h?1:D.g?D.g.size:0}function Ns(D,z){return D.h?D.h==z:D.g?D.g.has(z):!1}function vl(D,z){D.g?D.g.add(z):D.h=z}function _l(D,z){D.h&&D.h==z?D.h=null:D.g&&D.g.has(z)&&D.g.delete(z)}qn.prototype.cancel=function(){if(this.i=Va(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const D of this.g.values())D.cancel();this.g.clear()}};function Va(D){if(D.h!=null)return D.i.concat(D.h.G);if(D.g!=null&&D.g.size!==0){let z=D.i;for(const ee of D.g.values())z=z.concat(ee.G);return z}return y(D.i)}var ed=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ks(D,z){if(D){D=D.split("&");for(let ee=0;ee<D.length;ee++){const pe=D[ee].indexOf("=");let Be,Qe=null;pe>=0?(Be=D[ee].substring(0,pe),Qe=D[ee].substring(pe+1)):Be=D[ee],z(Be,Qe?decodeURIComponent(Qe.replace(/\+/g," ")):"")}}}function Wa(D){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let z;D instanceof Wa?(this.l=D.l,Vr(this,D.j),this.o=D.o,this.g=D.g,td(this,D.u),this.h=D.h,r_(this,wE(D.i)),this.m=D.m):D&&(z=String(D).match(ed))?(this.l=!1,Vr(this,z[1]||"",!0),this.o=uc(z[2]||""),this.g=uc(z[3]||"",!0),td(this,z[4]),this.h=uc(z[5]||"",!0),r_(this,z[6]||"",!0),this.m=uc(z[7]||"")):(this.l=!1,this.i=new id(null,this.l))}Wa.prototype.toString=function(){const D=[];var z=this.j;z&&D.push(Sp(z,d0,!0),":");var ee=this.g;return(ee||z=="file")&&(D.push("//"),(z=this.o)&&D.push(Sp(z,d0,!0),"@"),D.push(Ar(ee).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),ee=this.u,ee!=null&&D.push(":",String(ee))),(ee=this.h)&&(this.g&&ee.charAt(0)!="/"&&D.push("/"),D.push(Sp(ee,ee.charAt(0)=="/"?s_:bE,!0))),(ee=this.i.toString())&&D.push("?",ee),(ee=this.m)&&D.push("#",Sp(ee,TE)),D.join("")},Wa.prototype.resolve=function(D){const z=ar(this);let ee=!!D.j;ee?Vr(z,D.j):ee=!!D.o,ee?z.o=D.o:ee=!!D.g,ee?z.g=D.g:ee=D.u!=null;var pe=D.h;if(ee)td(z,D.u);else if(ee=!!D.h){if(pe.charAt(0)!="/")if(this.g&&!this.h)pe="/"+pe;else{var Be=z.h.lastIndexOf("/");Be!=-1&&(pe=z.h.slice(0,Be+1)+pe)}if(Be=pe,Be==".."||Be==".")pe="";else if(Be.indexOf("./")!=-1||Be.indexOf("/.")!=-1){pe=Be.lastIndexOf("/",0)==0,Be=Be.split("/");const Qe=[];for(let xt=0;xt<Be.length;){const ln=Be[xt++];ln=="."?pe&&xt==Be.length&&Qe.push(""):ln==".."?((Qe.length>1||Qe.length==1&&Qe[0]!="")&&Qe.pop(),pe&&xt==Be.length&&Qe.push("")):(Qe.push(ln),pe=!0)}pe=Qe.join("/")}else pe=Be}return ee?z.h=pe:ee=D.i.toString()!=="",ee?r_(z,wE(D.i)):ee=!!D.m,ee&&(z.m=D.m),z};function ar(D){return new Wa(D)}function Vr(D,z,ee){D.j=ee?uc(z,!0):z,D.j&&(D.j=D.j.replace(/:$/,""))}function td(D,z){if(z){if(z=Number(z),isNaN(z)||z<0)throw Error("Bad port number "+z);D.u=z}else D.u=null}function r_(D,z,ee){z instanceof id?(D.i=z,p0(D.i,D.l)):(ee||(z=Sp(z,nd)),D.i=new id(z,D.l))}function jn(D,z,ee){D.i.set(z,ee)}function Ap(D){return jn(D,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),D}function uc(D,z){return D?z?decodeURI(D.replace(/%25/g,"%2525")):decodeURIComponent(D):""}function Sp(D,z,ee){return typeof D=="string"?(D=encodeURI(D).replace(z,ga),ee&&(D=D.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),D):null}function ga(D){return D=D.charCodeAt(0),"%"+(D>>4&15).toString(16)+(D&15).toString(16)}var d0=/[#\/\?@]/g,bE=/[#\?:]/g,s_=/[#\?]/g,nd=/[#\?@]/g,TE=/#/g;function id(D,z){this.h=this.g=null,this.i=D||null,this.j=!!z}function ma(D){D.g||(D.g=new Map,D.h=0,D.i&&ks(D.i,function(z,ee){D.add(decodeURIComponent(z.replace(/\+/g," ")),ee)}))}n=id.prototype,n.add=function(D,z){ma(this),this.i=null,D=rd(this,D);let ee=this.g.get(D);return ee||this.g.set(D,ee=[]),ee.push(z),this.h+=1,this};function EE(D,z){ma(D),z=rd(D,z),D.g.has(z)&&(D.i=null,D.h-=D.g.get(z).length,D.g.delete(z))}function a_(D,z){return ma(D),z=rd(D,z),D.g.has(z)}n.forEach=function(D,z){ma(this),this.g.forEach(function(ee,pe){ee.forEach(function(Be){D.call(z,Be,pe,this)},this)},this)};function o_(D,z){ma(D);let ee=[];if(typeof z=="string")a_(D,z)&&(ee=ee.concat(D.g.get(rd(D,z))));else for(D=Array.from(D.g.values()),z=0;z<D.length;z++)ee=ee.concat(D[z]);return ee}n.set=function(D,z){return ma(this),this.i=null,D=rd(this,D),a_(this,D)&&(this.h-=this.g.get(D).length),this.g.set(D,[z]),this.h+=1,this},n.get=function(D,z){return D?(D=o_(this,D),D.length>0?String(D[0]):z):z};function f0(D,z,ee){EE(D,z),ee.length>0&&(D.i=null,D.g.set(rd(D,z),y(ee)),D.h+=ee.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";const D=[],z=Array.from(this.g.keys());for(let pe=0;pe<z.length;pe++){var ee=z[pe];const Be=Ar(ee);ee=o_(this,ee);for(let Qe=0;Qe<ee.length;Qe++){let xt=Be;ee[Qe]!==""&&(xt+="="+Ar(ee[Qe])),D.push(xt)}}return this.i=D.join("&")};function wE(D){const z=new id;return z.i=D.i,D.g&&(z.g=new Map(D.g),z.h=D.h),z}function rd(D,z){return z=String(z),D.j&&(z=z.toLowerCase()),z}function p0(D,z){z&&!D.j&&(ma(D),D.i=null,D.g.forEach(function(ee,pe){const Be=pe.toLowerCase();pe!=Be&&(EE(this,pe),f0(this,Be,ee))},D)),D.j=z}function xl(D,z){const ee=new Oe;if(a.Image){const pe=new Image;pe.onload=h(Io,ee,"TestLoadImage: loaded",!0,z,pe),pe.onerror=h(Io,ee,"TestLoadImage: error",!1,z,pe),pe.onabort=h(Io,ee,"TestLoadImage: abort",!1,z,pe),pe.ontimeout=h(Io,ee,"TestLoadImage: timeout",!1,z,pe),a.setTimeout(function(){pe.ontimeout&&pe.ontimeout()},1e4),pe.src=D}else z(!1)}function l_(D,z){const ee=new Oe,pe=new AbortController,Be=setTimeout(()=>{pe.abort(),Io(ee,"TestPingServer: timeout",!1,z)},1e4);fetch(D,{signal:pe.signal}).then(Qe=>{clearTimeout(Be),Qe.ok?Io(ee,"TestPingServer: ok",!0,z):Io(ee,"TestPingServer: server error",!1,z)}).catch(()=>{clearTimeout(Be),Io(ee,"TestPingServer: error",!1,z)})}function Io(D,z,ee,pe,Be){try{Be&&(Be.onload=null,Be.onerror=null,Be.onabort=null,Be.ontimeout=null),pe(ee)}catch{}}function sd(){this.g=new Nt}function hc(D){this.i=D.Sb||null,this.h=D.ab||!1}f(hc,Gt),hc.prototype.g=function(){return new Dp(this.i,this.h)};function Dp(D,z){we.call(this),this.H=D,this.o=z,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}f(Dp,we),n=Dp.prototype,n.open=function(D,z){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=D,this.D=z,this.readyState=1,bl(this)},n.send=function(D){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const z={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};D&&(z.body=D),(this.H||a).fetch(new Request(this.D,z)).then(this.Pa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,ad(this)),this.readyState=0},n.Pa=function(D){if(this.g&&(this.l=D,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=D.headers,this.readyState=2,bl(this)),this.g&&(this.readyState=3,bl(this),this.g)))if(this.responseType==="arraybuffer")D.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in D){if(this.j=D.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;g0(this)}else D.text().then(this.Oa.bind(this),this.ga.bind(this))};function g0(D){D.j.read().then(D.Ma.bind(D)).catch(D.ga.bind(D))}n.Ma=function(D){if(this.g){if(this.o&&D.value)this.response.push(D.value);else if(!this.o){var z=D.value?D.value:new Uint8Array(0);(z=this.B.decode(z,{stream:!D.done}))&&(this.response=this.responseText+=z)}D.done?ad(this):bl(this),this.readyState==3&&g0(this)}},n.Oa=function(D){this.g&&(this.response=this.responseText=D,ad(this))},n.Na=function(D){this.g&&(this.response=D,ad(this))},n.ga=function(){this.g&&ad(this)};function ad(D){D.readyState=4,D.l=null,D.j=null,D.B=null,bl(D)}n.setRequestHeader=function(D,z){this.A.append(D,z)},n.getResponseHeader=function(D){return this.h&&this.h.get(D.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const D=[],z=this.h.entries();for(var ee=z.next();!ee.done;)ee=ee.value,D.push(ee[0]+": "+ee[1]),ee=z.next();return D.join(`\r
`)};function bl(D){D.onreadystatechange&&D.onreadystatechange.call(D)}Object.defineProperty(Dp.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(D){this.m=D?"include":"same-origin"}});function Ro(D){let z="";return ue(D,function(ee,pe){z+=pe,z+=":",z+=ee,z+=`\r
`}),z}function Cp(D,z,ee){e:{for(pe in ee){var pe=!1;break e}pe=!0}pe||(ee=Ro(ee),typeof D=="string"?ee!=null&&Ar(ee):jn(D,z,ee))}function ri(D){we.call(this),this.headers=new Map,this.L=D||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}f(ri,we);var dc=/^https?$/i,c_=["POST","PUT"];n=ri.prototype,n.Fa=function(D){this.H=D},n.ea=function(D,z,ee,pe){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+D);z=z?z.toUpperCase():"GET",this.D=D,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Ys.g(),this.g.onreadystatechange=p(c(this.Ca,this));try{this.B=!0,this.g.open(z,String(D),!0),this.B=!1}catch(Qe){Ip(this,Qe);return}if(D=ee||"",ee=new Map(this.headers),pe)if(Object.getPrototypeOf(pe)===Object.prototype)for(var Be in pe)ee.set(Be,pe[Be]);else if(typeof pe.keys=="function"&&typeof pe.get=="function")for(const Qe of pe.keys())ee.set(Qe,pe.get(Qe));else throw Error("Unknown input type for opt_headers: "+String(pe));pe=Array.from(ee.keys()).find(Qe=>Qe.toLowerCase()=="content-type"),Be=a.FormData&&D instanceof a.FormData,!(Array.prototype.indexOf.call(c_,z,void 0)>=0)||pe||Be||ee.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Qe,xt]of ee)this.g.setRequestHeader(Qe,xt);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(D),this.v=!1}catch(Qe){Ip(this,Qe)}};function Ip(D,z){D.h=!1,D.g&&(D.j=!0,D.g.abort(),D.j=!1),D.l=z,D.o=5,u_(D),yu(D)}function u_(D){D.A||(D.A=!0,Le(D,"complete"),Le(D,"error"))}n.abort=function(D){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=D||7,Le(this,"complete"),Le(this,"abort"),yu(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),yu(this,!0)),ri.Z.N.call(this)},n.Ca=function(){this.u||(this.B||this.v||this.j?Rp(this):this.Xa())},n.Xa=function(){Rp(this)};function Rp(D){if(D.h&&typeof s<"u"){if(D.v&&Tl(D)==4)setTimeout(D.Ca.bind(D),0);else if(Le(D,"readystatechange"),Tl(D)==4){D.h=!1;try{const Qe=D.ca();e:switch(Qe){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var z=!0;break e;default:z=!1}var ee;if(!(ee=z)){var pe;if(pe=Qe===0){let xt=String(D.D).match(ed)[1]||null;!xt&&a.self&&a.self.location&&(xt=a.self.location.protocol.slice(0,-1)),pe=!dc.test(xt?xt.toLowerCase():"")}ee=pe}if(ee)Le(D,"complete"),Le(D,"success");else{D.o=6;try{var Be=Tl(D)>2?D.g.statusText:""}catch{Be=""}D.l=Be+" ["+D.ca()+"]",u_(D)}}finally{yu(D)}}}}function yu(D,z){if(D.g){D.m&&(clearTimeout(D.m),D.m=null);const ee=D.g;D.g=null,z||Le(D,"ready");try{ee.onreadystatechange=null}catch{}}}n.isActive=function(){return!!this.g};function Tl(D){return D.g?D.g.readyState:0}n.ca=function(){try{return Tl(this)>2?this.g.status:-1}catch{return-1}},n.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.La=function(D){if(this.g){var z=this.g.responseText;return D&&z.indexOf(D)==0&&(z=z.substring(D.length)),zt(z)}};function os(D){try{if(!D.g)return null;if("response"in D.g)return D.g.response;switch(D.F){case"":case"text":return D.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in D.g)return D.g.mozResponseArrayBuffer}return null}catch{return null}}function vu(D){const z={};D=(D.g&&Tl(D)>=2&&D.g.getAllResponseHeaders()||"").split(`\r
`);for(let pe=0;pe<D.length;pe++){if(O(D[pe]))continue;var ee=se(D[pe]);const Be=ee[0];if(ee=ee[1],typeof ee!="string")continue;ee=ee.trim();const Qe=z[Be]||[];z[Be]=Qe,Qe.push(ee)}ge(z,function(pe){return pe.join(", ")})}n.ya=function(){return this.o},n.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};function fc(D,z,ee){return ee&&ee.internalChannelParams&&ee.internalChannelParams[D]||z}function od(D){this.za=0,this.i=[],this.j=new Oe,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=fc("failFast",!1,D),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=fc("baseRetryDelayMs",5e3,D),this.Za=fc("retryDelaySeedMs",1e4,D),this.Ta=fc("forwardChannelMaxRetries",2,D),this.va=fc("forwardChannelRequestTimeoutMs",2e4,D),this.ma=D&&D.xmlHttpFactory||void 0,this.Ua=D&&D.Rb||void 0,this.Aa=D&&D.useFetchStreams||!1,this.O=void 0,this.L=D&&D.supportsCrossDomainXhr||!1,this.M="",this.h=new qn(D&&D.concurrentRequestLimit),this.Ba=new sd,this.S=D&&D.fastHandshake||!1,this.R=D&&D.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=D&&D.Pb||!1,D&&D.ua&&this.j.ua(),D&&D.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&D&&D.detectBufferingProxy||!1,this.ia=void 0,D&&D.longPollingTimeout&&D.longPollingTimeout>0&&(this.ia=D.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}n=od.prototype,n.ka=8,n.I=1,n.connect=function(D,z,ee,pe){ne(0),this.W=D,this.H=z||{},ee&&pe!==void 0&&(this.H.OSID=ee,this.H.OAID=pe),this.F=this.X,this.J=NE(this,null,this.W),pc(this)};function h_(D){if(m0(D),D.I==3){var z=D.V++,ee=ar(D.J);if(jn(ee,"SID",D.M),jn(ee,"RID",z),jn(ee,"TYPE","terminate"),Np(D,ee),z=new me(D,D.j,z),z.M=2,z.A=Ap(ar(ee)),ee=!1,a.navigator&&a.navigator.sendBeacon)try{ee=a.navigator.sendBeacon(z.A.toString(),"")}catch{}!ee&&a.Image&&(new Image().src=z.A,ee=!0),ee||(z.g=kE(z.j,null),z.g.ea(z.A)),z.F=Date.now(),qe(z)}RE(D)}function ld(D){D.g&&(f_(D),D.g.cancel(),D.g=null)}function m0(D){ld(D),D.v&&(a.clearTimeout(D.v),D.v=null),v0(D),D.h.cancel(),D.m&&(typeof D.m=="number"&&a.clearTimeout(D.m),D.m=null)}function pc(D){if(!$n(D.h)&&!D.m){D.m=!0;var z=D.Ea;k||M(),F||(k(),F=!0),C.add(z,D),D.D=0}}function y0(D,z){return gi(D.h)>=D.h.j-(D.m?1:0)?!1:D.m?(D.i=z.G.concat(D.i),!0):D.I==1||D.I==2||D.D>=(D.Sa?0:D.Ta)?!1:(D.m=Ae(c(D.Ea,D,z),IE(D,D.D)),D.D++,!0)}n.Ea=function(D){if(this.m)if(this.m=null,this.I==1){if(!D){this.V=Math.floor(Math.random()*1e5),D=this.V++;const Be=new me(this,this.j,D);let Qe=this.o;if(this.U&&(Qe?(Qe=j(Qe),Z(Qe,this.U)):Qe=this.U),this.u!==null||this.R||(Be.J=Qe,Qe=null),this.S)e:{for(var z=0,ee=0;ee<this.i.length;ee++){t:{var pe=this.i[ee];if("__data__"in pe.map&&(pe=pe.map.__data__,typeof pe=="string")){pe=pe.length;break t}pe=void 0}if(pe===void 0)break;if(z+=pe,z>4096){z=ee;break e}if(z===4096||ee===this.i.length-1){z=ee+1;break e}}z=1e3}else z=1e3;z=AE(this,Be,z),ee=ar(this.J),jn(ee,"RID",D),jn(ee,"CVER",22),this.G&&jn(ee,"X-HTTP-Session-Id",this.G),Np(this,ee),Qe&&(this.R?z="headers="+Ar(Ro(Qe))+"&"+z:this.u&&Cp(ee,this.u,Qe)),vl(this.h,Be),this.Ra&&jn(ee,"TYPE","init"),this.S?(jn(ee,"$req",z),jn(ee,"SID","null"),Be.U=!0,ve(Be,ee,null)):ve(Be,ee,z),this.I=2}}else this.I==3&&(D?d_(this,D):this.i.length==0||$n(this.h)||d_(this))};function d_(D,z){var ee;z?ee=z.l:ee=D.V++;const pe=ar(D.J);jn(pe,"SID",D.M),jn(pe,"RID",ee),jn(pe,"AID",D.K),Np(D,pe),D.u&&D.o&&Cp(pe,D.u,D.o),ee=new me(D,D.j,ee,D.D+1),D.u===null&&(ee.J=D.o),z&&(D.i=z.G.concat(D.i)),z=AE(D,ee,1e3),ee.H=Math.round(D.va*.5)+Math.round(D.va*.5*Math.random()),vl(D.h,ee),ve(ee,pe,z)}function Np(D,z){D.H&&ue(D.H,function(ee,pe){jn(z,pe,ee)}),D.l&&ue({},function(ee,pe){jn(z,pe,ee)})}function AE(D,z,ee){ee=Math.min(D.i.length,ee);const pe=D.l?c(D.l.Ka,D.l,D):null;e:{var Be=D.i;let ln=-1;for(;;){const Zi=["count="+ee];ln==-1?ee>0?(ln=Be[0].g,Zi.push("ofs="+ln)):ln=0:Zi.push("ofs="+ln);let Pn=!0;for(let Mi=0;Mi<ee;Mi++){var Qe=Be[Mi].g;const No=Be[Mi].map;if(Qe-=ln,Qe<0)ln=Math.max(0,Be[Mi].g-100),Pn=!1;else try{Qe="req"+Qe+"_"||"";try{var xt=No instanceof Map?No:Object.entries(No);for(const[mc,El]of xt){let wl=El;o(El)&&(wl=bt(El)),Zi.push(Qe+mc+"="+encodeURIComponent(wl))}}catch(mc){throw Zi.push(Qe+"type="+encodeURIComponent("_badmap")),mc}}catch{pe&&pe(No)}}if(Pn){xt=Zi.join("&");break e}}xt=void 0}return D=D.i.splice(0,ee),z.G=D,xt}function SE(D){if(!D.g&&!D.v){D.Y=1;var z=D.Da;k||M(),F||(k(),F=!0),C.add(z,D),D.A=0}}function kp(D){return D.g||D.v||D.A>=3?!1:(D.Y++,D.v=Ae(c(D.Da,D),IE(D,D.A)),D.A++,!0)}n.Da=function(){if(this.v=null,DE(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var D=4*this.T;this.j.info("BP detection timer enabled: "+D),this.B=Ae(c(this.Wa,this),D)}},n.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,ne(10),ld(this),DE(this))};function f_(D){D.B!=null&&(a.clearTimeout(D.B),D.B=null)}function DE(D){D.g=new me(D,D.j,"rpc",D.Y),D.u===null&&(D.g.J=D.o),D.g.P=0;var z=ar(D.na);jn(z,"RID","rpc"),jn(z,"SID",D.M),jn(z,"AID",D.K),jn(z,"CI",D.F?"0":"1"),!D.F&&D.ia&&jn(z,"TO",D.ia),jn(z,"TYPE","xmlhttp"),Np(D,z),D.u&&D.o&&Cp(z,D.u,D.o),D.O&&(D.g.H=D.O);var ee=D.g;D=D.ba,ee.M=1,ee.A=Ap(ar(z)),ee.u=null,ee.R=!0,Ve(ee,D)}n.Va=function(){this.C!=null&&(this.C=null,ld(this),kp(this),ne(19))};function v0(D){D.C!=null&&(a.clearTimeout(D.C),D.C=null)}function CE(D,z){var ee=null;if(D.g==z){v0(D),f_(D),D.g=null;var pe=2}else if(Ns(D.h,z))ee=z.G,_l(D.h,z),pe=1;else return;if(D.I!=0){if(z.o)if(pe==1){ee=z.u?z.u.length:0,z=Date.now()-z.F;var Be=D.D;pe=mt(),Le(pe,new le(pe,ee)),pc(D)}else SE(D);else if(Be=z.m,Be==3||Be==0&&z.X>0||!(pe==1&&y0(D,z)||pe==2&&kp(D)))switch(ee&&ee.length>0&&(z=D.h,z.i=z.i.concat(ee)),Be){case 1:gc(D,5);break;case 4:gc(D,10);break;case 3:gc(D,6);break;default:gc(D,2)}}}function IE(D,z){let ee=D.Qa+Math.floor(Math.random()*D.Za);return D.isActive()||(ee*=2),ee*z}function gc(D,z){if(D.j.info("Error code "+z),z==2){var ee=c(D.bb,D),pe=D.Ua;const Be=!pe;pe=new Wa(pe||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||Vr(pe,"https"),Ap(pe),Be?xl(pe.toString(),ee):l_(pe.toString(),ee)}else ne(2);D.I=0,D.l&&D.l.pa(z),RE(D),m0(D)}n.bb=function(D){D?(this.j.info("Successfully pinged google.com"),ne(2)):(this.j.info("Failed to ping google.com"),ne(1))};function RE(D){if(D.I=0,D.ja=[],D.l){const z=Va(D.h);(z.length!=0||D.i.length!=0)&&(x(D.ja,z),x(D.ja,D.i),D.h.i.length=0,y(D.i),D.i.length=0),D.l.oa()}}function NE(D,z,ee){var pe=ee instanceof Wa?ar(ee):new Wa(ee);if(pe.g!="")z&&(pe.g=z+"."+pe.g),td(pe,pe.u);else{var Be=a.location;pe=Be.protocol,z=z?z+"."+Be.hostname:Be.hostname,Be=+Be.port;const Qe=new Wa(null);pe&&Vr(Qe,pe),z&&(Qe.g=z),Be&&td(Qe,Be),ee&&(Qe.h=ee),pe=Qe}return ee=D.G,z=D.wa,ee&&z&&jn(pe,ee,z),jn(pe,"VER",D.ka),Np(D,pe),pe}function kE(D,z,ee){if(z&&!D.L)throw Error("Can't create secondary domain capable XhrIo object.");return z=D.Aa&&!D.ma?new ri(new hc({ab:ee})):new ri(D.ma),z.Fa(D.L),z}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function ME(){}n=ME.prototype,n.ra=function(){},n.qa=function(){},n.pa=function(){},n.oa=function(){},n.isActive=function(){return!0},n.Ka=function(){};function cd(){}cd.prototype.g=function(D,z){return new Js(D,z)};function Js(D,z){we.call(this),this.g=new od(z),this.l=D,this.h=z&&z.messageUrlParams||null,D=z&&z.messageHeaders||null,z&&z.clientProtocolHeaderRequired&&(D?D["X-Client-Protocol"]="webchannel":D={"X-Client-Protocol":"webchannel"}),this.g.o=D,D=z&&z.initMessageHeaders||null,z&&z.messageContentType&&(D?D["X-WebChannel-Content-Type"]=z.messageContentType:D={"X-WebChannel-Content-Type":z.messageContentType}),z&&z.sa&&(D?D["X-WebChannel-Client-Profile"]=z.sa:D={"X-WebChannel-Client-Profile":z.sa}),this.g.U=D,(D=z&&z.Qb)&&!O(D)&&(this.g.u=D),this.A=z&&z.supportsCrossDomainXhr||!1,this.v=z&&z.sendRawJson||!1,(z=z&&z.httpSessionIdParam)&&!O(z)&&(this.g.G=z,D=this.h,D!==null&&z in D&&(D=this.h,z in D&&delete D[z])),this.j=new _u(this)}f(Js,we),Js.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Js.prototype.close=function(){h_(this.g)},Js.prototype.o=function(D){var z=this.g;if(typeof D=="string"){var ee={};ee.__data__=D,D=ee}else this.v&&(ee={},ee.__data__=bt(D),D=ee);z.i.push(new Ft(z.Ya++,D)),z.I==3&&pc(z)},Js.prototype.N=function(){this.g.l=null,delete this.j,h_(this.g),delete this.g,Js.Z.N.call(this)};function FE(D){xe.call(this),D.__headers__&&(this.headers=D.__headers__,this.statusCode=D.__status__,delete D.__headers__,delete D.__status__);var z=D.__sm__;if(z){e:{for(const ee in z){D=ee;break e}D=void 0}(this.i=D)&&(D=this.i,z=z!==null&&D in z?z[D]:void 0),this.data=z}else this.data=D}f(FE,xe);function UE(){Ye.call(this),this.status=1}f(UE,Ye);function _u(D){this.g=D}f(_u,ME),_u.prototype.ra=function(){Le(this.g,"a")},_u.prototype.qa=function(D){Le(this.g,new FE(D))},_u.prototype.pa=function(D){Le(this.g,new UE)},_u.prototype.oa=function(){Le(this.g,"b")},cd.prototype.createWebChannel=cd.prototype.g,Js.prototype.send=Js.prototype.o,Js.prototype.open=Js.prototype.m,Js.prototype.close=Js.prototype.close,zte=function(){return new cd},Hte=function(){return mt()},Wte=Je,lP={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Br.NO_ERROR=0,Br.TIMEOUT=8,Br.HTTP_ERROR=6,ZS=Br,wr.COMPLETE="complete",Vte=wr,on.EventType=ke,ke.OPEN="a",ke.CLOSE="b",ke.ERROR="c",ke.MESSAGE="d",we.prototype.listen=we.prototype.J,Xx=on,ri.prototype.listenOnce=ri.prototype.K,ri.prototype.getLastError=ri.prototype.Ha,ri.prototype.getLastErrorCode=ri.prototype.ya,ri.prototype.getStatus=ri.prototype.ca,ri.prototype.getResponseJson=ri.prototype.La,ri.prototype.getResponseText=ri.prototype.la,ri.prototype.send=ri.prototype.ea,ri.prototype.setWithCredentials=ri.prototype.Fa,Bte=ri}).apply(typeof CA<"u"?CA:typeof self<"u"?self:typeof window<"u"?window:{});/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Hs{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Hs.UNAUTHENTICATED=new Hs(null),Hs.GOOGLE_CREDENTIALS=new Hs("google-credentials-uid"),Hs.FIRST_PARTY=new Hs("first-party-uid"),Hs.MOCK_USER=new Hs("mock-user");/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Z1="12.11.0";function z3e(n){Z1=n}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const jm=new VL("@firebase/firestore");function fy(){return jm.logLevel}function Ct(n,...e){if(jm.logLevel<=En.DEBUG){const t=e.map(ZL);jm.debug(`Firestore (${Z1}): ${n}`,...t)}}function Gh(n,...e){if(jm.logLevel<=En.ERROR){const t=e.map(ZL);jm.error(`Firestore (${Z1}): ${n}`,...t)}}function op(n,...e){if(jm.logLevel<=En.WARN){const t=e.map(ZL);jm.warn(`Firestore (${Z1}): ${n}`,...t)}}function ZL(n){if(typeof n=="string")return n;try{return(function(t){return JSON.stringify(t)})(n)}catch{return n}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Xt(n,e,t){let i="Unexpected state";typeof e=="string"?i=e:t=e,Gte(n,i,t)}function Gte(n,e,t){let i=`FIRESTORE (${Z1}) INTERNAL ASSERTION FAILED: ${e} (ID: ${n.toString(16)})`;if(t!==void 0)try{i+=" CONTEXT: "+JSON.stringify(t)}catch{i+=" CONTEXT: "+t}throw Gh(i),new Error(i)}function zn(n,e,t,i){let r="Unexpected state";typeof t=="string"?r=t:i=t,n||Gte(e,r,i)}function nn(n,e){return n}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const at={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Dt extends Zh{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Nh{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class qte{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class $te{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable((()=>t(Hs.UNAUTHENTICATED)))}shutdown(){}}class G3e{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}shutdown(){this.changeListener=null}}class q3e{constructor(e){this.t=e,this.currentUser=Hs.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){zn(this.o===void 0,42304);let i=this.i;const r=l=>this.i!==i?(i=this.i,t(l)):Promise.resolve();let s=new Nh;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Nh,e.enqueueRetryable((()=>r(this.currentUser)))};const a=()=>{const l=s;e.enqueueRetryable((async()=>{await l.promise,await r(this.currentUser)}))},o=l=>{Ct("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit((l=>o(l))),setTimeout((()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?o(l):(Ct("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Nh)}}),0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((i=>this.i!==e?(Ct("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):i?(zn(typeof i.accessToken=="string",31837,{l:i}),new qte(i.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return zn(e===null||typeof e=="string",2055,{h:e}),new Hs(e)}}class $3e{constructor(e,t,i){this.P=e,this.T=t,this.I=i,this.type="FirstParty",this.user=Hs.FIRST_PARTY,this.R=new Map}A(){return this.I?this.I():null}get headers(){this.R.set("X-Goog-AuthUser",this.P);const e=this.A();return e&&this.R.set("Authorization",e),this.T&&this.R.set("X-Goog-Iam-Authorization-Token",this.T),this.R}}class j3e{constructor(e,t,i){this.P=e,this.T=t,this.I=i}getToken(){return Promise.resolve(new $3e(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable((()=>t(Hs.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class qG{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class X3e{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Kl(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){zn(this.o===void 0,3512);const i=s=>{s.error!=null&&Ct("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const a=s.token!==this.m;return this.m=s.token,Ct("FirebaseAppCheckTokenProvider",`Received ${a?"new":"existing"} token.`),a?t(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable((()=>i(s)))};const r=s=>{Ct("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit((s=>r(s))),setTimeout((()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?r(s):Ct("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.p)return Promise.resolve(new qG(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((t=>t?(zn(typeof t.token=="string",44558,{tokenResult:t}),this.m=t.token,new qG(t.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function K3e(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let i=0;i<n;i++)t[i]=Math.floor(256*Math.random());return t}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iR{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let i="";for(;i.length<20;){const r=K3e(40);for(let s=0;s<r.length;++s)i.length<20&&r[s]<t&&(i+=e.charAt(r[s]%62))}return i}}function wn(n,e){return n<e?-1:n>e?1:0}function cP(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++){const r=n.charAt(i),s=e.charAt(i);if(r!==s)return TM(r)===TM(s)?wn(r,s):TM(r)?1:-1}return wn(n.length,e.length)}const Y3e=55296,J3e=57343;function TM(n){const e=n.charCodeAt(0);return e>=Y3e&&e<=J3e}function C1(n,e,t){return n.length===e.length&&n.every(((i,r)=>t(i,e[r])))}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const $G="__name__";class Rc{constructor(e,t,i){t===void 0?t=0:t>e.length&&Xt(637,{offset:t,range:e.length}),i===void 0?i=e.length-t:i>e.length-t&&Xt(1746,{length:i,range:e.length-t}),this.segments=e,this.offset=t,this.len=i}get length(){return this.len}isEqual(e){return Rc.comparator(this,e)===0}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Rc?e.forEach((i=>{t.push(i)})):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,i=this.limit();t<i;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const i=Math.min(e.length,t.length);for(let r=0;r<i;r++){const s=Rc.compareSegments(e.get(r),t.get(r));if(s!==0)return s}return wn(e.length,t.length)}static compareSegments(e,t){const i=Rc.isNumericId(e),r=Rc.isNumericId(t);return i&&!r?-1:!i&&r?1:i&&r?Rc.extractNumericId(e).compare(Rc.extractNumericId(t)):cP(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Yf.fromString(e.substring(4,e.length-2))}}class bi extends Rc{construct(e,t,i){return new bi(e,t,i)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const i of e){if(i.indexOf("//")>=0)throw new Dt(at.INVALID_ARGUMENT,`Invalid segment (${i}). Paths must not contain // in them.`);t.push(...i.split("/").filter((r=>r.length>0)))}return new bi(t)}static emptyPath(){return new bi([])}}const Q3e=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Zr extends Rc{construct(e,t,i){return new Zr(e,t,i)}static isValidIdentifier(e){return Q3e.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Zr.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===$G}static keyField(){return new Zr([$G])}static fromServerFormat(e){const t=[];let i="",r=0;const s=()=>{if(i.length===0)throw new Dt(at.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(i),i=""};let a=!1;for(;r<e.length;){const o=e[r];if(o==="\\"){if(r+1===e.length)throw new Dt(at.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const l=e[r+1];if(l!=="\\"&&l!=="."&&l!=="`")throw new Dt(at.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);i+=l,r+=2}else o==="`"?(a=!a,r++):o!=="."||a?(i+=o,r++):(s(),r++)}if(s(),a)throw new Dt(at.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Zr(t)}static emptyPath(){return new Zr([])}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Vt{constructor(e){this.path=e}static fromPath(e){return new Vt(bi.fromString(e))}static fromName(e){return new Vt(bi.fromString(e).popFirst(5))}static empty(){return new Vt(bi.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&bi.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return bi.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Vt(new bi(e.slice()))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function jte(n,e,t){if(!t)throw new Dt(at.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function Xte(n,e,t,i){if(e===!0&&i===!0)throw new Dt(at.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function jG(n){if(!Vt.isDocumentKey(n))throw new Dt(at.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function XG(n){if(Vt.isDocumentKey(n))throw new Dt(at.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function Kte(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}function rR(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{const e=(function(i){return i.constructor?i.constructor.name:null})(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":Xt(12329,{type:typeof n})}function lp(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new Dt(at.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=rR(n);throw new Dt(at.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}/**
 * @license
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _r(n,e){const t={typeString:n};return e&&(t.value=e),t}function pE(n,e){if(!Kte(n))throw new Dt(at.INVALID_ARGUMENT,"JSON must be an object");let t;for(const i in e)if(e[i]){const r=e[i].typeString,s="value"in e[i]?{value:e[i].value}:void 0;if(!(i in n)){t=`JSON missing required field: '${i}'`;break}const a=n[i];if(r&&typeof a!==r){t=`JSON field '${i}' must be a ${r}.`;break}if(s!==void 0&&a!==s.value){t=`Expected '${i}' field to equal '${s.value}'`;break}}if(t)throw new Dt(at.INVALID_ARGUMENT,t);return!0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const KG=-62135596800,YG=1e6;class Ti{static now(){return Ti.fromMillis(Date.now())}static fromDate(e){return Ti.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),i=Math.floor((e-1e3*t)*YG);return new Ti(t,i)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Dt(at.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Dt(at.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<KG)throw new Dt(at.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Dt(at.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/YG}_compareTo(e){return this.seconds===e.seconds?wn(this.nanoseconds,e.nanoseconds):wn(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Ti._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(pE(e,Ti._jsonSchema))return new Ti(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-KG;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Ti._jsonSchemaVersion="firestore/timestamp/1.0",Ti._jsonSchema={type:_r("string",Ti._jsonSchemaVersion),seconds:_r("number"),nanoseconds:_r("number")};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Qt{static fromTimestamp(e){return new Qt(e)}static min(){return new Qt(new Ti(0,0))}static max(){return new Qt(new Ti(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Bb=-1;function Z3e(n,e){const t=n.toTimestamp().seconds,i=n.toTimestamp().nanoseconds+1,r=Qt.fromTimestamp(i===1e9?new Ti(t+1,0):new Ti(t,i));return new cp(r,Vt.empty(),e)}function eMe(n){return new cp(n.readTime,n.key,Bb)}class cp{constructor(e,t,i){this.readTime=e,this.documentKey=t,this.largestBatchId=i}static min(){return new cp(Qt.min(),Vt.empty(),Bb)}static max(){return new cp(Qt.max(),Vt.empty(),Bb)}}function tMe(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=Vt.comparator(n.documentKey,e.documentKey),t!==0?t:wn(n.largestBatchId,e.largestBatchId))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const nMe="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class iMe{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function e_(n){if(n.code!==at.FAILED_PRECONDITION||n.message!==nMe)throw n;Ct("LocalStore","Unexpectedly lost primary lease")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ot{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Xt(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ot(((i,r)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(i,r)},this.catchCallback=s=>{this.wrapFailure(t,s).next(i,r)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof ot?t:ot.resolve(t)}catch(t){return ot.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):ot.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):ot.reject(t)}static resolve(e){return new ot(((t,i)=>{t(e)}))}static reject(e){return new ot(((t,i)=>{i(e)}))}static waitFor(e){return new ot(((t,i)=>{let r=0,s=0,a=!1;e.forEach((o=>{++r,o.next((()=>{++s,a&&s===r&&t()}),(l=>i(l)))})),a=!0,s===r&&t()}))}static or(e){let t=ot.resolve(!1);for(const i of e)t=t.next((r=>r?ot.resolve(r):i()));return t}static forEach(e,t){const i=[];return e.forEach(((r,s)=>{i.push(t.call(this,r,s))})),this.waitFor(i)}static mapArray(e,t){return new ot(((i,r)=>{const s=e.length,a=new Array(s);let o=0;for(let l=0;l<s;l++){const c=l;t(e[c]).next((h=>{a[c]=h,++o,o===s&&i(a)}),(h=>r(h)))}}))}static doWhile(e,t){return new ot(((i,r)=>{const s=()=>{e()===!0?t().next((()=>{s()}),r):i()};s()}))}}function rMe(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function t_(n){return n.name==="IndexedDbTransactionError"}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sR{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=i=>this.ae(i),this.ue=i=>t.writeSequenceNumber(i))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}sR.ce=-1;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const e5=-1;function aR(n){return n==null}function gC(n){return n===0&&1/n==-1/0}function sMe(n){return typeof n=="number"&&Number.isInteger(n)&&!gC(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Yte="";function aMe(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=JG(e)),e=oMe(n.get(t),e);return JG(e)}function oMe(n,e){let t=e;const i=n.length;for(let r=0;r<i;r++){const s=n.charAt(r);switch(s){case"\0":t+="";break;case Yte:t+="";break;default:t+=s}}return t}function JG(n){return n+Yte+""}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function QG(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function o0(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function Jte(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Wi{constructor(e,t){this.comparator=e,this.root=t||Es.EMPTY}insert(e,t){return new Wi(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Es.BLACK,null,null))}remove(e){return new Wi(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Es.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const i=this.comparator(e,t.key);if(i===0)return t.value;i<0?t=t.left:i>0&&(t=t.right)}return null}indexOf(e){let t=0,i=this.root;for(;!i.isEmpty();){const r=this.comparator(e,i.key);if(r===0)return t+i.left.size;r<0?i=i.left:(t+=i.left.size+1,i=i.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,i)=>(e(t,i),!1)))}toString(){const e=[];return this.inorderTraversal(((t,i)=>(e.push(`${t}:${i}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new IA(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new IA(this.root,e,this.comparator,!1)}getReverseIterator(){return new IA(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new IA(this.root,e,this.comparator,!0)}}class IA{constructor(e,t,i,r){this.isReverse=r,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=t?i(e.key,t):1,t&&r&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Es{constructor(e,t,i,r,s){this.key=e,this.value=t,this.color=i??Es.RED,this.left=r??Es.EMPTY,this.right=s??Es.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,i,r,s){return new Es(e??this.key,t??this.value,i??this.color,r??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let r=this;const s=i(e,r.key);return r=s<0?r.copy(null,null,null,r.left.insert(e,t,i),null):s===0?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,i)),r.fixUp()}removeMin(){if(this.left.isEmpty())return Es.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let i,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),t(e,r.key)===0){if(r.right.isEmpty())return Es.EMPTY;i=r.right.min(),r=r.copy(i.key,i.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Es.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Es.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Xt(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Xt(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Xt(27949);return e+(this.isRed()?0:1)}}Es.EMPTY=null,Es.RED=!0,Es.BLACK=!1;Es.EMPTY=new class{constructor(){this.size=0}get key(){throw Xt(57766)}get value(){throw Xt(16141)}get color(){throw Xt(16727)}get left(){throw Xt(29726)}get right(){throw Xt(36894)}copy(e,t,i,r,s){return this}insert(e,t,i){return new Es(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Lr{constructor(e){this.comparator=e,this.data=new Wi(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((t,i)=>(e(t),!1)))}forEachInRange(e,t){const i=this.data.getIteratorFrom(e[0]);for(;i.hasNext();){const r=i.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let i;for(i=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();i.hasNext();)if(!e(i.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new ZG(this.data.getIterator())}getIteratorFrom(e){return new ZG(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach((i=>{t=t.add(i)})),t}isEqual(e){if(!(e instanceof Lr)||this.size!==e.size)return!1;const t=this.data.getIterator(),i=e.data.getIterator();for(;t.hasNext();){const r=t.getNext().key,s=i.getNext().key;if(this.comparator(r,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new Lr(this.comparator);return t.data=e,t}}class ZG{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Ql{constructor(e){this.fields=e,e.sort(Zr.comparator)}static empty(){return new Ql([])}unionWith(e){let t=new Lr(Zr.comparator);for(const i of this.fields)t=t.add(i);for(const i of e)t=t.add(i);return new Ql(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return C1(this.fields,e.fields,((t,i)=>t.isEqual(i)))}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Qte extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class is{constructor(e){this.binaryString=e}static fromBase64String(e){const t=(function(r){try{return atob(r)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new Qte("Invalid base64 string: "+s):s}})(e);return new is(t)}static fromUint8Array(e){const t=(function(r){let s="";for(let a=0;a<r.length;++a)s+=String.fromCharCode(r[a]);return s})(e);return new is(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(t){return btoa(t)})(this.binaryString)}toUint8Array(){return(function(t){const i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return wn(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}is.EMPTY_BYTE_STRING=new is("");const lMe=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function up(n){if(zn(!!n,39018),typeof n=="string"){let e=0;const t=lMe.exec(n);if(zn(!!t,46558,{timestamp:n}),t[1]){let r=t[1];r=(r+"000000000").substr(0,9),e=Number(r)}const i=new Date(n);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:rr(n.seconds),nanos:rr(n.nanos)}}function rr(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function hp(n){return typeof n=="string"?is.fromBase64String(n):is.fromUint8Array(n)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Zte="server_timestamp",ene="__type__",tne="__previous_value__",nne="__local_write_time__";function t5(n){var t,i;return((i=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[ene])==null?void 0:i.stringValue)===Zte}function oR(n){const e=n.mapValue.fields[tne];return t5(e)?oR(e):e}function Vb(n){const e=up(n.mapValue.fields[nne].timestampValue);return new Ti(e.seconds,e.nanos)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class cMe{constructor(e,t,i,r,s,a,o,l,c,h,f){this.databaseId=e,this.appId=t,this.persistenceKey=i,this.host=r,this.ssl=s,this.forceLongPolling=a,this.autoDetectLongPolling=o,this.longPollingOptions=l,this.useFetchStreams=c,this.isUsingEmulator=h,this.apiKey=f}}const mC="(default)";class I1{constructor(e,t){this.projectId=e,this.database=t||mC}static empty(){return new I1("","")}get isDefaultDatabase(){return this.database===mC}isEqual(e){return e instanceof I1&&e.projectId===this.projectId&&e.database===this.database}}function uMe(n,e){if(!Object.prototype.hasOwnProperty.apply(n.options,["projectId"]))throw new Dt(at.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new I1(n.options.projectId,e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const ine="__type__",hMe="__max__",RA={mapValue:{}},rne="__vector__",yC="value";function dp(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?t5(n)?4:fMe(n)?9007199254740991:dMe(n)?10:11:Xt(28295,{value:n})}function fu(n,e){if(n===e)return!0;const t=dp(n);if(t!==dp(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return Vb(n).isEqual(Vb(e));case 3:return(function(r,s){if(typeof r.timestampValue=="string"&&typeof s.timestampValue=="string"&&r.timestampValue.length===s.timestampValue.length)return r.timestampValue===s.timestampValue;const a=up(r.timestampValue),o=up(s.timestampValue);return a.seconds===o.seconds&&a.nanos===o.nanos})(n,e);case 5:return n.stringValue===e.stringValue;case 6:return(function(r,s){return hp(r.bytesValue).isEqual(hp(s.bytesValue))})(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return(function(r,s){return rr(r.geoPointValue.latitude)===rr(s.geoPointValue.latitude)&&rr(r.geoPointValue.longitude)===rr(s.geoPointValue.longitude)})(n,e);case 2:return(function(r,s){if("integerValue"in r&&"integerValue"in s)return rr(r.integerValue)===rr(s.integerValue);if("doubleValue"in r&&"doubleValue"in s){const a=rr(r.doubleValue),o=rr(s.doubleValue);return a===o?gC(a)===gC(o):isNaN(a)&&isNaN(o)}return!1})(n,e);case 9:return C1(n.arrayValue.values||[],e.arrayValue.values||[],fu);case 10:case 11:return(function(r,s){const a=r.mapValue.fields||{},o=s.mapValue.fields||{};if(QG(a)!==QG(o))return!1;for(const l in a)if(a.hasOwnProperty(l)&&(o[l]===void 0||!fu(a[l],o[l])))return!1;return!0})(n,e);default:return Xt(52216,{left:n})}}function Wb(n,e){return(n.values||[]).find((t=>fu(t,e)))!==void 0}function R1(n,e){if(n===e)return 0;const t=dp(n),i=dp(e);if(t!==i)return wn(t,i);switch(t){case 0:case 9007199254740991:return 0;case 1:return wn(n.booleanValue,e.booleanValue);case 2:return(function(s,a){const o=rr(s.integerValue||s.doubleValue),l=rr(a.integerValue||a.doubleValue);return o<l?-1:o>l?1:o===l?0:isNaN(o)?isNaN(l)?0:-1:1})(n,e);case 3:return eq(n.timestampValue,e.timestampValue);case 4:return eq(Vb(n),Vb(e));case 5:return cP(n.stringValue,e.stringValue);case 6:return(function(s,a){const o=hp(s),l=hp(a);return o.compareTo(l)})(n.bytesValue,e.bytesValue);case 7:return(function(s,a){const o=s.split("/"),l=a.split("/");for(let c=0;c<o.length&&c<l.length;c++){const h=wn(o[c],l[c]);if(h!==0)return h}return wn(o.length,l.length)})(n.referenceValue,e.referenceValue);case 8:return(function(s,a){const o=wn(rr(s.latitude),rr(a.latitude));return o!==0?o:wn(rr(s.longitude),rr(a.longitude))})(n.geoPointValue,e.geoPointValue);case 9:return tq(n.arrayValue,e.arrayValue);case 10:return(function(s,a){var p,y,x,v;const o=s.fields||{},l=a.fields||{},c=(p=o[yC])==null?void 0:p.arrayValue,h=(y=l[yC])==null?void 0:y.arrayValue,f=wn(((x=c==null?void 0:c.values)==null?void 0:x.length)||0,((v=h==null?void 0:h.values)==null?void 0:v.length)||0);return f!==0?f:tq(c,h)})(n.mapValue,e.mapValue);case 11:return(function(s,a){if(s===RA.mapValue&&a===RA.mapValue)return 0;if(s===RA.mapValue)return 1;if(a===RA.mapValue)return-1;const o=s.fields||{},l=Object.keys(o),c=a.fields||{},h=Object.keys(c);l.sort(),h.sort();for(let f=0;f<l.length&&f<h.length;++f){const p=cP(l[f],h[f]);if(p!==0)return p;const y=R1(o[l[f]],c[h[f]]);if(y!==0)return y}return wn(l.length,h.length)})(n.mapValue,e.mapValue);default:throw Xt(23264,{he:t})}}function eq(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return wn(n,e);const t=up(n),i=up(e),r=wn(t.seconds,i.seconds);return r!==0?r:wn(t.nanos,i.nanos)}function tq(n,e){const t=n.values||[],i=e.values||[];for(let r=0;r<t.length&&r<i.length;++r){const s=R1(t[r],i[r]);if(s)return s}return wn(t.length,i.length)}function N1(n){return uP(n)}function uP(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?(function(t){const i=up(t);return`time(${i.seconds},${i.nanos})`})(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?(function(t){return hp(t).toBase64()})(n.bytesValue):"referenceValue"in n?(function(t){return Vt.fromName(t).toString()})(n.referenceValue):"geoPointValue"in n?(function(t){return`geo(${t.latitude},${t.longitude})`})(n.geoPointValue):"arrayValue"in n?(function(t){let i="[",r=!0;for(const s of t.values||[])r?r=!1:i+=",",i+=uP(s);return i+"]"})(n.arrayValue):"mapValue"in n?(function(t){const i=Object.keys(t.fields||{}).sort();let r="{",s=!0;for(const a of i)s?s=!1:r+=",",r+=`${a}:${uP(t.fields[a])}`;return r+"}"})(n.mapValue):Xt(61005,{value:n})}function eD(n){switch(dp(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=oR(n);return e?16+eD(e):16;case 5:return 2*n.stringValue.length;case 6:return hp(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return(function(i){return(i.values||[]).reduce(((r,s)=>r+eD(s)),0)})(n.arrayValue);case 10:case 11:return(function(i){let r=0;return o0(i.fields,((s,a)=>{r+=s.length+eD(a)})),r})(n.mapValue);default:throw Xt(13486,{value:n})}}function nq(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function hP(n){return!!n&&"integerValue"in n}function n5(n){return!!n&&"arrayValue"in n}function iq(n){return!!n&&"nullValue"in n}function rq(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function tD(n){return!!n&&"mapValue"in n}function dMe(n){var t,i;return((i=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[ine])==null?void 0:i.stringValue)===rne}function lb(n){if(n.geoPointValue)return{geoPointValue:{...n.geoPointValue}};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:{...n.timestampValue}};if(n.mapValue){const e={mapValue:{fields:{}}};return o0(n.mapValue.fields,((t,i)=>e.mapValue.fields[t]=lb(i))),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=lb(n.arrayValue.values[t]);return e}return{...n}}function fMe(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===hMe}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class al{constructor(e){this.value=e}static empty(){return new al({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let i=0;i<e.length-1;++i)if(t=(t.mapValue.fields||{})[e.get(i)],!tD(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=lb(t)}setAll(e){let t=Zr.emptyPath(),i={},r=[];e.forEach(((a,o)=>{if(!t.isImmediateParentOf(o)){const l=this.getFieldsMap(t);this.applyChanges(l,i,r),i={},r=[],t=o.popLast()}a?i[o.lastSegment()]=lb(a):r.push(o.lastSegment())}));const s=this.getFieldsMap(t);this.applyChanges(s,i,r)}delete(e){const t=this.field(e.popLast());tD(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return fu(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let i=0;i<e.length;++i){let r=t.mapValue.fields[e.get(i)];tD(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(i)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,i){o0(t,((r,s)=>e[r]=s));for(const r of i)delete e[r]}clone(){return new al(lb(this.value))}}function sne(n){const e=[];return o0(n.fields,((t,i)=>{const r=new Zr([t]);if(tD(i)){const s=sne(i.mapValue).fields;if(s.length===0)e.push(r);else for(const a of s)e.push(r.child(a))}else e.push(r)})),new Ql(e)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class zs{constructor(e,t,i,r,s,a,o){this.key=e,this.documentType=t,this.version=i,this.readTime=r,this.createTime=s,this.data=a,this.documentState=o}static newInvalidDocument(e){return new zs(e,0,Qt.min(),Qt.min(),Qt.min(),al.empty(),0)}static newFoundDocument(e,t,i,r){return new zs(e,1,t,Qt.min(),i,r,0)}static newNoDocument(e,t){return new zs(e,2,t,Qt.min(),Qt.min(),al.empty(),0)}static newUnknownDocument(e,t){return new zs(e,3,t,Qt.min(),Qt.min(),al.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(Qt.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=al.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=al.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Qt.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof zs&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new zs(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class vC{constructor(e,t){this.position=e,this.inclusive=t}}function sq(n,e,t){let i=0;for(let r=0;r<n.position.length;r++){const s=e[r],a=n.position[r];if(s.field.isKeyField()?i=Vt.comparator(Vt.fromName(a.referenceValue),t.key):i=R1(a,t.data.field(s.field)),s.dir==="desc"&&(i*=-1),i!==0)break}return i}function aq(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!fu(n.position[t],e.position[t]))return!1;return!0}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class _C{constructor(e,t="asc"){this.field=e,this.dir=t}}function pMe(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ane{}class vr extends ane{constructor(e,t,i){super(),this.field=e,this.op=t,this.value=i}static create(e,t,i){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,i):new mMe(e,t,i):t==="array-contains"?new _Me(e,i):t==="in"?new xMe(e,i):t==="not-in"?new bMe(e,i):t==="array-contains-any"?new TMe(e,i):new vr(e,t,i)}static createKeyFieldInFilter(e,t,i){return t==="in"?new yMe(e,i):new vMe(e,i)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&t.nullValue===void 0&&this.matchesComparison(R1(t,this.value)):t!==null&&dp(this.value)===dp(t)&&this.matchesComparison(R1(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Xt(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class oc extends ane{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new oc(e,t)}matches(e){return one(this)?this.filters.find((t=>!t.matches(e)))===void 0:this.filters.find((t=>t.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function one(n){return n.op==="and"}function lne(n){return gMe(n)&&one(n)}function gMe(n){for(const e of n.filters)if(e instanceof oc)return!1;return!0}function dP(n){if(n instanceof vr)return n.field.canonicalString()+n.op.toString()+N1(n.value);if(lne(n))return n.filters.map((e=>dP(e))).join(",");{const e=n.filters.map((t=>dP(t))).join(",");return`${n.op}(${e})`}}function cne(n,e){return n instanceof vr?(function(i,r){return r instanceof vr&&i.op===r.op&&i.field.isEqual(r.field)&&fu(i.value,r.value)})(n,e):n instanceof oc?(function(i,r){return r instanceof oc&&i.op===r.op&&i.filters.length===r.filters.length?i.filters.reduce(((s,a,o)=>s&&cne(a,r.filters[o])),!0):!1})(n,e):void Xt(19439)}function une(n){return n instanceof vr?(function(t){return`${t.field.canonicalString()} ${t.op} ${N1(t.value)}`})(n):n instanceof oc?(function(t){return t.op.toString()+" {"+t.getFilters().map(une).join(" ,")+"}"})(n):"Filter"}class mMe extends vr{constructor(e,t,i){super(e,t,i),this.key=Vt.fromName(i.referenceValue)}matches(e){const t=Vt.comparator(e.key,this.key);return this.matchesComparison(t)}}class yMe extends vr{constructor(e,t){super(e,"in",t),this.keys=hne("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class vMe extends vr{constructor(e,t){super(e,"not-in",t),this.keys=hne("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function hne(n,e){var t;return(((t=e.arrayValue)==null?void 0:t.values)||[]).map((i=>Vt.fromName(i.referenceValue)))}class _Me extends vr{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return n5(t)&&Wb(t.arrayValue,this.value)}}class xMe extends vr{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Wb(this.value.arrayValue,t)}}class bMe extends vr{constructor(e,t){super(e,"not-in",t)}matches(e){if(Wb(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!Wb(this.value.arrayValue,t)}}class TMe extends vr{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!n5(t)||!t.arrayValue.values)&&t.arrayValue.values.some((i=>Wb(this.value.arrayValue,i)))}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class EMe{constructor(e,t=null,i=[],r=[],s=null,a=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=i,this.filters=r,this.limit=s,this.startAt=a,this.endAt=o,this.Te=null}}function oq(n,e=null,t=[],i=[],r=null,s=null,a=null){return new EMe(n,e,t,i,r,s,a)}function i5(n){const e=nn(n);if(e.Te===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((i=>dP(i))).join(","),t+="|ob:",t+=e.orderBy.map((i=>(function(s){return s.field.canonicalString()+s.dir})(i))).join(","),aR(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((i=>N1(i))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((i=>N1(i))).join(",")),e.Te=t}return e.Te}function r5(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!pMe(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!cne(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!aq(n.startAt,e.startAt)&&aq(n.endAt,e.endAt)}function fP(n){return Vt.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class gE{constructor(e,t=null,i=[],r=[],s=null,a="F",o=null,l=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=i,this.filters=r,this.limit=s,this.limitType=a,this.startAt=o,this.endAt=l,this.Ee=null,this.Ie=null,this.Re=null,this.startAt,this.endAt}}function wMe(n,e,t,i,r,s,a,o){return new gE(n,e,t,i,r,s,a,o)}function s5(n){return new gE(n)}function lq(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function AMe(n){return Vt.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}function dne(n){return n.collectionGroup!==null}function cb(n){const e=nn(n);if(e.Ee===null){e.Ee=[];const t=new Set;for(const s of e.explicitOrderBy)e.Ee.push(s),t.add(s.field.canonicalString());const i=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(a){let o=new Lr(Zr.comparator);return a.filters.forEach((l=>{l.getFlattenedFilters().forEach((c=>{c.isInequality()&&(o=o.add(c.field))}))})),o})(e).forEach((s=>{t.has(s.canonicalString())||s.isKeyField()||e.Ee.push(new _C(s,i))})),t.has(Zr.keyField().canonicalString())||e.Ee.push(new _C(Zr.keyField(),i))}return e.Ee}function au(n){const e=nn(n);return e.Ie||(e.Ie=SMe(e,cb(n))),e.Ie}function SMe(n,e){if(n.limitType==="F")return oq(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map((r=>{const s=r.dir==="desc"?"asc":"desc";return new _C(r.field,s)}));const t=n.endAt?new vC(n.endAt.position,n.endAt.inclusive):null,i=n.startAt?new vC(n.startAt.position,n.startAt.inclusive):null;return oq(n.path,n.collectionGroup,e,n.filters,n.limit,t,i)}}function pP(n,e){const t=n.filters.concat([e]);return new gE(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function gP(n,e,t){return new gE(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function lR(n,e){return r5(au(n),au(e))&&n.limitType===e.limitType}function fne(n){return`${i5(au(n))}|lt:${n.limitType}`}function py(n){return`Query(target=${(function(t){let i=t.path.canonicalString();return t.collectionGroup!==null&&(i+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(i+=`, filters: [${t.filters.map((r=>une(r))).join(", ")}]`),aR(t.limit)||(i+=", limit: "+t.limit),t.orderBy.length>0&&(i+=`, orderBy: [${t.orderBy.map((r=>(function(a){return`${a.field.canonicalString()} (${a.dir})`})(r))).join(", ")}]`),t.startAt&&(i+=", startAt: ",i+=t.startAt.inclusive?"b:":"a:",i+=t.startAt.position.map((r=>N1(r))).join(",")),t.endAt&&(i+=", endAt: ",i+=t.endAt.inclusive?"a:":"b:",i+=t.endAt.position.map((r=>N1(r))).join(",")),`Target(${i})`})(au(n))}; limitType=${n.limitType})`}function cR(n,e){return e.isFoundDocument()&&(function(i,r){const s=r.key.path;return i.collectionGroup!==null?r.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(s):Vt.isDocumentKey(i.path)?i.path.isEqual(s):i.path.isImmediateParentOf(s)})(n,e)&&(function(i,r){for(const s of cb(i))if(!s.field.isKeyField()&&r.data.field(s.field)===null)return!1;return!0})(n,e)&&(function(i,r){for(const s of i.filters)if(!s.matches(r))return!1;return!0})(n,e)&&(function(i,r){return!(i.startAt&&!(function(a,o,l){const c=sq(a,o,l);return a.inclusive?c<=0:c<0})(i.startAt,cb(i),r)||i.endAt&&!(function(a,o,l){const c=sq(a,o,l);return a.inclusive?c>=0:c>0})(i.endAt,cb(i),r))})(n,e)}function DMe(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function pne(n){return(e,t)=>{let i=!1;for(const r of cb(n)){const s=CMe(r,e,t);if(s!==0)return s;i=i||r.field.isKeyField()}return 0}}function CMe(n,e,t){const i=n.field.isKeyField()?Vt.comparator(e.key,t.key):(function(s,a,o){const l=a.data.field(s),c=o.data.field(s);return l!==null&&c!==null?R1(l,c):Xt(42886)})(n.field,e,t);switch(n.dir){case"asc":return i;case"desc":return-1*i;default:return Xt(19790,{direction:n.dir})}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class l0{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),i=this.inner[t];if(i!==void 0){for(const[r,s]of i)if(this.equalsFn(r,e))return s}}has(e){return this.get(e)!==void 0}set(e,t){const i=this.mapKeyFn(e),r=this.inner[i];if(r===void 0)return this.inner[i]=[[e,t]],void this.innerSize++;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return void(r[s]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),i=this.inner[t];if(i===void 0)return!1;for(let r=0;r<i.length;r++)if(this.equalsFn(i[r][0],e))return i.length===1?delete this.inner[t]:i.splice(r,1),this.innerSize--,!0;return!1}forEach(e){o0(this.inner,((t,i)=>{for(const[r,s]of i)e(r,s)}))}isEmpty(){return Jte(this.inner)}size(){return this.innerSize}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const IMe=new Wi(Vt.comparator);function qh(){return IMe}const gne=new Wi(Vt.comparator);function Kx(...n){let e=gne;for(const t of n)e=e.insert(t.key,t);return e}function mne(n){let e=gne;return n.forEach(((t,i)=>e=e.insert(t,i.overlayedDocument))),e}function vg(){return ub()}function yne(){return ub()}function ub(){return new l0((n=>n.toString()),((n,e)=>n.isEqual(e)))}const RMe=new Wi(Vt.comparator),NMe=new Lr(Vt.comparator);function An(...n){let e=NMe;for(const t of n)e=e.add(t);return e}const kMe=new Lr(wn);function MMe(){return kMe}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function a5(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:gC(e)?"-0":e}}function vne(n){return{integerValue:""+n}}function FMe(n,e){return sMe(e)?vne(e):a5(n,e)}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class uR{constructor(){this._=void 0}}function UMe(n,e,t){return n instanceof xC?(function(r,s){const a={fields:{[ene]:{stringValue:Zte},[nne]:{timestampValue:{seconds:r.seconds,nanos:r.nanoseconds}}}};return s&&t5(s)&&(s=oR(s)),s&&(a.fields[tne]=s),{mapValue:a}})(t,e):n instanceof Hb?xne(n,e):n instanceof zb?bne(n,e):(function(r,s){const a=_ne(r,s),o=cq(a)+cq(r.Ae);return hP(a)&&hP(r.Ae)?vne(o):a5(r.serializer,o)})(n,e)}function PMe(n,e,t){return n instanceof Hb?xne(n,e):n instanceof zb?bne(n,e):t}function _ne(n,e){return n instanceof bC?(function(i){return hP(i)||(function(s){return!!s&&"doubleValue"in s})(i)})(e)?e:{integerValue:0}:null}class xC extends uR{}class Hb extends uR{constructor(e){super(),this.elements=e}}function xne(n,e){const t=Tne(e);for(const i of n.elements)t.some((r=>fu(r,i)))||t.push(i);return{arrayValue:{values:t}}}class zb extends uR{constructor(e){super(),this.elements=e}}function bne(n,e){let t=Tne(e);for(const i of n.elements)t=t.filter((r=>!fu(r,i)));return{arrayValue:{values:t}}}class bC extends uR{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function cq(n){return rr(n.integerValue||n.doubleValue)}function Tne(n){return n5(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function LMe(n,e){return n.field.isEqual(e.field)&&(function(i,r){return i instanceof Hb&&r instanceof Hb||i instanceof zb&&r instanceof zb?C1(i.elements,r.elements,fu):i instanceof bC&&r instanceof bC?fu(i.Ae,r.Ae):i instanceof xC&&r instanceof xC})(n.transform,e.transform)}class OMe{constructor(e,t){this.version=e,this.transformResults=t}}class ou{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new ou}static exists(e){return new ou(void 0,e)}static updateTime(e){return new ou(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function nD(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class hR{}function Ene(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new o5(n.key,ou.none()):new mE(n.key,n.data,ou.none());{const t=n.data,i=al.empty();let r=new Lr(Zr.comparator);for(let s of e.fields)if(!r.has(s)){let a=t.field(s);a===null&&s.length>1&&(s=s.popLast(),a=t.field(s)),a===null?i.delete(s):i.set(s,a),r=r.add(s)}return new c0(n.key,i,new Ql(r.toArray()),ou.none())}}function BMe(n,e,t){n instanceof mE?(function(r,s,a){const o=r.value.clone(),l=hq(r.fieldTransforms,s,a.transformResults);o.setAll(l),s.convertToFoundDocument(a.version,o).setHasCommittedMutations()})(n,e,t):n instanceof c0?(function(r,s,a){if(!nD(r.precondition,s))return void s.convertToUnknownDocument(a.version);const o=hq(r.fieldTransforms,s,a.transformResults),l=s.data;l.setAll(wne(r)),l.setAll(o),s.convertToFoundDocument(a.version,l).setHasCommittedMutations()})(n,e,t):(function(r,s,a){s.convertToNoDocument(a.version).setHasCommittedMutations()})(0,e,t)}function hb(n,e,t,i){return n instanceof mE?(function(s,a,o,l){if(!nD(s.precondition,a))return o;const c=s.value.clone(),h=dq(s.fieldTransforms,l,a);return c.setAll(h),a.convertToFoundDocument(a.version,c).setHasLocalMutations(),null})(n,e,t,i):n instanceof c0?(function(s,a,o,l){if(!nD(s.precondition,a))return o;const c=dq(s.fieldTransforms,l,a),h=a.data;return h.setAll(wne(s)),h.setAll(c),a.convertToFoundDocument(a.version,h).setHasLocalMutations(),o===null?null:o.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map((f=>f.field)))})(n,e,t,i):(function(s,a,o){return nD(s.precondition,a)?(a.convertToNoDocument(a.version).setHasLocalMutations(),null):o})(n,e,t)}function VMe(n,e){let t=null;for(const i of n.fieldTransforms){const r=e.data.field(i.field),s=_ne(i.transform,r||null);s!=null&&(t===null&&(t=al.empty()),t.set(i.field,s))}return t||null}function uq(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!(function(i,r){return i===void 0&&r===void 0||!(!i||!r)&&C1(i,r,((s,a)=>LMe(s,a)))})(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class mE extends hR{constructor(e,t,i,r=[]){super(),this.key=e,this.value=t,this.precondition=i,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class c0 extends hR{constructor(e,t,i,r,s=[]){super(),this.key=e,this.data=t,this.fieldMask=i,this.precondition=r,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function wne(n){const e=new Map;return n.fieldMask.fields.forEach((t=>{if(!t.isEmpty()){const i=n.data.field(t);e.set(t,i)}})),e}function hq(n,e,t){const i=new Map;zn(n.length===t.length,32656,{Ve:t.length,de:n.length});for(let r=0;r<t.length;r++){const s=n[r],a=s.transform,o=e.data.field(s.field);i.set(s.field,PMe(a,o,t[r]))}return i}function dq(n,e,t){const i=new Map;for(const r of n){const s=r.transform,a=t.data.field(r.field);i.set(r.field,UMe(s,a,e))}return i}class o5 extends hR{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class WMe extends hR{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class HMe{constructor(e,t,i,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=i,this.mutations=r}applyToRemoteDocument(e,t){const i=t.mutationResults;for(let r=0;r<this.mutations.length;r++){const s=this.mutations[r];s.key.isEqual(e.key)&&BMe(s,e,i[r])}}applyToLocalView(e,t){for(const i of this.baseMutations)i.key.isEqual(e.key)&&(t=hb(i,e,t,this.localWriteTime));for(const i of this.mutations)i.key.isEqual(e.key)&&(t=hb(i,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const i=yne();return this.mutations.forEach((r=>{const s=e.get(r.key),a=s.overlayedDocument;let o=this.applyToLocalView(a,s.mutatedFields);o=t.has(r.key)?null:o;const l=Ene(a,o);l!==null&&i.set(r.key,l),a.isValidDocument()||a.convertToNoDocument(Qt.min())})),i}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),An())}isEqual(e){return this.batchId===e.batchId&&C1(this.mutations,e.mutations,((t,i)=>uq(t,i)))&&C1(this.baseMutations,e.baseMutations,((t,i)=>uq(t,i)))}}class l5{constructor(e,t,i,r){this.batch=e,this.commitVersion=t,this.mutationResults=i,this.docVersions=r}static from(e,t,i){zn(e.mutations.length===i.length,58842,{me:e.mutations.length,fe:i.length});let r=(function(){return RMe})();const s=e.mutations;for(let a=0;a<s.length;a++)r=r.insert(s[a].key,i[a].version);return new l5(e,t,i,r)}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class zMe{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
      largestBatchId: ${this.largestBatchId},
      mutation: ${this.mutation.toString()}
    }`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class GMe{constructor(e,t){this.count=e,this.unchangedNames=t}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var pr,Cn;function qMe(n){switch(n){case at.OK:return Xt(64938);case at.CANCELLED:case at.UNKNOWN:case at.DEADLINE_EXCEEDED:case at.RESOURCE_EXHAUSTED:case at.INTERNAL:case at.UNAVAILABLE:case at.UNAUTHENTICATED:return!1;case at.INVALID_ARGUMENT:case at.NOT_FOUND:case at.ALREADY_EXISTS:case at.PERMISSION_DENIED:case at.FAILED_PRECONDITION:case at.ABORTED:case at.OUT_OF_RANGE:case at.UNIMPLEMENTED:case at.DATA_LOSS:return!0;default:return Xt(15467,{code:n})}}function Ane(n){if(n===void 0)return Gh("GRPC error has no .code"),at.UNKNOWN;switch(n){case pr.OK:return at.OK;case pr.CANCELLED:return at.CANCELLED;case pr.UNKNOWN:return at.UNKNOWN;case pr.DEADLINE_EXCEEDED:return at.DEADLINE_EXCEEDED;case pr.RESOURCE_EXHAUSTED:return at.RESOURCE_EXHAUSTED;case pr.INTERNAL:return at.INTERNAL;case pr.UNAVAILABLE:return at.UNAVAILABLE;case pr.UNAUTHENTICATED:return at.UNAUTHENTICATED;case pr.INVALID_ARGUMENT:return at.INVALID_ARGUMENT;case pr.NOT_FOUND:return at.NOT_FOUND;case pr.ALREADY_EXISTS:return at.ALREADY_EXISTS;case pr.PERMISSION_DENIED:return at.PERMISSION_DENIED;case pr.FAILED_PRECONDITION:return at.FAILED_PRECONDITION;case pr.ABORTED:return at.ABORTED;case pr.OUT_OF_RANGE:return at.OUT_OF_RANGE;case pr.UNIMPLEMENTED:return at.UNIMPLEMENTED;case pr.DATA_LOSS:return at.DATA_LOSS;default:return Xt(39323,{code:n})}}(Cn=pr||(pr={}))[Cn.OK=0]="OK",Cn[Cn.CANCELLED=1]="CANCELLED",Cn[Cn.UNKNOWN=2]="UNKNOWN",Cn[Cn.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Cn[Cn.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Cn[Cn.NOT_FOUND=5]="NOT_FOUND",Cn[Cn.ALREADY_EXISTS=6]="ALREADY_EXISTS",Cn[Cn.PERMISSION_DENIED=7]="PERMISSION_DENIED",Cn[Cn.UNAUTHENTICATED=16]="UNAUTHENTICATED",Cn[Cn.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Cn[Cn.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Cn[Cn.ABORTED=10]="ABORTED",Cn[Cn.OUT_OF_RANGE=11]="OUT_OF_RANGE",Cn[Cn.UNIMPLEMENTED=12]="UNIMPLEMENTED",Cn[Cn.INTERNAL=13]="INTERNAL",Cn[Cn.UNAVAILABLE=14]="UNAVAILABLE",Cn[Cn.DATA_LOSS=15]="DATA_LOSS";/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function $Me(){return new TextEncoder}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const jMe=new Yf([4294967295,4294967295],0);function fq(n){const e=$Me().encode(n),t=new Ote;return t.update(e),new Uint8Array(t.digest())}function pq(n){const e=new DataView(n.buffer),t=e.getUint32(0,!0),i=e.getUint32(4,!0),r=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new Yf([t,i],0),new Yf([r,s],0)]}class c5{constructor(e,t,i){if(this.bitmap=e,this.padding=t,this.hashCount=i,t<0||t>=8)throw new Yx(`Invalid padding: ${t}`);if(i<0)throw new Yx(`Invalid hash count: ${i}`);if(e.length>0&&this.hashCount===0)throw new Yx(`Invalid hash count: ${i}`);if(e.length===0&&t!==0)throw new Yx(`Invalid padding when bitmap length is 0: ${t}`);this.ge=8*e.length-t,this.pe=Yf.fromNumber(this.ge)}ye(e,t,i){let r=e.add(t.multiply(Yf.fromNumber(i)));return r.compare(jMe)===1&&(r=new Yf([r.getBits(0),r.getBits(1)],0)),r.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.ge===0)return!1;const t=fq(e),[i,r]=pq(t);for(let s=0;s<this.hashCount;s++){const a=this.ye(i,r,s);if(!this.we(a))return!1}return!0}static create(e,t,i){const r=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),a=new c5(s,r,t);return i.forEach((o=>a.insert(o))),a}insert(e){if(this.ge===0)return;const t=fq(e),[i,r]=pq(t);for(let s=0;s<this.hashCount;s++){const a=this.ye(i,r,s);this.Se(a)}}Se(e){const t=Math.floor(e/8),i=e%8;this.bitmap[t]|=1<<i}}class Yx extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class dR{constructor(e,t,i,r,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=i,this.documentUpdates=r,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,i){const r=new Map;return r.set(e,yE.createSynthesizedTargetChangeForCurrentChange(e,t,i)),new dR(Qt.min(),r,new Wi(wn),qh(),An())}}class yE{constructor(e,t,i,r,s){this.resumeToken=e,this.current=t,this.addedDocuments=i,this.modifiedDocuments=r,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,t,i){return new yE(i,t,An(),An(),An())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iD{constructor(e,t,i,r){this.be=e,this.removedTargetIds=t,this.key=i,this.De=r}}class Sne{constructor(e,t){this.targetId=e,this.Ce=t}}class Dne{constructor(e,t,i=is.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=i,this.cause=r}}class gq{constructor(){this.ve=0,this.Fe=mq(),this.Me=is.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return this.ve!==0}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=An(),t=An(),i=An();return this.Fe.forEach(((r,s)=>{switch(s){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:Xt(38017,{changeType:s})}})),new yE(this.Me,this.xe,e,t,i)}qe(){this.Oe=!1,this.Fe=mq()}Ke(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}Ue(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}$e(){this.ve+=1}We(){this.ve-=1,zn(this.ve>=0,3241,{ve:this.ve})}Qe(){this.Oe=!0,this.xe=!0}}class XMe{constructor(e){this.Ge=e,this.ze=new Map,this.je=qh(),this.Je=NA(),this.He=NA(),this.Ze=new Wi(wn)}Xe(e){for(const t of e.be)e.De&&e.De.isFoundDocument()?this.Ye(t,e.De):this.et(t,e.key,e.De);for(const t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,(t=>{const i=this.nt(t);switch(e.state){case 0:this.rt(t)&&i.Le(e.resumeToken);break;case 1:i.We(),i.Ne||i.qe(),i.Le(e.resumeToken);break;case 2:i.We(),i.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(i.Qe(),i.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),i.Le(e.resumeToken));break;default:Xt(56790,{state:e.state})}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach(((i,r)=>{this.rt(r)&&t(r)}))}st(e){const t=e.targetId,i=e.Ce.count,r=this.ot(t);if(r){const s=r.target;if(fP(s))if(i===0){const a=new Vt(s.path);this.et(t,a,zs.newNoDocument(a,Qt.min()))}else zn(i===1,20013,{expectedCount:i});else{const a=this._t(t);if(a!==i){const o=this.ut(e),l=o?this.ct(o,e,a):1;if(l!==0){this.it(t);const c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(t,c)}}}}}ut(e){const t=e.Ce.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:i="",padding:r=0},hashCount:s=0}=t;let a,o;try{a=hp(i).toUint8Array()}catch(l){if(l instanceof Qte)return op("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{o=new c5(a,r,s)}catch(l){return op(l instanceof Yx?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return o.ge===0?null:o}ct(e,t,i){return t.Ce.count===i-this.Pt(e,t.targetId)?0:2}Pt(e,t){const i=this.Ge.getRemoteKeysForTarget(t);let r=0;return i.forEach((s=>{const a=this.Ge.ht(),o=`projects/${a.projectId}/databases/${a.database}/documents/${s.path.canonicalString()}`;e.mightContain(o)||(this.et(t,s,null),r++)})),r}Tt(e){const t=new Map;this.ze.forEach(((s,a)=>{const o=this.ot(a);if(o){if(s.current&&fP(o.target)){const l=new Vt(o.target.path);this.Et(l).has(a)||this.It(a,l)||this.et(a,l,zs.newNoDocument(l,e))}s.Be&&(t.set(a,s.ke()),s.qe())}}));let i=An();this.He.forEach(((s,a)=>{let o=!0;a.forEachWhile((l=>{const c=this.ot(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(o=!1,!1)})),o&&(i=i.add(s))})),this.je.forEach(((s,a)=>a.setReadTime(e)));const r=new dR(e,t,this.Ze,this.je,i);return this.je=qh(),this.Je=NA(),this.He=NA(),this.Ze=new Wi(wn),r}Ye(e,t){if(!this.rt(e))return;const i=this.It(e,t.key)?2:0;this.nt(e).Ke(t.key,i),this.je=this.je.insert(t.key,t),this.Je=this.Je.insert(t.key,this.Et(t.key).add(e)),this.He=this.He.insert(t.key,this.Rt(t.key).add(e))}et(e,t,i){if(!this.rt(e))return;const r=this.nt(e);this.It(e,t)?r.Ke(t,1):r.Ue(t),this.He=this.He.insert(t,this.Rt(t).delete(e)),this.He=this.He.insert(t,this.Rt(t).add(e)),i&&(this.je=this.je.insert(t,i))}removeTarget(e){this.ze.delete(e)}_t(e){const t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.nt(e).$e()}nt(e){let t=this.ze.get(e);return t||(t=new gq,this.ze.set(e,t)),t}Rt(e){let t=this.He.get(e);return t||(t=new Lr(wn),this.He=this.He.insert(e,t)),t}Et(e){let t=this.Je.get(e);return t||(t=new Lr(wn),this.Je=this.Je.insert(e,t)),t}rt(e){const t=this.ot(e)!==null;return t||Ct("WatchChangeAggregator","Detected inactive target",e),t}ot(e){const t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new gq),this.Ge.getRemoteKeysForTarget(e).forEach((t=>{this.et(e,t,null)}))}It(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function NA(){return new Wi(Vt.comparator)}function mq(){return new Wi(Vt.comparator)}const KMe={asc:"ASCENDING",desc:"DESCENDING"},YMe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},JMe={and:"AND",or:"OR"};class QMe{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function mP(n,e){return n.useProto3Json||aR(e)?e:{value:e}}function TC(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Cne(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function ZMe(n,e){return TC(n,e.toTimestamp())}function lu(n){return zn(!!n,49232),Qt.fromTimestamp((function(t){const i=up(t);return new Ti(i.seconds,i.nanos)})(n))}function u5(n,e){return yP(n,e).canonicalString()}function yP(n,e){const t=(function(r){return new bi(["projects",r.projectId,"databases",r.database])})(n).child("documents");return e===void 0?t:t.child(e)}function Ine(n){const e=bi.fromString(n);return zn(Fne(e),10190,{key:e.toString()}),e}function vP(n,e){return u5(n.databaseId,e.path)}function EM(n,e){const t=Ine(e);if(t.get(1)!==n.databaseId.projectId)throw new Dt(at.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new Dt(at.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new Vt(Nne(t))}function Rne(n,e){return u5(n.databaseId,e)}function eFe(n){const e=Ine(n);return e.length===4?bi.emptyPath():Nne(e)}function _P(n){return new bi(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function Nne(n){return zn(n.length>4&&n.get(4)==="documents",29091,{key:n.toString()}),n.popFirst(5)}function yq(n,e,t){return{name:vP(n,e),fields:t.value.mapValue.fields}}function tFe(n,e){let t;if("targetChange"in e){e.targetChange;const i=(function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Xt(39313,{state:c})})(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],s=(function(c,h){return c.useProto3Json?(zn(h===void 0||typeof h=="string",58123),is.fromBase64String(h||"")):(zn(h===void 0||h instanceof Buffer||h instanceof Uint8Array,16193),is.fromUint8Array(h||new Uint8Array))})(n,e.targetChange.resumeToken),a=e.targetChange.cause,o=a&&(function(c){const h=c.code===void 0?at.UNKNOWN:Ane(c.code);return new Dt(h,c.message||"")})(a);t=new Dne(i,r,s,o||null)}else if("documentChange"in e){e.documentChange;const i=e.documentChange;i.document,i.document.name,i.document.updateTime;const r=EM(n,i.document.name),s=lu(i.document.updateTime),a=i.document.createTime?lu(i.document.createTime):Qt.min(),o=new al({mapValue:{fields:i.document.fields}}),l=zs.newFoundDocument(r,s,a,o),c=i.targetIds||[],h=i.removedTargetIds||[];t=new iD(c,h,l.key,l)}else if("documentDelete"in e){e.documentDelete;const i=e.documentDelete;i.document;const r=EM(n,i.document),s=i.readTime?lu(i.readTime):Qt.min(),a=zs.newNoDocument(r,s),o=i.removedTargetIds||[];t=new iD([],o,a.key,a)}else if("documentRemove"in e){e.documentRemove;const i=e.documentRemove;i.document;const r=EM(n,i.document),s=i.removedTargetIds||[];t=new iD([],s,r,null)}else{if(!("filter"in e))return Xt(11601,{Vt:e});{e.filter;const i=e.filter;i.targetId;const{count:r=0,unchangedNames:s}=i,a=new GMe(r,s),o=i.targetId;t=new Sne(o,a)}}return t}function nFe(n,e){let t;if(e instanceof mE)t={update:yq(n,e.key,e.value)};else if(e instanceof o5)t={delete:vP(n,e.key)};else if(e instanceof c0)t={update:yq(n,e.key,e.data),updateMask:hFe(e.fieldMask)};else{if(!(e instanceof WMe))return Xt(16599,{dt:e.type});t={verify:vP(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map((i=>(function(s,a){const o=a.transform;if(o instanceof xC)return{fieldPath:a.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(o instanceof Hb)return{fieldPath:a.field.canonicalString(),appendMissingElements:{values:o.elements}};if(o instanceof zb)return{fieldPath:a.field.canonicalString(),removeAllFromArray:{values:o.elements}};if(o instanceof bC)return{fieldPath:a.field.canonicalString(),increment:o.Ae};throw Xt(20930,{transform:a.transform})})(0,i)))),e.precondition.isNone||(t.currentDocument=(function(r,s){return s.updateTime!==void 0?{updateTime:ZMe(r,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:Xt(27497)})(n,e.precondition)),t}function iFe(n,e){return n&&n.length>0?(zn(e!==void 0,14353),n.map((t=>(function(r,s){let a=r.updateTime?lu(r.updateTime):lu(s);return a.isEqual(Qt.min())&&(a=lu(s)),new OMe(a,r.transformResults||[])})(t,e)))):[]}function rFe(n,e){return{documents:[Rne(n,e.path)]}}function sFe(n,e){const t={structuredQuery:{}},i=e.path;let r;e.collectionGroup!==null?(r=i,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r=i.popLast(),t.structuredQuery.from=[{collectionId:i.lastSegment()}]),t.parent=Rne(n,r);const s=(function(c){if(c.length!==0)return Mne(oc.create(c,"and"))})(e.filters);s&&(t.structuredQuery.where=s);const a=(function(c){if(c.length!==0)return c.map((h=>(function(p){return{field:gy(p.field),direction:lFe(p.dir)}})(h)))})(e.orderBy);a&&(t.structuredQuery.orderBy=a);const o=mP(n,e.limit);return o!==null&&(t.structuredQuery.limit=o),e.startAt&&(t.structuredQuery.startAt=(function(c){return{before:c.inclusive,values:c.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(c){return{before:!c.inclusive,values:c.position}})(e.endAt)),{ft:t,parent:r}}function aFe(n){let e=eFe(n.parent);const t=n.structuredQuery,i=t.from?t.from.length:0;let r=null;if(i>0){zn(i===1,65062);const h=t.from[0];h.allDescendants?r=h.collectionId:e=e.child(h.collectionId)}let s=[];t.where&&(s=(function(f){const p=kne(f);return p instanceof oc&&lne(p)?p.getFilters():[p]})(t.where));let a=[];t.orderBy&&(a=(function(f){return f.map((p=>(function(x){return new _C(my(x.field),(function(_){switch(_){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(x.direction))})(p)))})(t.orderBy));let o=null;t.limit&&(o=(function(f){let p;return p=typeof f=="object"?f.value:f,aR(p)?null:p})(t.limit));let l=null;t.startAt&&(l=(function(f){const p=!!f.before,y=f.values||[];return new vC(y,p)})(t.startAt));let c=null;return t.endAt&&(c=(function(f){const p=!f.before,y=f.values||[];return new vC(y,p)})(t.endAt)),wMe(e,r,a,s,o,"F",l,c)}function oFe(n,e){const t=(function(r){switch(r){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Xt(28987,{purpose:r})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function kne(n){return n.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":const i=my(t.unaryFilter.field);return vr.create(i,"==",{doubleValue:NaN});case"IS_NULL":const r=my(t.unaryFilter.field);return vr.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=my(t.unaryFilter.field);return vr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const a=my(t.unaryFilter.field);return vr.create(a,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Xt(61313);default:return Xt(60726)}})(n):n.fieldFilter!==void 0?(function(t){return vr.create(my(t.fieldFilter.field),(function(r){switch(r){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Xt(58110);default:return Xt(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(n):n.compositeFilter!==void 0?(function(t){return oc.create(t.compositeFilter.filters.map((i=>kne(i))),(function(r){switch(r){case"AND":return"and";case"OR":return"or";default:return Xt(1026)}})(t.compositeFilter.op))})(n):Xt(30097,{filter:n})}function lFe(n){return KMe[n]}function cFe(n){return YMe[n]}function uFe(n){return JMe[n]}function gy(n){return{fieldPath:n.canonicalString()}}function my(n){return Zr.fromServerFormat(n.fieldPath)}function Mne(n){return n instanceof vr?(function(t){if(t.op==="=="){if(rq(t.value))return{unaryFilter:{field:gy(t.field),op:"IS_NAN"}};if(iq(t.value))return{unaryFilter:{field:gy(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(rq(t.value))return{unaryFilter:{field:gy(t.field),op:"IS_NOT_NAN"}};if(iq(t.value))return{unaryFilter:{field:gy(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:gy(t.field),op:cFe(t.op),value:t.value}}})(n):n instanceof oc?(function(t){const i=t.getFilters().map((r=>Mne(r)));return i.length===1?i[0]:{compositeFilter:{op:uFe(t.op),filters:i}}})(n):Xt(54877,{filter:n})}function hFe(n){const e=[];return n.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function Fne(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}function Une(n){return!!n&&typeof n._toProto=="function"&&n._protoValueType==="ProtoValue"}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class $f{constructor(e,t,i,r,s=Qt.min(),a=Qt.min(),o=is.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=t,this.purpose=i,this.sequenceNumber=r,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=o,this.expectedCount=l}withSequenceNumber(e){return new $f(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new $f(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new $f(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new $f(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class dFe{constructor(e){this.yt=e}}function fFe(n){const e=aFe({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?gP(e,e.limit,"L"):e}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class pFe{constructor(){this.bn=new gFe}addToCollectionParentIndex(e,t){return this.bn.add(t),ot.resolve()}getCollectionParents(e,t){return ot.resolve(this.bn.getEntries(t))}addFieldIndex(e,t){return ot.resolve()}deleteFieldIndex(e,t){return ot.resolve()}deleteAllFieldIndexes(e){return ot.resolve()}createTargetIndexes(e,t){return ot.resolve()}getDocumentsMatchingTarget(e,t){return ot.resolve(null)}getIndexType(e,t){return ot.resolve(0)}getFieldIndexes(e,t){return ot.resolve([])}getNextCollectionGroupToUpdate(e){return ot.resolve(null)}getMinOffset(e,t){return ot.resolve(cp.min())}getMinOffsetFromCollectionGroup(e,t){return ot.resolve(cp.min())}updateCollectionGroup(e,t,i){return ot.resolve()}updateIndexEntries(e,t){return ot.resolve()}}class gFe{constructor(){this.index={}}add(e){const t=e.lastSegment(),i=e.popLast(),r=this.index[t]||new Lr(bi.comparator),s=!r.has(i);return this.index[t]=r.add(i),s}has(e){const t=e.lastSegment(),i=e.popLast(),r=this.index[t];return r&&r.has(i)}getEntries(e){return(this.index[e]||new Lr(bi.comparator)).toArray()}}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const vq={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Pne=41943040;class Ma{static withCacheSize(e){return new Ma(e,Ma.DEFAULT_COLLECTION_PERCENTILE,Ma.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,i){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=i}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Ma.DEFAULT_COLLECTION_PERCENTILE=10,Ma.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Ma.DEFAULT=new Ma(Pne,Ma.DEFAULT_COLLECTION_PERCENTILE,Ma.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Ma.DISABLED=new Ma(-1,0,0);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class k1{constructor(e){this.sr=e}next(){return this.sr+=2,this.sr}static _r(){return new k1(0)}static ar(){return new k1(-1)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const _q="LruGarbageCollector",mFe=1048576;function xq([n,e],[t,i]){const r=wn(n,t);return r===0?wn(e,i):r}class yFe{constructor(e){this.Pr=e,this.buffer=new Lr(xq),this.Tr=0}Er(){return++this.Tr}Ir(e){const t=[e,this.Er()];if(this.buffer.size<this.Pr)this.buffer=this.buffer.add(t);else{const i=this.buffer.last();xq(t,i)<0&&(this.buffer=this.buffer.delete(i).add(t))}}get maxValue(){return this.buffer.last()[0]}}class vFe{constructor(e,t,i){this.garbageCollector=e,this.asyncQueue=t,this.localStore=i,this.Rr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Ar(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return this.Rr!==null}Ar(e){Ct(_q,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){t_(t)?Ct(_q,"Ignoring IndexedDB error during garbage collection: ",t):await e_(t)}await this.Ar(3e5)}))}}class _Fe{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.dr(e).next((i=>Math.floor(t/100*i)))}nthSequenceNumber(e,t){if(t===0)return ot.resolve(sR.ce);const i=new yFe(t);return this.Vr.forEachTarget(e,(r=>i.Ir(r.sequenceNumber))).next((()=>this.Vr.mr(e,(r=>i.Ir(r))))).next((()=>i.maxValue))}removeTargets(e,t,i){return this.Vr.removeTargets(e,t,i)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(Ct("LruGarbageCollector","Garbage collection skipped; disabled"),ot.resolve(vq)):this.getCacheSize(e).next((i=>i<this.params.cacheSizeCollectionThreshold?(Ct("LruGarbageCollector",`Garbage collection skipped; Cache size ${i} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),vq):this.gr(e,t)))}getCacheSize(e){return this.Vr.getCacheSize(e)}gr(e,t){let i,r,s,a,o,l,c;const h=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((f=>(f>this.params.maximumSequenceNumbersToCollect?(Ct("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${f}`),r=this.params.maximumSequenceNumbersToCollect):r=f,a=Date.now(),this.nthSequenceNumber(e,r)))).next((f=>(i=f,o=Date.now(),this.removeTargets(e,i,t)))).next((f=>(s=f,l=Date.now(),this.removeOrphanedDocuments(e,i)))).next((f=>(c=Date.now(),fy()<=En.DEBUG&&Ct("LruGarbageCollector",`LRU Garbage Collection
	Counted targets in ${a-h}ms
	Determined least recently used ${r} in `+(o-a)+`ms
	Removed ${s} targets in `+(l-o)+`ms
	Removed ${f} documents in `+(c-l)+`ms
Total Duration: ${c-h}ms`),ot.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:s,documentsRemoved:f}))))}}function xFe(n,e){return new _Fe(n,e)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class bFe{constructor(){this.changes=new l0((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,zs.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const i=this.changes.get(t);return i!==void 0?ot.resolve(i):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class TFe{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class EFe{constructor(e,t,i,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=i,this.indexManager=r}getDocument(e,t){let i=null;return this.documentOverlayCache.getOverlay(e,t).next((r=>(i=r,this.remoteDocumentCache.getEntry(e,t)))).next((r=>(i!==null&&hb(i.mutation,r,Ql.empty(),Ti.now()),r)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((i=>this.getLocalViewOfDocuments(e,i,An()).next((()=>i))))}getLocalViewOfDocuments(e,t,i=An()){const r=vg();return this.populateOverlays(e,r,t).next((()=>this.computeViews(e,t,r,i).next((s=>{let a=Kx();return s.forEach(((o,l)=>{a=a.insert(o,l.overlayedDocument)})),a}))))}getOverlayedDocuments(e,t){const i=vg();return this.populateOverlays(e,i,t).next((()=>this.computeViews(e,t,i,An())))}populateOverlays(e,t,i){const r=[];return i.forEach((s=>{t.has(s)||r.push(s)})),this.documentOverlayCache.getOverlays(e,r).next((s=>{s.forEach(((a,o)=>{t.set(a,o)}))}))}computeViews(e,t,i,r){let s=qh();const a=ub(),o=(function(){return ub()})();return t.forEach(((l,c)=>{const h=i.get(c.key);r.has(c.key)&&(h===void 0||h.mutation instanceof c0)?s=s.insert(c.key,c):h!==void 0?(a.set(c.key,h.mutation.getFieldMask()),hb(h.mutation,c,h.mutation.getFieldMask(),Ti.now())):a.set(c.key,Ql.empty())})),this.recalculateAndSaveOverlays(e,s).next((l=>(l.forEach(((c,h)=>a.set(c,h))),t.forEach(((c,h)=>o.set(c,new TFe(h,a.get(c)??null)))),o)))}recalculateAndSaveOverlays(e,t){const i=ub();let r=new Wi(((a,o)=>a-o)),s=An();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((a=>{for(const o of a)o.keys().forEach((l=>{const c=t.get(l);if(c===null)return;let h=i.get(l)||Ql.empty();h=o.applyToLocalView(c,h),i.set(l,h);const f=(r.get(o.batchId)||An()).add(l);r=r.insert(o.batchId,f)}))})).next((()=>{const a=[],o=r.getReverseIterator();for(;o.hasNext();){const l=o.getNext(),c=l.key,h=l.value,f=yne();h.forEach((p=>{if(!s.has(p)){const y=Ene(t.get(p),i.get(p));y!==null&&f.set(p,y),s=s.add(p)}})),a.push(this.documentOverlayCache.saveOverlays(e,c,f))}return ot.waitFor(a)})).next((()=>i))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((i=>this.recalculateAndSaveOverlays(e,i)))}getDocumentsMatchingQuery(e,t,i,r){return AMe(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):dne(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,i,r):this.getDocumentsMatchingCollectionQuery(e,t,i,r)}getNextDocuments(e,t,i,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,i,r).next((s=>{const a=r-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,i.largestBatchId,r-s.size):ot.resolve(vg());let o=Bb,l=s;return a.next((c=>ot.forEach(c,((h,f)=>(o<f.largestBatchId&&(o=f.largestBatchId),s.get(h)?ot.resolve():this.remoteDocumentCache.getEntry(e,h).next((p=>{l=l.insert(h,p)}))))).next((()=>this.populateOverlays(e,c,s))).next((()=>this.computeViews(e,l,c,An()))).next((h=>({batchId:o,changes:mne(h)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Vt(t)).next((i=>{let r=Kx();return i.isFoundDocument()&&(r=r.insert(i.key,i)),r}))}getDocumentsMatchingCollectionGroupQuery(e,t,i,r){const s=t.collectionGroup;let a=Kx();return this.indexManager.getCollectionParents(e,s).next((o=>ot.forEach(o,(l=>{const c=(function(f,p){return new gE(p,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)})(t,l.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,i,r).next((h=>{h.forEach(((f,p)=>{a=a.insert(f,p)}))}))})).next((()=>a))))}getDocumentsMatchingCollectionQuery(e,t,i,r){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,i.largestBatchId).next((a=>(s=a,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,s,r)))).next((a=>{s.forEach(((l,c)=>{const h=c.getKey();a.get(h)===null&&(a=a.insert(h,zs.newInvalidDocument(h)))}));let o=Kx();return a.forEach(((l,c)=>{const h=s.get(l);h!==void 0&&hb(h.mutation,c,Ql.empty(),Ti.now()),cR(t,c)&&(o=o.insert(l,c))})),o}))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class wFe{constructor(e){this.serializer=e,this.Nr=new Map,this.Br=new Map}getBundleMetadata(e,t){return ot.resolve(this.Nr.get(t))}saveBundleMetadata(e,t){return this.Nr.set(t.id,(function(r){return{id:r.id,version:r.version,createTime:lu(r.createTime)}})(t)),ot.resolve()}getNamedQuery(e,t){return ot.resolve(this.Br.get(t))}saveNamedQuery(e,t){return this.Br.set(t.name,(function(r){return{name:r.name,query:fFe(r.bundledQuery),readTime:lu(r.readTime)}})(t)),ot.resolve()}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class AFe{constructor(){this.overlays=new Wi(Vt.comparator),this.Lr=new Map}getOverlay(e,t){return ot.resolve(this.overlays.get(t))}getOverlays(e,t){const i=vg();return ot.forEach(t,(r=>this.getOverlay(e,r).next((s=>{s!==null&&i.set(r,s)})))).next((()=>i))}saveOverlays(e,t,i){return i.forEach(((r,s)=>{this.St(e,t,s)})),ot.resolve()}removeOverlaysForBatchId(e,t,i){const r=this.Lr.get(i);return r!==void 0&&(r.forEach((s=>this.overlays=this.overlays.remove(s))),this.Lr.delete(i)),ot.resolve()}getOverlaysForCollection(e,t,i){const r=vg(),s=t.length+1,a=new Vt(t.child("")),o=this.overlays.getIteratorFrom(a);for(;o.hasNext();){const l=o.getNext().value,c=l.getKey();if(!t.isPrefixOf(c.path))break;c.path.length===s&&l.largestBatchId>i&&r.set(l.getKey(),l)}return ot.resolve(r)}getOverlaysForCollectionGroup(e,t,i,r){let s=new Wi(((c,h)=>c-h));const a=this.overlays.getIterator();for(;a.hasNext();){const c=a.getNext().value;if(c.getKey().getCollectionGroup()===t&&c.largestBatchId>i){let h=s.get(c.largestBatchId);h===null&&(h=vg(),s=s.insert(c.largestBatchId,h)),h.set(c.getKey(),c)}}const o=vg(),l=s.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach(((c,h)=>o.set(c,h))),!(o.size()>=r)););return ot.resolve(o)}St(e,t,i){const r=this.overlays.get(i.key);if(r!==null){const a=this.Lr.get(r.largestBatchId).delete(i.key);this.Lr.set(r.largestBatchId,a)}this.overlays=this.overlays.insert(i.key,new zMe(t,i));let s=this.Lr.get(t);s===void 0&&(s=An(),this.Lr.set(t,s)),this.Lr.set(t,s.add(i.key))}}/**
 * @license
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class SFe{constructor(){this.sessionToken=is.EMPTY_BYTE_STRING}getSessionToken(e){return ot.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,ot.resolve()}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class h5{constructor(){this.kr=new Lr(Jr.qr),this.Kr=new Lr(Jr.Ur)}isEmpty(){return this.kr.isEmpty()}addReference(e,t){const i=new Jr(e,t);this.kr=this.kr.add(i),this.Kr=this.Kr.add(i)}$r(e,t){e.forEach((i=>this.addReference(i,t)))}removeReference(e,t){this.Wr(new Jr(e,t))}Qr(e,t){e.forEach((i=>this.removeReference(i,t)))}Gr(e){const t=new Vt(new bi([])),i=new Jr(t,e),r=new Jr(t,e+1),s=[];return this.Kr.forEachInRange([i,r],(a=>{this.Wr(a),s.push(a.key)})),s}zr(){this.kr.forEach((e=>this.Wr(e)))}Wr(e){this.kr=this.kr.delete(e),this.Kr=this.Kr.delete(e)}jr(e){const t=new Vt(new bi([])),i=new Jr(t,e),r=new Jr(t,e+1);let s=An();return this.Kr.forEachInRange([i,r],(a=>{s=s.add(a.key)})),s}containsKey(e){const t=new Jr(e,0),i=this.kr.firstAfterOrEqual(t);return i!==null&&e.isEqual(i.key)}}class Jr{constructor(e,t){this.key=e,this.Jr=t}static qr(e,t){return Vt.comparator(e.key,t.key)||wn(e.Jr,t.Jr)}static Ur(e,t){return wn(e.Jr,t.Jr)||Vt.comparator(e.key,t.key)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class DFe{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Yn=1,this.Hr=new Lr(Jr.qr)}checkEmpty(e){return ot.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,i,r){const s=this.Yn;this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const a=new HMe(s,t,i,r);this.mutationQueue.push(a);for(const o of r)this.Hr=this.Hr.add(new Jr(o.key,s)),this.indexManager.addToCollectionParentIndex(e,o.key.path.popLast());return ot.resolve(a)}lookupMutationBatch(e,t){return ot.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){const i=t+1,r=this.Xr(i),s=r<0?0:r;return ot.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return ot.resolve(this.mutationQueue.length===0?e5:this.Yn-1)}getAllMutationBatches(e){return ot.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const i=new Jr(t,0),r=new Jr(t,Number.POSITIVE_INFINITY),s=[];return this.Hr.forEachInRange([i,r],(a=>{const o=this.Zr(a.Jr);s.push(o)})),ot.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,t){let i=new Lr(wn);return t.forEach((r=>{const s=new Jr(r,0),a=new Jr(r,Number.POSITIVE_INFINITY);this.Hr.forEachInRange([s,a],(o=>{i=i.add(o.Jr)}))})),ot.resolve(this.Yr(i))}getAllMutationBatchesAffectingQuery(e,t){const i=t.path,r=i.length+1;let s=i;Vt.isDocumentKey(s)||(s=s.child(""));const a=new Jr(new Vt(s),0);let o=new Lr(wn);return this.Hr.forEachWhile((l=>{const c=l.key.path;return!!i.isPrefixOf(c)&&(c.length===r&&(o=o.add(l.Jr)),!0)}),a),ot.resolve(this.Yr(o))}Yr(e){const t=[];return e.forEach((i=>{const r=this.Zr(i);r!==null&&t.push(r)})),t}removeMutationBatch(e,t){zn(this.ei(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let i=this.Hr;return ot.forEach(t.mutations,(r=>{const s=new Jr(r.key,t.batchId);return i=i.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)})).next((()=>{this.Hr=i}))}nr(e){}containsKey(e,t){const i=new Jr(t,0),r=this.Hr.firstAfterOrEqual(i);return ot.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,ot.resolve()}ei(e,t){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){const t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class CFe{constructor(e){this.ti=e,this.docs=(function(){return new Wi(Vt.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const i=t.key,r=this.docs.get(i),s=r?r.size:0,a=this.ti(t);return this.docs=this.docs.insert(i,{document:t.mutableCopy(),size:a}),this.size+=a-s,this.indexManager.addToCollectionParentIndex(e,i.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const i=this.docs.get(t);return ot.resolve(i?i.document.mutableCopy():zs.newInvalidDocument(t))}getEntries(e,t){let i=qh();return t.forEach((r=>{const s=this.docs.get(r);i=i.insert(r,s?s.document.mutableCopy():zs.newInvalidDocument(r))})),ot.resolve(i)}getDocumentsMatchingQuery(e,t,i,r){let s=qh();const a=t.path,o=new Vt(a.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(o);for(;l.hasNext();){const{key:c,value:{document:h}}=l.getNext();if(!a.isPrefixOf(c.path))break;c.path.length>a.length+1||tMe(eMe(h),i)<=0||(r.has(h.key)||cR(t,h))&&(s=s.insert(h.key,h.mutableCopy()))}return ot.resolve(s)}getAllFromCollectionGroup(e,t,i,r){Xt(9500)}ni(e,t){return ot.forEach(this.docs,(i=>t(i)))}newChangeBuffer(e){return new IFe(this)}getSize(e){return ot.resolve(this.size)}}class IFe extends bFe{constructor(e){super(),this.Mr=e}applyChanges(e){const t=[];return this.changes.forEach(((i,r)=>{r.isValidDocument()?t.push(this.Mr.addEntry(e,r)):this.Mr.removeEntry(i)})),ot.waitFor(t)}getFromCache(e,t){return this.Mr.getEntry(e,t)}getAllFromCache(e,t){return this.Mr.getEntries(e,t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class RFe{constructor(e){this.persistence=e,this.ri=new l0((t=>i5(t)),r5),this.lastRemoteSnapshotVersion=Qt.min(),this.highestTargetId=0,this.ii=0,this.si=new h5,this.targetCount=0,this.oi=k1._r()}forEachTarget(e,t){return this.ri.forEach(((i,r)=>t(r))),ot.resolve()}getLastRemoteSnapshotVersion(e){return ot.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ot.resolve(this.ii)}allocateTargetId(e){return this.highestTargetId=this.oi.next(),ot.resolve(this.highestTargetId)}setTargetsMetadata(e,t,i){return i&&(this.lastRemoteSnapshotVersion=i),t>this.ii&&(this.ii=t),ot.resolve()}lr(e){this.ri.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.oi=new k1(t),this.highestTargetId=t),e.sequenceNumber>this.ii&&(this.ii=e.sequenceNumber)}addTargetData(e,t){return this.lr(t),this.targetCount+=1,ot.resolve()}updateTargetData(e,t){return this.lr(t),ot.resolve()}removeTargetData(e,t){return this.ri.delete(t.target),this.si.Gr(t.targetId),this.targetCount-=1,ot.resolve()}removeTargets(e,t,i){let r=0;const s=[];return this.ri.forEach(((a,o)=>{o.sequenceNumber<=t&&i.get(o.targetId)===null&&(this.ri.delete(a),s.push(this.removeMatchingKeysForTargetId(e,o.targetId)),r++)})),ot.waitFor(s).next((()=>r))}getTargetCount(e){return ot.resolve(this.targetCount)}getTargetData(e,t){const i=this.ri.get(t)||null;return ot.resolve(i)}addMatchingKeys(e,t,i){return this.si.$r(t,i),ot.resolve()}removeMatchingKeys(e,t,i){this.si.Qr(t,i);const r=this.persistence.referenceDelegate,s=[];return r&&t.forEach((a=>{s.push(r.markPotentiallyOrphaned(e,a))})),ot.waitFor(s)}removeMatchingKeysForTargetId(e,t){return this.si.Gr(t),ot.resolve()}getMatchingKeysForTargetId(e,t){const i=this.si.jr(t);return ot.resolve(i)}containsKey(e,t){return ot.resolve(this.si.containsKey(t))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Lne{constructor(e,t){this._i={},this.overlays={},this.ai=new sR(0),this.ui=!1,this.ui=!0,this.ci=new SFe,this.referenceDelegate=e(this),this.li=new RFe(this),this.indexManager=new pFe,this.remoteDocumentCache=(function(r){return new CFe(r)})((i=>this.referenceDelegate.hi(i))),this.serializer=new dFe(t),this.Pi=new wFe(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new AFe,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let i=this._i[e.toKey()];return i||(i=new DFe(t,this.referenceDelegate),this._i[e.toKey()]=i),i}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,t,i){Ct("MemoryPersistence","Starting transaction:",e);const r=new NFe(this.ai.next());return this.referenceDelegate.Ti(),i(r).next((s=>this.referenceDelegate.Ei(r).next((()=>s)))).toPromise().then((s=>(r.raiseOnCommittedEvent(),s)))}Ii(e,t){return ot.or(Object.values(this._i).map((i=>()=>i.containsKey(e,t))))}}class NFe extends iMe{constructor(e){super(),this.currentSequenceNumber=e}}class d5{constructor(e){this.persistence=e,this.Ri=new h5,this.Ai=null}static Vi(e){return new d5(e)}get di(){if(this.Ai)return this.Ai;throw Xt(60996)}addReference(e,t,i){return this.Ri.addReference(i,t),this.di.delete(i.toString()),ot.resolve()}removeReference(e,t,i){return this.Ri.removeReference(i,t),this.di.add(i.toString()),ot.resolve()}markPotentiallyOrphaned(e,t){return this.di.add(t.toString()),ot.resolve()}removeTarget(e,t){this.Ri.Gr(t.targetId).forEach((r=>this.di.add(r.toString())));const i=this.persistence.getTargetCache();return i.getMatchingKeysForTargetId(e,t.targetId).next((r=>{r.forEach((s=>this.di.add(s.toString())))})).next((()=>i.removeTargetData(e,t)))}Ti(){this.Ai=new Set}Ei(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ot.forEach(this.di,(i=>{const r=Vt.fromPath(i);return this.mi(e,r).next((s=>{s||t.removeEntry(r,Qt.min())}))})).next((()=>(this.Ai=null,t.apply(e))))}updateLimboDocument(e,t){return this.mi(e,t).next((i=>{i?this.di.delete(t.toString()):this.di.add(t.toString())}))}hi(e){return 0}mi(e,t){return ot.or([()=>ot.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ii(e,t)])}}class EC{constructor(e,t){this.persistence=e,this.fi=new l0((i=>aMe(i.path)),((i,r)=>i.isEqual(r))),this.garbageCollector=xFe(this,t)}static Vi(e,t){return new EC(e,t)}Ti(){}Ei(e){return ot.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}dr(e){const t=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next((i=>t.next((r=>i+r))))}pr(e){let t=0;return this.mr(e,(i=>{t++})).next((()=>t))}mr(e,t){return ot.forEach(this.fi,((i,r)=>this.wr(e,i,r).next((s=>s?ot.resolve():t(r)))))}removeTargets(e,t,i){return this.persistence.getTargetCache().removeTargets(e,t,i)}removeOrphanedDocuments(e,t){let i=0;const r=this.persistence.getRemoteDocumentCache(),s=r.newChangeBuffer();return r.ni(e,(a=>this.wr(e,a,t).next((o=>{o||(i++,s.removeEntry(a,Qt.min()))})))).next((()=>s.apply(e))).next((()=>i))}markPotentiallyOrphaned(e,t){return this.fi.set(t,e.currentSequenceNumber),ot.resolve()}removeTarget(e,t){const i=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,i)}addReference(e,t,i){return this.fi.set(i,e.currentSequenceNumber),ot.resolve()}removeReference(e,t,i){return this.fi.set(i,e.currentSequenceNumber),ot.resolve()}updateLimboDocument(e,t){return this.fi.set(t,e.currentSequenceNumber),ot.resolve()}hi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=eD(e.data.value)),t}wr(e,t,i){return ot.or([()=>this.persistence.Ii(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const r=this.fi.get(t);return ot.resolve(r!==void 0&&r>i)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class f5{constructor(e,t,i,r){this.targetId=e,this.fromCache=t,this.Ts=i,this.Es=r}static Is(e,t){let i=An(),r=An();for(const s of t.docChanges)switch(s.type){case 0:i=i.add(s.doc.key);break;case 1:r=r.add(s.doc.key)}return new f5(e,t.fromCache,i,r)}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class kFe{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class MFe{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=(function(){return TRe()?8:rMe(Xs())>0?6:4})()}initialize(e,t){this.fs=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,i,r){const s={result:null};return this.gs(e,t).next((a=>{s.result=a})).next((()=>{if(!s.result)return this.ps(e,t,r,i).next((a=>{s.result=a}))})).next((()=>{if(s.result)return;const a=new kFe;return this.ys(e,t,a).next((o=>{if(s.result=o,this.As)return this.ws(e,t,a,o.size)}))})).next((()=>s.result))}ws(e,t,i,r){return i.documentReadCount<this.Vs?(fy()<=En.DEBUG&&Ct("QueryEngine","SDK will not create cache indexes for query:",py(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),ot.resolve()):(fy()<=En.DEBUG&&Ct("QueryEngine","Query:",py(t),"scans",i.documentReadCount,"local documents and returns",r,"documents as results."),i.documentReadCount>this.ds*r?(fy()<=En.DEBUG&&Ct("QueryEngine","The SDK decides to create cache indexes for query:",py(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,au(t))):ot.resolve())}gs(e,t){if(lq(t))return ot.resolve(null);let i=au(t);return this.indexManager.getIndexType(e,i).next((r=>r===0?null:(t.limit!==null&&r===1&&(t=gP(t,null,"F"),i=au(t)),this.indexManager.getDocumentsMatchingTarget(e,i).next((s=>{const a=An(...s);return this.fs.getDocuments(e,a).next((o=>this.indexManager.getMinOffset(e,i).next((l=>{const c=this.Ss(t,o);return this.bs(t,c,a,l.readTime)?this.gs(e,gP(t,null,"F")):this.Ds(e,c,t,l)}))))})))))}ps(e,t,i,r){return lq(t)||r.isEqual(Qt.min())?ot.resolve(null):this.fs.getDocuments(e,i).next((s=>{const a=this.Ss(t,s);return this.bs(t,a,i,r)?ot.resolve(null):(fy()<=En.DEBUG&&Ct("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),py(t)),this.Ds(e,a,t,Z3e(r,Bb)).next((o=>o)))}))}Ss(e,t){let i=new Lr(pne(e));return t.forEach(((r,s)=>{cR(e,s)&&(i=i.add(s))})),i}bs(e,t,i,r){if(e.limit===null)return!1;if(i.size!==t.size)return!0;const s=e.limitType==="F"?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(r)>0)}ys(e,t,i){return fy()<=En.DEBUG&&Ct("QueryEngine","Using full collection scan to execute query:",py(t)),this.fs.getDocumentsMatchingQuery(e,t,cp.min(),i)}Ds(e,t,i,r){return this.fs.getDocumentsMatchingQuery(e,i,r).next((s=>(t.forEach((a=>{s=s.insert(a.key,a)})),s)))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const p5="LocalStore",FFe=3e8;class UFe{constructor(e,t,i,r){this.persistence=e,this.Cs=t,this.serializer=r,this.vs=new Wi(wn),this.Fs=new l0((s=>i5(s)),r5),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(i)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new EFe(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.vs)))}}function PFe(n,e,t,i){return new UFe(n,e,t,i)}async function One(n,e){const t=nn(n);return await t.persistence.runTransaction("Handle user change","readonly",(i=>{let r;return t.mutationQueue.getAllMutationBatches(i).next((s=>(r=s,t.Os(e),t.mutationQueue.getAllMutationBatches(i)))).next((s=>{const a=[],o=[];let l=An();for(const c of r){a.push(c.batchId);for(const h of c.mutations)l=l.add(h.key)}for(const c of s){o.push(c.batchId);for(const h of c.mutations)l=l.add(h.key)}return t.localDocuments.getDocuments(i,l).next((c=>({Ns:c,removedBatchIds:a,addedBatchIds:o})))}))}))}function LFe(n,e){const t=nn(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",(i=>{const r=e.batch.keys(),s=t.xs.newChangeBuffer({trackRemovals:!0});return(function(o,l,c,h){const f=c.batch,p=f.keys();let y=ot.resolve();return p.forEach((x=>{y=y.next((()=>h.getEntry(l,x))).next((v=>{const _=c.docVersions.get(x);zn(_!==null,48541),v.version.compareTo(_)<0&&(f.applyToRemoteDocument(v,c),v.isValidDocument()&&(v.setReadTime(c.commitVersion),h.addEntry(v)))}))})),y.next((()=>o.mutationQueue.removeMutationBatch(l,f)))})(t,i,e,s).next((()=>s.apply(i))).next((()=>t.mutationQueue.performConsistencyCheck(i))).next((()=>t.documentOverlayCache.removeOverlaysForBatchId(i,r,e.batch.batchId))).next((()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(i,(function(o){let l=An();for(let c=0;c<o.mutationResults.length;++c)o.mutationResults[c].transformResults.length>0&&(l=l.add(o.batch.mutations[c].key));return l})(e)))).next((()=>t.localDocuments.getDocuments(i,r)))}))}function Bne(n){const e=nn(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.li.getLastRemoteSnapshotVersion(t)))}function OFe(n,e){const t=nn(n),i=e.snapshotVersion;let r=t.vs;return t.persistence.runTransaction("Apply remote event","readwrite-primary",(s=>{const a=t.xs.newChangeBuffer({trackRemovals:!0});r=t.vs;const o=[];e.targetChanges.forEach(((h,f)=>{const p=r.get(f);if(!p)return;o.push(t.li.removeMatchingKeys(s,h.removedDocuments,f).next((()=>t.li.addMatchingKeys(s,h.addedDocuments,f))));let y=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?y=y.withResumeToken(is.EMPTY_BYTE_STRING,Qt.min()).withLastLimboFreeSnapshotVersion(Qt.min()):h.resumeToken.approximateByteSize()>0&&(y=y.withResumeToken(h.resumeToken,i)),r=r.insert(f,y),(function(v,_,E){return v.resumeToken.approximateByteSize()===0||_.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=FFe?!0:E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0})(p,y,h)&&o.push(t.li.updateTargetData(s,y))}));let l=qh(),c=An();if(e.documentUpdates.forEach((h=>{e.resolvedLimboDocuments.has(h)&&o.push(t.persistence.referenceDelegate.updateLimboDocument(s,h))})),o.push(BFe(s,a,e.documentUpdates).next((h=>{l=h.Bs,c=h.Ls}))),!i.isEqual(Qt.min())){const h=t.li.getLastRemoteSnapshotVersion(s).next((f=>t.li.setTargetsMetadata(s,s.currentSequenceNumber,i)));o.push(h)}return ot.waitFor(o).next((()=>a.apply(s))).next((()=>t.localDocuments.getLocalViewOfDocuments(s,l,c))).next((()=>l))})).then((s=>(t.vs=r,s)))}function BFe(n,e,t){let i=An(),r=An();return t.forEach((s=>i=i.add(s))),e.getEntries(n,i).next((s=>{let a=qh();return t.forEach(((o,l)=>{const c=s.get(o);l.isFoundDocument()!==c.isFoundDocument()&&(r=r.add(o)),l.isNoDocument()&&l.version.isEqual(Qt.min())?(e.removeEntry(o,l.readTime),a=a.insert(o,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),a=a.insert(o,l)):Ct(p5,"Ignoring outdated watch update for ",o,". Current version:",c.version," Watch version:",l.version)})),{Bs:a,Ls:r}}))}function VFe(n,e){const t=nn(n);return t.persistence.runTransaction("Get next mutation batch","readonly",(i=>(e===void 0&&(e=e5),t.mutationQueue.getNextMutationBatchAfterBatchId(i,e))))}function WFe(n,e){const t=nn(n);return t.persistence.runTransaction("Allocate target","readwrite",(i=>{let r;return t.li.getTargetData(i,e).next((s=>s?(r=s,ot.resolve(r)):t.li.allocateTargetId(i).next((a=>(r=new $f(e,a,"TargetPurposeListen",i.currentSequenceNumber),t.li.addTargetData(i,r).next((()=>r)))))))})).then((i=>{const r=t.vs.get(i.targetId);return(r===null||i.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(t.vs=t.vs.insert(i.targetId,i),t.Fs.set(e,i.targetId)),i}))}async function xP(n,e,t){const i=nn(n),r=i.vs.get(e),s=t?"readwrite":"readwrite-primary";try{t||await i.persistence.runTransaction("Release target",s,(a=>i.persistence.referenceDelegate.removeTarget(a,r)))}catch(a){if(!t_(a))throw a;Ct(p5,`Failed to update sequence numbers for target ${e}: ${a}`)}i.vs=i.vs.remove(e),i.Fs.delete(r.target)}function bq(n,e,t){const i=nn(n);let r=Qt.min(),s=An();return i.persistence.runTransaction("Execute query","readwrite",(a=>(function(l,c,h){const f=nn(l),p=f.Fs.get(h);return p!==void 0?ot.resolve(f.vs.get(p)):f.li.getTargetData(c,h)})(i,a,au(e)).next((o=>{if(o)return r=o.lastLimboFreeSnapshotVersion,i.li.getMatchingKeysForTargetId(a,o.targetId).next((l=>{s=l}))})).next((()=>i.Cs.getDocumentsMatchingQuery(a,e,t?r:Qt.min(),t?s:An()))).next((o=>(HFe(i,DMe(e),o),{documents:o,ks:s})))))}function HFe(n,e,t){let i=n.Ms.get(e)||Qt.min();t.forEach(((r,s)=>{s.readTime.compareTo(i)>0&&(i=s.readTime)})),n.Ms.set(e,i)}class Tq{constructor(){this.activeTargetIds=MMe()}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class zFe{constructor(){this.vo=new Tq,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,i){}addLocalQueryTarget(e,t=!0){return t&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,t,i){this.Fo[e]=t}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new Tq,Promise.resolve()}handleUserChange(e,t,i){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class GFe{Mo(e){}shutdown(){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Eq="ConnectivityMonitor";class wq{constructor(){this.xo=()=>this.Oo(),this.No=()=>this.Bo(),this.Lo=[],this.ko()}Mo(e){this.Lo.push(e)}shutdown(){window.removeEventListener("online",this.xo),window.removeEventListener("offline",this.No)}ko(){window.addEventListener("online",this.xo),window.addEventListener("offline",this.No)}Oo(){Ct(Eq,"Network connectivity changed: AVAILABLE");for(const e of this.Lo)e(0)}Bo(){Ct(Eq,"Network connectivity changed: UNAVAILABLE");for(const e of this.Lo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let kA=null;function bP(){return kA===null?kA=(function(){return 268435456+Math.round(2147483648*Math.random())})():kA++,"0x"+kA.toString(16)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const wM="RestConnection",qFe={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class $Fe{get qo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.Ko=t+"://"+e.host,this.Uo=`projects/${i}/databases/${r}`,this.$o=this.databaseId.database===mC?`project_id=${i}`:`project_id=${i}&database_id=${r}`}Wo(e,t,i,r,s){const a=bP(),o=this.Qo(e,t.toUriEncodedString());Ct(wM,`Sending RPC '${e}' ${a}:`,o,i);const l={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(l,r,s);const{host:c}=new URL(o),h=uE(c);return this.zo(e,o,l,i,h).then((f=>(Ct(wM,`Received RPC '${e}' ${a}: `,f),f)),(f=>{throw op(wM,`RPC '${e}' ${a} failed with error: `,f,"url: ",o,"request:",i),f}))}jo(e,t,i,r,s,a){return this.Wo(e,t,i,r,s)}Go(e,t,i){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Z1})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((r,s)=>e[s]=r)),i&&i.headers.forEach(((r,s)=>e[s]=r))}Qo(e,t){const i=qFe[e];let r=`${this.Ko}/v1/${t}:${i}`;return this.databaseInfo.apiKey&&(r=`${r}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),r}terminate(){}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class jFe{constructor(e){this.Jo=e.Jo,this.Ho=e.Ho}Zo(e){this.Xo=e}Yo(e){this.e_=e}t_(e){this.n_=e}onMessage(e){this.r_=e}close(){this.Ho()}send(e){this.Jo(e)}i_(){this.Xo()}s_(){this.e_()}o_(e){this.n_(e)}__(e){this.r_(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Fs="WebChannelConnection",_x=(n,e,t)=>{n.listen(e,(i=>{try{t(i)}catch(r){setTimeout((()=>{throw r}),0)}}))};class Gy extends $Fe{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!Gy.c_){const e=Hte();_x(e,Wte.STAT_EVENT,(t=>{t.stat===lP.PROXY?Ct(Fs,"STAT_EVENT: detected buffering proxy"):t.stat===lP.NOPROXY&&Ct(Fs,"STAT_EVENT: detected no buffering proxy")})),Gy.c_=!0}}zo(e,t,i,r,s){const a=bP();return new Promise(((o,l)=>{const c=new Bte;c.setWithCredentials(!0),c.listenOnce(Vte.COMPLETE,(()=>{try{switch(c.getLastErrorCode()){case ZS.NO_ERROR:const f=c.getResponseJson();Ct(Fs,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(f)),o(f);break;case ZS.TIMEOUT:Ct(Fs,`RPC '${e}' ${a} timed out`),l(new Dt(at.DEADLINE_EXCEEDED,"Request time out"));break;case ZS.HTTP_ERROR:const p=c.getStatus();if(Ct(Fs,`RPC '${e}' ${a} failed with status:`,p,"response text:",c.getResponseText()),p>0){let y=c.getResponseJson();Array.isArray(y)&&(y=y[0]);const x=y==null?void 0:y.error;if(x&&x.status&&x.message){const v=(function(E){const w=E.toLowerCase().replace(/_/g,"-");return Object.values(at).indexOf(w)>=0?w:at.UNKNOWN})(x.status);l(new Dt(v,x.message))}else l(new Dt(at.UNKNOWN,"Server responded with status "+c.getStatus()))}else l(new Dt(at.UNAVAILABLE,"Connection failed."));break;default:Xt(9055,{l_:e,streamId:a,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{Ct(Fs,`RPC '${e}' ${a} completed.`)}}));const h=JSON.stringify(r);Ct(Fs,`RPC '${e}' ${a} sending request:`,r),c.send(t,"POST",h,i,15)}))}T_(e,t,i){const r=bP(),s=[this.Ko,"/","google.firestore.v1.Firestore","/",e,"/channel"],a=this.createWebChannelTransport(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(o.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(o.useFetchStreams=!0),this.Go(o.initMessageHeaders,t,i),o.encodeInitMessageHeaders=!0;const c=s.join("");Ct(Fs,`Creating RPC '${e}' stream ${r}: ${c}`,o);const h=a.createWebChannel(c,o);this.E_(h);let f=!1,p=!1;const y=new jFe({Jo:x=>{p?Ct(Fs,`Not sending because RPC '${e}' stream ${r} is closed:`,x):(f||(Ct(Fs,`Opening RPC '${e}' stream ${r} transport.`),h.open(),f=!0),Ct(Fs,`RPC '${e}' stream ${r} sending:`,x),h.send(x))},Ho:()=>h.close()});return _x(h,Xx.EventType.OPEN,(()=>{p||(Ct(Fs,`RPC '${e}' stream ${r} transport opened.`),y.i_())})),_x(h,Xx.EventType.CLOSE,(()=>{p||(p=!0,Ct(Fs,`RPC '${e}' stream ${r} transport closed`),y.o_(),this.I_(h))})),_x(h,Xx.EventType.ERROR,(x=>{p||(p=!0,op(Fs,`RPC '${e}' stream ${r} transport errored. Name:`,x.name,"Message:",x.message),y.o_(new Dt(at.UNAVAILABLE,"The operation could not be completed")))})),_x(h,Xx.EventType.MESSAGE,(x=>{var v;if(!p){const _=x.data[0];zn(!!_,16349);const E=_,w=(E==null?void 0:E.error)||((v=E[0])==null?void 0:v.error);if(w){Ct(Fs,`RPC '${e}' stream ${r} received error:`,w);const A=w.status;let N=(function(C){const M=pr[C];if(M!==void 0)return Ane(M)})(A),k=w.message;A==="NOT_FOUND"&&k.includes("database")&&k.includes("does not exist")&&k.includes(this.databaseId.database)&&op(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),N===void 0&&(N=at.INTERNAL,k="Unknown error status: "+A+" with message "+w.message),p=!0,y.o_(new Dt(N,k)),h.close()}else Ct(Fs,`RPC '${e}' stream ${r} received:`,_),y.__(_)}})),Gy.u_(),setTimeout((()=>{y.s_()}),0),y}terminate(){this.a_.forEach((e=>e.close())),this.a_=[]}E_(e){this.a_.push(e)}I_(e){this.a_=this.a_.filter((t=>t===e))}Go(e,t,i){super.Go(e,t,i),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return zte()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function XFe(n){return new Gy(n)}function AM(){return typeof document<"u"?document:null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function fR(n){return new QMe(n,!0)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Gy.c_=!1;class Vne{constructor(e,t,i=1e3,r=1.5,s=6e4){this.Ci=e,this.timerId=t,this.R_=i,this.A_=r,this.V_=s,this.d_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.d_=0}g_(){this.d_=this.V_}p_(e){this.cancel();const t=Math.floor(this.d_+this.y_()),i=Math.max(0,Date.now()-this.f_),r=Math.max(0,t-i);r>0&&Ct("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.d_} ms, delay with jitter: ${t} ms, last attempt: ${i} ms ago)`),this.m_=this.Ci.enqueueAfterDelay(this.timerId,r,(()=>(this.f_=Date.now(),e()))),this.d_*=this.A_,this.d_<this.R_&&(this.d_=this.R_),this.d_>this.V_&&(this.d_=this.V_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.d_}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Aq="PersistentStream";class Wne{constructor(e,t,i,r,s,a,o,l){this.Ci=e,this.S_=i,this.b_=r,this.connection=s,this.authCredentialsProvider=a,this.appCheckCredentialsProvider=o,this.listener=l,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new Vne(e,t)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Ci.enqueueAfterDelay(this.S_,6e4,(()=>this.k_())))}q_(e){this.K_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}K_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.K_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():t&&t.code===at.RESOURCE_EXHAUSTED?(Gh(t.toString()),Gh("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===at.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(t)}W_(){}auth(){this.state=1;const e=this.Q_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([i,r])=>{this.D_===t&&this.G_(i,r)}),(i=>{e((()=>{const r=new Dt(at.UNKNOWN,"Fetching auth token failed: "+i.message);return this.z_(r)}))}))}G_(e,t){const i=this.Q_(this.D_);this.stream=this.j_(e,t),this.stream.Zo((()=>{i((()=>this.listener.Zo()))})),this.stream.Yo((()=>{i((()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.b_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.Yo())))})),this.stream.t_((r=>{i((()=>this.z_(r)))})),this.stream.onMessage((r=>{i((()=>++this.F_==1?this.J_(r):this.onNext(r)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return Ct(Aq,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return t=>{this.Ci.enqueueAndForget((()=>this.D_===e?t():(Ct(Aq,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class KFe extends Wne{constructor(e,t,i,r,s,a){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,i,r,a),this.serializer=s}j_(e,t){return this.connection.T_("Listen",e,t)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const t=tFe(this.serializer,e),i=(function(s){if(!("targetChange"in s))return Qt.min();const a=s.targetChange;return a.targetIds&&a.targetIds.length?Qt.min():a.readTime?lu(a.readTime):Qt.min()})(e);return this.listener.H_(t,i)}Z_(e){const t={};t.database=_P(this.serializer),t.addTarget=(function(s,a){let o;const l=a.target;if(o=fP(l)?{documents:rFe(s,l)}:{query:sFe(s,l).ft},o.targetId=a.targetId,a.resumeToken.approximateByteSize()>0){o.resumeToken=Cne(s,a.resumeToken);const c=mP(s,a.expectedCount);c!==null&&(o.expectedCount=c)}else if(a.snapshotVersion.compareTo(Qt.min())>0){o.readTime=TC(s,a.snapshotVersion.toTimestamp());const c=mP(s,a.expectedCount);c!==null&&(o.expectedCount=c)}return o})(this.serializer,e);const i=oFe(this.serializer,e);i&&(t.labels=i),this.q_(t)}X_(e){const t={};t.database=_P(this.serializer),t.removeTarget=e,this.q_(t)}}class YFe extends Wne{constructor(e,t,i,r,s,a){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,i,r,a),this.serializer=s}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}J_(e){return zn(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,zn(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){zn(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const t=iFe(e.writeResults,e.commitTime),i=lu(e.commitTime);return this.listener.na(i,t)}ra(){const e={};e.database=_P(this.serializer),this.q_(e)}ea(e){const t={streamToken:this.lastStreamToken,writes:e.map((i=>nFe(this.serializer,i)))};this.q_(t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class JFe{}class QFe extends JFe{constructor(e,t,i,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=i,this.serializer=r,this.ia=!1}sa(){if(this.ia)throw new Dt(at.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,t,i,r){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([s,a])=>this.connection.Wo(e,yP(t,i),r,s,a))).catch((s=>{throw s.name==="FirebaseError"?(s.code===at.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new Dt(at.UNKNOWN,s.toString())}))}jo(e,t,i,r,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([a,o])=>this.connection.jo(e,yP(t,i),r,a,o,s))).catch((a=>{throw a.name==="FirebaseError"?(a.code===at.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new Dt(at.UNKNOWN,a.toString())}))}terminate(){this.ia=!0,this.connection.terminate()}}function ZFe(n,e,t,i){return new QFe(n,e,t,i)}class eUe{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve()))))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const t=`Could not reach Cloud Firestore backend. ${e}
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(Gh(t),this.aa=!1):Ct("OnlineStateTracker",t)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Xm="RemoteStore";class tUe{constructor(e,t,i,r,s){this.localStore=e,this.datastore=t,this.asyncQueue=i,this.remoteSyncer={},this.Ta=[],this.Ea=new Map,this.Ia=new Set,this.Ra=[],this.Aa=s,this.Aa.Mo((a=>{i.enqueueAndForget((async()=>{u0(this)&&(Ct(Xm,"Restarting streams for network reachability change."),await(async function(l){const c=nn(l);c.Ia.add(4),await vE(c),c.Va.set("Unknown"),c.Ia.delete(4),await pR(c)})(this))}))})),this.Va=new eUe(i,r)}}async function pR(n){if(u0(n))for(const e of n.Ra)await e(!0)}async function vE(n){for(const e of n.Ra)await e(!1)}function Hne(n,e){const t=nn(n);t.Ea.has(e.targetId)||(t.Ea.set(e.targetId,e),v5(t)?y5(t):n_(t).O_()&&m5(t,e))}function g5(n,e){const t=nn(n),i=n_(t);t.Ea.delete(e),i.O_()&&zne(t,e),t.Ea.size===0&&(i.O_()?i.L_():u0(t)&&t.Va.set("Unknown"))}function m5(n,e){if(n.da.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Qt.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}n_(n).Z_(e)}function zne(n,e){n.da.$e(e),n_(n).X_(e)}function y5(n){n.da=new XMe({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),At:e=>n.Ea.get(e)||null,ht:()=>n.datastore.serializer.databaseId}),n_(n).start(),n.Va.ua()}function v5(n){return u0(n)&&!n_(n).x_()&&n.Ea.size>0}function u0(n){return nn(n).Ia.size===0}function Gne(n){n.da=void 0}async function nUe(n){n.Va.set("Online")}async function iUe(n){n.Ea.forEach(((e,t)=>{m5(n,e)}))}async function rUe(n,e){Gne(n),v5(n)?(n.Va.ha(e),y5(n)):n.Va.set("Unknown")}async function sUe(n,e,t){if(n.Va.set("Online"),e instanceof Dne&&e.state===2&&e.cause)try{await(async function(r,s){const a=s.cause;for(const o of s.targetIds)r.Ea.has(o)&&(await r.remoteSyncer.rejectListen(o,a),r.Ea.delete(o),r.da.removeTarget(o))})(n,e)}catch(i){Ct(Xm,"Failed to remove targets %s: %s ",e.targetIds.join(","),i),await wC(n,i)}else if(e instanceof iD?n.da.Xe(e):e instanceof Sne?n.da.st(e):n.da.tt(e),!t.isEqual(Qt.min()))try{const i=await Bne(n.localStore);t.compareTo(i)>=0&&await(function(s,a){const o=s.da.Tt(a);return o.targetChanges.forEach(((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const h=s.Ea.get(c);h&&s.Ea.set(c,h.withResumeToken(l.resumeToken,a))}})),o.targetMismatches.forEach(((l,c)=>{const h=s.Ea.get(l);if(!h)return;s.Ea.set(l,h.withResumeToken(is.EMPTY_BYTE_STRING,h.snapshotVersion)),zne(s,l);const f=new $f(h.target,l,c,h.sequenceNumber);m5(s,f)})),s.remoteSyncer.applyRemoteEvent(o)})(n,t)}catch(i){Ct(Xm,"Failed to raise snapshot:",i),await wC(n,i)}}async function wC(n,e,t){if(!t_(e))throw e;n.Ia.add(1),await vE(n),n.Va.set("Offline"),t||(t=()=>Bne(n.localStore)),n.asyncQueue.enqueueRetryable((async()=>{Ct(Xm,"Retrying IndexedDB access"),await t(),n.Ia.delete(1),await pR(n)}))}function qne(n,e){return e().catch((t=>wC(n,t,e)))}async function gR(n){const e=nn(n),t=fp(e);let i=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:e5;for(;aUe(e);)try{const r=await VFe(e.localStore,i);if(r===null){e.Ta.length===0&&t.L_();break}i=r.batchId,oUe(e,r)}catch(r){await wC(e,r)}$ne(e)&&jne(e)}function aUe(n){return u0(n)&&n.Ta.length<10}function oUe(n,e){n.Ta.push(e);const t=fp(n);t.O_()&&t.Y_&&t.ea(e.mutations)}function $ne(n){return u0(n)&&!fp(n).x_()&&n.Ta.length>0}function jne(n){fp(n).start()}async function lUe(n){fp(n).ra()}async function cUe(n){const e=fp(n);for(const t of n.Ta)e.ea(t.mutations)}async function uUe(n,e,t){const i=n.Ta.shift(),r=l5.from(i,e,t);await qne(n,(()=>n.remoteSyncer.applySuccessfulWrite(r))),await gR(n)}async function hUe(n,e){e&&fp(n).Y_&&await(async function(i,r){if((function(a){return qMe(a)&&a!==at.ABORTED})(r.code)){const s=i.Ta.shift();fp(i).B_(),await qne(i,(()=>i.remoteSyncer.rejectFailedWrite(s.batchId,r))),await gR(i)}})(n,e),$ne(n)&&jne(n)}async function Sq(n,e){const t=nn(n);t.asyncQueue.verifyOperationInProgress(),Ct(Xm,"RemoteStore received new credentials");const i=u0(t);t.Ia.add(3),await vE(t),i&&t.Va.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.Ia.delete(3),await pR(t)}async function dUe(n,e){const t=nn(n);e?(t.Ia.delete(2),await pR(t)):e||(t.Ia.add(2),await vE(t),t.Va.set("Unknown"))}function n_(n){return n.ma||(n.ma=(function(t,i,r){const s=nn(t);return s.sa(),new KFe(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,r)})(n.datastore,n.asyncQueue,{Zo:nUe.bind(null,n),Yo:iUe.bind(null,n),t_:rUe.bind(null,n),H_:sUe.bind(null,n)}),n.Ra.push((async e=>{e?(n.ma.B_(),v5(n)?y5(n):n.Va.set("Unknown")):(await n.ma.stop(),Gne(n))}))),n.ma}function fp(n){return n.fa||(n.fa=(function(t,i,r){const s=nn(t);return s.sa(),new YFe(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,r)})(n.datastore,n.asyncQueue,{Zo:()=>Promise.resolve(),Yo:lUe.bind(null,n),t_:hUe.bind(null,n),ta:cUe.bind(null,n),na:uUe.bind(null,n)}),n.Ra.push((async e=>{e?(n.fa.B_(),await gR(n)):(await n.fa.stop(),n.Ta.length>0&&(Ct(Xm,`Stopping write stream with ${n.Ta.length} pending writes`),n.Ta=[]))}))),n.fa}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class _5{constructor(e,t,i,r,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=i,this.op=r,this.removalCallback=s,this.deferred=new Nh,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((a=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,t,i,r,s){const a=Date.now()+i,o=new _5(e,t,a,r,s);return o.start(i),o}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Dt(at.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function x5(n,e){if(Gh("AsyncQueue",`${e}: ${n}`),t_(n))return new Dt(at.UNAVAILABLE,`${e}: ${n}`);throw n}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class qy{static emptySet(e){return new qy(e.comparator)}constructor(e){this.comparator=e?(t,i)=>e(t,i)||Vt.comparator(t.key,i.key):(t,i)=>Vt.comparator(t.key,i.key),this.keyedMap=Kx(),this.sortedSet=new Wi(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((t,i)=>(e(t),!1)))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof qy)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),i=e.sortedSet.getIterator();for(;t.hasNext();){const r=t.getNext().key,s=i.getNext().key;if(!r.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),e.length===0?"DocumentSet ()":`DocumentSet (
  `+e.join(`  
`)+`
)`}copy(e,t){const i=new qy;return i.comparator=this.comparator,i.keyedMap=e,i.sortedSet=t,i}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Dq{constructor(){this.ga=new Wi(Vt.comparator)}track(e){const t=e.doc.key,i=this.ga.get(t);i?e.type!==0&&i.type===3?this.ga=this.ga.insert(t,e):e.type===3&&i.type!==1?this.ga=this.ga.insert(t,{type:i.type,doc:e.doc}):e.type===2&&i.type===2?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):e.type===2&&i.type===0?this.ga=this.ga.insert(t,{type:0,doc:e.doc}):e.type===1&&i.type===0?this.ga=this.ga.remove(t):e.type===1&&i.type===2?this.ga=this.ga.insert(t,{type:1,doc:i.doc}):e.type===0&&i.type===1?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):Xt(63341,{Vt:e,pa:i}):this.ga=this.ga.insert(t,e)}ya(){const e=[];return this.ga.inorderTraversal(((t,i)=>{e.push(i)})),e}}class M1{constructor(e,t,i,r,s,a,o,l,c){this.query=e,this.docs=t,this.oldDocs=i,this.docChanges=r,this.mutatedKeys=s,this.fromCache=a,this.syncStateChanged=o,this.excludesMetadataChanges=l,this.hasCachedResults=c}static fromInitialDocuments(e,t,i,r,s){const a=[];return t.forEach((o=>{a.push({type:0,doc:o})})),new M1(e,t,qy.emptySet(t),a,i,r,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&lR(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,i=e.docChanges;if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(t[r].type!==i[r].type||!t[r].doc.isEqual(i[r].doc))return!1;return!0}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class fUe{constructor(){this.wa=void 0,this.Sa=[]}ba(){return this.Sa.some((e=>e.Da()))}}class pUe{constructor(){this.queries=Cq(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(t,i){const r=nn(t),s=r.queries;r.queries=Cq(),s.forEach(((a,o)=>{for(const l of o.Sa)l.onError(i)}))})(this,new Dt(at.ABORTED,"Firestore shutting down"))}}function Cq(){return new l0((n=>fne(n)),lR)}async function Xne(n,e){const t=nn(n);let i=3;const r=e.query;let s=t.queries.get(r);s?!s.ba()&&e.Da()&&(i=2):(s=new fUe,i=e.Da()?0:1);try{switch(i){case 0:s.wa=await t.onListen(r,!0);break;case 1:s.wa=await t.onListen(r,!1);break;case 2:await t.onFirstRemoteStoreListen(r)}}catch(a){const o=x5(a,`Initialization of query '${py(e.query)}' failed`);return void e.onError(o)}t.queries.set(r,s),s.Sa.push(e),e.va(t.onlineState),s.wa&&e.Fa(s.wa)&&b5(t)}async function Kne(n,e){const t=nn(n),i=e.query;let r=3;const s=t.queries.get(i);if(s){const a=s.Sa.indexOf(e);a>=0&&(s.Sa.splice(a,1),s.Sa.length===0?r=e.Da()?0:1:!s.ba()&&e.Da()&&(r=2))}switch(r){case 0:return t.queries.delete(i),t.onUnlisten(i,!0);case 1:return t.queries.delete(i),t.onUnlisten(i,!1);case 2:return t.onLastRemoteStoreUnlisten(i);default:return}}function gUe(n,e){const t=nn(n);let i=!1;for(const r of e){const s=r.query,a=t.queries.get(s);if(a){for(const o of a.Sa)o.Fa(r)&&(i=!0);a.wa=r}}i&&b5(t)}function mUe(n,e,t){const i=nn(n),r=i.queries.get(e);if(r)for(const s of r.Sa)s.onError(t);i.queries.delete(e)}function b5(n){n.Ca.forEach((e=>{e.next()}))}var TP,Iq;(Iq=TP||(TP={})).Ma="default",Iq.Cache="cache";class Yne{constructor(e,t,i){this.query=e,this.xa=t,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=i||{}}Fa(e){if(!this.options.includeMetadataChanges){const i=[];for(const r of e.docChanges)r.type!==3&&i.push(r);e=new M1(e.query,e.docs,e.oldDocs,i,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),t=!0):this.La(e,this.onlineState)&&(this.ka(e),t=!0),this.Na=e,t}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let t=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),t=!0),t}La(e,t){if(!e.fromCache||!this.Da())return!0;const i=t!=="Offline";return(!this.options.qa||!i)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const t=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}ka(e){e=M1.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==TP.Cache}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class Jne{constructor(e){this.key=e}}class Qne{constructor(e){this.key=e}}class yUe{constructor(e,t){this.query=e,this.Za=t,this.Xa=null,this.hasCachedResults=!1,this.current=!1,this.Ya=An(),this.mutatedKeys=An(),this.eu=pne(e),this.tu=new qy(this.eu)}get nu(){return this.Za}ru(e,t){const i=t?t.iu:new Dq,r=t?t.tu:this.tu;let s=t?t.mutatedKeys:this.mutatedKeys,a=r,o=!1;const l=this.query.limitType==="F"&&r.size===this.query.limit?r.last():null,c=this.query.limitType==="L"&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal(((h,f)=>{const p=r.get(h),y=cR(this.query,f)?f:null,x=!!p&&this.mutatedKeys.has(p.key),v=!!y&&(y.hasLocalMutations||this.mutatedKeys.has(y.key)&&y.hasCommittedMutations);let _=!1;p&&y?p.data.isEqual(y.data)?x!==v&&(i.track({type:3,doc:y}),_=!0):this.su(p,y)||(i.track({type:2,doc:y}),_=!0,(l&&this.eu(y,l)>0||c&&this.eu(y,c)<0)&&(o=!0)):!p&&y?(i.track({type:0,doc:y}),_=!0):p&&!y&&(i.track({type:1,doc:p}),_=!0,(l||c)&&(o=!0)),_&&(y?(a=a.add(y),s=v?s.add(h):s.delete(h)):(a=a.delete(h),s=s.delete(h)))})),this.query.limit!==null)for(;a.size>this.query.limit;){const h=this.query.limitType==="F"?a.last():a.first();a=a.delete(h.key),s=s.delete(h.key),i.track({type:1,doc:h})}return{tu:a,iu:i,bs:o,mutatedKeys:s}}su(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,i,r){const s=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const a=e.iu.ya();a.sort(((h,f)=>(function(y,x){const v=_=>{switch(_){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Xt(20277,{Vt:_})}};return v(y)-v(x)})(h.type,f.type)||this.eu(h.doc,f.doc))),this.ou(i),r=r??!1;const o=t&&!r?this._u():[],l=this.Ya.size===0&&this.current&&!r?1:0,c=l!==this.Xa;return this.Xa=l,a.length!==0||c?{snapshot:new M1(this.query,e.tu,s,a,e.mutatedKeys,l===0,c,!1,!!i&&i.resumeToken.approximateByteSize()>0),au:o}:{au:o}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new Dq,mutatedKeys:this.mutatedKeys,bs:!1},!1)):{au:[]}}uu(e){return!this.Za.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((t=>this.Za=this.Za.add(t))),e.modifiedDocuments.forEach((t=>{})),e.removedDocuments.forEach((t=>this.Za=this.Za.delete(t))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Ya;this.Ya=An(),this.tu.forEach((i=>{this.uu(i.key)&&(this.Ya=this.Ya.add(i.key))}));const t=[];return e.forEach((i=>{this.Ya.has(i)||t.push(new Qne(i))})),this.Ya.forEach((i=>{e.has(i)||t.push(new Jne(i))})),t}cu(e){this.Za=e.ks,this.Ya=An();const t=this.ru(e.documents);return this.applyChanges(t,!0)}lu(){return M1.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Xa===0,this.hasCachedResults)}}const T5="SyncEngine";class vUe{constructor(e,t,i){this.query=e,this.targetId=t,this.view=i}}class _Ue{constructor(e){this.key=e,this.hu=!1}}class xUe{constructor(e,t,i,r,s,a){this.localStore=e,this.remoteStore=t,this.eventManager=i,this.sharedClientState=r,this.currentUser=s,this.maxConcurrentLimboResolutions=a,this.Pu={},this.Tu=new l0((o=>fne(o)),lR),this.Eu=new Map,this.Iu=new Set,this.Ru=new Wi(Vt.comparator),this.Au=new Map,this.Vu=new h5,this.du={},this.mu=new Map,this.fu=k1.ar(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function bUe(n,e,t=!0){const i=rie(n);let r;const s=i.Tu.get(e);return s?(i.sharedClientState.addLocalQueryTarget(s.targetId),r=s.view.lu()):r=await Zne(i,e,t,!0),r}async function TUe(n,e){const t=rie(n);await Zne(t,e,!0,!1)}async function Zne(n,e,t,i){const r=await WFe(n.localStore,au(e)),s=r.targetId,a=n.sharedClientState.addLocalQueryTarget(s,t);let o;return i&&(o=await EUe(n,e,s,a==="current",r.resumeToken)),n.isPrimaryClient&&t&&Hne(n.remoteStore,r),o}async function EUe(n,e,t,i,r){n.pu=(f,p,y)=>(async function(v,_,E,w){let A=_.view.ru(E);A.bs&&(A=await bq(v.localStore,_.query,!1).then((({documents:C})=>_.view.ru(C,A))));const N=w&&w.targetChanges.get(_.targetId),k=w&&w.targetMismatches.get(_.targetId)!=null,F=_.view.applyChanges(A,v.isPrimaryClient,N,k);return Nq(v,_.targetId,F.au),F.snapshot})(n,f,p,y);const s=await bq(n.localStore,e,!0),a=new yUe(e,s.ks),o=a.ru(s.documents),l=yE.createSynthesizedTargetChangeForCurrentChange(t,i&&n.onlineState!=="Offline",r),c=a.applyChanges(o,n.isPrimaryClient,l);Nq(n,t,c.au);const h=new vUe(e,t,a);return n.Tu.set(e,h),n.Eu.has(t)?n.Eu.get(t).push(e):n.Eu.set(t,[e]),c.snapshot}async function wUe(n,e,t){const i=nn(n),r=i.Tu.get(e),s=i.Eu.get(r.targetId);if(s.length>1)return i.Eu.set(r.targetId,s.filter((a=>!lR(a,e)))),void i.Tu.delete(e);i.isPrimaryClient?(i.sharedClientState.removeLocalQueryTarget(r.targetId),i.sharedClientState.isActiveQueryTarget(r.targetId)||await xP(i.localStore,r.targetId,!1).then((()=>{i.sharedClientState.clearQueryState(r.targetId),t&&g5(i.remoteStore,r.targetId),EP(i,r.targetId)})).catch(e_)):(EP(i,r.targetId),await xP(i.localStore,r.targetId,!0))}async function AUe(n,e){const t=nn(n),i=t.Tu.get(e),r=t.Eu.get(i.targetId);t.isPrimaryClient&&r.length===1&&(t.sharedClientState.removeLocalQueryTarget(i.targetId),g5(t.remoteStore,i.targetId))}async function SUe(n,e,t){const i=MUe(n);try{const r=await(function(a,o){const l=nn(a),c=Ti.now(),h=o.reduce(((y,x)=>y.add(x.key)),An());let f,p;return l.persistence.runTransaction("Locally write mutations","readwrite",(y=>{let x=qh(),v=An();return l.xs.getEntries(y,h).next((_=>{x=_,x.forEach(((E,w)=>{w.isValidDocument()||(v=v.add(E))}))})).next((()=>l.localDocuments.getOverlayedDocuments(y,x))).next((_=>{f=_;const E=[];for(const w of o){const A=VMe(w,f.get(w.key).overlayedDocument);A!=null&&E.push(new c0(w.key,A,sne(A.value.mapValue),ou.exists(!0)))}return l.mutationQueue.addMutationBatch(y,c,E,o)})).next((_=>{p=_;const E=_.applyToLocalDocumentSet(f,v);return l.documentOverlayCache.saveOverlays(y,_.batchId,E)}))})).then((()=>({batchId:p.batchId,changes:mne(f)})))})(i.localStore,e);i.sharedClientState.addPendingMutation(r.batchId),(function(a,o,l){let c=a.du[a.currentUser.toKey()];c||(c=new Wi(wn)),c=c.insert(o,l),a.du[a.currentUser.toKey()]=c})(i,r.batchId,t),await _E(i,r.changes),await gR(i.remoteStore)}catch(r){const s=x5(r,"Failed to persist write");t.reject(s)}}async function eie(n,e){const t=nn(n);try{const i=await OFe(t.localStore,e);e.targetChanges.forEach(((r,s)=>{const a=t.Au.get(s);a&&(zn(r.addedDocuments.size+r.modifiedDocuments.size+r.removedDocuments.size<=1,22616),r.addedDocuments.size>0?a.hu=!0:r.modifiedDocuments.size>0?zn(a.hu,14607):r.removedDocuments.size>0&&(zn(a.hu,42227),a.hu=!1))})),await _E(t,i,e)}catch(i){await e_(i)}}function Rq(n,e,t){const i=nn(n);if(i.isPrimaryClient&&t===0||!i.isPrimaryClient&&t===1){const r=[];i.Tu.forEach(((s,a)=>{const o=a.view.va(e);o.snapshot&&r.push(o.snapshot)})),(function(a,o){const l=nn(a);l.onlineState=o;let c=!1;l.queries.forEach(((h,f)=>{for(const p of f.Sa)p.va(o)&&(c=!0)})),c&&b5(l)})(i.eventManager,e),r.length&&i.Pu.H_(r),i.onlineState=e,i.isPrimaryClient&&i.sharedClientState.setOnlineState(e)}}async function DUe(n,e,t){const i=nn(n);i.sharedClientState.updateQueryState(e,"rejected",t);const r=i.Au.get(e),s=r&&r.key;if(s){let a=new Wi(Vt.comparator);a=a.insert(s,zs.newNoDocument(s,Qt.min()));const o=An().add(s),l=new dR(Qt.min(),new Map,new Wi(wn),a,o);await eie(i,l),i.Ru=i.Ru.remove(s),i.Au.delete(e),E5(i)}else await xP(i.localStore,e,!1).then((()=>EP(i,e,t))).catch(e_)}async function CUe(n,e){const t=nn(n),i=e.batch.batchId;try{const r=await LFe(t.localStore,e);nie(t,i,null),tie(t,i),t.sharedClientState.updateMutationState(i,"acknowledged"),await _E(t,r)}catch(r){await e_(r)}}async function IUe(n,e,t){const i=nn(n);try{const r=await(function(a,o){const l=nn(a);return l.persistence.runTransaction("Reject batch","readwrite-primary",(c=>{let h;return l.mutationQueue.lookupMutationBatch(c,o).next((f=>(zn(f!==null,37113),h=f.keys(),l.mutationQueue.removeMutationBatch(c,f)))).next((()=>l.mutationQueue.performConsistencyCheck(c))).next((()=>l.documentOverlayCache.removeOverlaysForBatchId(c,h,o))).next((()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,h))).next((()=>l.localDocuments.getDocuments(c,h)))}))})(i.localStore,e);nie(i,e,t),tie(i,e),i.sharedClientState.updateMutationState(e,"rejected",t),await _E(i,r)}catch(r){await e_(r)}}function tie(n,e){(n.mu.get(e)||[]).forEach((t=>{t.resolve()})),n.mu.delete(e)}function nie(n,e,t){const i=nn(n);let r=i.du[i.currentUser.toKey()];if(r){const s=r.get(e);s&&(t?s.reject(t):s.resolve(),r=r.remove(e)),i.du[i.currentUser.toKey()]=r}}function EP(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const i of n.Eu.get(e))n.Tu.delete(i),t&&n.Pu.yu(i,t);n.Eu.delete(e),n.isPrimaryClient&&n.Vu.Gr(e).forEach((i=>{n.Vu.containsKey(i)||iie(n,i)}))}function iie(n,e){n.Iu.delete(e.path.canonicalString());const t=n.Ru.get(e);t!==null&&(g5(n.remoteStore,t),n.Ru=n.Ru.remove(e),n.Au.delete(t),E5(n))}function Nq(n,e,t){for(const i of t)i instanceof Jne?(n.Vu.addReference(i.key,e),RUe(n,i)):i instanceof Qne?(Ct(T5,"Document no longer in limbo: "+i.key),n.Vu.removeReference(i.key,e),n.Vu.containsKey(i.key)||iie(n,i.key)):Xt(19791,{wu:i})}function RUe(n,e){const t=e.key,i=t.path.canonicalString();n.Ru.get(t)||n.Iu.has(i)||(Ct(T5,"New document in limbo: "+t),n.Iu.add(i),E5(n))}function E5(n){for(;n.Iu.size>0&&n.Ru.size<n.maxConcurrentLimboResolutions;){const e=n.Iu.values().next().value;n.Iu.delete(e);const t=new Vt(bi.fromString(e)),i=n.fu.next();n.Au.set(i,new _Ue(t)),n.Ru=n.Ru.insert(t,i),Hne(n.remoteStore,new $f(au(s5(t.path)),i,"TargetPurposeLimboResolution",sR.ce))}}async function _E(n,e,t){const i=nn(n),r=[],s=[],a=[];i.Tu.isEmpty()||(i.Tu.forEach(((o,l)=>{a.push(i.pu(l,e,t).then((c=>{var h;if((c||t)&&i.isPrimaryClient){const f=c?!c.fromCache:(h=t==null?void 0:t.targetChanges.get(l.targetId))==null?void 0:h.current;i.sharedClientState.updateQueryState(l.targetId,f?"current":"not-current")}if(c){r.push(c);const f=f5.Is(l.targetId,c);s.push(f)}})))})),await Promise.all(a),i.Pu.H_(r),await(async function(l,c){const h=nn(l);try{await h.persistence.runTransaction("notifyLocalViewChanges","readwrite",(f=>ot.forEach(c,(p=>ot.forEach(p.Ts,(y=>h.persistence.referenceDelegate.addReference(f,p.targetId,y))).next((()=>ot.forEach(p.Es,(y=>h.persistence.referenceDelegate.removeReference(f,p.targetId,y)))))))))}catch(f){if(!t_(f))throw f;Ct(p5,"Failed to update sequence numbers: "+f)}for(const f of c){const p=f.targetId;if(!f.fromCache){const y=h.vs.get(p),x=y.snapshotVersion,v=y.withLastLimboFreeSnapshotVersion(x);h.vs=h.vs.insert(p,v)}}})(i.localStore,s))}async function NUe(n,e){const t=nn(n);if(!t.currentUser.isEqual(e)){Ct(T5,"User change. New user:",e.toKey());const i=await One(t.localStore,e);t.currentUser=e,(function(s,a){s.mu.forEach((o=>{o.forEach((l=>{l.reject(new Dt(at.CANCELLED,a))}))})),s.mu.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,i.removedBatchIds,i.addedBatchIds),await _E(t,i.Ns)}}function kUe(n,e){const t=nn(n),i=t.Au.get(e);if(i&&i.hu)return An().add(i.key);{let r=An();const s=t.Eu.get(e);if(!s)return r;for(const a of s){const o=t.Tu.get(a);r=r.unionWith(o.view.nu)}return r}}function rie(n){const e=nn(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=eie.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=kUe.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=DUe.bind(null,e),e.Pu.H_=gUe.bind(null,e.eventManager),e.Pu.yu=mUe.bind(null,e.eventManager),e}function MUe(n){const e=nn(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=CUe.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=IUe.bind(null,e),e}class AC{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=fR(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){return PFe(this.persistence,new MFe,e.initialUser,this.serializer)}Cu(e){return new Lne(d5.Vi,this.serializer)}Du(e){return new zFe}async terminate(){var e,t;(e=this.gcScheduler)==null||e.stop(),(t=this.indexBackfillerScheduler)==null||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}AC.provider={build:()=>new AC};class FUe extends AC{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){zn(this.persistence.referenceDelegate instanceof EC,46915);const i=this.persistence.referenceDelegate.garbageCollector;return new vFe(i,e.asyncQueue,t)}Cu(e){const t=this.cacheSizeBytes!==void 0?Ma.withCacheSize(this.cacheSizeBytes):Ma.DEFAULT;return new Lne((i=>EC.Vi(i,t)),this.serializer)}}class wP{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>Rq(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=NUe.bind(null,this.syncEngine),await dUe(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new pUe})()}createDatastore(e){const t=fR(e.databaseInfo.databaseId),i=XFe(e.databaseInfo);return ZFe(e.authCredentials,e.appCheckCredentials,i,t)}createRemoteStore(e){return(function(i,r,s,a,o){return new tUe(i,r,s,a,o)})(this.localStore,this.datastore,e.asyncQueue,(t=>Rq(this.syncEngine,t,0)),(function(){return wq.v()?new wq:new GFe})())}createSyncEngine(e,t){return(function(r,s,a,o,l,c,h){const f=new xUe(r,s,a,o,l,c);return h&&(f.gu=!0),f})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await(async function(r){const s=nn(r);Ct(Xm,"RemoteStore shutting down."),s.Ia.add(5),await vE(s),s.Aa.shutdown(),s.Va.set("Unknown")})(this.remoteStore),(e=this.datastore)==null||e.terminate(),(t=this.eventManager)==null||t.terminate()}}wP.provider={build:()=>new wP};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sie{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):Gh("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,t){setTimeout((()=>{this.muted||e(t)}),0)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const pp="FirestoreClient";class UUe{constructor(e,t,i,r,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=i,this._databaseInfo=r,this.user=Hs.UNAUTHENTICATED,this.clientId=iR.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(i,(async a=>{Ct(pp,"Received user=",a.uid),await this.authCredentialListener(a),this.user=a})),this.appCheckCredentials.start(i,(a=>(Ct(pp,"Received new app check token=",a),this.appCheckCredentialListener(a,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Nh;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const i=x5(t,"Failed to shutdown persistence");e.reject(i)}})),e.promise}}async function SM(n,e){n.asyncQueue.verifyOperationInProgress(),Ct(pp,"Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let i=t.initialUser;n.setCredentialChangeListener((async r=>{i.isEqual(r)||(await One(e.localStore,r),i=r)})),e.persistence.setDatabaseDeletedListener((()=>n.terminate())),n._offlineComponents=e}async function kq(n,e){n.asyncQueue.verifyOperationInProgress();const t=await PUe(n);Ct(pp,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener((i=>Sq(e.remoteStore,i))),n.setAppCheckTokenChangeListener(((i,r)=>Sq(e.remoteStore,r))),n._onlineComponents=e}async function PUe(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){Ct(pp,"Using user provided OfflineComponentProvider");try{await SM(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!(function(r){return r.name==="FirebaseError"?r.code===at.FAILED_PRECONDITION||r.code===at.UNIMPLEMENTED:!(typeof DOMException<"u"&&r instanceof DOMException)||r.code===22||r.code===20||r.code===11})(t))throw t;op("Error using user provided cache. Falling back to memory cache: "+t),await SM(n,new AC)}}else Ct(pp,"Using default OfflineComponentProvider"),await SM(n,new FUe(void 0));return n._offlineComponents}async function aie(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(Ct(pp,"Using user provided OnlineComponentProvider"),await kq(n,n._uninitializedComponentsProvider._online)):(Ct(pp,"Using default OnlineComponentProvider"),await kq(n,new wP))),n._onlineComponents}function LUe(n){return aie(n).then((e=>e.syncEngine))}async function oie(n){const e=await aie(n),t=e.eventManager;return t.onListen=bUe.bind(null,e.syncEngine),t.onUnlisten=wUe.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=TUe.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=AUe.bind(null,e.syncEngine),t}function OUe(n,e,t={}){const i=new Nh;return n.asyncQueue.enqueueAndForget((async()=>(function(s,a,o,l,c){const h=new sie({next:p=>{h.Nu(),a.enqueueAndForget((()=>Kne(s,f)));const y=p.docs.has(o);!y&&p.fromCache?c.reject(new Dt(at.UNAVAILABLE,"Failed to get document because the client is offline.")):y&&p.fromCache&&l&&l.source==="server"?c.reject(new Dt(at.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new Yne(s5(o.path),h,{includeMetadataChanges:!0,qa:!0});return Xne(s,f)})(await oie(n),n.asyncQueue,e,t,i))),i.promise}function BUe(n,e,t={}){const i=new Nh;return n.asyncQueue.enqueueAndForget((async()=>(function(s,a,o,l,c){const h=new sie({next:p=>{h.Nu(),a.enqueueAndForget((()=>Kne(s,f))),p.fromCache&&l.source==="server"?c.reject(new Dt(at.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new Yne(o,h,{includeMetadataChanges:!0,qa:!0});return Xne(s,f)})(await oie(n),n.asyncQueue,e,t,i))),i.promise}function VUe(n,e){const t=new Nh;return n.asyncQueue.enqueueAndForget((async()=>SUe(await LUe(n),e,t))),t.promise}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function lie(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const WUe="ComponentProvider",Mq=new Map;function HUe(n,e,t,i,r){return new cMe(n,e,t,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,lie(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,i)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const cie="firestore.googleapis.com",Fq=!0;class Uq{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new Dt(at.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=cie,this.ssl=Fq}else this.host=e.host,this.ssl=e.ssl??Fq;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=Pne;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<mFe)throw new Dt(at.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Xte("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=lie(e.experimentalLongPollingOptions??{}),(function(i){if(i.timeoutSeconds!==void 0){if(isNaN(i.timeoutSeconds))throw new Dt(at.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (must not be NaN)`);if(i.timeoutSeconds<5)throw new Dt(at.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (minimum allowed value is 5)`);if(i.timeoutSeconds>30)throw new Dt(at.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(i,r){return i.timeoutSeconds===r.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class mR{constructor(e,t,i,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=i,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Uq({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Dt(at.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Dt(at.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Uq(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(i){if(!i)return new $te;switch(i.type){case"firstParty":return new j3e(i.sessionIndex||"0",i.iamToken||null,i.authTokenFactory||null);case"provider":return i.client;default:throw new Dt(at.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(t){const i=Mq.get(t);i&&(Ct(WUe,"Removing Datastore"),Mq.delete(t),i.terminate())})(this),Promise.resolve()}}function uie(n,e,t,i={}){var c;n=lp(n,mR);const r=uE(e),s=n._getSettings(),a={...s,emulatorOptions:n._getEmulatorOptions()},o=`${e}:${t}`;r&&tte(`https://${o}`),s.host!==cie&&s.host!==o&&op("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const l={...s,host:o,ssl:r,emulatorOptions:i};if(!Gm(l,a)&&(n._setSettings(l),i.mockUserToken)){let h,f;if(typeof i.mockUserToken=="string")h=i.mockUserToken,f=Hs.MOCK_USER;else{h=gRe(i.mockUserToken,(c=n._app)==null?void 0:c.options.projectId);const p=i.mockUserToken.sub||i.mockUserToken.user_id;if(!p)throw new Dt(at.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");f=new Hs(p)}n._authCredentials=new G3e(new qte(h,f))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class h0{constructor(e,t,i){this.converter=t,this._query=i,this.type="query",this.firestore=e}withConverter(e){return new h0(this.firestore,e,this._query)}}class xr{constructor(e,t,i){this.converter=t,this._key=i,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new kh(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new xr(this.firestore,e,this._key)}toJSON(){return{type:xr._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,i){if(pE(t,xr._jsonSchema))return new xr(e,i||null,new Vt(bi.fromString(t.referencePath)))}}xr._jsonSchemaVersion="firestore/documentReference/1.0",xr._jsonSchema={type:_r("string",xr._jsonSchemaVersion),referencePath:_r("string")};class kh extends h0{constructor(e,t,i){super(e,t,s5(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new xr(this.firestore,null,new Vt(e))}withConverter(e){return new kh(this.firestore,e,this._path)}}function cg(n,e,...t){if(n=La(n),jte("collection","path",e),n instanceof mR){const i=bi.fromString(e,...t);return XG(i),new kh(n,null,i)}{if(!(n instanceof xr||n instanceof kh))throw new Dt(at.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(bi.fromString(e,...t));return XG(i),new kh(n.firestore,null,i)}}function yR(n,e,...t){if(n=La(n),arguments.length===1&&(e=iR.newId()),jte("doc","path",e),n instanceof mR){const i=bi.fromString(e,...t);return jG(i),new xr(n,null,new Vt(i))}{if(!(n instanceof xr||n instanceof kh))throw new Dt(at.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(bi.fromString(e,...t));return jG(i),new xr(n.firestore,n instanceof kh?n.converter:null,new Vt(i))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Pq="AsyncQueue";class Lq{constructor(e=Promise.resolve()){this.Yu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new Vne(this,"async_queue_retry"),this._c=()=>{const i=AM();i&&Ct(Pq,"Visibility state changed to "+i.visibilityState),this.M_.w_()},this.ac=e;const t=AM();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const t=AM();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise((()=>{}));const t=new Nh;return this.cc((()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Yu.push(e),this.lc())))}async lc(){if(this.Yu.length!==0){try{await this.Yu[0](),this.Yu.shift(),this.M_.reset()}catch(e){if(!t_(e))throw e;Ct(Pq,"Operation failed with retryable error: "+e)}this.Yu.length>0&&this.M_.p_((()=>this.lc()))}}cc(e){const t=this.ac.then((()=>(this.rc=!0,e().catch((i=>{throw this.nc=i,this.rc=!1,Gh("INTERNAL UNHANDLED ERROR: ",Oq(i)),i})).then((i=>(this.rc=!1,i))))));return this.ac=t,t}enqueueAfterDelay(e,t,i){this.uc(),this.oc.indexOf(e)>-1&&(t=0);const r=_5.createAndSchedule(this,e,t,i,(s=>this.hc(s)));return this.tc.push(r),r}uc(){this.nc&&Xt(47125,{Pc:Oq(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ec(e){for(const t of this.tc)if(t.timerId===e)return!0;return!1}Ic(e){return this.Tc().then((()=>{this.tc.sort(((t,i)=>t.targetTimeMs-i.targetTimeMs));for(const t of this.tc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Tc()}))}Rc(e){this.oc.push(e)}hc(e){const t=this.tc.indexOf(e);this.tc.splice(t,1)}}function Oq(n){let e=n.message||"";return n.stack&&(e=n.stack.includes(n.message)?n.stack:n.message+`
`+n.stack),e}class i_ extends mR{constructor(e,t,i,r){super(e,t,i,r),this.type="firestore",this._queue=new Lq,this._persistenceKey=(r==null?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Lq(e),this._firestoreClient=void 0,await e}}}function hie(n,e){const t=typeof n=="object"?n:ste(),i=typeof n=="string"?n:e||mC,r=HL(t,"firestore").getImmediate({identifier:i});if(!r._initialized){const s=fRe("firestore");s&&uie(r,...s)}return r}function vR(n){if(n._terminated)throw new Dt(at.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||zUe(n),n._firestoreClient}function zUe(n){var i,r,s,a;const e=n._freezeSettings(),t=HUe(n._databaseId,((i=n._app)==null?void 0:i.options.appId)||"",n._persistenceKey,(r=n._app)==null?void 0:r.options.apiKey,e);n._componentsProvider||(s=e.localCache)!=null&&s._offlineComponentProvider&&((a=e.localCache)!=null&&a._onlineComponentProvider)&&(n._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),n._firestoreClient=new UUe(n._authCredentials,n._appCheckCredentials,n._queue,t,n._componentsProvider&&(function(l){const c=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(c),_online:c}})(n._componentsProvider))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class To{constructor(e){this._byteString=e}static fromBase64String(e){try{return new To(is.fromBase64String(e))}catch(t){throw new Dt(at.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new To(is.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:To._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(pE(e,To._jsonSchema))return To.fromBase64String(e.bytes)}}To._jsonSchemaVersion="firestore/bytes/1.0",To._jsonSchema={type:_r("string",To._jsonSchemaVersion),bytes:_r("string")};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class w5{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new Dt(at.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Zr(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class A5{constructor(e){this._methodName=e}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sc{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Dt(at.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Dt(at.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return wn(this._lat,e._lat)||wn(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:sc._jsonSchemaVersion}}static fromJSON(e){if(pE(e,sc._jsonSchema))return new sc(e.latitude,e.longitude)}}sc._jsonSchemaVersion="firestore/geoPoint/1.0",sc._jsonSchema={type:_r("string",sc._jsonSchemaVersion),latitude:_r("number"),longitude:_r("number")};/**
 * @license
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class hl{constructor(e){this._values=(e||[]).map((t=>t))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(i,r){if(i.length!==r.length)return!1;for(let s=0;s<i.length;++s)if(i[s]!==r[s])return!1;return!0})(this._values,e._values)}toJSON(){return{type:hl._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(pE(e,hl._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((t=>typeof t=="number")))return new hl(e.vectorValues);throw new Dt(at.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}hl._jsonSchemaVersion="firestore/vectorValue/1.0",hl._jsonSchema={type:_r("string",hl._jsonSchemaVersion),vectorValues:_r("object")};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const GUe=/^__.*__$/;class qUe{constructor(e,t,i){this.data=e,this.fieldMask=t,this.fieldTransforms=i}toMutation(e,t){return this.fieldMask!==null?new c0(e,this.data,this.fieldMask,t,this.fieldTransforms):new mE(e,this.data,t,this.fieldTransforms)}}function die(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Xt(40011,{dataSource:n})}}class S5{constructor(e,t,i,r,s,a){this.settings=e,this.databaseId=t,this.serializer=i,this.ignoreUndefinedProperties=r,s===void 0&&this.Ac(),this.fieldTransforms=s||[],this.fieldMask=a||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}i(e){return new S5({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}dc(e){var r;const t=(r=this.path)==null?void 0:r.child(e),i=this.i({path:t,arrayElement:!1});return i.mc(e),i}fc(e){var r;const t=(r=this.path)==null?void 0:r.child(e),i=this.i({path:t,arrayElement:!1});return i.Ac(),i}gc(e){return this.i({path:void 0,arrayElement:!0})}yc(e){return SC(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((t=>e.isPrefixOf(t)))!==void 0||this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))!==void 0}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.mc(this.path.get(e))}mc(e){if(e.length===0)throw this.yc("Document fields must not be empty");if(die(this.dataSource)&&GUe.test(e))throw this.yc('Document fields cannot begin and end with "__"')}}class $Ue{constructor(e,t,i){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=i||fR(e)}A(e,t,i,r=!1){return new S5({dataSource:e,methodName:t,targetDoc:i,path:Zr.emptyPath(),arrayElement:!1,hasConverter:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function fie(n){const e=n._freezeSettings(),t=fR(n._databaseId);return new $Ue(n._databaseId,!!e.ignoreUndefinedProperties,t)}function jUe(n,e,t,i,r,s={}){const a=n.A(s.merge||s.mergeFields?2:0,e,t,r);mie("Data must be an object, but it was:",a,i);const o=pie(i,a);let l,c;if(s.merge)l=new Ql(a.fieldMask),c=a.fieldTransforms;else if(s.mergeFields){const h=[];for(const f of s.mergeFields){const p=_R(e,f,t);if(!a.contains(p))throw new Dt(at.INVALID_ARGUMENT,`Field '${p}' is specified in your field mask but missing from your input data.`);JUe(h,p)||h.push(p)}l=new Ql(h),c=a.fieldTransforms.filter((f=>l.covers(f.field)))}else l=null,c=a.fieldTransforms;return new qUe(new al(o),l,c)}function XUe(n,e,t,i=!1){return D5(t,n.A(i?4:3,e))}function D5(n,e){if(gie(n=La(n)))return mie("Unsupported field value:",e,n),pie(n,e);if(n instanceof A5)return(function(i,r){if(!die(r.dataSource))throw r.yc(`${i._methodName}() can only be used with update() and set()`);if(!r.path)throw r.yc(`${i._methodName}() is not currently supported inside arrays`);const s=i._toFieldTransform(r);s&&r.fieldTransforms.push(s)})(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.yc("Nested arrays are not supported");return(function(i,r){const s=[];let a=0;for(const o of i){let l=D5(o,r.gc(a));l==null&&(l={nullValue:"NULL_VALUE"}),s.push(l),a++}return{arrayValue:{values:s}}})(n,e)}return(function(i,r){if((i=La(i))===null)return{nullValue:"NULL_VALUE"};if(typeof i=="number")return FMe(r.serializer,i);if(typeof i=="boolean")return{booleanValue:i};if(typeof i=="string")return{stringValue:i};if(i instanceof Date){const s=Ti.fromDate(i);return{timestampValue:TC(r.serializer,s)}}if(i instanceof Ti){const s=new Ti(i.seconds,1e3*Math.floor(i.nanoseconds/1e3));return{timestampValue:TC(r.serializer,s)}}if(i instanceof sc)return{geoPointValue:{latitude:i.latitude,longitude:i.longitude}};if(i instanceof To)return{bytesValue:Cne(r.serializer,i._byteString)};if(i instanceof xr){const s=r.databaseId,a=i.firestore._databaseId;if(!a.isEqual(s))throw r.yc(`Document reference is for database ${a.projectId}/${a.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:u5(i.firestore._databaseId||r.databaseId,i._key.path)}}if(i instanceof hl)return(function(a,o){const l=a instanceof hl?a.toArray():a;return{mapValue:{fields:{[ine]:{stringValue:rne},[yC]:{arrayValue:{values:l.map((h=>{if(typeof h!="number")throw o.yc("VectorValues must only contain numeric values.");return a5(o.serializer,h)}))}}}}}})(i,r);if(Une(i))return i._toProto(r.serializer);throw r.yc(`Unsupported field value: ${rR(i)}`)})(n,e)}function pie(n,e){const t={};return Jte(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):o0(n,((i,r)=>{const s=D5(r,e.dc(i));s!=null&&(t[i]=s)})),{mapValue:{fields:t}}}function gie(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof Ti||n instanceof sc||n instanceof To||n instanceof xr||n instanceof A5||n instanceof hl||Une(n))}function mie(n,e,t){if(!gie(t)||!Kte(t)){const i=rR(t);throw i==="an object"?e.yc(n+" a custom object"):e.yc(n+" "+i)}}function _R(n,e,t){if((e=La(e))instanceof w5)return e._internalPath;if(typeof e=="string")return YUe(n,e);throw SC("Field path arguments must be of type string or ",n,!1,void 0,t)}const KUe=new RegExp("[~\\*/\\[\\]]");function YUe(n,e,t){if(e.search(KUe)>=0)throw SC(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new w5(...e.split("."))._internalPath}catch{throw SC(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function SC(n,e,t,i,r){const s=i&&!i.isEmpty(),a=r!==void 0;let o=`Function ${e}() called with invalid data`;t&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(s||a)&&(l+=" (found",s&&(l+=` in field ${i}`),a&&(l+=` in document ${r}`),l+=")"),new Dt(at.INVALID_ARGUMENT,o+n+l)}function JUe(n,e){return n.some((t=>t.isEqual(e)))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class yie{convertValue(e,t="none"){switch(dp(e)){case 0:return null;case 1:return e.booleanValue;case 2:return rr(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(hp(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Xt(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const i={};return o0(e,((r,s)=>{i[r]=this.convertValue(s,t)})),i}convertVectorValue(e){var i,r,s;const t=(s=(r=(i=e.fields)==null?void 0:i[yC].arrayValue)==null?void 0:r.values)==null?void 0:s.map((a=>rr(a.doubleValue)));return new hl(t)}convertGeoPoint(e){return new sc(rr(e.latitude),rr(e.longitude))}convertArray(e,t){return(e.values||[]).map((i=>this.convertValue(i,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const i=oR(e);return i==null?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(Vb(e));default:return null}}convertTimestamp(e){const t=up(e);return new Ti(t.seconds,t.nanos)}convertDocumentKey(e,t){const i=bi.fromString(e);zn(Fne(i),9688,{name:e});const r=new I1(i.get(1),i.get(3)),s=new Vt(i.popFirst(5));return r.isEqual(t)||Gh(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),s}}/**
 * @license
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class vie extends yie{constructor(e){super(),this.firestore=e}convertBytes(e){return new To(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new xr(this.firestore,null,t)}}const Bq="@firebase/firestore",Vq="4.13.0";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class _ie{constructor(e,t,i,r,s){this._firestore=e,this._userDataWriter=t,this._key=i,this._document=r,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new xr(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new QUe(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){var e;return((e=this._document)==null?void 0:e.data.clone().value.mapValue.fields)??void 0}get(e){if(this._document){const t=this._document.data.field(_R("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class QUe extends _ie{data(){return super.data()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ZUe(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new Dt(at.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class C5{}class xie extends C5{}function rD(n,e,...t){let i=[];e instanceof C5&&i.push(e),i=i.concat(t),(function(s){const a=s.filter((l=>l instanceof xR)).length,o=s.filter((l=>l instanceof xE)).length;if(a>1||a>0&&o>0)throw new Dt(at.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(i);for(const r of i)n=r._apply(n);return n}class xE extends xie{constructor(e,t,i){super(),this._field=e,this._op=t,this._value=i,this.type="where"}static _create(e,t,i){return new xE(e,t,i)}_apply(e){const t=this._parse(e);return bie(e._query,t),new h0(e.firestore,e.converter,pP(e._query,t))}_parse(e){const t=fie(e.firestore);return(function(s,a,o,l,c,h,f){let p;if(c.isKeyField()){if(h==="array-contains"||h==="array-contains-any")throw new Dt(at.INVALID_ARGUMENT,`Invalid Query. You can't perform '${h}' queries on documentId().`);if(h==="in"||h==="not-in"){Hq(f,h);const x=[];for(const v of f)x.push(Wq(l,s,v));p={arrayValue:{values:x}}}else p=Wq(l,s,f)}else h!=="in"&&h!=="not-in"&&h!=="array-contains-any"||Hq(f,h),p=XUe(o,a,f,h==="in"||h==="not-in");return vr.create(c,h,p)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function sD(n,e,t){const i=e,r=_R("where",n);return xE._create(r,i,t)}class xR extends C5{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new xR(e,t)}_parse(e){const t=this._queryConstraints.map((i=>i._parse(e))).filter((i=>i.getFilters().length>0));return t.length===1?t[0]:oc.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:((function(r,s){let a=r;const o=s.getFlattenedFilters();for(const l of o)bie(a,l),a=pP(a,l)})(e._query,t),new h0(e.firestore,e.converter,pP(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function Wq(n,e,t){if(typeof(t=La(t))=="string"){if(t==="")throw new Dt(at.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!dne(e)&&t.indexOf("/")!==-1)throw new Dt(at.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const i=e.path.child(bi.fromString(t));if(!Vt.isDocumentKey(i))throw new Dt(at.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${i}' is not because it has an odd number of segments (${i.length}).`);return nq(n,new Vt(i))}if(t instanceof xr)return nq(n,t._key);throw new Dt(at.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${rR(t)}.`)}function Hq(n,e){if(!Array.isArray(n)||n.length===0)throw new Dt(at.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function bie(n,e){const t=(function(r,s){for(const a of r)for(const o of a.getFlattenedFilters())if(s.indexOf(o.op)>=0)return o.op;return null})(n.filters,(function(r){switch(r){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(t!==null)throw t===e.op?new Dt(at.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Dt(at.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function ePe(n,e,t){let i;return i=n?n.toFirestore(e):e,i}class Sy{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Jf extends _ie{constructor(e,t,i,r,s,a){super(e,t,i,r,a),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new db(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const i=this._document.data.field(_R("DocumentSnapshot.get",e));if(i!==null)return this._userDataWriter.convertValue(i,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Dt(at.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Jf._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}Jf._jsonSchemaVersion="firestore/documentSnapshot/1.0",Jf._jsonSchema={type:_r("string",Jf._jsonSchemaVersion),bundleSource:_r("string","DocumentSnapshot"),bundleName:_r("string"),bundle:_r("string")};class db extends Jf{data(e={}){return super.data(e)}}class Pm{constructor(e,t,i,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new Sy(r.hasPendingWrites,r.fromCache),this.query=i}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach((i=>{e.call(t,new db(this._firestore,this._userDataWriter,i.key,i,new Sy(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Dt(at.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=(function(r,s){if(r._snapshot.oldDocs.isEmpty()){let a=0;return r._snapshot.docChanges.map((o=>{const l=new db(r._firestore,r._userDataWriter,o.doc.key,o.doc,new Sy(r._snapshot.mutatedKeys.has(o.doc.key),r._snapshot.fromCache),r.query.converter);return o.doc,{type:"added",doc:l,oldIndex:-1,newIndex:a++}}))}{let a=r._snapshot.oldDocs;return r._snapshot.docChanges.filter((o=>s||o.type!==3)).map((o=>{const l=new db(r._firestore,r._userDataWriter,o.doc.key,o.doc,new Sy(r._snapshot.mutatedKeys.has(o.doc.key),r._snapshot.fromCache),r.query.converter);let c=-1,h=-1;return o.type!==0&&(c=a.indexOf(o.doc.key),a=a.delete(o.doc.key)),o.type!==1&&(a=a.add(o.doc),h=a.indexOf(o.doc.key)),{type:tPe(o.type),doc:l,oldIndex:c,newIndex:h}}))}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Dt(at.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Pm._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=iR.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],i=[],r=[];return this.docs.forEach((s=>{s._document!==null&&(t.push(s._document),i.push(this._userDataWriter.convertObjectMap(s._document.data.value.mapValue.fields,"previous")),r.push(s.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function tPe(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Xt(61501,{type:n})}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */Pm._jsonSchemaVersion="firestore/querySnapshot/1.0",Pm._jsonSchema={type:_r("string",Pm._jsonSchemaVersion),bundleSource:_r("string","QuerySnapshot"),bundleName:_r("string"),bundle:_r("string")};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Tie(n){n=lp(n,xr);const e=lp(n.firestore,i_),t=vR(e);return OUe(t,n._key).then((i=>nPe(e,n,i)))}function aD(n){n=lp(n,h0);const e=lp(n.firestore,i_),t=vR(e),i=new vie(e);return ZUe(n._query),BUe(t,n._query).then((r=>new Pm(e,i,n,r)))}function Eie(n){return I5(lp(n.firestore,i_),[new o5(n._key,ou.none())])}function oD(n,e){const t=lp(n.firestore,i_),i=yR(n),r=ePe(n.converter,e),s=fie(n.firestore);return I5(t,[jUe(s,"addDoc",i._key,r,n.converter!==null,{}).toMutation(i._key,ou.exists(!1))]).then((()=>i))}function I5(n,e){const t=vR(n);return VUe(t,e)}function nPe(n,e,t){const i=t.docs.get(e._key),r=new vie(n);return new Jf(n,r,e._key,i,new Sy(t.hasPendingWrites,t.fromCache),e.converter)}(function(e,t=!0){z3e(J1),S1(new qm("firestore",((i,{instanceIdentifier:r,options:s})=>{const a=i.getProvider("app").getImmediate(),o=new i_(new q3e(i.getProvider("auth-internal")),new X3e(a,i.getProvider("app-check-internal")),uMe(a,r),a);return s={useFetchStreams:t,...s},o._setSettings(s),o}),"PUBLIC").setMultipleInstances(!0)),Kf(Bq,Vq,e),Kf(Bq,Vq,"esm2020")})();const iPe=Object.freeze(Object.defineProperty({__proto__:null,AbstractUserDataWriter:yie,Bytes:To,CollectionReference:kh,DocumentReference:xr,DocumentSnapshot:Jf,FieldPath:w5,FieldValue:A5,Firestore:i_,FirestoreError:Dt,GeoPoint:sc,Query:h0,QueryCompositeFilterConstraint:xR,QueryConstraint:xie,QueryDocumentSnapshot:db,QueryFieldFilterConstraint:xE,QuerySnapshot:Pm,SnapshotMetadata:Sy,Timestamp:Ti,VectorValue:hl,_AutoId:iR,_ByteString:is,_DatabaseId:I1,_DocumentKey:Vt,_EmptyAuthCredentialsProvider:$te,_FieldPath:Zr,_cast:lp,_logWarn:op,_validateIsNotUsedTogether:Xte,addDoc:oD,collection:cg,connectFirestoreEmulator:uie,deleteDoc:Eie,doc:yR,ensureFirestoreConfigured:vR,executeWrite:I5,getDoc:Tie,getDocs:aD,getFirestore:hie,query:rD,where:sD},Symbol.toStringTag,{value:"Module"})),rPe="gen-lang-client-0162309706",sPe="1:956268943067:web:2869b488736246f1289efe",aPe="AIzaSyD_7Cjjn9cKXnXqiWW5aaQxam_a3DkQrCw",oPe="gen-lang-client-0162309706.firebaseapp.com",lPe="ai-studio-169608c9-080c-48bb-9ad5-efb8816ffa8c",cPe="gen-lang-client-0162309706.firebasestorage.app",uPe="956268943067",hPe="",wie={projectId:rPe,appId:sPe,apiKey:aPe,authDomain:oPe,firestoreDatabaseId:lPe,storageBucket:cPe,messagingSenderId:uPe,measurementId:hPe},Aie=rte(wie),Wu=hie(Aie,wie.firestoreDatabaseId),R5=W3e(Aie),dPe=new Ah,fPe=async()=>{try{return(await Yke(R5,dPe)).user}catch(n){throw console.error("Error signing in with Google:",n),n}},pPe=async()=>{try{await Rke(R5)}catch(n){throw console.error("Error signing out:",n),n}};function hg(...n){return oK($X(n))}function gPe({subQuestions:n,onAnswer:e,disabled:t,result:i}){const[r,s]=Se.useState(i||{}),a=(l,c)=>{if(t)return;const h={...r,[l]:c};s(h)},o=n.every(l=>r[l.id]);return J.jsxs("div",{className:"space-y-4",children:[J.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-2 bg-gray-100 rounded-lg text-[10px] font-black uppercase tracking-widest text-gray-500",children:[J.jsx("div",{className:"col-span-8",children:"Nhận định"}),J.jsx("div",{className:"col-span-2 text-center",children:"Đúng"}),J.jsx("div",{className:"col-span-2 text-center",children:"Sai"})]}),n.map((l,c)=>J.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 bg-white border border-gray-100 rounded-xl items-center",children:[J.jsxs("div",{className:"col-span-8 text-sm font-medium text-gray-700",children:[J.jsxs("span",{className:"font-black text-emerald-600 mr-2",children:[String.fromCharCode(97+c),")"]}),l.content]}),J.jsx("div",{className:"col-span-2 flex justify-center",children:J.jsx("button",{disabled:t,onClick:()=>a(l.id,"true"),className:hg("w-8 h-8 rounded-full border-2 flex items-center justify-center transition-all",r[l.id]==="true"?t?l.answer==="true"?"bg-emerald-500 border-emerald-500 text-white":"bg-red-500 border-red-500 text-white":"bg-emerald-600 border-emerald-600 text-white":t&&l.answer==="true"?"border-emerald-200 text-emerald-200":"border-gray-200 hover:border-emerald-500"),children:r[l.id]==="true"?J.jsx(Hf,{className:"w-5 h-5"}):t&&l.answer==="true"?J.jsx(Hf,{className:"w-4 h-4"}):null})}),J.jsx("div",{className:"col-span-2 flex justify-center",children:J.jsx("button",{disabled:t,onClick:()=>a(l.id,"false"),className:hg("w-8 h-8 rounded-full border-2 flex items-center justify-center transition-all",r[l.id]==="false"?t?l.answer==="false"?"bg-emerald-500 border-emerald-500 text-white":"bg-red-500 border-red-500 text-white":"bg-red-600 border-red-600 text-white":t&&l.answer==="false"?"border-emerald-200 text-emerald-200":"border-gray-200 hover:border-red-500"),children:r[l.id]==="false"?J.jsx(Hf,{className:"w-5 h-5"}):t&&l.answer==="false"?J.jsx(Hf,{className:"w-4 h-4"}):null})})]},l.id)),!t&&J.jsxs("button",{disabled:!o,onClick:()=>e(r),className:"w-full py-4 bg-emerald-600 disabled:bg-gray-200 text-white font-black rounded-2xl shadow-xl shadow-emerald-100 hover:bg-emerald-700 transition-all flex items-center justify-center gap-2 mt-4",children:["Xác nhận câu trả lời",J.jsx(My,{className:"w-5 h-5"})]})]})}function mPe(){var re,q;const[n]=l$(),e=XC(),[t,i]=Se.useState([]),[r,s]=Se.useState(0),[a,o]=Se.useState([]),[l,c]=Se.useState(!1),[h,f]=Se.useState(!1),[p,y]=Se.useState(!0),[x,v]=Se.useState(null),[_,E]=Se.useState(null),[w,A]=Se.useState(null),[N,k]=Se.useState(null),[F,C]=Se.useState({id:"",name:"",className:""}),[M,R]=Se.useState(!1);Se.useEffect(()=>{(async()=>{const oe=new URLSearchParams(window.location.search),ue=new URLSearchParams(window.location.hash.split("?")[1]||""),ge=n.get("id")||oe.get("id")||ue.get("id"),j=n.get("data")||oe.get("data")||ue.get("data");if(ge){E(ge),y(!0);try{const G=yR(Wu,"quizzes",ge),Z=await Tie(G);if(Z.exists()){const te=Z.data();te.userId&&A(te.userId),te.level&&k(te.level),te.questions&&Array.isArray(te.questions)?i(te.questions):v("Dữ liệu bộ câu hỏi không hợp lệ.")}else v("Không tìm thấy bộ câu hỏi. Có thể link đã hết hạn hoặc bị xóa.")}catch(G){console.error("Error fetching quiz from Firestore:",G),v("Lỗi kết nối hệ thống. Vui lòng thử lại sau.")}finally{y(!1)}}else if(j){y(!0);try{const G=JSON.parse(atob(j));Array.isArray(G)?i(G):v("Dữ liệu câu hỏi không hợp lệ.")}catch(G){console.error("Error decoding quiz data:",G),v("Không thể tải bộ câu hỏi. Vui lòng kiểm tra lại đường dẫn.")}finally{y(!1)}}else v("Không tìm thấy dữ liệu câu hỏi."),y(!1)})()},[n]);const L=()=>{const X=a.filter(te=>te.isCorrect).length,oe=t.length,ue=X/oe*100;let ge="",j="";ue>=90?(ge="Xuất sắc",j="text-emerald-600"):ue>=75?(ge="Tốt",j="text-blue-600"):ue>=50?(ge="Khá",j="text-amber-600"):ue>=35?(ge="Trung bình",j="text-orange-600"):(ge="Cần cố gắng",j="text-red-600");const Z=["A","B","C"].map(te=>{const ie=t.filter(Ie=>Ie.level===te),_e=a.filter(Ie=>t[Ie.index].level===te&&Ie.isCorrect).length;return{level:te,total:ie.length,correct:_e,percentage:ie.length>0?_e/ie.length*100:0}});return{correctCount:X,total:oe,percentage:ue,grade:ge,color:j,levelStats:Z}};Se.useEffect(()=>{l&&_&&F.id&&Xae(async()=>{const{addDoc:X,collection:oe}=await Promise.resolve().then(()=>iPe);return{addDoc:X,collection:oe}},[],import.meta.url).then(({addDoc:X,collection:oe})=>{const ue=L();X(oe(Wu,"quiz_results"),{quizId:_,teacherId:w||"anonymous",studentId:F.id,studentName:F.name,className:F.className,quizLevel:N||"all",score:ue.correctCount,total:ue.total,percentage:ue.percentage,grade:ue.grade,submittedAt:new Date().toISOString()}).catch(ge=>console.error("Error saving result:",ge))})},[l,_,F,w,N]);const H=X=>{var ge;const oe=t[r];let ue=!1;oe.type==="true_false"&&typeof X=="object"?ue=((ge=oe.subQuestions)==null?void 0:ge.every(j=>X[j.id]===j.answer))||!1:typeof X=="string"&&(ue=X.trim().toLowerCase()===oe.answer.trim().toLowerCase()),o(j=>[...j,{index:r,isCorrect:ue,userAnswer:X}]),f(!0)},P=()=>{r<t.length-1?(s(X=>X+1),f(!1)):c(!0)},O=()=>{s(0),o([]),c(!1),f(!1)};if(x)return J.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-6",children:J.jsxs("div",{className:"bg-white p-8 rounded-3xl shadow-xl max-w-md w-full text-center space-y-4",children:[J.jsx(mD,{className:"w-16 h-16 text-red-500 mx-auto"}),J.jsx("h2",{className:"text-2xl font-black text-gray-900",children:"Lỗi nạp bài tập"}),J.jsx("p",{className:"text-gray-500",children:x}),J.jsx("button",{onClick:()=>e("/"),className:"w-full py-3 bg-gray-900 text-white font-bold rounded-xl",children:"Quay lại trang chủ"})]})});if(p)return J.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:J.jsxs("div",{className:"flex flex-col items-center gap-4",children:[J.jsx(bx,{className:"w-12 h-12 text-emerald-600 animate-spin"}),J.jsx("p",{className:"font-bold text-gray-400 uppercase tracking-widest text-xs",children:"Đang tải bài tập..."})]})});const B=l?L():null;return M?J.jsx("div",{className:"min-h-screen bg-[#FDFDFD] text-[#1A1A1A] font-sans selection:bg-emerald-100 p-6",children:J.jsx("div",{className:"max-w-3xl mx-auto space-y-8 py-8",children:l?B&&J.jsxs(Ic.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"bg-white p-12 rounded-[3rem] shadow-2xl border border-gray-100 text-center space-y-10",children:[J.jsxs("div",{className:"space-y-4",children:[J.jsxs("div",{className:"relative inline-block",children:[J.jsx("div",{className:"absolute inset-0 bg-emerald-100 rounded-full animate-ping opacity-20"}),J.jsx("div",{className:"relative bg-emerald-50 p-8 rounded-full",children:J.jsx(fge,{className:"w-16 h-16 text-emerald-600"})})]}),J.jsx("h2",{className:"text-4xl font-black text-gray-900",children:"Kết quả làm bài"}),J.jsxs("div",{className:hg("text-2xl font-black uppercase tracking-widest",B.color),children:["Xếp loại: ",B.grade]})]}),J.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[J.jsxs("div",{className:"p-6 bg-gray-50 rounded-3xl",children:[J.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-1",children:"Đúng"}),J.jsx("p",{className:"text-3xl font-black text-emerald-600",children:B.correctCount})]}),J.jsxs("div",{className:"p-6 bg-gray-50 rounded-3xl",children:[J.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-1",children:"Tổng số"}),J.jsx("p",{className:"text-3xl font-black text-gray-900",children:B.total})]}),J.jsxs("div",{className:"p-6 bg-gray-50 rounded-3xl",children:[J.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-1",children:"Tỷ lệ"}),J.jsxs("p",{className:"text-3xl font-black text-blue-600",children:[Math.round(B.percentage),"%"]})]}),J.jsxs("div",{className:"p-6 bg-gray-50 rounded-3xl",children:[J.jsx("p",{className:"text-[10px] font-black text-gray-400 uppercase tracking-widest mb-1",children:"Điểm số"}),J.jsx("p",{className:"text-3xl font-black text-purple-600",children:(B.percentage/10).toFixed(1)})]})]}),J.jsxs("div",{className:"space-y-6 text-left",children:[J.jsxs("h3",{className:"text-lg font-black text-gray-900 uppercase tracking-widest flex items-center gap-2",children:[J.jsx(mD,{className:"w-5 h-5 text-emerald-600"}),"Phân tích chi tiết & Nhận xét"]}),J.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:B.levelStats.map(X=>J.jsxs("div",{className:"p-4 rounded-2xl border border-gray-100 bg-gray-50/50 space-y-2",children:[J.jsxs("div",{className:"flex justify-between items-center",children:[J.jsxs("span",{className:"text-xs font-black text-gray-400",children:["MỨC ",X.level]}),J.jsxs("span",{className:hg("text-xs font-bold",X.percentage>=80?"text-emerald-600":X.percentage>=50?"text-amber-600":"text-red-600"),children:[X.correct,"/",X.total]})]}),J.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full overflow-hidden",children:J.jsx("div",{className:hg("h-full transition-all duration-1000",X.percentage>=80?"bg-emerald-500":X.percentage>=50?"bg-amber-500":"bg-red-500"),style:{width:`${X.percentage}%`}})})]},X.level))}),J.jsxs("div",{className:"p-8 bg-emerald-50 rounded-[2rem] border border-emerald-100 space-y-4",children:[J.jsx("h4",{className:"font-black text-emerald-800 uppercase text-xs tracking-widest",children:"Đánh giá sư phạm & Lời khuyên"}),J.jsxs("div",{className:"text-emerald-900 font-medium leading-relaxed space-y-4",children:[J.jsx("p",{children:B.percentage>=80?"Chúc mừng! Bạn đã nắm vững kiến thức trọng tâm của bài học.":B.percentage>=50?"Bạn đã đạt mức cơ bản, tuy nhiên vẫn còn một số lỗ hổng cần bù đắp.":"Kết quả cho thấy bạn đang gặp khó khăn trong việc tiếp cận nội dung này."}),J.jsxs("div",{className:"space-y-2",children:[B.levelStats.map(X=>X.percentage<70?J.jsxs("div",{className:"flex gap-2 items-start",children:[J.jsx("div",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-emerald-400 shrink-0"}),J.jsxs("p",{className:"text-sm",children:[X.level==="A"&&"Bạn cần xem lại các khái niệm cơ bản và định nghĩa (Mức A). Đây là nền tảng quan trọng.",X.level==="B"&&"Bạn cần rèn luyện thêm khả năng hiểu và vận dụng lý thuyết vào các tình huống cụ thể (Mức B).",X.level==="C"&&"Các câu hỏi vận dụng cao (Mức C) đang là thử thách với bạn. Hãy tập trung phân tích kỹ đề bài hơn."]})]},X.level):null),B.levelStats.every(X=>X.percentage>=70)&&J.jsxs("div",{className:"flex gap-2 items-start",children:[J.jsx("div",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-emerald-400 shrink-0"}),J.jsx("p",{className:"text-sm",children:"Bạn đã hoàn thành tốt cả 3 mức độ. Hãy tiếp tục duy trì phong độ này nhé!"})]})]})]})]})]}),J.jsx("div",{className:"flex flex-col gap-3",children:J.jsxs("button",{onClick:O,className:"w-full py-5 bg-emerald-600 text-white font-black rounded-2xl shadow-xl shadow-emerald-100 hover:bg-emerald-700 transition-colors flex items-center justify-center gap-2",children:[J.jsx(rj,{className:"w-5 h-5"}),"Làm lại bài tập"]})})]}):J.jsxs(J.Fragment,{children:[J.jsxs("div",{className:"flex items-center justify-between",children:[J.jsxs("div",{className:"flex items-center gap-4",children:[J.jsx("div",{className:"bg-emerald-600 p-2 rounded-xl",children:J.jsx(_y,{className:"text-white w-6 h-6"})}),J.jsxs("div",{children:[J.jsx("h2",{className:"text-xl font-black text-gray-900",children:"Học sinh làm bài"}),J.jsxs("p",{className:"text-xs font-bold text-emerald-600 uppercase tracking-widest",children:["Câu hỏi ",r+1," / ",t.length]})]})]}),J.jsx("div",{className:"w-32 h-2 bg-gray-100 rounded-full overflow-hidden",children:J.jsx("div",{className:"h-full bg-emerald-500 transition-all duration-500",style:{width:`${(r+1)/t.length*100}%`}})})]}),J.jsxs(Ic.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"bg-white p-10 rounded-[2.5rem] shadow-2xl border border-gray-100 space-y-8",children:[J.jsxs("div",{className:"space-y-4",children:[J.jsxs("div",{className:hg("inline-block px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest",t[r].level==="A"?"bg-blue-100 text-blue-600":t[r].level==="B"?"bg-emerald-100 text-emerald-600":"bg-amber-100 text-amber-600"),children:["Mức ",t[r].level]}),J.jsx("h3",{className:"text-2xl font-bold text-gray-900 leading-tight",children:t[r].content})]}),J.jsx("div",{className:"space-y-3",children:t[r].type==="multiple_choice"?(re=t[r].options)==null?void 0:re.map((X,oe)=>{var j;const ue=((j=a.find(G=>G.index===r))==null?void 0:j.userAnswer)===X,ge=X===t[r].answer;return J.jsxs("button",{disabled:h,onClick:()=>H(X),className:hg("w-full p-5 text-left rounded-2xl border-2 font-bold transition-all flex items-center justify-between group",h?ge?"border-emerald-500 bg-emerald-50 text-emerald-700":ue?"border-red-500 bg-red-50 text-red-700":"border-gray-100 text-gray-400":"border-gray-100 hover:border-emerald-500 hover:bg-emerald-50/30 text-gray-700"),children:[J.jsx("span",{children:X}),!h&&J.jsx(Mpe,{className:"w-5 h-5 opacity-0 group-hover:opacity-100 transition-opacity"}),h&&ge&&J.jsx(Ppe,{className:"w-5 h-5"}),h&&ue&&!ge&&J.jsx(yD,{className:"w-5 h-5"})]},oe)}):t[r].type==="true_false"?J.jsx(gPe,{subQuestions:t[r].subQuestions||[],onAnswer:H,disabled:h,result:(q=a.find(X=>X.index===r))==null?void 0:q.userAnswer}):J.jsxs("div",{className:"space-y-4",children:[J.jsx("input",{type:"text",disabled:h,placeholder:"Nhập câu trả lời của bạn...",onKeyDown:X=>{X.key==="Enter"&&!h&&H(X.target.value)},className:"w-full p-5 bg-gray-50 border-2 border-transparent focus:border-emerald-500 rounded-2xl outline-none font-bold"}),!h&&J.jsx("p",{className:"text-xs text-gray-400 text-center font-bold italic",children:"Nhấn Enter để gửi câu trả lời"})]})}),J.jsx(fF,{children:h&&J.jsxs(Ic.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"pt-8 border-t border-gray-100 space-y-6",children:[J.jsxs("div",{className:"flex gap-4",children:[J.jsx("div",{className:"bg-emerald-100 p-3 rounded-2xl h-fit",children:J.jsx(rge,{className:"w-6 h-6 text-emerald-600"})}),J.jsxs("div",{className:"space-y-3",children:[J.jsx("h4",{className:"font-black text-gray-900 uppercase text-xs tracking-widest",children:"Lời giải từ Giáo viên"}),J.jsx("p",{className:"text-gray-600 leading-relaxed font-medium",children:t[r].explanation}),J.jsx("div",{className:"p-4 bg-red-50 rounded-xl border border-red-100",children:J.jsxs("p",{className:"text-xs text-red-600 font-bold",children:[J.jsx("span",{className:"uppercase",children:"Lưu ý:"})," ",t[r].commonErrors]})})]})]}),J.jsxs("button",{onClick:P,className:"w-full py-4 bg-gray-900 text-white font-black rounded-2xl hover:bg-black transition-colors flex items-center justify-center gap-2",children:[r===t.length-1?"Xem kết quả":"Câu tiếp theo",J.jsx(My,{className:"w-5 h-5"})]})]})})]},r)]})})}):J.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-6",children:J.jsxs("div",{className:"bg-white p-8 rounded-3xl shadow-xl max-w-md w-full space-y-6",children:[J.jsxs("div",{className:"text-center space-y-2",children:[J.jsx("div",{className:"bg-emerald-100 w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-4",children:J.jsx(_y,{className:"w-8 h-8 text-emerald-600"})}),J.jsx("h2",{className:"text-2xl font-black text-gray-900",children:"Vào làm bài"}),J.jsx("p",{className:"text-gray-500 text-sm",children:"Vui lòng nhập thông tin để bắt đầu làm bài và lưu kết quả."})]}),J.jsxs("div",{className:"space-y-4",children:[J.jsxs("div",{children:[J.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-1",children:"Mã học sinh (Bắt buộc)"}),J.jsx("input",{type:"text",value:F.id,onChange:X=>C({...F,id:X.target.value}),placeholder:"VD: HS001",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-200 outline-none transition-all"})]}),J.jsxs("div",{children:[J.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-1",children:"Họ và tên (Bắt buộc)"}),J.jsx("input",{type:"text",value:F.name,onChange:X=>C({...F,name:X.target.value}),placeholder:"VD: Nguyễn Văn A",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-200 outline-none transition-all"})]}),J.jsxs("div",{children:[J.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-1",children:"Lớp (Bắt buộc)"}),J.jsx("input",{type:"text",value:F.className,onChange:X=>C({...F,className:X.target.value}),placeholder:"VD: 10A1",className:"w-full px-4 py-3 rounded-xl border border-gray-200 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-200 outline-none transition-all"})]}),J.jsxs("button",{onClick:()=>{if(!F.id.trim()||!F.name.trim()||!F.className.trim()){alert("Vui lòng nhập đầy đủ Mã học sinh, Họ tên và Lớp!");return}R(!0)},className:"w-full py-4 bg-emerald-600 text-white font-black rounded-xl shadow-lg hover:bg-emerald-700 transition-all flex items-center justify-center gap-2 mt-4",children:["Bắt đầu làm bài ",J.jsx(My,{className:"w-5 h-5"})]})]})]})})}nu.workerSrc=Yxe;function Dc(...n){return oK($X(n))}const yPe=new nj({apiKey:""});class vPe extends lse.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){var e;return this.state.hasError?J.jsx("div",{className:"min-h-screen bg-red-50 flex items-center justify-center p-6",children:J.jsxs("div",{className:"max-w-md w-full bg-white p-8 rounded-3xl shadow-xl border border-red-100 text-center space-y-4",children:[J.jsx(yD,{className:"w-16 h-16 text-red-500 mx-auto"}),J.jsx("h2",{className:"text-2xl font-black text-gray-900",children:"Đã có lỗi xảy ra"}),J.jsx("p",{className:"text-gray-600 text-sm",children:((e=this.state.error)==null?void 0:e.message)||"Vui lòng tải lại trang hoặc liên hệ quản trị viên."}),J.jsx("button",{onClick:()=>window.location.reload(),className:"w-full py-4 bg-red-600 text-white font-black rounded-2xl hover:bg-red-700 transition-all",children:"Tải lại trang"})]})}):this.props.children}}function _Pe(){const n=mu(),[e]=l$(),[t,i]=Se.useState(()=>{const r=window.location.href;return r.includes("id=")||r.includes("data=")||r.includes("student-quiz")});return Se.useEffect(()=>{const r=window.location.href,s=r.includes("id=")||r.includes("data=")||r.includes("student-quiz");i(s)},[n,e]),J.jsx(vPe,{children:t?J.jsx(mPe,{}):J.jsx(xPe,{})})}function xPe(){const n=XC(),[e,t]=Se.useState(null),[i,r]=Se.useState(!1),[s,a]=Se.useState(!1),o=window.location.href.includes("id=")||window.location.href.includes("data="),[l,c]=Se.useState({step:"input",topic:"",referenceMaterial:"",matrix:[],questions:[],activeTab:"matrix"}),[h,f]=Se.useState(!1),[p,y]=Se.useState(!1),[x,v]=Se.useState(""),[_,E]=Se.useState("all"),[w,A]=Se.useState(0),[N,k]=Se.useState([]),[F,C]=Se.useState(!1),[M,R]=Se.useState(!1),[L,H]=Se.useState(!1),[P,O]=Se.useState(!0),[B,re]=Se.useState([]),[q,X]=Se.useState(!1),[oe,ue]=Se.useState(!1),[ge,j]=Se.useState(null),[G,Z]=Se.useState(!1),[te,ie]=Se.useState(()=>{const xe=localStorage.getItem("ai_edubank_public_url"),Ye="https://ais-pre-53li4wfbyqewfsubylp5kl-526976808466.asia-southeast1.run.app";return xe&&!xe.includes("ai.studio")?xe:Ye}),[_e,Ie]=Se.useState(!1),Pe=Se.useRef(null),[Fe,Ge]=Se.useState("create"),[ct,gt]=Se.useState([]),[Mt,W]=Se.useState(!1),Re="https://ais-pre-53li4wfbyqewfsubylp5kl-526976808466.asia-southeast1.run.app";Se.useEffect(()=>{const xe=Ike(R5,Ye=>{t(Ye),r(!0),Ye&&(a(!0),Te(Ye.uid))});return()=>xe()},[]);const Te=async xe=>{try{const Ye=rD(cg(Wu,"referenceMaterials"),sD("userId","==",xe)),pt=(await aD(Ye)).docs.map(mt=>({id:mt.id,...mt.data()}));re(pt)}catch(Ye){console.error("Error fetching materials:",Ye)}},ae=async(xe,Ye)=>{if(e)try{await oD(cg(Wu,"referenceMaterials"),{userId:e.uid,fileName:xe,extractedText:Ye,createdAt:new Date().toISOString()}),Te(e.uid)}catch(Je){console.error("Error saving material:",Je)}},he=async xe=>{try{await Eie(yR(Wu,"referenceMaterials",xe)),e&&Te(e.uid)}catch(Ye){console.error("Error deleting material:",Ye)}},we=["Đang phân tích tài liệu tham khảo...","Đang xác định yêu cầu cần đạt (YCCĐ)...","Đang thiết lập ma trận phân hóa A-B-C...","Đang soạn thảo ngân hàng câu hỏi đa dạng...","Đang kiểm tra tính sư phạm và logic...","Đang chuẩn bị chế độ đố vui tương tác...","Sắp hoàn tất, vui lòng chờ trong giây lát..."],Le=async xe=>{const Ye=await xe.arrayBuffer(),Je=await SY({data:Ye}).promise;let pt="";for(let mt=1;mt<=Je.numPages;mt++){const jt=(await(await Je.getPage(mt)).getTextContent()).items.map(ne=>ne.str).join(" ");pt+=jt+`
`}return pt},$e=async xe=>{const Ye=await xe.arrayBuffer();return(await mTe.extractRawText({arrayBuffer:Ye})).value},Ce=async xe=>{var Je;const Ye=(Je=xe.target.files)==null?void 0:Je[0];if(Ye){y(!0);try{let pt="";if(Ye.type==="application/pdf")pt=await Le(Ye);else if(Ye.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document")pt=await $e(Ye);else{alert("Chỉ hỗ trợ file PDF và Word (.docx)");return}c(mt=>({...mt,referenceMaterial:pt}));try{const Kt=(await new nj({apiKey:void 0}).models.generateContent({model:"gemini-3-flash-preview",contents:`Trích xuất tiêu đề hoặc chủ đề ngắn gọn (dưới 10 từ) từ nội dung sau: 

 ${pt.substring(0,2e3)}`})).text.trim().replace(/^["']|["']$/g,"");Kt&&c(jt=>({...jt,topic:Kt}))}catch(mt){console.error("Error detecting topic:",mt)}P&&e&&await ae(Ye.name,pt)}catch(pt){console.error("Error extracting text:",pt),alert("Có lỗi khi đọc file. Vui lòng thử lại.")}finally{y(!1),Pe.current&&(Pe.current.value="")}}},be=async()=>{if(!l.topic.trim())return;f(!0);let xe=0;const Ye=setInterval(()=>{v(we[xe%we.length]),xe++},2e3);try{const Je="gemini-3.1-pro-preview",pt=`
        Bạn là một Giáo viên cốt cán, chuyên gia ra đề thi phân hóa. 
        
        LƯU Ý CỰC KỲ QUAN TRỌNG: 
        Bạn PHẢI ĐỌC KỸ "Tài liệu tham khảo" và "Chủ đề yêu cầu ra đề" dưới đây.
        1. CHỈ ĐƯỢC PHÉP ra đề về ĐÚNG "Chủ đề yêu cầu ra đề". Tuyệt đối KHÔNG ĐƯỢC ra đề về các chủ đề khác dù nó có nằm trong "Tài liệu tham khảo".
        2. Ví dụ: Nếu tài liệu là toàn bộ sách Tin học 10, nhưng Chủ đề yêu cầu là "Bài 19: Câu lệnh rẽ nhánh if", bạn CHỈ ĐƯỢC TÌM VÀ SỬ DỤNG phần kiến thức về "câu lệnh if" trong tài liệu đó để ra đề. Tuyệt đối không ra đề về "câu lệnh while", "for", hay các bài khác.
        3. Mọi câu hỏi, ma trận, đáp án đều phải bám sát nội dung TRONG TÀI LIỆU THAM KHẢO tương ứng với Chủ đề đó. Không tự bịa thêm kiến thức ngoài tài liệu nếu tài liệu đã có đủ.

        Chủ đề yêu cầu ra đề: "${l.topic}"
        Tài liệu tham khảo (Nguồn dữ liệu): 
        """
        ${l.referenceMaterial||"Sử dụng kiến thức chuẩn chương trình phổ thông mới."}
        """

        NHIỆM VỤ:
        1. Trích xuất kiến thức trọng tâm của đúng "${l.topic}" từ "Tài liệu tham khảo" trên.
        2. Lập ma trận phân hóa 3 cấp độ (A - B - C) CHỈ CHO CHỦ ĐỀ NÀY:
           - Mức A (Biết): Nhận biết, nhớ lại kiến thức cơ bản của chủ đề.
           - Mức B (Hiểu): Hiểu rõ, giải thích, áp dụng cơ bản kiến thức của chủ đề.
           - Mức C (Vận dụng): Vận dụng kiến thức của chủ đề để giải quyết vấn đề phức tạp hơn.
        3. Tạo ngân hàng câu hỏi đa dạng (chỉ xoay quanh Chủ đề):
           - Số lượng: Ít nhất 15 câu (5 câu mỗi mức A, B, C).
           - Hình thức: Trắc nghiệm 4 lựa chọn, Đúng/Sai, Câu hỏi ngắn.
           - ĐẶC BIỆT CHO CÂU HỎI ĐÚNG/SAI: Mỗi câu hỏi phải có 1 ngữ cảnh chung (content), sau đó là 4 ý nhỏ (subQuestions) A, B, C, D. Mỗi ý nhỏ học sinh sẽ chọn Đúng hoặc Sai.
           - Mã đề: [MãMôn][Khối]-[ViếtTắtChủĐề]-[MứcĐộ][STT] (Ví dụ: TIN10-IF-A01).

        TRẢ VỀ KẾT QUẢ DƯỚI DẠNG JSON với cấu trúc:
        {
          "matrix": [
            {"level": "A", "title": "Biết", "description": "...", "requirements": "..."},
            {"level": "B", "title": "Hiểu", "description": "...", "requirements": "..."},
            {"level": "C", "title": "Vận dụng", "description": "...", "requirements": "..."}
          ],
          "questions": [
            {
              "id": "1",
              "code": "...",
              "type": "multiple_choice | true_false | short_answer",
              "level": "A | B | C",
              "content": "...", // Đối với true_false, đây là ngữ cảnh chung
              "options": ["A...", "B...", "C...", "D..."], // Chỉ dùng cho multiple_choice
              "subQuestions": [ // BẮT BUỘC cho true_false, chính xác 4 ý
                {"id": "a", "content": "...", "answer": "true | false"},
                {"id": "b", "content": "...", "answer": "true | false"},
                {"id": "c", "content": "...", "answer": "true | false"},
                {"id": "d", "content": "...", "answer": "true | false"}
              ],
              "answer": "...", // Đáp án cho multiple_choice hoặc short_answer
              "explanation": "...",
              "commonErrors": "..."
            }
          ]
        }
      `,mt=await yPe.models.generateContent({model:Je,contents:pt,config:{responseMimeType:"application/json",systemInstruction:"Bạn là một chuyên gia giáo dục nghiêm ngặt. Bạn TUYỆT ĐỐI KHÔNG ĐƯỢC sinh ra bất kỳ câu hỏi hay nội dung nào nằm ngoài 'Chủ đề yêu cầu ra đề'. Nếu tài liệu tham khảo chứa nhiều bài học, bạn CHỈ ĐƯỢC lọc và sử dụng đúng phần kiến thức của bài học được yêu cầu. Bất kỳ sự lạc đề nào cũng là lỗi nghiêm trọng."}}),Yt=JSON.parse(mt.text);c(Kt=>({...Kt,step:"result",matrix:Yt.matrix||[],questions:Yt.questions||[],activeTab:"matrix"}))}catch(Je){console.error("Error:",Je),alert("Có lỗi xảy ra trong quá trình tạo bộ đề. Vui lòng thử lại với nội dung ngắn hơn hoặc kiểm tra kết nối.")}finally{clearInterval(Ye),f(!1)}},Ee=async xe=>{if(!l.questions||l.questions.length===0){alert("Chưa có ngân hàng câu hỏi để làm bài.");return}const Ye=xe==="all"?l.questions:l.questions.filter(Je=>Je.level===xe);if(Ye.length===0){alert(`Không có câu hỏi nào ở mức ${xe}.`);return}ue(!0);try{const Je=xe==="all"?"":` - Mức ${xe}`,pt=await oD(cg(Wu,"quizzes"),{userId:(e==null?void 0:e.uid)||"anonymous",title:(l.topic||"Bài tập ôn tập")+Je,level:xe,questions:Ye,createdAt:new Date().toISOString()});n(`/student-quiz?id=${pt.id}`)}catch(Je){console.error("Error starting quiz:",Je);const pt=btoa(unescape(encodeURIComponent(JSON.stringify(Ye))));n(`/student-quiz?data=${pt}`)}finally{ue(!1)}},Me=async xe=>{if(!l.questions||l.questions.length===0)return;const Ye=xe==="all"?l.questions:l.questions.filter(Je=>Je.level===xe);if(Ye.length===0){alert(`Không có câu hỏi nào ở mức ${xe}.`);return}ue(!0);try{const Je=xe==="all"?"":` - Mức ${xe}`,pt=await oD(cg(Wu,"quizzes"),{userId:(e==null?void 0:e.uid)||"anonymous",title:(l.topic||"Bài tập ôn tập")+Je,level:xe,questions:Ye,createdAt:new Date().toISOString()}),mt=`${Re}/?id=${pt.id}`;j(mt),Z(!0);try{await navigator.clipboard.writeText(mt),H(!0),setTimeout(()=>H(!1),2e3)}catch{}}catch(Je){console.error("Error sharing quiz:",Je),alert("Có lỗi khi tạo link chia sẻ. Vui lòng thử lại.")}finally{ue(!1)}},Xe=async()=>{if(e){W(!0);try{const xe=rD(cg(Wu,"quizzes"),sD("userId","==",e.uid)),Ye=await aD(xe),Je=Ye.docs.map(jt=>jt.id),pt=Ye.docs.reduce((jt,ne)=>(jt[ne.id]=ne.data().title,jt),{});if(Je.length===0){gt([]),W(!1);return}const mt=rD(cg(Wu,"quiz_results"),sD("teacherId","==",e.uid)),Kt=(await aD(mt)).docs.map(jt=>({id:jt.id,...jt.data()})).map(jt=>({...jt,quizTitle:pt[jt.quizId]||"Bài tập không tên"})).sort((jt,ne)=>new Date(ne.submittedAt).getTime()-new Date(jt.submittedAt).getTime());gt(Kt)}catch(xe){console.error("Error fetching results",xe)}finally{W(!1)}}};Se.useEffect(()=>{Fe==="results"&&e&&Xe()},[Fe,e]);const[dt,bt]=Se.useState(!1),zt=()=>{if(ct.length===0)return;const xe=ct.map((pt,mt)=>({STT:mt+1,"Mã học sinh":pt.studentId,"Họ và tên":pt.studentName,Lớp:pt.className||"N/A","Bài tập":pt.quizTitle,"Mức độ":pt.quizLevel==="all"?"Tất cả":pt.quizLevel||"N/A","Điểm số":`${pt.score}/${pt.total}`,"Tỷ lệ (%)":Math.round(pt.percentage),"Xếp loại":pt.grade,"Thời gian nộp":new Date(pt.submittedAt).toLocaleString("vi-VN")})),Ye=ny.json_to_sheet(xe),Je=ny.book_new();ny.book_append_sheet(Je,Ye,"Kết quả học sinh"),gG(Je,`Ket_qua_hoc_sinh_${new Date().getTime()}.xlsx`)};_==="all"?l.questions:l.questions.filter(xe=>xe.level===_);const Nt=()=>{const xe=`| Mã đề | Mức độ | Loại | Câu hỏi | Lựa chọn | Đáp án | Giải thích | Lỗi thường gặp |
|---|---|---|---|---|---|---|---|
`,Ye=(l.questions||[]).map(Je=>{const pt=Je.options?Je.options.join("; "):"";let mt=Je.answer,Yt=Je.content;return Je.type==="true_false"&&Je.subQuestions&&(mt=Je.subQuestions.map((Kt,jt)=>`${String.fromCharCode(97+jt)}: ${Kt.answer==="true"?"Đúng":"Sai"}`).join("; "),Yt=`${Je.content}
`+Je.subQuestions.map((Kt,jt)=>`${String.fromCharCode(97+jt)}) ${Kt.content}`).join(`
`)),`| ${Je.code} | ${Je.level} | ${Je.type} | ${Yt.replace(/\n/g," ")} | ${pt} | ${mt} | ${Je.explanation} | ${Je.commonErrors} |`}).join(`
`);navigator.clipboard.writeText(xe+Ye),H(!0),setTimeout(()=>H(!1),2e3)},[Gt,on]=Se.useState(!1),ke=()=>{const xe=(l.questions||[]).map(mt=>{var jt,ne,le,Ae;let Yt=mt.content,Kt=mt.answer;return mt.type==="true_false"&&mt.subQuestions&&(Yt=`${mt.content}
`+mt.subQuestions.map((Oe,ft)=>`${String.fromCharCode(97+ft)}) ${Oe.content}`).join(`
`),Kt=mt.subQuestions.map((Oe,ft)=>`${String.fromCharCode(97+ft)}: ${Oe.answer==="true"?"Đúng":"Sai"}`).join("; ")),{"Mã đề":mt.code,"Mức độ":mt.level,"Loại câu hỏi":mt.type==="multiple_choice"?"Trắc nghiệm":mt.type==="true_false"?"Đúng/Sai":"Câu hỏi ngắn","Câu hỏi":Yt,"Lựa chọn A":((jt=mt.options)==null?void 0:jt[0])||"","Lựa chọn B":((ne=mt.options)==null?void 0:ne[1])||"","Lựa chọn C":((le=mt.options)==null?void 0:le[2])||"","Lựa chọn D":((Ae=mt.options)==null?void 0:Ae[3])||"","Đáp án đúng":Kt,"Giải thích chi tiết":mt.explanation,"Lỗi thường gặp":mt.commonErrors}}),Ye=ny.json_to_sheet(xe),Je=ny.book_new();ny.book_append_sheet(Je,Ye,"Ngân hàng câu hỏi");const pt=[{wch:15},{wch:10},{wch:15},{wch:50},{wch:30},{wch:30},{wch:30},{wch:30},{wch:20},{wch:50},{wch:30}];Ye["!cols"]=pt,gG(Je,`NganHangCauHoi_${l.topic.replace(/\s+/g,"_")}.xlsx`)};return i?!s&&!e?J.jsxs("div",{className:"min-h-screen bg-[#FDFDFD] text-[#1A1A1A] font-sans flex flex-col items-center justify-center p-6 relative overflow-hidden",children:[J.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-emerald-100/50 rounded-full blur-3xl"}),J.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-100/50 rounded-full blur-3xl"}),J.jsxs("div",{className:"max-w-md w-full relative z-10 space-y-12",children:[J.jsxs("div",{className:"text-center space-y-4",children:[J.jsx("div",{className:"bg-emerald-600 w-20 h-20 rounded-3xl shadow-2xl shadow-emerald-200 mx-auto flex items-center justify-center transform -rotate-6 hover:rotate-0 transition-all duration-300",children:J.jsx(_y,{className:"text-white w-10 h-10"})}),J.jsx("h1",{className:"text-4xl font-black tracking-tight text-gray-900 mt-6",children:"AI EduBank Pro"}),J.jsx("p",{className:"text-gray-500 font-medium text-lg",children:"Hệ thống học liệu phân hóa thông minh"})]}),J.jsxs("div",{className:"space-y-4",children:[J.jsxs("button",{onClick:()=>a(!0),className:"w-full group relative flex items-center p-6 bg-white border-2 border-emerald-100 rounded-3xl hover:border-emerald-500 hover:shadow-2xl hover:shadow-emerald-100 transition-all duration-300 overflow-hidden",children:[J.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-emerald-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"}),J.jsxs("div",{className:"relative z-10 flex items-center gap-6 w-full",children:[J.jsx("div",{className:"bg-emerald-100 p-4 rounded-2xl text-emerald-600 group-hover:scale-110 transition-transform",children:J.jsx(d7,{className:"w-8 h-8"})}),J.jsxs("div",{className:"text-left flex-1",children:[J.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Dành cho Giáo viên"}),J.jsx("p",{className:"text-sm text-gray-500 font-medium mt-1",children:"Tạo và quản lý bài tập AI"})]}),J.jsx(My,{className:"w-6 h-6 text-gray-300 group-hover:text-emerald-500 group-hover:translate-x-2 transition-all"})]})]}),J.jsxs("div",{className:"w-full group relative flex items-center p-6 bg-white border-2 border-blue-100 rounded-3xl hover:border-blue-500 hover:shadow-2xl hover:shadow-blue-100 transition-all duration-300 overflow-hidden",children:[J.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"}),J.jsxs("div",{className:"relative z-10 flex flex-col w-full gap-4",children:[J.jsxs("div",{className:"flex items-center gap-6",children:[J.jsx("div",{className:"bg-blue-100 p-4 rounded-2xl text-blue-600 group-hover:scale-110 transition-transform",children:J.jsx(_y,{className:"w-8 h-8"})}),J.jsxs("div",{className:"text-left flex-1",children:[J.jsx("h3",{className:"text-xl font-black text-gray-900",children:"Dành cho Học sinh"}),J.jsx("p",{className:"text-sm text-gray-500 font-medium mt-1",children:"Nhập mã bài tập để làm bài"})]})]}),J.jsxs("div",{className:"flex gap-2 mt-2",children:[J.jsx("input",{type:"text",id:"quizCodeInput",placeholder:"Nhập mã bài tập (VD: 7aB9...)",className:"flex-1 px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm font-mono focus:ring-2 focus:ring-blue-500 outline-none",onKeyDown:xe=>{if(xe.key==="Enter"){const Ye=xe.target.value.trim();Ye&&(window.location.href=`/?id=${Ye}`)}}}),J.jsx("button",{onClick:()=>{const xe=document.getElementById("quizCodeInput").value.trim();xe&&(window.location.href=`/?id=${xe}`)},className:"px-6 py-3 bg-blue-600 text-white font-black rounded-xl hover:bg-blue-700 transition-colors",children:"Vào thi"})]})]})]})]})]})]}):J.jsxs("div",{className:"min-h-screen bg-[#FDFDFD] text-[#1A1A1A] font-sans selection:bg-emerald-100",children:[o&&J.jsxs("div",{onClick:()=>window.location.reload(),className:"sticky top-0 z-[100] bg-red-600 text-white p-4 text-center font-black animate-pulse cursor-pointer flex items-center justify-center gap-3 shadow-2xl",children:[J.jsx(Kp,{className:"w-6 h-6"}),J.jsx("span",{children:"PHÁT HIỆN BÀI TẬP! Nhấn vào đây để vào làm bài ngay."})]}),J.jsx("header",{className:"sticky top-0 z-50 bg-white/90 backdrop-blur-md border-b border-gray-100 px-6 py-4",children:J.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[J.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>c(xe=>({...xe,step:"input"})),children:[J.jsx("div",{className:"bg-emerald-600 p-2 rounded-xl shadow-lg shadow-emerald-100",children:J.jsx(_y,{className:"text-white w-6 h-6"})}),J.jsxs("div",{children:[J.jsx("h1",{className:"text-xl font-bold tracking-tight text-gray-900",children:"AI EduBank Pro"}),J.jsx("p",{className:"text-[10px] font-bold text-emerald-600 uppercase tracking-[0.2em]",children:"Hệ thống học liệu phân hóa"})]})]}),J.jsxs("div",{className:"flex items-center gap-4",children:[e&&J.jsxs("div",{className:"flex bg-gray-100 p-1 rounded-xl mr-4",children:[J.jsx("button",{onClick:()=>Ge("create"),className:`px-4 py-1.5 rounded-lg text-sm font-bold transition-all ${Fe==="create"?"bg-white text-emerald-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:"Tạo bài tập"}),J.jsx("button",{onClick:()=>Ge("results"),className:`px-4 py-1.5 rounded-lg text-sm font-bold transition-all ${Fe==="results"?"bg-white text-blue-600 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:"Kết quả học sinh"})]}),(window.location.href.includes("id=")||window.location.href.includes("data="))&&J.jsxs("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-red-600 text-white rounded-xl text-sm font-black animate-pulse shadow-lg shadow-red-100 flex items-center gap-2",children:[J.jsx(Kp,{className:"w-4 h-4"}),"VÀO LÀM BÀI"]}),e?J.jsxs("div",{className:"flex items-center gap-3",children:[J.jsx("img",{src:e.photoURL||"",alt:e.displayName||"",className:"w-8 h-8 rounded-full border border-gray-200"}),J.jsxs("button",{onClick:pPe,className:"text-xs font-bold text-gray-500 hover:text-red-500 transition-colors flex items-center gap-1",children:[J.jsx(nge,{className:"w-3 h-3"}),"Đăng xuất"]})]}):J.jsxs("button",{onClick:fPe,className:"flex items-center gap-2 px-4 py-2 bg-white border border-gray-200 rounded-xl text-sm font-bold text-gray-700 hover:bg-gray-50 transition-colors shadow-sm",children:[J.jsx(ege,{className:"w-4 h-4 text-emerald-600"}),"Đăng nhập GV"]}),l.step!=="input"&&J.jsxs("button",{onClick:()=>c(xe=>({...xe,step:"input"})),className:"text-sm font-bold text-gray-500 hover:text-emerald-600 transition-colors flex items-center gap-2",children:[J.jsx(rj,{className:"w-4 h-4"}),"Tạo mới"]})]})]})}),J.jsx("main",{className:"max-w-5xl mx-auto px-6 py-12",children:J.jsx(fF,{mode:"wait",children:Fe==="results"?J.jsxs(Ic.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"space-y-8",children:[J.jsxs("div",{className:"flex justify-between items-center",children:[J.jsx("h2",{className:"text-3xl font-black text-gray-900 tracking-tight",children:"Kết quả học sinh"}),J.jsxs("button",{onClick:zt,disabled:ct.length===0,className:"flex items-center gap-2 px-6 py-3 bg-emerald-600 text-white font-black rounded-xl hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[J.jsx(f7,{className:"w-5 h-5"}),"Xuất Excel"]})]}),Mt?J.jsx("div",{className:"flex justify-center py-12",children:J.jsx(bx,{className:"w-8 h-8 text-emerald-600 animate-spin"})}):ct.length===0?J.jsx("div",{className:"text-center py-12 bg-gray-50 rounded-3xl border-2 border-dashed border-gray-200",children:J.jsx("p",{className:"text-gray-500 font-medium",children:"Chưa có kết quả nào."})}):J.jsx("div",{className:"bg-white rounded-3xl shadow-sm border border-gray-100 overflow-hidden",children:J.jsx("div",{className:"overflow-x-auto",children:J.jsxs("table",{className:"w-full text-left border-collapse",children:[J.jsx("thead",{children:J.jsxs("tr",{className:"bg-gray-50 border-b border-gray-100",children:[J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"STT"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Mã HS"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Họ và tên"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Lớp"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Bài tập"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Mức độ"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Điểm"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Tỷ lệ"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Xếp loại"}),J.jsx("th",{className:"p-4 font-bold text-gray-600 text-sm",children:"Thời gian nộp"})]})}),J.jsx("tbody",{className:"divide-y divide-gray-100",children:ct.map((xe,Ye)=>J.jsxs("tr",{className:"hover:bg-gray-50 transition-colors",children:[J.jsx("td",{className:"p-4 text-sm text-gray-500",children:Ye+1}),J.jsx("td",{className:"p-4 text-sm font-mono text-gray-900",children:xe.studentId}),J.jsx("td",{className:"p-4 text-sm font-medium text-gray-900",children:xe.studentName}),J.jsx("td",{className:"p-4 text-sm text-gray-600 font-medium",children:xe.className||"N/A"}),J.jsx("td",{className:"p-4 text-sm text-gray-600 max-w-[200px] truncate",title:xe.quizTitle,children:xe.quizTitle}),J.jsx("td",{className:"p-4 text-sm text-gray-600 font-medium",children:xe.quizLevel==="all"?"Tất cả":xe.quizLevel||"N/A"}),J.jsxs("td",{className:"p-4 text-sm font-bold text-emerald-600",children:[xe.score,"/",xe.total]}),J.jsxs("td",{className:"p-4 text-sm text-gray-600",children:[Math.round(xe.percentage),"%"]}),J.jsx("td",{className:"p-4 text-sm",children:J.jsx("span",{className:`px-2 py-1 rounded-md text-xs font-bold ${xe.grade==="Giỏi"?"bg-emerald-100 text-emerald-700":xe.grade==="Khá"?"bg-blue-100 text-blue-700":xe.grade==="Trung bình"?"bg-yellow-100 text-yellow-700":"bg-red-100 text-red-700"}`,children:xe.grade})}),J.jsx("td",{className:"p-4 text-sm text-gray-500",children:new Date(xe.submittedAt).toLocaleString("vi-VN")})]},xe.id))})]})})})]},"results"):J.jsxs(J.Fragment,{children:[l.step==="input"&&J.jsxs(Ic.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"space-y-8",children:[J.jsxs("div",{className:"text-center space-y-4",children:[J.jsx("h2",{className:"text-4xl font-black text-gray-900 tracking-tight",children:"Chào mừng Giáo viên"}),J.jsx("p",{className:"text-gray-500 text-lg max-w-2xl mx-auto",children:"Hãy nhập thông tin bài học và tài liệu tham khảo để AI bắt đầu quy trình xây dựng học liệu phân hóa chuẩn sư phạm."})]}),J.jsxs("div",{className:"bg-white p-8 rounded-[2rem] shadow-2xl shadow-gray-100 border border-gray-100 space-y-6",children:[J.jsxs("div",{className:"space-y-2",children:[J.jsx("label",{className:"text-xs font-black uppercase tracking-widest text-gray-400 ml-1",children:"Tên bài học / Chủ đề"}),J.jsxs("div",{className:"relative",children:[J.jsx("input",{type:"text",value:l.topic,onChange:xe=>c(Ye=>({...Ye,topic:xe.target.value})),placeholder:"Ví dụ: Tạo đề Bài 19 Tin học 10 - Cấu trúc rẽ nhánh",className:"w-full px-6 py-4 bg-gray-50 border-2 border-transparent focus:border-emerald-500 focus:bg-white rounded-2xl outline-none transition-all text-lg font-medium"}),J.jsx(d7,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-gray-300 w-6 h-6"})]})]}),J.jsxs("div",{className:"space-y-2",children:[J.jsxs("div",{className:"flex items-center justify-between ml-1",children:[J.jsxs("label",{className:"text-xs font-black uppercase tracking-widest text-gray-400 flex items-center gap-2",children:[J.jsx($pe,{className:"w-3 h-3"}),"Tài liệu tham khảo (SGK, SBT, Bài giảng...)"]}),J.jsxs("div",{className:"flex items-center gap-3",children:[e&&J.jsxs("button",{onClick:()=>X(!q),className:"flex items-center gap-2 px-3 py-1.5 bg-blue-50 text-blue-600 rounded-lg text-[10px] font-black uppercase tracking-widest hover:bg-blue-100 transition-colors",children:[J.jsx(Kpe,{className:"w-3 h-3"}),"Thư viện (",B.length,")"]}),J.jsx("input",{type:"file",ref:Pe,onChange:Ce,accept:".pdf,.docx",className:"hidden"}),J.jsxs("button",{onClick:()=>{var xe;return(xe=Pe.current)==null?void 0:xe.click()},disabled:p,className:"flex items-center gap-2 px-3 py-1.5 bg-emerald-50 text-emerald-600 rounded-lg text-[10px] font-black uppercase tracking-widest hover:bg-emerald-100 transition-colors disabled:opacity-50",children:[p?J.jsx(bx,{className:"w-3 h-3 animate-spin"}):J.jsx(age,{className:"w-3 h-3"}),p?"Đang trích xuất...":"Tải lên PDF/Word"]})]})]}),q&&e&&J.jsxs(Ic.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"bg-gray-50 border border-gray-200 rounded-2xl overflow-hidden mb-4",children:[J.jsxs("div",{className:"p-4 border-b border-gray-200 bg-white flex items-center justify-between",children:[J.jsx("h4",{className:"text-xs font-black uppercase tracking-widest text-gray-500",children:"Tài liệu đã lưu"}),J.jsx("button",{onClick:()=>X(!1),className:"text-gray-400 hover:text-gray-600",children:J.jsx(yD,{className:"w-4 h-4"})})]}),J.jsx("div",{className:"max-h-[200px] overflow-y-auto p-2 space-y-1",children:B.length===0?J.jsx("p",{className:"text-center py-4 text-xs text-gray-400 italic",children:"Chưa có tài liệu nào được lưu."}):B.map(xe=>J.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-gray-100 hover:border-blue-200 transition-all group",children:[J.jsxs("div",{className:"flex-1 cursor-pointer",onClick:()=>{c(Ye=>({...Ye,referenceMaterial:xe.extractedText,topic:xe.fileName.replace(/\.[^/.]+$/,"")})),X(!1)},children:[J.jsx("p",{className:"text-sm font-bold text-gray-700 group-hover:text-blue-600",children:xe.fileName}),J.jsx("p",{className:"text-[10px] text-gray-400",children:new Date(xe.createdAt).toLocaleDateString("vi-VN")})]}),J.jsx("button",{onClick:()=>he(xe.id),className:"p-2 text-gray-300 hover:text-red-500 transition-colors",children:J.jsx(hge,{className:"w-4 h-4"})})]},xe.id))})]}),J.jsx("textarea",{value:l.referenceMaterial,onChange:xe=>c(Ye=>({...Ye,referenceMaterial:xe.target.value})),placeholder:"Dán nội dung kiến thức trọng tâm hoặc trích xuất từ file để AI phân tích chính xác hơn...",className:"w-full px-6 py-4 bg-gray-50 border-2 border-transparent focus:border-emerald-500 focus:bg-white rounded-2xl outline-none transition-all min-h-[200px] text-sm leading-relaxed"}),J.jsxs("div",{className:"flex items-center justify-between",children:[J.jsx("div",{className:"flex items-center gap-4",children:l.referenceMaterial&&J.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-gray-100 rounded-lg w-fit",children:[J.jsx(Hpe,{className:"w-3 h-3 text-gray-400"}),J.jsxs("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:["Đã nạp ",l.referenceMaterial.length," ký tự tài liệu"]}),J.jsx("button",{onClick:()=>c(xe=>({...xe,referenceMaterial:""})),className:"text-[10px] font-black text-red-400 hover:text-red-600 ml-2",children:"Xóa"})]})}),e&&J.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[J.jsx("input",{type:"checkbox",checked:P,onChange:xe=>O(xe.target.checked),className:"w-4 h-4 accent-emerald-600"}),J.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-gray-400",children:"Lưu vào thư viện"})]})]})]}),J.jsx("button",{onClick:be,disabled:h||!l.topic.trim(),className:"w-full py-5 bg-emerald-600 hover:bg-emerald-700 disabled:bg-gray-200 text-white font-black text-lg rounded-2xl shadow-xl shadow-emerald-100 transition-all flex items-center justify-center gap-3 group",children:h?J.jsx(bx,{className:"w-6 h-6 animate-spin"}):J.jsxs(J.Fragment,{children:["Bắt đầu quy trình 4 bước",J.jsx(My,{className:"w-6 h-6 group-hover:translate-x-1 transition-transform"})]})})]}),h&&J.jsxs(Ic.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center space-y-2",children:[J.jsx("p",{className:"text-emerald-600 font-bold animate-pulse",children:x}),J.jsx("div",{className:"w-48 h-1 bg-gray-100 mx-auto rounded-full overflow-hidden",children:J.jsx(Ic.div,{className:"h-full bg-emerald-500",animate:{x:[-192,192]},transition:{duration:1.5,repeat:1/0,ease:"linear"}})})]})]},"input"),l.step==="result"&&J.jsxs(Ic.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},className:"space-y-8",children:[J.jsxs("div",{className:"flex items-center justify-between",children:[J.jsx("h2",{className:"text-2xl font-black text-gray-900",children:"Kết quả phân tích & Ngân hàng đề"}),J.jsxs("div",{className:"flex gap-2 p-1 bg-gray-100 rounded-xl",children:[J.jsx(DM,{active:l.activeTab==="matrix",onClick:()=>c(xe=>({...xe,activeTab:"matrix"})),icon:J.jsx(Jpe,{className:"w-4 h-4"}),label:"Ma trận"}),J.jsx(DM,{active:l.activeTab==="bank",onClick:()=>c(xe=>({...xe,activeTab:"bank"})),icon:J.jsx(Gpe,{className:"w-4 h-4"}),label:"Ngân hàng"}),J.jsx(DM,{active:l.activeTab==="excel",onClick:()=>c(xe=>({...xe,activeTab:"excel"})),icon:J.jsx(cge,{className:"w-4 h-4"}),label:"Excel"})]})]}),J.jsxs("div",{className:"bg-white rounded-[2rem] shadow-xl border border-gray-100 overflow-hidden",children:[l.activeTab==="matrix"&&J.jsx("div",{className:"p-8 space-y-6",children:J.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:(l.matrix||[]).map(xe=>J.jsxs("div",{className:Dc("p-6 rounded-2xl border-2 transition-all hover:shadow-lg",xe.level==="A"?"border-blue-50 bg-blue-50/30":xe.level==="B"?"border-emerald-50 bg-emerald-50/30":"border-amber-50 bg-amber-50/30"),children:[J.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[J.jsxs("span",{className:Dc("px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest",xe.level==="A"?"bg-blue-500 text-white":xe.level==="B"?"bg-emerald-500 text-white":"bg-amber-500 text-white"),children:["Mức ",xe.level]}),J.jsx("h4",{className:"font-bold text-gray-900",children:xe.title})]}),J.jsx("p",{className:"text-sm text-gray-600 mb-4 font-medium",children:xe.description}),J.jsxs("div",{className:"pt-4 border-t border-gray-200/50",children:[J.jsx("p",{className:"text-xs font-bold text-gray-400 uppercase mb-2",children:"Yêu cầu cần đạt"}),J.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:xe.requirements})]})]},xe.level))})}),l.activeTab==="bank"&&J.jsx("div",{className:"divide-y divide-gray-100",children:(l.questions||[]).map((xe,Ye)=>J.jsxs("div",{className:"p-8 hover:bg-gray-50/50 transition-colors space-y-4",children:[J.jsxs("div",{className:"flex items-start justify-between",children:[J.jsxs("div",{className:"flex items-center gap-3",children:[J.jsxs("span",{className:"text-xs font-black text-emerald-600 bg-emerald-50 px-2 py-1 rounded",children:["#",Ye+1]}),J.jsx("span",{className:"text-xs font-bold text-gray-400 font-mono",children:xe.code}),J.jsxs("span",{className:Dc("text-[10px] font-black px-2 py-0.5 rounded-full uppercase",xe.level==="A"?"bg-blue-100 text-blue-600":xe.level==="B"?"bg-emerald-100 text-emerald-600":"bg-amber-100 text-amber-600"),children:["Mức ",xe.level]})]}),J.jsx("div",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest",children:xe.type.replace("_"," ")})]}),J.jsx("h3",{className:"text-lg font-bold text-gray-900 leading-snug",children:xe.content}),xe.type==="multiple_choice"&&xe.options&&J.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:xe.options.map((Je,pt)=>J.jsx("div",{className:"p-3 bg-white border border-gray-200 rounded-xl text-sm font-medium",children:Je},pt))}),xe.type==="true_false"&&xe.subQuestions&&J.jsxs("div",{className:"space-y-3",children:[J.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-2 bg-gray-100 rounded-lg text-[10px] font-black uppercase tracking-widest text-gray-500",children:[J.jsx("div",{className:"col-span-8",children:"Nhận định"}),J.jsx("div",{className:"col-span-2 text-center",children:"Đúng"}),J.jsx("div",{className:"col-span-2 text-center",children:"Sai"})]}),xe.subQuestions.map((Je,pt)=>J.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 bg-white border border-gray-100 rounded-xl items-center",children:[J.jsxs("div",{className:"col-span-8 text-sm font-medium text-gray-700",children:[J.jsxs("span",{className:"font-black text-emerald-600 mr-2",children:[String.fromCharCode(97+pt),")"]}),Je.content]}),J.jsx("div",{className:"col-span-2 flex justify-center",children:J.jsx("div",{className:Dc("w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all",Je.answer==="true"?"bg-emerald-500 border-emerald-500 text-white":"border-gray-200"),children:Je.answer==="true"&&J.jsx(Hf,{className:"w-4 h-4"})})}),J.jsx("div",{className:"col-span-2 flex justify-center",children:J.jsx("div",{className:Dc("w-6 h-6 rounded-full border-2 flex items-center justify-center transition-all",Je.answer==="false"?"bg-red-500 border-red-500 text-white":"border-gray-200"),children:Je.answer==="false"&&J.jsx(Hf,{className:"w-4 h-4"})})})]},Je.id))]}),J.jsxs("div",{className:"bg-emerald-50/50 p-4 rounded-xl space-y-2",children:[xe.type!=="true_false"&&J.jsxs("p",{className:"text-sm",children:[J.jsx("span",{className:"font-black text-emerald-700",children:"Đáp án:"})," ",xe.answer]}),J.jsxs("p",{className:"text-sm text-gray-600 italic",children:[J.jsx("span",{className:"font-bold text-gray-700 not-italic",children:"Giải thích:"})," ",xe.explanation]}),J.jsxs("p",{className:"text-xs text-red-500",children:[J.jsx("span",{className:"font-bold",children:"Lỗi thường gặp:"})," ",xe.commonErrors]})]})]},xe.id))}),l.activeTab==="excel"&&J.jsxs("div",{className:"p-8 space-y-6",children:[J.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[J.jsxs("div",{children:[J.jsx("h3",{className:"font-black text-gray-900 uppercase text-xs tracking-widest mb-1",children:"Xuất dữ liệu học liệu"}),J.jsx("p",{className:"text-sm text-gray-500",children:"Bảng dữ liệu đầy đủ thông tin để lưu trữ hoặc nhập vào các hệ thống khác."})]}),J.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[J.jsxs("button",{onClick:Nt,className:"flex-1 md:flex-none flex items-center justify-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounded-2xl font-bold text-sm hover:bg-gray-200 transition-colors",children:[L?J.jsx(Hf,{className:"w-4 h-4"}):J.jsx(Yp,{className:"w-4 h-4"}),L?"Đã sao chép":"Sao chép bảng"]}),J.jsxs("button",{onClick:ke,className:"flex-1 md:flex-none flex items-center justify-center gap-2 px-6 py-3 bg-emerald-600 text-white rounded-2xl font-black text-sm shadow-xl shadow-emerald-100 hover:bg-emerald-700 transition-all",children:[J.jsx(f7,{className:"w-4 h-4"}),"Tải xuống Excel (.xlsx)"]})]})]}),J.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded-2xl",children:J.jsxs("table",{className:"w-full text-sm text-left",children:[J.jsx("thead",{className:"bg-gray-50 text-gray-400 uppercase text-[10px] font-black",children:J.jsxs("tr",{children:[J.jsx("th",{className:"px-6 py-4",children:"Mã đề"}),J.jsx("th",{className:"px-6 py-4",children:"Mức độ"}),J.jsx("th",{className:"px-6 py-4",children:"Câu hỏi"}),J.jsx("th",{className:"px-6 py-4",children:"Đáp án"}),J.jsx("th",{className:"px-6 py-4",children:"Giải thích"}),J.jsx("th",{className:"px-6 py-4",children:"Lỗi thường gặp"})]})}),J.jsx("tbody",{className:"divide-y divide-gray-100",children:(l.questions||[]).map(xe=>J.jsxs("tr",{className:"hover:bg-gray-50/50 transition-colors",children:[J.jsx("td",{className:"px-6 py-4 font-mono font-bold text-emerald-600 whitespace-nowrap",children:xe.code}),J.jsx("td",{className:"px-6 py-4",children:J.jsxs("span",{className:Dc("px-2 py-0.5 rounded-full text-[10px] font-black uppercase",xe.level==="A"?"bg-blue-100 text-blue-600":xe.level==="B"?"bg-emerald-100 text-emerald-600":"bg-amber-100 text-amber-600"),children:["Mức ",xe.level]})}),J.jsx("td",{className:"px-6 py-4 text-gray-900 font-medium min-w-[300px]",children:xe.content}),J.jsx("td",{className:"px-6 py-4 font-bold text-emerald-700",children:xe.answer}),J.jsx("td",{className:"px-6 py-4 text-gray-500 italic max-w-[200px] truncate",children:xe.explanation}),J.jsx("td",{className:"px-6 py-4 text-red-500 text-xs max-w-[150px] truncate",children:xe.commonErrors})]},xe.id))})]})})]})]}),J.jsxs("div",{className:"bg-emerald-600 p-8 rounded-[2rem] text-white flex flex-col gap-6",children:[J.jsxs("div",{className:"space-y-2 text-center md:text-left",children:[J.jsx("h3",{className:"text-2xl font-black",children:"Sẵn sàng vận hành Mini App Đố vui?"}),J.jsx("p",{className:"text-emerald-100 font-medium",children:"Tạo link gửi cho học sinh theo từng nhóm năng lực hoặc tự trải nghiệm ngay."})]}),J.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[J.jsxs("div",{className:"bg-white/10 p-5 rounded-2xl border border-white/20 flex flex-col gap-4 hover:bg-white/20 transition-colors",children:[J.jsxs("div",{children:[J.jsxs("h4",{className:"font-black text-lg text-white flex items-center gap-2",children:[J.jsx("span",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-sm",children:"A"}),"Mức Biết"]}),J.jsx("p",{className:"text-xs text-emerald-100 mt-1",children:"Dành cho HS cần hỗ trợ"})]}),J.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[J.jsxs("button",{onClick:()=>Me("A"),disabled:oe,className:"w-full py-3 bg-emerald-500 text-white font-bold rounded-xl hover:bg-emerald-400 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Yp,{className:"w-4 h-4"})," Chép Link"]}),J.jsxs("button",{onClick:()=>Ee("A"),disabled:oe,className:"w-full py-3 bg-white text-emerald-600 font-bold rounded-xl hover:bg-emerald-50 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Kp,{className:"w-4 h-4"})," Làm thử"]})]})]}),J.jsxs("div",{className:"bg-white/10 p-5 rounded-2xl border border-white/20 flex flex-col gap-4 hover:bg-white/20 transition-colors",children:[J.jsxs("div",{children:[J.jsxs("h4",{className:"font-black text-lg text-white flex items-center gap-2",children:[J.jsx("span",{className:"w-8 h-8 rounded-full bg-emerald-500 flex items-center justify-center text-sm",children:"B"}),"Mức Hiểu"]}),J.jsx("p",{className:"text-xs text-emerald-100 mt-1",children:"Dành cho HS Khá"})]}),J.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[J.jsxs("button",{onClick:()=>Me("B"),disabled:oe,className:"w-full py-3 bg-emerald-500 text-white font-bold rounded-xl hover:bg-emerald-400 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Yp,{className:"w-4 h-4"})," Chép Link"]}),J.jsxs("button",{onClick:()=>Ee("B"),disabled:oe,className:"w-full py-3 bg-white text-emerald-600 font-bold rounded-xl hover:bg-emerald-50 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Kp,{className:"w-4 h-4"})," Làm thử"]})]})]}),J.jsxs("div",{className:"bg-white/10 p-5 rounded-2xl border border-white/20 flex flex-col gap-4 hover:bg-white/20 transition-colors",children:[J.jsxs("div",{children:[J.jsxs("h4",{className:"font-black text-lg text-white flex items-center gap-2",children:[J.jsx("span",{className:"w-8 h-8 rounded-full bg-amber-500 flex items-center justify-center text-sm",children:"C"}),"Mức Vận dụng"]}),J.jsx("p",{className:"text-xs text-emerald-100 mt-1",children:"Dành cho HS Giỏi"})]}),J.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[J.jsxs("button",{onClick:()=>Me("C"),disabled:oe,className:"w-full py-3 bg-emerald-500 text-white font-bold rounded-xl hover:bg-emerald-400 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Yp,{className:"w-4 h-4"})," Chép Link"]}),J.jsxs("button",{onClick:()=>Ee("C"),disabled:oe,className:"w-full py-3 bg-white text-emerald-600 font-bold rounded-xl hover:bg-emerald-50 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Kp,{className:"w-4 h-4"})," Làm thử"]})]})]}),J.jsxs("div",{className:"bg-white/20 p-5 rounded-2xl border border-white/30 flex flex-col gap-4 hover:bg-white/30 transition-colors shadow-lg",children:[J.jsxs("div",{children:[J.jsxs("h4",{className:"font-black text-lg text-white flex items-center gap-2",children:[J.jsx("span",{className:"w-8 h-8 rounded-full bg-purple-500 flex items-center justify-center text-sm",children:"★"}),"Trộn tất cả"]}),J.jsx("p",{className:"text-xs text-emerald-100 mt-1",children:"Dành cho cả lớp"})]}),J.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[J.jsxs("button",{onClick:()=>Me("all"),disabled:oe,className:"w-full py-3 bg-emerald-500 text-white font-bold rounded-xl hover:bg-emerald-400 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Yp,{className:"w-4 h-4"})," Chép Link"]}),J.jsxs("button",{onClick:()=>Ee("all"),disabled:oe,className:"w-full py-3 bg-white text-emerald-600 font-bold rounded-xl hover:bg-emerald-50 transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[J.jsx(Kp,{className:"w-4 h-4"})," Làm thử"]})]})]})]})]})]},"result")]})})}),J.jsx("footer",{className:"mt-20 border-t border-gray-100 py-12 px-6 text-center",children:J.jsx("p",{className:"text-gray-400 text-xs font-bold uppercase tracking-[0.3em]",children:"AI EduBank Pro © 2026"})}),J.jsx(fF,{children:G&&ge&&J.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:J.jsxs(Ic.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},className:"bg-white rounded-[2.5rem] p-8 max-w-lg w-full shadow-2xl border border-emerald-100 relative overflow-hidden",children:[J.jsx("div",{className:"absolute top-0 left-0 w-full h-2 bg-emerald-500"}),J.jsxs("div",{className:"flex justify-between items-start mb-6",children:[J.jsx("div",{className:"bg-emerald-100 p-3 rounded-2xl",children:J.jsx(Yp,{className:"w-8 h-8 text-emerald-600"})}),J.jsx("button",{onClick:()=>Z(!1),className:"p-2 hover:bg-gray-100 rounded-xl transition-colors",children:J.jsx(yD,{className:"w-6 h-6 text-gray-400"})})]}),J.jsx("h3",{className:"text-2xl font-black text-gray-900 mb-2",children:"Link bài tập đã sẵn sàng!"}),J.jsx("p",{className:"text-gray-500 font-medium mb-6",children:"Gửi link này cho học sinh để các em bắt đầu làm bài trực tuyến."}),J.jsxs("div",{className:"space-y-6",children:[J.jsxs("div",{className:Dc("p-4 rounded-2xl border transition-all",te.includes("ais-dev-")||te.includes("ai.studio")?"bg-red-50 border-red-100":"bg-emerald-50 border-emerald-100"),children:[J.jsxs("div",{className:"flex items-center justify-between mb-3",children:[J.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:"Cấu hình Link công khai"}),J.jsx("button",{onClick:()=>Ie(!_e),className:"text-xs font-bold text-emerald-600 hover:underline",children:_e?"Xong":"Thay đổi"})]}),_e?J.jsxs("div",{className:"space-y-2",children:[J.jsx("input",{type:"text",value:te,onChange:xe=>{ie(xe.target.value),localStorage.setItem("ai_edubank_public_url",xe.target.value)},placeholder:"Dán Shared App URL vào đây...",className:"w-full px-3 py-2 bg-white border border-gray-200 rounded-xl text-sm font-mono focus:ring-2 focus:ring-emerald-500 outline-none"}),J.jsxs("p",{className:"text-[10px] text-gray-500 leading-relaxed",children:["Mẹo: Nhấn nút ",J.jsx("b",{children:"Share"})," ở góc trên bên phải AI Studio, copy ",J.jsx("b",{children:"Shared App URL"})," và dán vào đây. Hệ thống đã được tối ưu hóa để link hoạt động tốt nhất trên Zalo, Messenger và mọi trình duyệt."]})]}):J.jsxs("div",{className:"flex items-center gap-2",children:[J.jsx("div",{className:Dc("w-2 h-2 rounded-full animate-pulse",te.includes("ais-dev-")||te.includes("ai.studio")?"bg-red-500":"bg-emerald-500")}),J.jsx("p",{className:"text-sm font-mono text-gray-700 truncate flex-1",children:te})]}),(te.includes("ais-dev-")||te.includes("ai.studio"))&&!_e&&J.jsxs("div",{className:"mt-3 flex items-start gap-2 text-red-700 text-[11px] font-medium leading-tight",children:[J.jsx(mD,{className:"w-3.5 h-3.5 shrink-0"}),J.jsx("p",{children:'Cảnh báo: Link này không đúng. Học sinh sẽ KHÔNG mở được. Hãy nhấn "Thay đổi" và dán link Shared App URL vào.'})]})]}),(te.includes("ais-dev-")||te.includes("ai.studio"))&&J.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 rounded-xl flex items-start gap-3",children:[J.jsx(mD,{className:"w-5 h-5 text-red-500 shrink-0 mt-0.5"}),J.jsxs("div",{className:"space-y-1",children:[J.jsx("p",{className:"text-xs font-black text-red-700",children:"Cảnh báo: Link không hợp lệ"}),J.jsxs("p",{className:"text-[10px] text-red-600 leading-relaxed",children:["Bạn đang dùng link ",J.jsx("b",{children:te.includes("ai.studio")?"ai.studio":"ais-dev-..."}),". Link này chỉ hoạt động khi bạn đang mở AI Studio. Để học sinh vào được, hãy nhấn nút ",J.jsx("b",{children:"Share"})," ở góc trên bên phải AI Studio, copy ",J.jsx("b",{children:"Shared App URL"})," và dán vào ô bên dưới."]})]})]}),J.jsxs("div",{className:"bg-gray-50 p-4 rounded-2xl border border-gray-100 flex items-center gap-3",children:[J.jsx("div",{className:"flex-1 overflow-hidden",children:J.jsx("p",{className:"text-sm font-mono text-emerald-700 truncate select-all",children:ge})}),J.jsxs("div",{className:"flex gap-2",children:[J.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(ge),H(!0),setTimeout(()=>H(!1),2e3)},className:Dc("flex-1 px-4 py-4 rounded-2xl font-black text-sm transition-all flex items-center justify-center gap-2",L?"bg-emerald-500 text-white":"bg-emerald-600 text-white hover:bg-emerald-700 shadow-lg shadow-emerald-100"),children:[L?J.jsx(Hf,{className:"w-5 h-5"}):J.jsx(Yp,{className:"w-5 h-5"}),L?"Đã chép":"Chép link"]}),J.jsxs("button",{onClick:()=>window.open(ge,"_blank"),className:"px-4 py-4 bg-white text-emerald-600 border-2 border-emerald-100 rounded-2xl font-black text-sm hover:bg-emerald-50 transition-all flex items-center justify-center gap-2",children:[J.jsx(My,{className:"w-5 h-5"}),"Xem thử"]})]})]}),J.jsx("div",{className:"space-y-4",children:J.jsxs("a",{href:ge,target:"_blank",rel:"noopener noreferrer",className:"w-full py-4 bg-gray-900 text-white font-black rounded-2xl hover:bg-gray-800 transition-all flex items-center justify-center gap-2",children:[J.jsx(Kp,{className:"w-5 h-5"}),"Mở thử link học sinh"]})})]})]})})}),J.jsx("footer",{className:"max-w-5xl mx-auto px-6 py-12 border-t border-gray-100 mt-12",children:J.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[J.jsxs("div",{className:"flex items-center gap-2 text-gray-400 text-[10px] font-black uppercase tracking-[0.3em]",children:[J.jsx(_y,{className:"w-4 h-4"}),J.jsx("span",{children:"AI EduBank Pro © 2026"})]}),J.jsx("div",{className:"p-2 bg-gray-50 rounded-lg border border-gray-100",children:J.jsxs("p",{className:"text-[8px] font-mono text-gray-400 break-all max-w-md",children:["DEBUG URL: ",window.location.href]})})]})})]}):J.jsx("div",{className:"min-h-screen bg-[#FDFDFD] flex items-center justify-center",children:J.jsx(bx,{className:"w-12 h-12 text-emerald-600 animate-spin"})})}function DM({active:n,onClick:e,icon:t,label:i}){return J.jsxs("button",{onClick:e,className:Dc("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-bold transition-all",n?"bg-white text-emerald-600 shadow-sm":"text-gray-400 hover:text-gray-600"),children:[t,i]})}gse.createRoot(document.getElementById("root")).render(J.jsx(Se.StrictMode,{children:J.jsx(Pae,{children:J.jsx(_Pe,{})})}));
