vendor: 6,397 bytes, lines 1-9
1var nW=Object.defineProperty;var EO=r=>{throw TypeError(r)};var sW=(r,e,t)=>e in r?nW(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var oe=(r,e,t)=>sW(r,typeof e!="symbol"?e+"":e,t),NA=(r,e,t)=>e.has(r)||EO("Cannot "+t);var h=(r,e,t)=>(NA(r,e,"read from private field"),t?t.call(r):e.get(r)),R=(r,e,t)=>e.has(r)?EO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),C=(r,e,t,n)=>(NA(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),j=(r,e,t)=>(NA(r,e,"access private method"),t);var tr=(r,e,t,n)=>({set _(s){C(r,e,s,t)},get _(){return h(r,e,n)}});function iW(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();var aW=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jR(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var uL={exports:{}},uE={},dL={exports:{}},At={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var jb=Symbol.for("react.element"),oW=Symbol.for("react.portal"),lW=Symbol.for("react.fragment"),cW=Symbol.for("react.strict_mode"),uW=Symbol.for("react.profiler"),dW=Symbol.for("react.provider"),hW=Symbol.for("react.context"),fW=Symbol.for("react.forward_ref"),pW=Symbol.for("react.suspense"),mW=Symbol.for("react.memo"),gW=Symbol.for("react.lazy"),AO=Symbol.iterator;function xW(r){return r===null||typeof r!="object"?null:(r=AO&&r[AO]||r["@@iterator"],typeof r=="function"?r:null)}var hL={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fL=Object.assign,pL={};function Jx(r,e,t){this.props=r,this.context=e,this.refs=pL,this.updater=t||hL}Jx.prototype.isReactComponent={};Jx.prototype.setState=function(r,e){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,e,"setState")};Jx.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function mL(){}mL.prototype=Jx.prototype;function OR(r,e,t){this.props=r,this.context=e,this.refs=pL,this.updater=t||hL}var FR=OR.prototype=new mL;FR.constructor=OR;fL(FR,Jx.prototype);FR.isPureReactComponent=!0;var TO=Array.isArray,gL=Object.prototype.hasOwnProperty,DR={current:null},xL={key:!0,ref:!0,__self:!0,__source:!0};function vL(r,e,t){var n,s={},i=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)gL.call(e,n)&&!xL.hasOwnProperty(n)&&(s[n]=e[n]);var o=arguments.length-2;if(o===1)s.children=t;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];s.children=l}if(r&&r.defaultProps)for(n in o=r.defaultProps,o)s[n]===void 0&&(s[n]=o[n]);return{$$typeof:jb,type:r,key:i,ref:a,props:s,_owner:DR.current}}function vW(r,e){return{$$typeof:jb,type:r.type,key:e,ref:r.ref,props:r.props,_owner:r._owner}}function MR(r){return typeof r=="object"&&r!==null&&r.$$typeof===jb}function yW(r){var e={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(t){return e[t]})}var CO=/\/+/g;function PA(r,e){return typeof r=="object"&&r!==null&&r.key!=null?yW(""+r.key):e.toString(36)}function hk(r,e,t,n,s){var i=typeof r;(i==="undefined"||i==="boolean")&&(r=null);var a=!1;if(r===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(r.$$typeof){case jb:case oW:a=!0}}if(a)return a=r,s=s(a),r=n===""?"."+PA(a,0):n,TO(s)?(t="",r!=null&&(t=r.replace(CO,"$&/")+"/"),hk(s,e,t,"",function(c){return c})):s!=null&&(MR(s)&&(s=vW(s,t+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(CO,"$&/")+"/")+r)),e.push(s)),1;if(a=0,n=n===""?".":n+":",TO(r))for(var o=0;o<r.length;o++){i=r[o];var l=n+PA(i,o);a+=hk(i,e,t,l,s)}else if(l=xW(r),typeof l=="function")for(r=l.call(r),o=0;!(i=r.next()).done;)i=i.value,l=n+PA(i,o++),a+=hk(i,e,t,l,s);else if(i==="object")throw e=String(r),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function l_(r,e,t){if(r==null)return r;var n=[],s=0;return hk(r,n,"","",function(i){return e.call(t,i,s++)}),n}function wW(r){if(r._status===-1){var e=r._result;e=e(),e.then(function(t){(r._status===0||r._status===-1)&&(r._status=1,r._result=t)},function(t){(r._status===0||r._status===-1)&&(r._status=2,r._result=t)}),r._status===-1&&(r._status=0,r._result=e)}if(r._status===1)return r._result.default;throw r._result}var ii={current:null},fk={transition:null},bW={ReactCurrentDispatcher:ii,ReactCurrentBatchConfig:fk,ReactCurrentOwner:DR};function yL(){throw Error("act(...) is not supported in production builds of React.")}At.Children={map:l_,forEach:function(r,e,t){l_(r,function(){e.apply(this,arguments)},t)},count:function(r){var e=0;return l_(r,function(){e++}),e},toArray:function(r){return l_(r,function(e){return e})||[]},only:function(r){if(!MR(r))throw Error("React.Children.only expected to receive a single React element child.");return r}};At.Component=Jx;At.Fragment=lW;At.Profiler=uW;At.PureComponent=OR;At.StrictMode=cW;At.Suspense=pW;
vendor: 9,032 bytes, lines 9-33
9At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bW;At.act=yL;At.cloneElement=function(r,e,t){if(r==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+r+".");var n=fL({},r.props),s=r.key,i=r.ref,a=r._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,a=DR.current),e.key!==void 0&&(s=""+e.key),r.type&&r.type.defaultProps)var o=r.type.defaultProps;for(l in e)gL.call(e,l)&&!xL.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=t;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];n.children=o}return{$$typeof:jb,type:r.type,key:s,ref:i,props:n,_owner:a}};At.createContext=function(r){return r={$$typeof:hW,_currentValue:r,_currentValue2:r,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},r.Provider={$$typeof:dW,_context:r},r.Consumer=r};At.createElement=vL;At.createFactory=function(r){var e=vL.bind(null,r);return e.type=r,e};At.createRef=function(){return{current:null}};At.forwardRef=function(r){return{$$typeof:fW,render:r}};At.isValidElement=MR;At.lazy=function(r){return{$$typeof:gW,_payload:{_status:-1,_result:r},_init:wW}};At.memo=function(r,e){return{$$typeof:mW,type:r,compare:e===void 0?null:e}};At.startTransition=function(r){var e=fk.transition;fk.transition={};try{r()}finally{fk.transition=e}};At.unstable_act=yL;At.useCallback=function(r,e){return ii.current.useCallback(r,e)};At.useContext=function(r){return ii.current.useContext(r)};At.useDebugValue=function(){};At.useDeferredValue=function(r){return ii.current.useDeferredValue(r)};At.useEffect=function(r,e){return ii.current.useEffect(r,e)};At.useId=function(){return ii.current.useId()};At.useImperativeHandle=function(r,e,t){return ii.current.useImperativeHandle(r,e,t)};At.useInsertionEffect=function(r,e){return ii.current.useInsertionEffect(r,e)};At.useLayoutEffect=function(r,e){return ii.current.useLayoutEffect(r,e)};At.useMemo=function(r,e){return ii.current.useMemo(r,e)};At.useReducer=function(r,e,t){return ii.current.useReducer(r,e,t)};At.useRef=function(r){return ii.current.useRef(r)};At.useState=function(r){return ii.current.useState(r)};At.useSyncExternalStore=function(r,e,t){return ii.current.useSyncExternalStore(r,e,t)};At.useTransition=function(){return ii.current.useTransition()};At.version="18.3.1";dL.exports=At;var S=dL.exports;const be=jR(S),wL=iW({__proto__:null,default:be},[S]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var _W=S,kW=Symbol.for("react.element"),SW=Symbol.for("react.fragment"),EW=Object.prototype.hasOwnProperty,AW=_W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,TW={key:!0,ref:!0,__self:!0,__source:!0};function bL(r,e,t){var n,s={},i=null,a=null;t!==void 0&&(i=""+t),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)EW.call(e,n)&&!TW.hasOwnProperty(n)&&(s[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)s[n]===void 0&&(s[n]=e[n]);return{$$typeof:kW,type:r,key:i,ref:a,props:s,_owner:AW.current}}uE.Fragment=SW;uE.jsx=bL;uE.jsxs=bL;uL.exports=uE;var d=uL.exports,_L={exports:{}},va={},kL={exports:{}},SL={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(r){function e(Y,F){var J=Y.length;Y.push(F);e:for(;0<J;){var ne=J-1>>>1,I=Y[ne];if(0<s(I,F))Y[ne]=F,Y[J]=I,J=ne;else break e}}function t(Y){return Y.length===0?null:Y[0]}function n(Y){if(Y.length===0)return null;var F=Y[0],J=Y.pop();if(J!==F){Y[0]=J;e:for(var ne=0,I=Y.length,z=I>>>1;ne<z;){var M=2*(ne+1)-1,U=Y[M],te=M+1,re=Y[te];if(0>s(U,J))te<I&&0>s(re,U)?(Y[ne]=re,Y[te]=J,ne=te):(Y[ne]=U,Y[M]=J,ne=M);else if(te<I&&0>s(re,J))Y[ne]=re,Y[te]=J,ne=te;else break e}}return F}function s(Y,F){var J=Y.sortIndex-F.sortIndex;return J!==0?J:Y.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;r.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();r.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,f=null,p=3,m=!1,x=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(Y){for(var F=t(c);F!==null;){if(F.callback===null)n(c);else if(F.startTime<=Y)n(c),F.sortIndex=F.expirationTime,e(l,F);else break;F=t(c)}}function _(Y){if(g=!1,b(Y),!x)if(t(l)!==null)x=!0,X(T);else{var F=t(c);F!==null&&W(_,F.startTime-Y)}}function T(Y,F){x=!1,g&&(g=!1,v(k),k=-1),m=!0;var J=p;try{for(b(F),f=t(l);f!==null&&(!(f.expirationTime>F)||Y&&!O());){var ne=f.callback;if(typeof ne=="function"){f.callback=null,p=f.priorityLevel;var I=ne(f.expirationTime<=F);F=r.unstable_now(),typeof I=="function"?f.callback=I:f===t(l)&&n(l),b(F)}else n(l);f=t(l)}if(f!==null)var z=!0;else{var M=t(c);M!==null&&W(_,M.startTime-F),z=!1}return z}finally{f=null,p=J,m=!1}}var A=!1,N=null,k=-1,E=5,P=-1;function O(){return!(r.unstable_now()-P<E)}function D(){if(N!==null){var Y=r.unstable_now();P=Y;var F=!0;try{F=N(!0,Y)}finally{F?H():(A=!1,N=null)}}else A=!1}var H;if(typeof w=="function")H=function(){w(D)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,ee=B.port2;B.port1.onmessage=D,H=function(){ee.postMessage(null)}}else H=function(){y(D,0)};function X(Y){N=Y,A||(A=!0,H())}function W(Y,F){k=y(function(){Y(r.unstable_now())},F)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(Y){Y.callback=null},r.unstable_continueExecution=function(){x||m||(x=!0,X(T))},r.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<Y?Math.floor(1e3/Y):5},r.unstable_getCurrentPriorityLevel=function(){return p},r.unstable_getFirstCallbackNode=function(){return t(l)},r.unstable_next=function(Y){switch(p){case 1:case 2:case 3:var F=3;break;default:F=p}var J=p;p=F;try{return Y()}finally{p=J}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(Y,F){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var J=p;p=Y;try{return F()}finally{p=J}},r.unstable_scheduleCallback=function(Y,F,J){var ne=r.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ne+J:ne):J=ne,Y){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=J+I,Y={id:u++,callback:F,priorityLevel:Y,startTime:J,expirationTime:I,sortIndex:-1},J>ne?(Y.sortIndex=J,e(c,Y),t(l)===null&&Y===t(c)&&(g?(v(k),k=-1):g=!0,W(_,J-ne))):(Y.sortIndex=I,e(l,Y),x||m||(x=!0,X(T))),Y},r.unstable_shouldYield=O,r.unstable_wrapCallback=function(Y){var F=p;return function(){var J=p;p=F;try{return Y.apply(this,arguments)}finally{p=J}}}})(SL);kL.exports=SL;var CW=kL.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var NW=S,ma=CW;function ye(r){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+r,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var EL=new Set,Hy={};function O0(r,e){Cx(r,e),Cx(r+"Capture",e)}function Cx(r,e){for(Hy[r]=e,r=0;r<e.length;r++)EL.add(e[r])}var vu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nC=Object.prototype.hasOwnProperty,PW=/^[: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]*$/,NO={},PO={};function RW(r){return nC.call(PO,r)?!0:nC.call(NO,r)?!1:PW.test(r)?PO[r]=!0:(NO[r]=!0,!1)}function jW(r,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function OW(r,e,t,n){if(e===null||typeof e>"u"||jW(r,e,t,n))return!0;
vendor: 5,200 bytes, lines 33-34
33if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ai(r,e,t,n,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=r,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var ps={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){ps[r]=new ai(r,0,!1,r,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var e=r[0];ps[e]=new ai(e,1,!1,r[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(r){ps[r]=new ai(r,2,!1,r.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){ps[r]=new ai(r,2,!1,r,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){ps[r]=new ai(r,3,!1,r.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(r){ps[r]=new ai(r,3,!0,r,null,!1,!1)});["capture","download"].forEach(function(r){ps[r]=new ai(r,4,!1,r,null,!1,!1)});["cols","rows","size","span"].forEach(function(r){ps[r]=new ai(r,6,!1,r,null,!1,!1)});["rowSpan","start"].forEach(function(r){ps[r]=new ai(r,5,!1,r.toLowerCase(),null,!1,!1)});var IR=/[\-:]([a-z])/g;function LR(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var e=r.replace(IR,LR);ps[e]=new ai(e,1,!1,r,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var e=r.replace(IR,LR);ps[e]=new ai(e,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(r){var e=r.replace(IR,LR);ps[e]=new ai(e,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(r){ps[r]=new ai(r,1,!1,r.toLowerCase(),null,!1,!1)});ps.xlinkHref=new ai("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(r){ps[r]=new ai(r,1,!1,r.toLowerCase(),null,!0,!0)});function BR(r,e,t,n){var s=ps.hasOwnProperty(e)?ps[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(OW(e,t,s,n)&&(t=null),n||s===null?RW(e)&&(t===null?r.removeAttribute(e):r.setAttribute(e,""+t)):s.mustUseProperty?r[s.propertyName]=t===null?s.type===3?!1:"":t:(e=s.attributeName,n=s.attributeNamespace,t===null?r.removeAttribute(e):(s=s.type,t=s===3||s===4&&t===!0?"":""+t,n?r.setAttributeNS(n,e,t):r.setAttribute(e,t))))}var ju=NW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c_=Symbol.for("react.element"),gm=Symbol.for("react.portal"),xm=Symbol.for("react.fragment"),UR=Symbol.for("react.strict_mode"),sC=Symbol.for("react.profiler"),AL=Symbol.for("react.provider"),TL=Symbol.for("react.context"),$R=Symbol.for("react.forward_ref"),iC=Symbol.for("react.suspense"),aC=Symbol.for("react.suspense_list"),zR=Symbol.for("react.memo"),qu=Symbol.for("react.lazy"),CL=Symbol.for("react.offscreen"),RO=Symbol.iterator;function _v(r){return r===null||typeof r!="object"?null:(r=RO&&r[RO]||r["@@iterator"],typeof r=="function"?r:null)}var Vr=Object.assign,RA;function Bv(r){if(RA===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);RA=e&&e[1]||""}return` 34`+RA+r}var jA=!1;function OA(r,e){if(!r||jA)return"";jA=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var n=c}Reflect.construct(r,[],e)}else{try{e.call()}catch(c){n=c}r.call(e.prototype)}else{try{throw Error()}catch(c){n=c}r()}}
vendor: 4,826 bytes, lines 34-37
34catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(` 35`),i=n.stack.split(` 36`),a=s.length-1,o=i.length-1;1<=a&&0<=o&&s[a]!==i[o];)o--;for(;1<=a&&0<=o;a--,o--)if(s[a]!==i[o]){if(a!==1||o!==1)do if(a--,o--,0>o||s[a]!==i[o]){var l=` 37`+s[a].replace(" at new "," at ");return r.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",r.displayName)),l}while(1<=a&&0<=o);break}}}finally{jA=!1,Error.prepareStackTrace=t}return(r=r?r.displayName||r.name:"")?Bv(r):""}function FW(r){switch(r.tag){case 5:return Bv(r.type);case 16:return Bv("Lazy");case 13:return Bv("Suspense");case 19:return Bv("SuspenseList");case 0:case 2:case 15:return r=OA(r.type,!1),r;case 11:return r=OA(r.type.render,!1),r;case 1:return r=OA(r.type,!0),r;default:return""}}function oC(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case xm:return"Fragment";case gm:return"Portal";case sC:return"Profiler";case UR:return"StrictMode";case iC:return"Suspense";case aC:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case TL:return(r.displayName||"Context")+".Consumer";case AL:return(r._context.displayName||"Context")+".Provider";case $R:var e=r.render;return r=r.displayName,r||(r=e.displayName||e.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case zR:return e=r.displayName||null,e!==null?e:oC(r.type)||"Memo";case qu:e=r._payload,r=r._init;try{return oC(r(e))}catch{}}return null}function DW(r){var e=r.type;switch(r.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=e.render,r=r.displayName||r.name||"",e.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oC(e);case 8:return e===UR?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Nh(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function NL(r){var e=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function MW(r){var e=NL(r)?"checked":"value",t=Object.getOwnPropertyDescriptor(r.constructor.prototype,e),n=""+r[e];if(!r.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,i=t.set;return Object.defineProperty(r,e,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(r,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){r._valueTracker=null,delete r[e]}}}}function u_(r){r._valueTracker||(r._valueTracker=MW(r))}function PL(r){if(!r)return!1;var e=r._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return r&&(n=NL(r)?r.checked?"true":"false":r.value),r=n,r!==t?(e.setValue(r),!0):!1}function y2(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function lC(r,e){var t=e.checked;return Vr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??r._wrapperState.initialChecked})}function jO(r,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Nh(e.value!=null?e.value:t),r._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function RL(r,e){e=e.checked,e!=null&&BR(r,"checked",e,!1)}function cC(r,e){RL(r,e);var t=Nh(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&r.value===""||r.value!=t)&&(r.value=""+t):r.value!==""+t&&(r.value=""+t);else if(n==="submit"||n==="reset"){r.removeAttribute("value");return}e.hasOwnProperty("value")?uC(r,e.type,t):e.hasOwnProperty("defaultValue")&&uC(r,e.type,Nh(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(r.defaultChecked=!!e.defaultChecked)}function OO(r,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+r._wrapperState.initialValue,t||e===r.value||(r.value=e),r.defaultValue=e}t=r.name,t!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,t!==""&&(r.name=t)}function uC(r,e,t){(e!=="number"||y2(r.ownerDocument)!==r)&&(t==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+t&&(r.defaultValue=""+t))}var Uv=Array.isArray;
vendor: 11,927 bytes, line 37
37function Om(r,e,t,n){if(r=r.options,e){e={};for(var s=0;s<t.length;s++)e["$"+t[s]]=!0;for(t=0;t<r.length;t++)s=e.hasOwnProperty("$"+r[t].value),r[t].selected!==s&&(r[t].selected=s),s&&n&&(r[t].defaultSelected=!0)}else{for(t=""+Nh(t),e=null,s=0;s<r.length;s++){if(r[s].value===t){r[s].selected=!0,n&&(r[s].defaultSelected=!0);return}e!==null||r[s].disabled||(e=r[s])}e!==null&&(e.selected=!0)}}function dC(r,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ye(91));return Vr({},e,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function FO(r,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(ye(92));if(Uv(t)){if(1<t.length)throw Error(ye(93));t=t[0]}e=t}e==null&&(e=""),t=e}r._wrapperState={initialValue:Nh(t)}}function jL(r,e){var t=Nh(e.value),n=Nh(e.defaultValue);t!=null&&(t=""+t,t!==r.value&&(r.value=t),e.defaultValue==null&&r.defaultValue!==t&&(r.defaultValue=t)),n!=null&&(r.defaultValue=""+n)}function DO(r){var e=r.textContent;e===r._wrapperState.initialValue&&e!==""&&e!==null&&(r.value=e)}function OL(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hC(r,e){return r==null||r==="http://www.w3.org/1999/xhtml"?OL(e):r==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var d_,FL=function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,n,s){MSApp.execUnsafeLocalFunction(function(){return r(e,t,n,s)})}:r}(function(r,e){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=e;else{for(d_=d_||document.createElement("div"),d_.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=d_.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;e.firstChild;)r.appendChild(e.firstChild)}});function Wy(r,e){if(e){var t=r.firstChild;if(t&&t===r.lastChild&&t.nodeType===3){t.nodeValue=e;return}}r.textContent=e}var xy={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},IW=["Webkit","ms","Moz","O"];Object.keys(xy).forEach(function(r){IW.forEach(function(e){e=e+r.charAt(0).toUpperCase()+r.substring(1),xy[e]=xy[r]})});function DL(r,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||xy.hasOwnProperty(r)&&xy[r]?(""+e).trim():e+"px"}function ML(r,e){r=r.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,s=DL(t,e[t],n);t==="float"&&(t="cssFloat"),n?r.setProperty(t,s):r[t]=s}}var LW=Vr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fC(r,e){if(e){if(LW[r]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ye(137,r));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ye(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ye(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ye(62))}}function pC(r,e){if(r.indexOf("-")===-1)return typeof e.is=="string";switch(r){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 mC=null;function HR(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var gC=null,Fm=null,Dm=null;function MO(r){if(r=Db(r)){if(typeof gC!="function")throw Error(ye(280));var e=r.stateNode;e&&(e=mE(e),gC(r.stateNode,r.type,e))}}function IL(r){Fm?Dm?Dm.push(r):Dm=[r]:Fm=r}function LL(){if(Fm){var r=Fm,e=Dm;if(Dm=Fm=null,MO(r),e)for(r=0;r<e.length;r++)MO(e[r])}}function BL(r,e){return r(e)}function UL(){}var FA=!1;function $L(r,e,t){if(FA)return r(e,t);FA=!0;try{return BL(r,e,t)}finally{FA=!1,(Fm!==null||Dm!==null)&&(UL(),LL())}}function Vy(r,e){var t=r.stateNode;if(t===null)return null;var n=mE(t);if(n===null)return null;t=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(r=r.type,n=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!n;break e;default:r=!1}if(r)return null;if(t&&typeof t!="function")throw Error(ye(231,e,typeof t));return t}var xC=!1;if(vu)try{var kv={};Object.defineProperty(kv,"passive",{get:function(){xC=!0}}),window.addEventListener("test",kv,kv),window.removeEventListener("test",kv,kv)}catch{xC=!1}function BW(r,e,t,n,s,i,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var vy=!1,w2=null,b2=!1,vC=null,UW={onError:function(r){vy=!0,w2=r}};function $W(r,e,t,n,s,i,a,o,l){vy=!1,w2=null,BW.apply(UW,arguments)}function zW(r,e,t,n,s,i,a,o,l){if($W.apply(this,arguments),vy){if(vy){var c=w2;vy=!1,w2=null}else throw Error(ye(198));b2||(b2=!0,vC=c)}}function F0(r){var e=r,t=r;if(r.alternate)for(;e.return;)e=e.return;else{r=e;do e=r,e.flags&4098&&(t=e.return),r=e.return;while(r)}return e.tag===3?t:null}function zL(r){if(r.tag===13){var e=r.memoizedState;if(e===null&&(r=r.alternate,r!==null&&(e=r.memoizedState)),e!==null)return e.dehydrated}return null}function IO(r){if(F0(r)!==r)throw Error(ye(188))}function HW(r){var e=r.alternate;if(!e){if(e=F0(r),e===null)throw Error(ye(188));return e!==r?null:r}for(var t=r,n=e;;){var s=t.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){t=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===t)return IO(s),r;if(i===n)return IO(s),e;i=i.sibling}throw Error(ye(188))}if(t.return!==n.return)t=s,n=i;else{for(var a=!1,o=s.child;o;){if(o===t){a=!0,t=s,n=i;break}if(o===n){a=!0,n=s,t=i;break}o=o.sibling}if(!a){for(o=i.child;o;){if(o===t){a=!0,t=i,n=s;break}if(o===n){a=!0,n=i,t=s;break}o=o.sibling}if(!a)throw Error(ye(189))}}if(t.alternate!==n)throw Error(ye(190))}if(t.tag!==3)throw Error(ye(188));return t.stateNode.current===t?r:e}function HL(r){return r=HW(r),r!==null?WL(r):null}function WL(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var e=WL(r);if(e!==null)return e;r=r.sibling}return null}var VL=ma.unstable_scheduleCallback,LO=ma.unstable_cancelCallback,WW=ma.unstable_shouldYield,VW=ma.unstable_requestPaint,dn=ma.unstable_now,GW=ma.unstable_getCurrentPriorityLevel,WR=ma.unstable_ImmediatePriority,GL=ma.unstable_UserBlockingPriority,_2=ma.unstable_NormalPriority,KW=ma.unstable_LowPriority,KL=ma.unstable_IdlePriority,dE=null,Xl=null;function XW(r){if(Xl&&typeof Xl.onCommitFiberRoot=="function")try{Xl.onCommitFiberRoot(dE,r,void 0,(r.current.flags&128)===128)}catch{}}var Vo=Math.clz32?Math.clz32:ZW,YW=Math.log,qW=Math.LN2;function ZW(r){return r>>>=0,r===0?32:31-(YW(r)/qW|0)|0}var h_=64,f_=4194304;function $v(r){switch(r&-r){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: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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function k2(r,e){var t=r.pendingLanes;if(t===0)return 0;var n=0,s=r.suspendedLanes,i=r.pingedLanes,a=t&268435455;if(a!==0){var o=a&~s;o!==0?n=$v(o):(i&=a,i!==0&&(n=$v(i)))}else a=t&~s,a!==0?n=$v(a):i!==0&&(n=$v(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&s)&&(s=n&-n,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(n&4&&(n|=t&16),e=r.entangledLanes,e!==0)for(r=r.entanglements,e&=n;0<e;)t=31-Vo(e),s=1<<t,n|=r[t],e&=~s;return n}function JW(r,e){switch(r){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QW(r,e){for(var t=r.suspendedLanes,n=r.pingedLanes,s=r.expirationTimes,i=r.pendingLanes;0<i;){var a=31-Vo(i),o=1<<a,l=s[a];l===-1?(!(o&t)||o&n)&&(s[a]=JW(o,e)):l<=e&&(r.expiredLanes|=o),i&=~o}}function yC(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function XL(){var r=h_;return h_<<=1,!(h_&4194240)&&(h_=64),r}function DA(r){for(var e=[],t=0;31>t;t++)e.push(r);return e}function Ob(r,e,t){r.pendingLanes|=e,e!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,e=31-Vo(e),r[e]=t}function eV(r,e){var t=r.pendingLanes&~e;r.pendingLanes=e,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=e,r.mutableReadLanes&=e,r.entangledLanes&=e,e=r.entanglements;var n=r.eventTimes;for(r=r.expirationTimes;0<t;){var s=31-Vo(t),i=1<<s;e[s]=0,n[s]=-1,r[s]=-1,t&=~i}}function VR(r,e){var t=r.entangledLanes|=e;for(r=r.entanglements;t;){var n=31-Vo(t),s=1<<n;s&e|r[n]&e&&(r[n]|=e),t&=~s}}var er=0;function YL(r){return r&=-r,1<r?4<r?r&268435455?16:536870912:4:1}var qL,GR,ZL,JL,QL,wC=!1,p_=[],yh=null,wh=null,bh=null,Gy=new Map,Ky=new Map,Qu=[],tV="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 submit".split(" ");function BO(r,e){switch(r){case"focusin":case"focusout":yh=null;break;case"dragenter":case"dragleave":wh=null;break;case"mouseover":case"mouseout":bh=null;break;case"pointerover":case"pointerout":Gy.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ky.delete(e.pointerId)}}function Sv(r,e,t,n,s,i){return r===null||r.nativeEvent!==i?(r={blockedOn:e,domEventName:t,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Db(e),e!==null&&GR(e)),r):(r.eventSystemFlags|=n,e=r.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),r)}function rV(r,e,t,n,s){switch(e){case"focusin":return yh=Sv(yh,r,e,t,n,s),!0;case"dragenter":return wh=Sv(wh,r,e,t,n,s),!0;case"mouseover":return bh=Sv(bh,r,e,t,n,s),!0;case"pointerover":var i=s.pointerId;return Gy.set(i,Sv(Gy.get(i)||null,r,e,t,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Ky.set(i,Sv(Ky.get(i)||null,r,e,t,n,s)),!0}return!1}function e5(r){var e=bf(r.target);if(e!==null){var t=F0(e);if(t!==null){if(e=t.tag,e===13){if(e=zL(t),e!==null){r.blockedOn=e,QL(r.priority,function(){ZL(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){r.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pk(r){if(r.blockedOn!==null)return!1;for(var e=r.targetContainers;0<e.length;){var t=bC(r.domEventName,r.eventSystemFlags,e[0],r.nativeEvent);if(t===null){t=r.nativeEvent;var n=new t.constructor(t.type,t);mC=n,t.target.dispatchEvent(n),mC=null}else return e=Db(t),e!==null&&GR(e),r.blockedOn=t,!1;e.shift()}return!0}function UO(r,e,t){pk(r)&&t.delete(e)}function nV(){wC=!1,yh!==null&&pk(yh)&&(yh=null),wh!==null&&pk(wh)&&(wh=null),bh!==null&&pk(bh)&&(bh=null),Gy.forEac
vendor: 9,291 bytes, line 37
37h(UO),Ky.forEach(UO)}function Ev(r,e){r.blockedOn===e&&(r.blockedOn=null,wC||(wC=!0,ma.unstable_scheduleCallback(ma.unstable_NormalPriority,nV)))}function Xy(r){function e(s){return Ev(s,r)}if(0<p_.length){Ev(p_[0],r);for(var t=1;t<p_.length;t++){var n=p_[t];n.blockedOn===r&&(n.blockedOn=null)}}for(yh!==null&&Ev(yh,r),wh!==null&&Ev(wh,r),bh!==null&&Ev(bh,r),Gy.forEach(e),Ky.forEach(e),t=0;t<Qu.length;t++)n=Qu[t],n.blockedOn===r&&(n.blockedOn=null);for(;0<Qu.length&&(t=Qu[0],t.blockedOn===null);)e5(t),t.blockedOn===null&&Qu.shift()}var Mm=ju.ReactCurrentBatchConfig,S2=!0;function sV(r,e,t,n){var s=er,i=Mm.transition;Mm.transition=null;try{er=1,KR(r,e,t,n)}finally{er=s,Mm.transition=i}}function iV(r,e,t,n){var s=er,i=Mm.transition;Mm.transition=null;try{er=4,KR(r,e,t,n)}finally{er=s,Mm.transition=i}}function KR(r,e,t,n){if(S2){var s=bC(r,e,t,n);if(s===null)VA(r,e,n,E2,t),BO(r,n);else if(rV(s,r,e,t,n))n.stopPropagation();else if(BO(r,n),e&4&&-1<tV.indexOf(r)){for(;s!==null;){var i=Db(s);if(i!==null&&qL(i),i=bC(r,e,t,n),i===null&&VA(r,e,n,E2,t),i===s)break;s=i}s!==null&&n.stopPropagation()}else VA(r,e,n,null,t)}}var E2=null;function bC(r,e,t,n){if(E2=null,r=HR(n),r=bf(r),r!==null)if(e=F0(r),e===null)r=null;else if(t=e.tag,t===13){if(r=zL(e),r!==null)return r;r=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;r=null}else e!==r&&(r=null);return E2=r,null}function t5(r){switch(r){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(GW()){case WR:return 1;case GL:return 4;case _2:case KW:return 16;case KL:return 536870912;default:return 16}default:return 16}}var dh=null,XR=null,mk=null;function r5(){if(mk)return mk;var r,e=XR,t=e.length,n,s="value"in dh?dh.value:dh.textContent,i=s.length;for(r=0;r<t&&e[r]===s[r];r++);var a=t-r;for(n=1;n<=a&&e[t-n]===s[i-n];n++);return mk=s.slice(r,1<n?1-n:void 0)}function gk(r){var e=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&e===13&&(r=13)):r=e,r===10&&(r=13),32<=r||r===13?r:0}function m_(){return!0}function $O(){return!1}function ya(r){function e(t,n,s,i,a){this._reactName=t,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in r)r.hasOwnProperty(o)&&(t=r[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?m_:$O,this.isPropagationStopped=$O,this}return Vr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=m_)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=m_)},persist:function(){},isPersistent:m_}),e}var Qx={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},YR=ya(Qx),Fb=Vr({},Qx,{view:0,detail:0}),aV=ya(Fb),MA,IA,Av,hE=Vr({},Fb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qR,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Av&&(Av&&r.type==="mousemove"?(MA=r.screenX-Av.screenX,IA=r.screenY-Av.screenY):IA=MA=0,Av=r),MA)},movementY:function(r){return"movementY"in r?r.movementY:IA}}),zO=ya(hE),oV=Vr({},hE,{dataTransfer:0}),lV=ya(oV),cV=Vr({},Fb,{relatedTarget:0}),LA=ya(cV),uV=Vr({},Qx,{animationName:0,elapsedTime:0,pseudoElement:0}),dV=ya(uV),hV=Vr({},Qx,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),fV=ya(hV),pV=Vr({},Qx,{data:0}),HO=ya(pV),mV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gV={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"},xV={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vV(r){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(r):(r=xV[r])?!!e[r]:!1}function qR(){return vV}var yV=Vr({},Fb,{key:function(r){if(r.key){var e=mV[r.key]||r.key;if(e!=="Unidentified")return e}return r.type==="keypress"?(r=gk(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?gV[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qR,charCode:function(r){return r.type==="keypress"?gk(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?gk(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),wV=ya(yV),bV=Vr({},hE,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),WO=ya(bV),_V=Vr({},Fb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qR}),kV=ya(_V),SV=Vr({},Qx,{propertyName:0,elapsedTime:0,pseudoElement:0}),EV=ya(SV),AV=Vr({},hE,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),TV=ya(AV),CV=[9,13,27,32],ZR=vu&&"CompositionEvent"in window,yy=null;vu&&"documentMode"in document&&(yy=document.documentMode);var NV=vu&&"TextEvent"in window&&!yy,n5=vu&&(!ZR||yy&&8<yy&&11>=yy),VO=" ",GO=!1;function s5(r,e){switch(r){case"keyup":return CV.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i5(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var vm=!1;function PV(r,e){switch(r){case"compositionend":return i5(e);case"keypress":return e.which!==32?null:(GO=!0,VO);case"textInput":return r=e.data,r===VO&&GO?null:r;default:return null}}function RV(r,e){if(vm)return r==="compositionend"||!ZR&&s5(r,e)?(r=r5(),mk=XR=dh=null,vm=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return n5&&e.locale!=="ko"?null:e.data;default:return null}}var jV={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 KO(r){var e=r&&r.nodeName&&r.nodeName.toLowerCase();return e==="input"?!!jV[r.type]:e==="textarea"}function a5(r,e,t,n){IL(n),e=A2(e,"onChange"),0<e.length&&(t=new YR("onChange","change",null,t,n),r.push({event:t,listeners:e}))}var wy=null,Yy=null;function OV(r){x5(r,0)}function fE(r){var e=bm(r);if(PL(e))return r}function FV(r,e){if(r==="change")return e}var o5=!1;if(vu){var BA;if(vu){var UA="oninput"in document;if(!UA){var XO=document.createElement("div");XO.setAttribute("oninput","return;"),UA=typeof XO.oninput=="function"}BA=UA}else BA=!1;o5=BA&&(!document.documentMode||9<document.documentMode)}function YO(){wy&&(wy.detachEvent("onpropertychange",l5),Yy=wy=null)}function l5(r){if(r.propertyName==="value"&&fE(Yy)){var e=[];a5(e,Yy,r,HR(r)),$L(OV,e)}}function DV(r,e,t){r==="focusin"?(YO(),wy=e,Yy=t,wy.attachEvent("onpropertychange",l5)):r==="focusout"&&YO()}function MV(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return fE(Yy)}function IV(r,e){if(r==="click")return fE(e)}function LV(r,e){if(r==="input"||r==="change")return fE(e)}function BV(r,e){return r===e&&(r!==0||1/r===1/e)||r!==r&&e!==e}var el=typeof Object.is=="function"?Object.is:BV;function qy(r,e){if(el(r,e))return!0;
vendor: 4,808 bytes, line 37
37if(typeof r!="object"||r===null||typeof e!="object"||e===null)return!1;var t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(n=0;n<t.length;n++){var s=t[n];if(!nC.call(e,s)||!el(r[s],e[s]))return!1}return!0}function qO(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ZO(r,e){var t=qO(r);r=0;for(var n;t;){if(t.nodeType===3){if(n=r+t.textContent.length,r<=e&&n>=e)return{node:t,offset:e-r};r=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=qO(t)}}function c5(r,e){return r&&e?r===e?!0:r&&r.nodeType===3?!1:e&&e.nodeType===3?c5(r,e.parentNode):"contains"in r?r.contains(e):r.compareDocumentPosition?!!(r.compareDocumentPosition(e)&16):!1:!1}function u5(){for(var r=window,e=y2();e instanceof r.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)r=e.contentWindow;else break;e=y2(r.document)}return e}function JR(r){var e=r&&r.nodeName&&r.nodeName.toLowerCase();return e&&(e==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||e==="textarea"||r.contentEditable==="true")}function UV(r){var e=u5(),t=r.focusedElem,n=r.selectionRange;if(e!==t&&t&&t.ownerDocument&&c5(t.ownerDocument.documentElement,t)){if(n!==null&&JR(t)){if(e=n.start,r=n.end,r===void 0&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if(r=(e=t.ownerDocument||document)&&e.defaultView||window,r.getSelection){r=r.getSelection();var s=t.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!r.extend&&i>n&&(s=n,n=i,i=s),s=ZO(t,i);var a=ZO(t,n);s&&a&&(r.rangeCount!==1||r.anchorNode!==s.node||r.anchorOffset!==s.offset||r.focusNode!==a.node||r.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),r.removeAllRanges(),i>n?(r.addRange(e),r.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),r.addRange(e)))}}for(e=[],r=t;r=r.parentNode;)r.nodeType===1&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)r=e[t],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var $V=vu&&"documentMode"in document&&11>=document.documentMode,ym=null,_C=null,by=null,kC=!1;function JO(r,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;kC||ym==null||ym!==y2(n)||(n=ym,"selectionStart"in n&&JR(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),by&&qy(by,n)||(by=n,n=A2(_C,"onSelect"),0<n.length&&(e=new YR("onSelect","select",null,e,t),r.push({event:e,listeners:n}),e.target=ym)))}function g_(r,e){var t={};return t[r.toLowerCase()]=e.toLowerCase(),t["Webkit"+r]="webkit"+e,t["Moz"+r]="moz"+e,t}var wm={animationend:g_("Animation","AnimationEnd"),animationiteration:g_("Animation","AnimationIteration"),animationstart:g_("Animation","AnimationStart"),transitionend:g_("Transition","TransitionEnd")},$A={},d5={};vu&&(d5=document.createElement("div").style,"AnimationEvent"in window||(delete wm.animationend.animation,delete wm.animationiteration.animation,delete wm.animationstart.animation),"TransitionEvent"in window||delete wm.transitionend.transition);function pE(r){if($A[r])return $A[r];if(!wm[r])return r;var e=wm[r],t;for(t in e)if(e.hasOwnProperty(t)&&t in d5)return $A[r]=e[t];return r}var h5=pE("animationend"),f5=pE("animationiteration"),p5=pE("animationstart"),m5=pE("transitionend"),g5=new Map,QO="abort auxClick 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(" ");function Kh(r,e){g5.set(r,e),O0(e,[r])}for(var zA=0;zA<QO.length;zA++){var HA=QO[zA],zV=HA.toLowerCase(),HV=HA[0].toUpperCase()+HA.slice(1);Kh(zV,"on"+HV)}Kh(h5,"onAnimationEnd");Kh(f5,"onAnimationIteration");Kh(p5,"onAnimationStart");Kh("dblclick","onDoubleClick");Kh("focusin","onFocus");Kh("focusout","onBlur");Kh(m5,"onTransitionEnd");Cx("onMouseEnter",["mouseout","mouseover"]);Cx("onMouseLeave",["mouseout","mouseover"]);Cx("onPointerEnter",["pointerout","pointerover"]);Cx("onPointerLeave",["pointerout","pointerover"]);O0("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37O0("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));O0("onBeforeInput",["compositionend","keypress","textInput","paste"]);O0("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));O0("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));O0("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zv="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(" "),WV=new Set("cancel close invalid load scroll toggle".split(" ").concat(zv));function eF(r,e,t){var n=r.type||"unknown-event";r.currentTarget=t,zW(n,e,void 0,r),r.currentTarget=null}function x5(r,e){e=(e&4)!==0;for(var t=0;t<r.length;t++){var n=r[t],s=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==i&&s.isPropagationStopped())break e;eF(s,o,c),i=l}else for(a=0;a<n.length;a++){if(o=n[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==i&&s.isPropagationStopped())break e;eF(s,o,c),i=l}}}if(b2)throw r=vC,b2=!1,vC=null,r}function yr(r,e){var t=e[CC];t===void 0&&(t=e[CC]=new Set);var n=r+"__bubble";t.has(n)||(v5(e,r,2,!1),t.add(n))}function WA(r,e,t){var n=0;e&&(n|=4),v5(t,r,n,e)}var x_="_reactListening"+Math.random().toString(36).slice(2);function Zy(r){if(!r[x_]){r[x_]=!0,EL.forEach(function(t){t!=="selectionchange"&&(WV.has(t)||WA(t,!1,r),WA(t,!0,r))});var e=r.nodeType===9?r:r.ownerDocument;e===null||e[x_]||(e[x_]=!0,WA("selectionchange",!1,e))}}function v5(r,e,t,n){switch(t5(e)){case 1:var s=sV;break;case 4:s=iV;break;default:s=KR}t=s.bind(null,e,t,r),s=void 0,!xC||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),n?s!==void 0?r.addEventListener(e,t,{capture:!0,passive:s}):r.addEventListener(e,t,!0):s!==void 0?r.addEventListener(e,t,{passive:s}):r.addEventListener(e,t,!1)}function VA(r,e,t,n,s){var i=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(a===4)for(a=n.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;a=a.return}for(;o!==null;){if(a=bf(o),a===null)return;if(l=a.tag,l===5||l===6){n=i=a;continue e}o=o.parentNode}}n=n.return}$L(function(){var c=i,u=HR(t),f=[];e:{var p=g5.get(r);if(p!==void 0){var m=YR,x=r;switch(r){case"keypress":if(gk(t)===0)break e;case"keydown":case"keyup":m=wV;break;case"focusin":x="focus",m=LA;break;case"focusout":x="blur",m=LA;break;case"beforeblur":case"afterblur":m=LA;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=zO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=lV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=kV;break;case h5:case f5:case p5:m=dV;break;case m5:m=EV;break;case"scroll":m=aV;break;case"wheel":m=TV;break;case"copy":case"cut":case"paste":m=fV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=WO}var g=(e&4)!==0,y=!g&&r==="scroll",v=g?p!==null?p+"Capture":null:p;g=[];for(var w=c,b;w!==null;){b=w;var _=b.stateNode;if(b.tag===5&&_!==null&&(b=_,v!==null&&(_=Vy(w,v),_!=null&&g.push(Jy(w,_,b)))),y)break;w=w.return}0<g.length&&(p=new m(p,x,null,t,u),f.push({event:p,listeners:g}))}}if(!(e&7)){e:{if(p=r==="mouseover"||r==="pointerover",m=r==="mouseout"||r==="pointerout",p&&t!==mC&&(x=t.relatedTarget||t.fromElement)&&(bf(x)||x[yu]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(x=t.relatedTarget||t.toElement,m=c,x=x?bf(x):null,x!==null&&(y=F0(x),x!==y||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=c),m!==x)){if(g=zO,_="onMouseLeave",v="onMouseEnter",w="mouse",(r==="pointerout"||r==="pointerover")&&(g=WO,_="onPointerLeave",v="onPointerEnter",w="pointer"),y=m==null?p:bm(m),b=x==null?p:bm(x),p=new g(_,w+"leave",m,t,u),p.target=y,p.relatedTarget=b,_=null,bf(u)===c&&(g=new g(v,w+"enter",x,t,u),g.target=b,g.relatedTarget=y,_=g),y=_,m&&x)t:{for(g=m,v=x,w=0,b=g;b;b=W0(b))w++;for(b=0,_=v;_;_=W0(_))b++;for(;0<w-b;)g=W0(g),w--;for(;0<b-w;)v=W0(v),b--;for(;w--;){if(g===v||v!==null&&g===v.alternate)break t;g=W0(g),v=W0(v)}g=null}else g=null;m!==null&&tF(f,p,m,g,!1),x!==null&&y!==null&&tF(f,y,x,g,!0)}}
vendor: 5,862 bytes, lines 37-38
37e:{if(p=c?bm(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var T=FV;else if(KO(p))if(o5)T=LV;else{T=MV;var A=DV}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(T=IV);if(T&&(T=T(r,c))){a5(f,T,t,u);break e}A&&A(r,p,c),r==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&uC(p,"number",p.value)}switch(A=c?bm(c):window,r){case"focusin":(KO(A)||A.contentEditable==="true")&&(ym=A,_C=c,by=null);break;case"focusout":by=_C=ym=null;break;case"mousedown":kC=!0;break;case"contextmenu":case"mouseup":case"dragend":kC=!1,JO(f,t,u);break;case"selectionchange":if($V)break;case"keydown":case"keyup":JO(f,t,u)}var N;if(ZR)e:{switch(r){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else vm?s5(r,t)&&(k="onCompositionEnd"):r==="keydown"&&t.keyCode===229&&(k="onCompositionStart");k&&(n5&&t.locale!=="ko"&&(vm||k!=="onCompositionStart"?k==="onCompositionEnd"&&vm&&(N=r5()):(dh=u,XR="value"in dh?dh.value:dh.textContent,vm=!0)),A=A2(c,k),0<A.length&&(k=new HO(k,r,null,t,u),f.push({event:k,listeners:A}),N?k.data=N:(N=i5(t),N!==null&&(k.data=N)))),(N=NV?PV(r,t):RV(r,t))&&(c=A2(c,"onBeforeInput"),0<c.length&&(u=new HO("onBeforeInput","beforeinput",null,t,u),f.push({event:u,listeners:c}),u.data=N))}x5(f,e)})}function Jy(r,e,t){return{instance:r,listener:e,currentTarget:t}}function A2(r,e){for(var t=e+"Capture",n=[];r!==null;){var s=r,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Vy(r,t),i!=null&&n.unshift(Jy(r,i,s)),i=Vy(r,e),i!=null&&n.push(Jy(r,i,s))),r=r.return}return n}function W0(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function tF(r,e,t,n,s){for(var i=e._reactName,a=[];t!==null&&t!==n;){var o=t,l=o.alternate,c=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&c!==null&&(o=c,s?(l=Vy(t,i),l!=null&&a.unshift(Jy(t,l,o))):s||(l=Vy(t,i),l!=null&&a.push(Jy(t,l,o)))),t=t.return}a.length!==0&&r.push({event:e,listeners:a})}var VV=/\r\n?/g,GV=/\u0000|\uFFFD/g;function rF(r){return(typeof r=="string"?r:""+r).replace(VV,` 38`).replace(GV,"")}function v_(r,e,t){if(e=rF(e),rF(r)!==e&&t)throw Error(ye(425))}function T2(){}var SC=null,EC=null;function AC(r,e){return r==="textarea"||r==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var TC=typeof setTimeout=="function"?setTimeout:void 0,KV=typeof clearTimeout=="function"?clearTimeout:void 0,nF=typeof Promise=="function"?Promise:void 0,XV=typeof queueMicrotask=="function"?queueMicrotask:typeof nF<"u"?function(r){return nF.resolve(null).then(r).catch(YV)}:TC;function YV(r){setTimeout(function(){throw r})}function GA(r,e){var t=e,n=0;do{var s=t.nextSibling;if(r.removeChild(t),s&&s.nodeType===8)if(t=s.data,t==="/$"){if(n===0){r.removeChild(s),Xy(e);return}n--}else t!=="$"&&t!=="$?"&&t!=="$!"||n++;t=s}while(t);Xy(e)}function _h(r){for(;r!=null;r=r.nextSibling){var e=r.nodeType;if(e===1||e===3)break;if(e===8){if(e=r.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return r}function sF(r){r=r.previousSibling;for(var e=0;r;){if(r.nodeType===8){var t=r.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return r;e--}else t==="/$"&&e++}r=r.previousSibling}return null}var ev=Math.random().toString(36).slice(2),Wl="__reactFiber$"+ev,Qy="__reactProps$"+ev,yu="__reactContainer$"+ev,CC="__reactEvents$"+ev,qV="__reactListeners$"+ev,ZV="__reactHandles$"+ev;function bf(r){var e=r[Wl];if(e)return e;for(var t=r.parentNode;t;){if(e=t[yu]||t[Wl]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(r=sF(r);r!==null;){if(t=r[Wl])return t;r=sF(r)}return e}r=t,t=r.parentNode}return null}function Db(r){return r=r[Wl]||r[yu],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function bm(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(ye(33))}function mE(r){return r[Qy]||null}var NC=[],_m=-1;function Xh(r){return{current:r}}function Sr(r){0>_m||(r.current=NC[_m],NC[_m]=null,_m--)}function xr(r,e){_m++,NC[_m]=r.current,r.current=e}var Ph={},Ms=Xh(Ph),Si=Xh(!1),p0=Ph;function Nx(r,e){var t=r.type.contextTypes;if(!t)return Ph;var n=r.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in t)s[i]=e[i];return n&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=e,r.__reactInternalMemoizedMaskedChildContext=s),s}function Ei(r){return r=r.childContextTypes,r!=null}function C2(){Sr(Si),Sr(Ms)}function iF(r,e,t){if(Ms.current!==Ph)throw Error(ye(168));xr(Ms,e),xr(Si,t)}function y5(r,e,t){var n=r.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var s in n)if(!(s in e))throw Error(ye(108,DW(r)||"Unknown",s));return Vr({},t,n)}function N2(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Ph,p0=Ms.current,xr(Ms,r),xr(Si,Si.current),!0}function aF(r,e,t){var n=r.stateNode;if(!n)throw Error(ye(169));t?(r=y5(r,e,p0),n.__reactInternalMemoizedMergedChildContext=r,Sr(Si),Sr(Ms),xr(Ms,r)):Sr(Si),xr(Si,t)}var bc=null,gE=!1,KA=!1;function w5(r){bc===null?bc=[r]:bc.push(r)}function JV(r){gE=!0,w5(r)}function Yh(){if(!KA&&bc!==null){KA=!0;var r=0,e=er;try{var t=bc;for(er=1;r<t.length;r++){var n=t[r];do n=n(!0);while(n!==null)}bc=null,gE=!1}catch(s){throw bc!==null&&(bc=bc.slice(r+1)),VL(WR,Yh),s}finally{er=e,KA=!1}}return null}var km=[],Sm=0,P2=null,R2=0,Ga=[],Ka=0,m0=null,ou=1,lu="";function lf(r,e){km[Sm++]=R2,km[Sm++]=P2,P2=r,R2=e}function b5(r,e,t){Ga[Ka++]=ou,Ga[Ka++]=lu,Ga[Ka++]=m0,m0=r;var n=ou;r=lu;var s=32-Vo(n)-1;n&=~(1<<s),t+=1;var i=32-Vo(e)+s;if(30<i){var a=s-s%5;i=(n&(1<<a)-1).toString(32),n>>
vendor: 25,697 bytes, lines 38-40
38=a,s-=a,ou=1<<32-Vo(e)+s|t<<s|n,lu=i+r}else ou=1<<i|t<<s|n,lu=r}function QR(r){r.return!==null&&(lf(r,1),b5(r,1,0))}function e4(r){for(;r===P2;)P2=km[--Sm],km[Sm]=null,R2=km[--Sm],km[Sm]=null;for(;r===m0;)m0=Ga[--Ka],Ga[Ka]=null,lu=Ga[--Ka],Ga[Ka]=null,ou=Ga[--Ka],Ga[Ka]=null}var ha=null,da=null,Rr=!1,Io=null;function _5(r,e){var t=Ya(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=r,e=r.deletions,e===null?(r.deletions=[t],r.flags|=16):e.push(t)}function oF(r,e){switch(r.tag){case 5:var t=r.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(r.stateNode=e,ha=r,da=_h(e.firstChild),!0):!1;case 6:return e=r.pendingProps===""||e.nodeType!==3?null:e,e!==null?(r.stateNode=e,ha=r,da=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=m0!==null?{id:ou,overflow:lu}:null,r.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=Ya(18,null,null,0),t.stateNode=e,t.return=r,r.child=t,ha=r,da=null,!0):!1;default:return!1}}function PC(r){return(r.mode&1)!==0&&(r.flags&128)===0}function RC(r){if(Rr){var e=da;if(e){var t=e;if(!oF(r,e)){if(PC(r))throw Error(ye(418));e=_h(t.nextSibling);var n=ha;e&&oF(r,e)?_5(n,t):(r.flags=r.flags&-4097|2,Rr=!1,ha=r)}}else{if(PC(r))throw Error(ye(418));r.flags=r.flags&-4097|2,Rr=!1,ha=r}}}function lF(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;ha=r}function y_(r){if(r!==ha)return!1;if(!Rr)return lF(r),Rr=!0,!1;var e;if((e=r.tag!==3)&&!(e=r.tag!==5)&&(e=r.type,e=e!=="head"&&e!=="body"&&!AC(r.type,r.memoizedProps)),e&&(e=da)){if(PC(r))throw k5(),Error(ye(418));for(;e;)_5(r,e),e=_h(e.nextSibling)}if(lF(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(ye(317));e:{for(r=r.nextSibling,e=0;r;){if(r.nodeType===8){var t=r.data;if(t==="/$"){if(e===0){da=_h(r.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}r=r.nextSibling}da=null}}else da=ha?_h(r.stateNode.nextSibling):null;return!0}function k5(){for(var r=da;r;)r=_h(r.nextSibling)}function Px(){da=ha=null,Rr=!1}function t4(r){Io===null?Io=[r]:Io.push(r)}var QV=ju.ReactCurrentBatchConfig;function Tv(r,e,t){if(r=t.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(ye(309));var n=t.stateNode}if(!n)throw Error(ye(147,r));var s=n,i=""+r;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(a){var o=s.refs;a===null?delete o[i]:o[i]=a},e._stringRef=i,e)}if(typeof r!="string")throw Error(ye(284));if(!t._owner)throw Error(ye(290,r))}return r}function w_(r,e){throw r=Object.prototype.toString.call(e),Error(ye(31,r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r))}function cF(r){var e=r._init;return e(r._payload)}function S5(r){function e(v,w){if(r){var b=v.deletions;b===null?(v.deletions=[w],v.flags|=16):b.push(w)}}function t(v,w){if(!r)return null;for(;w!==null;)e(v,w),w=w.sibling;return null}function n(v,w){for(v=new Map;w!==null;)w.key!==null?v.set(w.key,w):v.set(w.index,w),w=w.sibling;return v}function s(v,w){return v=Ah(v,w),v.index=0,v.sibling=null,v}function i(v,w,b){return v.index=b,r?(b=v.alternate,b!==null?(b=b.index,b<w?(v.flags|=2,w):b):(v.flags|=2,w)):(v.flags|=1048576,w)}function a(v){return r&&v.alternate===null&&(v.flags|=2),v}function o(v,w,b,_){return w===null||w.tag!==6?(w=eT(b,v.mode,_),w.return=v,w):(w=s(w,b),w.return=v,w)}function l(v,w,b,_){var T=b.type;return T===xm?u(v,w,b.props.children,_,b.key):w!==null&&(w.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===qu&&cF(T)===w.type)?(_=s(w,b.props),_.ref=Tv(v,w,b),_.return=v,_):(_=kk(b.type,b.key,b.props,null,v.mode,_),_.ref=Tv(v,w,b),_.return=v,_)}function c(v,w,b,_){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=tT(b,v.mode,_),w.return=v,w):(w=s(w,b.children||[]),w.return=v,w)}function u(v,w,b,_,T){return w===null||w.tag!==7?(w=c0(b,v.mode,_,T),w.return=v,w):(w=s(w,b),w.return=v,w)}function f(v,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=eT(""+w,v.mode,b),w.return=v,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case c_:return b=kk(w.type,w.key,w.props,null,v.mode,b),b.ref=Tv(v,null,w),b.return=v,b;case gm:return w=tT(w,v.mode,b),w.return=v,w;case qu:var _=w._init;return f(v,_(w._payload),b)}if(Uv(w)||_v(w))return w=c0(w,v.mode,b,null),w.return=v,w;w_(v,w)}return null}function p(v,w,b,_){var T=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return T!==null?null:o(v,w,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case c_:return b.key===T?l(v,w,b,_):null;case gm:return b.key===T?c(v,w,b,_):null;case qu:return T=b._init,p(v,w,T(b._payload),_)}if(Uv(b)||_v(b))return T!==null?null:u(v,w,b,_,null);w_(v,b)}return null}function m(v,w,b,_,T){if(typeof _=="string"&&_!==""||typeof _=="number")return v=v.get(b)||null,o(w,v,""+_,T);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case c_:return v=v.get(_.key===null?b:_.key)||null,l(w,v,_,T);case gm:return v=v.get(_.key===null?b:_.key)||null,c(w,v,_,T);case qu:var A=_._init;return m(v,w,b,A(_._payload),T)}if(Uv(_)||_v(_))return v=v.get(b)||null,u(w,v,_,T,null);w_(w,_)}return null}function x(v,w,b,_){for(var T=null,A=null,N=w,k=w=0,E=null;N!==null&&k<b.length;k++){N.index>k?(E=N,N=null):E=N.sibling;var P=p(v,N,b[k],_);if(P===null){N===null&&(N=E);break}r&&N&&P.alternate===null&&e(v,N),w=i(P,w,k),A===null?T=P:A.sibling=P,A=P,N=E}if(k===b.length)return t(v,N),Rr&&lf(v,k),T;if(N===null){for(;k<b.length;k++)N=f(v,b[k],_),N!==null&&(w=i(N,w,k),A===null?T=N:A.sibling=N,A=N);return Rr&&lf(v,k),T}for(N=n(v,N);k<b.length;k++)E=m(N,v,k,b[k],_),E!==null&&(r&&E.alternate!==null&&N.delete(E.key===null?k:E.key),w=i(E,w,k),A===null?T=E:A.sibling=E,A=E);return r&&N.forEach(function(O){return e(v,O)}),Rr&&lf(v,k),T}function g(v,w,b,_){var T=_v(b);if(typeof T!="function")throw Error(ye(150));if(b=T.call(b),b==null)throw Error(ye(151));for(var A=T=null,N=w,k=w=0,E=null,P=b.next();N!==null&&!P.done;k++,P=b.next()){N.index>k?(E=N,N=null):E=N.sibling;var O=p(v,N,P.value,_);if(O===null){N===null&&(N=E);break}r&&N&&O.alternate===null&&e(v,N),w=i(O,w,k),A===null?T=O:A.sibling=O,A=O,N=E}if(P.done)return t(v,N),Rr&&lf(v,k),T;if(N===null){for(;!P.done;k++,P=b.next())P=f(v,P.value,_),P!==null&&(w=i(P,w,k),A===null?T=P:A.sibling=P,A=P);return Rr&&lf(v,k),T}for(N=n(v,N);!P.done;k++,P=b.next())P=m(N,v,k,P.value,_),P!==null&&(r&&P.alternate!==null&&N.delete(P.key===null?k:P.key),w=i(P,w,k),A===null?T=P:A.sibling=P,A=P);return r&&N.forEach(function(D){return e(v,D)}),Rr&&lf(v,k),T}function y(v,w,b,_){if(typeof b=="object"&&b!==null&&b.type===xm&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case c_:e:{for(var T=b.key,A=w;A!==null;){if(A.key===T){if(T=b.type,T===xm){if(A.tag===7){t(v,A.sibling),w=s(A,b.props.children),w.return=v,v=w;break e}}else if(A.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===qu&&cF(T)===A.type){t(v,A.sibling),w=s(A,b.props),w.ref=Tv(v,A,b),w.return=v,v=w;break e}t(v,A);break}else e(v,A);A=A.sibling}b.type===xm?(w=c0(b.props.children,v.mode,_,b.key),w.return=v,v=w):(_=kk(b.type,b.key,b.props,null,v.mode,_),_.ref=Tv(v,w,b),_.return=v,v=_)}return a(v);case gm:e:{for(A=b.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){t(v,w.sibling),w=s(w,b.children||[]),w.return=v,v=w;break e}else{t(v,w);break}else e(v,w);w=w.sibling}w=tT(b,v.mode,_),w.return=v,v=w}return a(v);case qu:return A=b._init,y(v,w,A(b._payload),_)}if(Uv(b))return x(v,w,b,_);if(_v(b))return g(v,w,b,_);w_(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(t(v,w.sibling),w=s(w,b),w.return=v,v=w):(t(v,w),w=eT(b,v.mode,_),w.return=v,v=w),a(v)):t(v,w)}return y}var Rx=S5(!0),E5=S5(!1),j2=Xh(null),O2=null,Em=null,r4=null;function n4(){r4=Em=O2=null}function s4(r){var e=j2.current;Sr(j2),r._currentValue=e}function jC(r,e,t){for(;r!==null;){var n=r.alternate;if((r.childLanes&e)!==e?(r.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),r===t)break;r=r.return}}function Im(r,e){O2=r,r4=Em=null,r=r.dependencies,r!==null&&r.firstContext!==null&&(r.lanes&e&&(ki=!0),r.firstContext=null)}function eo(r){var e=r._currentValue;if(r4!==r)if(r={context:r,memoizedValue:e,next:null},Em===null){if(O2===null)throw Error(ye(308));Em=r,O2.dependencies={lanes:0,firstContext:r}}else Em=Em.next=r;return e}var _f=null;function i4(r){_f===null?_f=[r]:_f.push(r)}function A5(r,e,t,n){var s=e.interleaved;return s===null?(t.next=t,i4(e)):(t.next=s.next,s.next=t),e.interleaved=t,wu(r,n)}function wu(r,e){r.lanes|=e;var t=r.alternate;for(t!==null&&(t.lanes|=e),t=r,r=r.return;r!==null;)r.childLanes|=e,t=r.alternate,t!==null&&(t.childLanes|=e),t=r,r=r.return;return t.tag===3?t.stateNode:null}var Zu=!1;function a4(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function T5(r,e){r=r.updateQueue,e.updateQueue===r&&(e.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function du(r,e){return{eventTime:r,lane:e,tag:0,payload:null,callback:null,next:null}}function kh(r,e,t){var n=r.updateQueue;if(n===null)return null;if(n=n.shared,Pt&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,wu(r,t)}return s=n.interleaved,s===null?(e.next=e,i4(n)):(e.next=s.next,s.next=e),n.interleaved=e,wu(r,t)}function xk(r,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,VR(r,t)}}function uF(r,e){var t=r.updateQueue,n=r.alternate;if(n!==null&&(n=n.updateQueue,t===n)){var s=null,i=null;if(t=t.firstBaseUpdate,t!==null){do{var a={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};i===null?s=i=a:i=i.next=a,t=t.next}while(t!==null);i===null?s=i=e:i=i.next=e}else s=i=e;t={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},r.updateQueue=t;return}r=t.lastBaseUpdate,r===null?t.firstBaseUpdate=e:r.next=e,t.lastBaseUpdate=e}function F2(r,e,t,n){var s=r.updateQueue;Zu=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?i=c:a.next=c,a=l;var u=r.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,u=c=l=null,o=i;do{var p=o.lane,m=o.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=r,g=o;switch(p=e,m=t,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(m,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(m,f,p):x,p==null)break e;f=Vr({},f,p);break e;case 2:Zu=!0}}o.callback!==null&&o.lane!==0&&(r.flags|=64,p=s.effects,p===null?s.effects=[o]:p.push(o))}else m={eventTime:m,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=m,l=f):u=u.next=m,a|=p;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;p=o,o=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);x0|=a,r.lanes=a,r.memoizedState=f}}function dF(r,e,t){if(r=e.effects,e.effects=null,r!==null)for(e=0;e<r.length;e++){var n=r[e],s=n.callback;if(s!==null){if(n.callback=null,n=t,typeof s!="function")throw Error(ye(191,s));s.call(n)}}}var Mb={},Yl=Xh(Mb),e1=Xh(Mb),t1=Xh(Mb);function kf(r){if(r===Mb)throw Error(ye(174));return r}function o4(r,e){switch(xr(t1,e),xr(e1,r),xr(Yl,Mb),r=e.nodeType,r){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:hC(null,"");break;default:r=r===8?e.parentNode:e,e=r.namespaceURI||null,r=r.tagName,e=hC(e,r)}Sr(Yl),xr(Yl,e)}function jx(){Sr(Yl),Sr(e1),Sr(t1)}function C5(r){kf(t1.current);var e=kf(Yl.current),t=hC(e,r.type);e!==t&&(xr(e1,r),xr(Yl,t))}function l4(r){e1.current===r&&(Sr(Yl),Sr(e1))}var Lr=Xh(0);function D2(r){for(var e=r;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break;for(;e.sibling===null;){if(e.return===null||e.return===r)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var XA=[];function c4(){for(var r=0;r<XA.length;r++)XA[r]._workInProgressVersionPrimary=null;XA.length=0}var vk=ju.ReactCurrentDispatcher,YA=ju.ReactCurrentBatchConfig,g0=0,Hr=null,An=null,Wn=null,M2=!1,_y=!1,r1=0,eG=0;function vs(){throw Error(ye(321))}function u4(r,e){if(e===null)return!1;for(var t=0;t<e.length&&t<r.length;t++)if(!el(r[t],e[t]))return!1;return!0}function d4(r,e,t,n,s,i){if(g0=i,Hr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,vk.current=r===null||r.memoizedState===null?sG:iG,r=t(n,s),_y){i=0;do{if(_y=!1,r1=0,25<=i)throw Error(ye(301));i+=1,Wn=An=null,e.updateQueue=null,vk.current=aG,r=t(n,s)}while(_y)}if(vk.current=I2,e=An!==null&&An.next!==null,g0=0,Wn=An=Hr=null,M2=!1,e)throw Error(ye(300));return r}function h4(){var r=r1!==0;return r1=0,r}function pl(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?Hr.memoizedState=Wn=r:Wn=Wn.next=r,Wn}function to(){if(An===null){var r=Hr.alternate;r=r!==null?r.memoizedState:null}else r=An.next;var e=Wn===null?Hr.memoizedState:Wn.next;if(e!==null)Wn=e,An=r;else{if(r===null)throw Error(ye(310));An=r,r={memoizedState:An.memoizedState,baseState:An.baseState,baseQueue:An.baseQueue,queue:An.queue,next:null},Wn===null?Hr.memoizedState=Wn=r:Wn=Wn.next=r}return Wn}function n1(r,e){return typeof e=="function"?e(r):e}function qA(r){var e=to(),t=e.queue;if(t===null)throw Error(ye(311));t.lastRenderedReducer=r;var n=An,s=n.baseQueue,i=t.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}n.baseQueue=s=i,t.pending=null}if(s!==null){i=s.next,n=n.baseState;var o=a=null,l=null,c=i;do{var u=c.lane;if((g0&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:r(n,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=f,a=n):l=l.next=f,Hr.lanes|=u,x0|=u}c=c.next}while(c!==null&&c!==i);l===null?a=n:l.next=o,el(n,e.memoizedState)||(ki=!0),e.memoizedState=n,e.baseState=a,e.baseQueue=l,t.lastRenderedState=n}if(r=t.interleaved,r!==null){s=r;do i=s.lane,Hr.lanes|=i,x0|=i,s=s.next;while(s!==r)}else s===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function ZA(r){var e=to(),t=e.queue;if(t===null)throw Error(ye(311));t.lastRenderedReducer=r;var n=t.dispatch,s=t.pending,i=e.memoizedState;if(s!==null){t.pending=null;var a=s=s.next;do i=r(i,a.action),a=a.next;while(a!==s);el(i,e.memoizedState)||(ki=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),t.lastRenderedState=i}return[i,n]}function N5(){}function P5(r,e){var t=Hr,n=to(),s=e(),i=!el(n.memoizedState,s);if(i&&(n.memoizedState=s,ki=!0),n=n.queue,f4(O5.bind(null,t,n,r),[r]),n.getSnapshot!==e||i||Wn!==null&&Wn.memoizedState.tag&1){if(t.flags|=2048,s1(9,j5.bind(null,t,n,s,e),void 0,null),Kn===null)throw Error(ye(349));g0&30||R5(t,e,s)}return s}function R5(r,e,t){r.flags|=16384,r={getSnapshot:e,value:t},e=Hr.updateQueue,e===null?(e={lastEffect:null,stores:null},Hr.updateQueue=e,e.stores=[r]):(t=e.stores,t===null?e.stores=[r]:t.push(r))}function j5(r,e,t,n){e.value=t,e.getSnapshot=n,F5(e)&&D5(r)}function O5(r,e,t){return t(function(){F5(e)&&D5(r)})}function F5(r){var e=r.getSnapshot;r=r.value;try{var t=e();return!el(r,t)}catch{return!0}}function D5(r){var e=wu(r,1);e!==null&&Go(e,r,1,-1)}function hF(r){var e=pl();return typeof r=="function"&&(r=r()),e.memoizedState=e.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n1,lastRenderedState:r},e.queue=r,r=r.dispatch=nG.bind(null,Hr,r),[e.memoizedState,r]}function s1(r,e,t,n){return r={tag:r,create:e,destroy:t,deps:n,next:null},e=Hr.updateQueue,e===null?(e={lastEffect:null,stores:null},Hr.updateQueue=e,e.lastEffect=r.next=r):(t=e.lastEffect,t===null?e.lastEffect=r.next=r:(n=t.next,t.next=r,r.next=n,e.lastEffect=r)),r}function M5(){return to().memoizedState}function yk(r,e,t,n){var s=pl();Hr.flags|=r,s.memoizedState=s1(1|e,t,void 0,n===void 0?null:n)}function xE(r,e,t,n){var s=to();n=n===void 0?null:n;var i=void 0;if(An!==null){var a=An.memoizedState;if(i=a.destroy,n!==null&&u4(n,a.deps)){s.memoizedState=s1(e,t,i,n);return}}Hr.flags|=r,s.memoizedState=s1(1|e,t,i,n)}function fF(r,e){return yk(8390656,8,r,e)}function f4(r,e){return xE(2048,8,r,e)}function I5(r,e){return xE(4,2,r,e)}function L5(r,e){return xE(4,4,r,e)}function B5(r,e){if(typeof e=="function")return r=r(),e(r),function(){e(null)};if(e!=null)return r=r(),e.current=r,function(){e.current=null}}function U5(r,e,t){return t=t!=null?t.concat([r]):null,xE(4,4,B5.bind(null,e,r),t)}function p4(){}function $5(r,e){var t=to();e=e===void 0?null:e;var n=t.memoizedState;return n!==null&&e!==null&&u4(e,n[1])?n[0]:(t.memoizedState=[r,e],r)}function z5(r,e){var t=to();e=e===void 0?null:e;var n=t.memoizedState;return n!==null&&e!==null&&u4(e,n[1])?n[0]:(r=r(),t.memoizedState=[r,e],r)}function H5(r,e,t){return g0&21?(el(t,e)||(t=XL(),Hr.lanes|=t,x0|=t,r.baseState=!0),e):(r.baseState&&(r.baseState=!1,ki=!0),r.memoizedState=t)}function tG(r,e){var t=er;er=t!==0&&4>t?t:4,r(!0);var n=YA.transition;YA.transition={};try{r(!1),e()}finally{er=t,YA.transition=n}}function W5(){return to().memoizedState}function rG(r,e,t){var n=Eh(r);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},V5(r))G5(e,t);else if(t=A5(r,e,t,n),t!==null){var s=ri();Go(t,r,n,s),K5(t,e,n)}}function nG(r,e,t){var n=Eh(r),s={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(V5(r))G5(e,s);else{var i=r.alternate;if(r.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,t);if(s.hasEagerState=!0,s.eagerState=o,el(o,a)){var l=e.interleaved;l===null?(s.next=s,i4(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=A5(r,e,s,n),t!==null&&(s=ri(),Go(t,r,n,s),K5(t,e,n))}}function V5(r){var e=r.alternate;return r===Hr||e!==null&&e===Hr}function G5(r,e){_y=M2=!0;var t=r.pending;t===null?e.next=e:(e.next=t.next,t.next=e),r.pending=e}function K5(r,e,t){if(t&4194240){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,VR(r,t)}}var I2={readContext:eo,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},sG={readContext:eo,useCallback:function(r,e){return pl().memoizedState=[r,e===void 0?null:e],r},useContext:eo,useEffect:fF,useImperativeHandle:function(r,e,t){return t=t!=null?t.concat([r]):null,yk(4194308,4,B5.bind(null,e,r),t)},useLayoutEffect:function(r,e){return yk(4194308,4,r,e)},useInsertionEffect:function(r,e){return yk(4,2,r,e)},useMemo:function(r,e){var t=pl();return e=e===void 0?null:e,r=r(),t.memoizedState=[r,e],r},useReducer:function(r,e,t){var n=pl();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:e},n.queue=r,r=r.dispatch=rG.bind(null,Hr,r),[n.memoizedState,r]},useRef:function(r){var e=pl();return r={current:r},e.memoizedState=r},useState:hF,useDebugValue:p4,useDeferredValue:function(r){return pl().memoizedState=r},useTransition:function(){var r=hF(!1),e=r[0];return r=tG.bind(null,r[1]),pl().memoizedState=r,[e,r]},useMutableSource:function(){},useSyncExternalStore:function(r,e,t){var n=Hr,s=pl();if(Rr){if(t===void 0)throw Error(ye(407));t=t()}else{if(t=e(),Kn===null)throw Error(ye(349));g0&30||R5(n,e,t)}s.memoizedState=t;var i={value:t,getSnapshot:e};return s.queue=i,fF(O5.bind(null,n,i,r),[r]),n.flags|=2048,s1(9,j5.bind(null,n,i,t,e),void 0,null),t},useId:function(){var r=pl(),e=Kn.identifierPrefix;if(Rr){var t=lu,n=ou;t=(n&~(1<<32-Vo(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=r1++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=eG++,e=":"+e+"r"+t.toString(32)+":";return r.memoizedState=e},unstable_isNewReconciler:!1},iG={readContext:eo,useCallback:$5,useContext:eo,useEffect:f4,useImperativeHandle:U5,useInsertionEffect:I5,useLayoutEffect:L5,useMemo:z5,useReducer:qA,useRef:M5,useState:function(){return qA(n1)},useDebugValue:p4,useDeferredValue:function(r){var e=to();return H5(e,An.memoizedState,r)},useTransition:function(){var r=qA(n1)[0],e=to().memoizedState;return[r,e]},useMutableSource:N5,useSyncExternalStore:P5,useId:W5,unstable_isNewReconciler:!1},aG={readContext:eo,useCallback:$5,useContext:eo,useEffect:f4,useImperativeHandle:U5,useInsertionEffect:I5,useLayoutEffect:L5,useMemo:z5,useReducer:ZA,useRef:M5,useState:function(){return ZA(n1)},useDebugValue:p4,useDeferredValue:function(r){var e=to();return An===null?e.memoizedState=r:H5(e,An.memoizedState,r)},useTransition:function(){var r=ZA(n1)[0],e=to().memoizedState;return[r,e]},useMutableSource:N5,useSyncExternalStore:P5,useId:W5,unstable_isNewReconciler:!1};function vo(r,e){if(r&&r.defaultProps){e=Vr({},e),r=r.defaultProps;for(var t in r)e[t]===void 0&&(e[t]=r[t]);return e}return e}function OC(r,e,t,n){e=r.memoizedState,t=t(n,e),t=t==null?e:Vr({},e,t),r.memoizedState=t,r.lanes===0&&(r.updateQueue.baseState=t)}var vE={isMounted:function(r){return(r=r._reactInternals)?F0(r)===r:!1},enqueueSetState:function(r,e,t){r=r._reactInternals;var n=ri(),s=Eh(r),i=du(n,s);i.payload=e,t!=null&&(i.callback=t),e=kh(r,i,s),e!==null&&(Go(e,r,s,n),xk(e,r,s))},enqueueReplaceState:function(r,e,t){r=r._reactInternals;var n=ri(),s=Eh(r),i=du(n,s);i.tag=1,i.payload=e,t!=null&&(i.callback=t),e=kh(r,i,s),e!==null&&(Go(e,r,s,n),xk(e,r,s))},enqueueForceUpdate:function(r,e){r=r._reactInternals;var t=ri(),n=Eh(r),s=du(t,n);s.tag=2,e!=null&&(s.callback=e),e=kh(r,s,n),e!==null&&(Go(e,r,n,t),xk(e,r,n))}};function pF(r,e,t,n,s,i,a){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(n,i,a):e.prototype&&e.prototype.isPureReactComponent?!qy(t,n)||!qy(s,i):!0}function X5(r,e,t){var n=!1,s=Ph,i=e.contextType;return typeof i=="object"&&i!==null?i=eo(i):(s=Ei(e)?p0:Ms.current,n=e.contextTypes,i=(n=n!=null)?Nx(r,s):Ph),e=new e(t,i),r.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=vE,r.stateNode=e,e._reactInternals=r,n&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=i),e}function mF(r,e,t,n){r=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,n),e.state!==r&&vE.enqueueReplaceState(e,e.state,null)}function FC(r,e,t,n){var s=r.stateNode;s.props=t,s.state=r.memoizedState,s.refs={},a4(r);var i=e.contextType;typeof i=="object"&&i!==null?s.context=eo(i):(i=Ei(e)?p0:Ms.current,s.context=Nx(r,i)),s.state=r.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(OC(r,e,i,t),s.state=r.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&vE.enqueueReplaceState(s,s.state,null),F2(r,t,s,n),s.state=r.memoizedState),typeof s.componentDidMount=="function"&&(r.flags|=4194308)}function Ox(r,e){try{var t="",n=e;do t+=FW(n),n=n.return;while(n);var s=t}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:r,source:e,stack:s,digest:null}}function JA(r,e,t){return{value:r,source:null,stack:t??null,digest:e??null}}function DC(r,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var oG=typeof WeakMap=="function"?WeakMap:Map;function Y5(r,e,t){t=du(-1,t),t.tag=3,t.payload={element:null};var n=e.value;return t.callback=function(){B2||(B2=!0,VC=n),DC(r,e)},t}function q5(r,e,t){t=du(-1,t),t.tag=3;var n=r.type.getDerivedStateFromError;if(typeof n=="function"){var s=e.value;t.payload=function(){return n(s)},t.callback=function(){DC(r,e)}}var i=r.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(t.callback=function(){DC(r,e),typeof n!="function"&&(Sh===null?Sh=new Set([this]):Sh.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),t}function gF(r,e,t){var n=r.pingCache;if(n===null){n=r.pingCache=new oG;var s=new Set;n.set(e,s)}else s=n.get(e),s===void 0&&(s=new Set,n.set(e,s));s.has(t)||(s.add(t),r=bG.bind(null,r,e,t),e.then(r,r))}function xF(r){do{var e;if((e=r.tag===13)&&(e=r.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return r;r=r.return}while(r!==null);return null}function vF(r,e,t,n,s){return r.mode&1?(r.flags|=65536,r.lanes=s,r):(r===e?r.flags|=65536:(r.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=du(-1,1),e.tag=2,kh(t,e,1)
vendor: 10,193 bytes, line 40
40)),t.lanes|=1),r)}var lG=ju.ReactCurrentOwner,ki=!1;function qs(r,e,t,n){e.child=r===null?E5(e,null,t,n):Rx(e,r.child,t,n)}function yF(r,e,t,n,s){t=t.render;var i=e.ref;return Im(e,s),n=d4(r,e,t,n,i,s),t=h4(),r!==null&&!ki?(e.updateQueue=r.updateQueue,e.flags&=-2053,r.lanes&=~s,bu(r,e,s)):(Rr&&t&&QR(e),e.flags|=1,qs(r,e,n,s),e.child)}function wF(r,e,t,n,s){if(r===null){var i=t.type;return typeof i=="function"&&!_4(i)&&i.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=i,Z5(r,e,i,n,s)):(r=kk(t.type,null,n,e,e.mode,s),r.ref=e.ref,r.return=e,e.child=r)}if(i=r.child,!(r.lanes&s)){var a=i.memoizedProps;if(t=t.compare,t=t!==null?t:qy,t(a,n)&&r.ref===e.ref)return bu(r,e,s)}return e.flags|=1,r=Ah(i,n),r.ref=e.ref,r.return=e,e.child=r}function Z5(r,e,t,n,s){if(r!==null){var i=r.memoizedProps;if(qy(i,n)&&r.ref===e.ref)if(ki=!1,e.pendingProps=n=i,(r.lanes&s)!==0)r.flags&131072&&(ki=!0);else return e.lanes=r.lanes,bu(r,e,s)}return MC(r,e,t,n,s)}function J5(r,e,t){var n=e.pendingProps,s=n.children,i=r!==null?r.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},xr(Tm,ta),ta|=t;else{if(!(t&1073741824))return r=i!==null?i.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:r,cachePool:null,transitions:null},e.updateQueue=null,xr(Tm,ta),ta|=r,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:t,xr(Tm,ta),ta|=n}else i!==null?(n=i.baseLanes|t,e.memoizedState=null):n=t,xr(Tm,ta),ta|=n;return qs(r,e,s,t),e.child}function Q5(r,e){var t=e.ref;(r===null&&t!==null||r!==null&&r.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function MC(r,e,t,n,s){var i=Ei(t)?p0:Ms.current;return i=Nx(e,i),Im(e,s),t=d4(r,e,t,n,i,s),n=h4(),r!==null&&!ki?(e.updateQueue=r.updateQueue,e.flags&=-2053,r.lanes&=~s,bu(r,e,s)):(Rr&&n&&QR(e),e.flags|=1,qs(r,e,t,s),e.child)}function bF(r,e,t,n,s){if(Ei(t)){var i=!0;N2(e)}else i=!1;if(Im(e,s),e.stateNode===null)wk(r,e),X5(e,t,n),FC(e,t,n,s),n=!0;else if(r===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=t.contextType;typeof c=="object"&&c!==null?c=eo(c):(c=Ei(t)?p0:Ms.current,c=Nx(e,c));var u=t.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==n||l!==c)&&mF(e,a,n,c),Zu=!1;var p=e.memoizedState;a.state=p,F2(e,n,a,s),l=e.memoizedState,o!==n||p!==l||Si.current||Zu?(typeof u=="function"&&(OC(e,t,u,n),l=e.memoizedState),(o=Zu||pF(e,t,o,n,p,l,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),a.props=n,a.state=l,a.context=c,n=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,T5(r,e),o=e.memoizedProps,c=e.type===e.elementType?o:vo(e.type,o),a.props=c,f=e.pendingProps,p=a.context,l=t.contextType,typeof l=="object"&&l!==null?l=eo(l):(l=Ei(t)?p0:Ms.current,l=Nx(e,l));var m=t.getDerivedStateFromProps;(u=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||p!==l)&&mF(e,a,n,l),Zu=!1,p=e.memoizedState,a.state=p,F2(e,n,a,s);var x=e.memoizedState;o!==f||p!==x||Si.current||Zu?(typeof m=="function"&&(OC(e,t,m,n),x=e.memoizedState),(c=Zu||pF(e,t,c,n,p,x,l)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,x,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,x,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===r.memoizedProps&&p===r.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===r.memoizedProps&&p===r.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=x),a.props=n,a.state=x,a.context=l,n=c):(typeof a.componentDidUpdate!="function"||o===r.memoizedProps&&p===r.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===r.memoizedProps&&p===r.memoizedState||(e.flags|=1024),n=!1)}return IC(r,e,t,n,i,s)}function IC(r,e,t,n,s,i){Q5(r,e);var a=(e.flags&128)!==0;if(!n&&!a)return s&&aF(e,t,!1),bu(r,e,i);n=e.stateNode,lG.current=e;var o=a&&typeof t.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,r!==null&&a?(e.child=Rx(e,r.child,null,i),e.child=Rx(e,null,o,i)):qs(r,e,o,i),e.memoizedState=n.state,s&&aF(e,t,!0),e.child}function eB(r){var e=r.stateNode;e.pendingContext?iF(r,e.pendingContext,e.pendingContext!==e.context):e.context&&iF(r,e.context,!1),o4(r,e.containerInfo)}function _F(r,e,t,n,s){return Px(),t4(s),e.flags|=256,qs(r,e,t,n),e.child}var LC={dehydrated:null,treeContext:null,retryLane:0};function BC(r){return{baseLanes:r,cachePool:null,transitions:null}}function tB(r,e,t){var n=e.pendingProps,s=Lr.current,i=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=r!==null&&r.memoizedState===null?!1:(s&2)!==0),o?(i=!0,e.flags&=-129):(r===null||r.memoizedState!==null)&&(s|=1),xr(Lr,s&1),r===null)return RC(e),r=e.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?(e.mode&1?r.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=n.children,r=n.fallback,i?(n=e.mode,i=e.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=bE(a,n,0,null),r=c0(r,n,t,null),i.return=e,r.return=e,i.sibling=r,e.child=i,e.child.memoizedState=BC(t),e.memoizedState=LC,r):m4(e,a));if(s=r.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return cG(r,e,a,n,o,s,t);if(i){i=n.fallback,a=e.mode,s=r.child,o=s.sibling;var l={mode:"hidden",children:n.children};return!(a&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=Ah(s,l),n.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=Ah(o,i):(i=c0(i,a,t,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,a=r.child.memoizedState,a=a===null?BC(t):{baseLanes:a.baseLanes|t,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=r.childLanes&~t,e.memoizedState=LC,n}return i=r.child,r=i.sibling,n=Ah(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=t),n.return=e,n.sibling=null,r!==null&&(t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)),e.child=n,e.memoizedState=null,n}function m4(r,e){return e=bE({mode:"visible",children:e},r.mode,0,null),e.return=r,r.child=e}function b_(r,e,t,n){return n!==null&&t4(n),Rx(e,r.child,null,t),r=m4(e,e.pendingProps.children),r.flags|=2,e.memoizedState=null,r}function cG(r,e,t,n,s,i,a){if(t)return e.flags&256?(e.flags&=-257,n=JA(Error(ye(422))),b_(r,e,a,n)):e.memoizedState!==null?(e.child=r.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=bE({mode:"visible",children:n.children},s,0,null),i=c0(i,s,a,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&Rx(e,r.child,null,a),e.child.memoizedState=BC(a),e.memoizedState=LC,i);if(!(e.mode&1))return b_(r,e,a,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(ye(419)),n=JA(i,n,void 0),b_(r,e,a,n)}if(o=(a&r.childLanes)!==0,ki||o){if(n=Kn,n!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,wu(r,s),Go(n,r,s,-1))}return b4(),n=JA(Error(ye(421))),b_(r,e,a,n)}return s.data==="$?"?(e.flags|=128,e.child=r.child,e=_G.bind(null,r),s._reactRetry=e,null):(r=i.treeContext,da=_h(s.nextSibling),ha=e,Rr=!0,Io=null,r!==null&&(Ga[Ka++]=ou,Ga[Ka++]=lu,Ga[Ka++]=m0,ou=r.id,lu=r.overflow,m0=e),e=m4(e,n.children),e.flags|=4096,e)}function kF(r,e,t){r.lanes|=e;var n=r.alternate;n!==null&&(n.lanes|=e),jC(r.return,e,t)}function QA(r,e,t,n,s){var i=r.memoizedState;i===null?r.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:t,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=t,i.tailMode=s)}function rB(r,e,t){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(qs(r,e,n.children,t),n=Lr.current,n&2)n=n&1|2,e.flags|=128;else{if(r!==null&&r.flags&128)e:for(r=e.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&kF(r,t,e);else if(r.tag===19)kF(r,t,e);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}n&=1}if(xr(Lr,n),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(t=e.child,s=null;t!==null;)r=t.alternate,r!==null&&D2(r)===null&&(s=t),t=t.sibling;t=s,t===null?(s=e.child,e.child=null):(s=t.sibling,t.sibling=null),QA(e,!1,s,t,i);break;case"backwards":for(t=null,s=e.child,e.child=null;s!==null;){if(r=s.alternate,r!==null&&D2(r)===null){e.child=s;break}r=s.sibling,s.sibling=t,t=s,s=r}QA(e,!0,t,null,i);break;case"together":QA(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function wk(r,e){!(e.mode&1)&&r!==null&&(r.alternate=null,e.alternate=null,e.flags|=2)}function bu(r,e,t){if(r!==null&&(e.dependencies=r.dependencies),x0|=e.lanes,!(t&e.childLanes))return null;if(r!==null&&e.child!==r.child)throw Error(ye(153));if(e.child!==null){for(r=e.child,t=Ah(r,r.pendingProps),e.child=t,t.return=e;r.sibling!==null;)r=r.sibling,t=t.sibling=Ah(r,r.pendingProps),t.return=e;t.sibling=null}return e.child}function uG(r,e,t){switch(e.tag){case 3:eB(e),Px();break;case 5:C5(e);break;case 1:Ei(e.type)&&N2(e);break;case 4:o4(e,e.stateNode.containerInfo);break;
vendor: 4,414 bytes, line 40
40case 10:var n=e.type._context,s=e.memoizedProps.value;xr(j2,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(xr(Lr,Lr.current&1),e.flags|=128,null):t&e.child.childLanes?tB(r,e,t):(xr(Lr,Lr.current&1),r=bu(r,e,t),r!==null?r.sibling:null);xr(Lr,Lr.current&1);break;case 19:if(n=(t&e.childLanes)!==0,r.flags&128){if(n)return rB(r,e,t);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),xr(Lr,Lr.current),n)break;return null;case 22:case 23:return e.lanes=0,J5(r,e,t)}return bu(r,e,t)}var nB,UC,sB,iB;nB=function(r,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)r.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};UC=function(){};sB=function(r,e,t,n){var s=r.memoizedProps;if(s!==n){r=e.stateNode,kf(Yl.current);var i=null;switch(t){case"input":s=lC(r,s),n=lC(r,n),i=[];break;case"select":s=Vr({},s,{value:void 0}),n=Vr({},n,{value:void 0}),i=[];break;case"textarea":s=dC(r,s),n=dC(r,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(r.onclick=T2)}fC(t,n);var a;t=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var o=s[c];for(a in o)o.hasOwnProperty(a)&&(t||(t={}),t[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Hy.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in n){var l=n[c];if(o=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(t||(t={}),t[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(t||(t={}),t[a]=l[a])}else t||(i||(i=[]),i.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Hy.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&yr("scroll",r),i||o===l||(i=[])):(i=i||[]).push(c,l))}t&&(i=i||[]).push("style",t);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};iB=function(r,e,t,n){t!==n&&(e.flags|=4)};function Cv(r,e){if(!Rr)switch(r.tailMode){case"hidden":e=r.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?r.tail=null:t.sibling=null;break;case"collapsed":t=r.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e||r.tail===null?r.tail=null:r.tail.sibling=null:n.sibling=null}}function ys(r){var e=r.alternate!==null&&r.alternate.child===r.child,t=0,n=0;if(e)for(var s=r.child;s!==null;)t|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=r,s=s.sibling;else for(s=r.child;s!==null;)t|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=r,s=s.sibling;return r.subtreeFlags|=n,r.childLanes=t,e}function dG(r,e,t){var n=e.pendingProps;switch(e4(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ys(e),null;case 1:return Ei(e.type)&&C2(),ys(e),null;case 3:return n=e.stateNode,jx(),Sr(Si),Sr(Ms),c4(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(r===null||r.child===null)&&(y_(e)?e.flags|=4:r===null||r.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Io!==null&&(XC(Io),Io=null))),UC(r,e),ys(e),null;case 5:l4(e);var s=kf(t1.current);if(t=e.type,r!==null&&e.stateNode!=null)sB(r,e,t,n,s),r.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(ye(166));return ys(e),null}if(r=kf(Yl.current),y_(e)){n=e.stateNode,t=e.type;var i=e.memoizedProps;switch(n[Wl]=e,n[Qy]=i,r=(e.mode&1)!==0,t){case"dialog":yr("cancel",n),yr("close",n);break;case"iframe":case"object":case"embed":yr("load",n);break;case"video":case"audio":for(s=0;s<zv.length;s++)yr(zv[s],n);break;case"source":yr("error",n);break;case"img":case"image":case"link":yr("error",n),yr("load",n);break;case"details":yr("toggle",n);break;case"input":jO(n,i),yr("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},yr("invalid",n);break;case"textarea":FO(n,i),yr("invalid",n)}fC(t,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var o=i[a];
vendor: 30,215 bytes, line 40
40a==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&v_(n.textContent,o,r),s=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&v_(n.textContent,o,r),s=["children",""+o]):Hy.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&yr("scroll",n)}switch(t){case"input":u_(n),OO(n,i,!0);break;case"textarea":u_(n),DO(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=T2)}n=s,e.updateQueue=n,n!==null&&(e.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=OL(t)),r==="http://www.w3.org/1999/xhtml"?t==="script"?(r=a.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof n.is=="string"?r=a.createElement(t,{is:n.is}):(r=a.createElement(t),t==="select"&&(a=r,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):r=a.createElementNS(r,t),r[Wl]=e,r[Qy]=n,nB(r,e,!1,!1),e.stateNode=r;e:{switch(a=pC(t,n),t){case"dialog":yr("cancel",r),yr("close",r),s=n;break;case"iframe":case"object":case"embed":yr("load",r),s=n;break;case"video":case"audio":for(s=0;s<zv.length;s++)yr(zv[s],r);s=n;break;case"source":yr("error",r),s=n;break;case"img":case"image":case"link":yr("error",r),yr("load",r),s=n;break;case"details":yr("toggle",r),s=n;break;case"input":jO(r,n),s=lC(r,n),yr("invalid",r);break;case"option":s=n;break;case"select":r._wrapperState={wasMultiple:!!n.multiple},s=Vr({},n,{value:void 0}),yr("invalid",r);break;case"textarea":FO(r,n),s=dC(r,n),yr("invalid",r);break;default:s=n}fC(t,s),o=s;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?ML(r,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&FL(r,l)):i==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Wy(r,l):typeof l=="number"&&Wy(r,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Hy.hasOwnProperty(i)?l!=null&&i==="onScroll"&&yr("scroll",r):l!=null&&BR(r,i,l,a))}switch(t){case"input":u_(r),OO(r,n,!1);break;case"textarea":u_(r),DO(r);break;case"option":n.value!=null&&r.setAttribute("value",""+Nh(n.value));break;case"select":r.multiple=!!n.multiple,i=n.value,i!=null?Om(r,!!n.multiple,i,!1):n.defaultValue!=null&&Om(r,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(r.onclick=T2)}switch(t){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ys(e),null;case 6:if(r&&e.stateNode!=null)iB(r,e,r.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(ye(166));if(t=kf(t1.current),kf(Yl.current),y_(e)){if(n=e.stateNode,t=e.memoizedProps,n[Wl]=e,(i=n.nodeValue!==t)&&(r=ha,r!==null))switch(r.tag){case 3:v_(n.nodeValue,t,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&v_(n.nodeValue,t,(r.mode&1)!==0)}i&&(e.flags|=4)}else n=(t.nodeType===9?t:t.ownerDocument).createTextNode(n),n[Wl]=e,e.stateNode=n}return ys(e),null;case 13:if(Sr(Lr),n=e.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Rr&&da!==null&&e.mode&1&&!(e.flags&128))k5(),Px(),e.flags|=98560,i=!1;else if(i=y_(e),n!==null&&n.dehydrated!==null){if(r===null){if(!i)throw Error(ye(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ye(317));i[Wl]=e}else Px(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ys(e),i=!1}else Io!==null&&(XC(Io),Io=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(n=n!==null,n!==(r!==null&&r.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(r===null||Lr.current&1?Cn===0&&(Cn=3):b4())),e.updateQueue!==null&&(e.flags|=4),ys(e),null);case 4:return jx(),UC(r,e),r===null&&Zy(e.stateNode.containerInfo),ys(e),null;case 10:return s4(e.type._context),ys(e),null;case 17:return Ei(e.type)&&C2(),ys(e),null;case 19:if(Sr(Lr),i=e.memoizedState,i===null)return ys(e),null;if(n=(e.flags&128)!==0,a=i.rendering,a===null)if(n)Cv(i,!1);else{if(Cn!==0||r!==null&&r.flags&128)for(r=e.child;r!==null;){if(a=D2(r),a!==null){for(e.flags|=128,Cv(i,!1),n=a.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=t,t=e.child;t!==null;)i=t,r=n,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,r=a.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t=t.sibling;return xr(Lr,Lr.current&1|2),e.child}r=r.sibling}i.tail!==null&&dn()>Fx&&(e.flags|=128,n=!0,Cv(i,!1),e.lanes=4194304)}else{if(!n)if(r=D2(a),r!==null){if(e.flags|=128,n=!0,t=r.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Cv(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Rr)return ys(e),null}else 2*dn()-i.renderingStartTime>Fx&&t!==1073741824&&(e.flags|=128,n=!0,Cv(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(t=i.last,t!==null?t.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=dn(),e.sibling=null,t=Lr.current,xr(Lr,n?t&1|2:t&1),e):(ys(e),null);case 22:case 23:return w4(),n=e.memoizedState!==null,r!==null&&r.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ta&1073741824&&(ys(e),e.subtreeFlags&6&&(e.flags|=8192)):ys(e),null;case 24:return null;case 25:return null}throw Error(ye(156,e.tag))}function hG(r,e){switch(e4(e),e.tag){case 1:return Ei(e.type)&&C2(),r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 3:return jx(),Sr(Si),Sr(Ms),c4(),r=e.flags,r&65536&&!(r&128)?(e.flags=r&-65537|128,e):null;case 5:return l4(e),null;case 13:if(Sr(Lr),r=e.memoizedState,r!==null&&r.dehydrated!==null){if(e.alternate===null)throw Error(ye(340));Px()}return r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 19:return Sr(Lr),null;case 4:return jx(),null;case 10:return s4(e.type._context),null;case 22:case 23:return w4(),null;case 24:return null;default:return null}}var __=!1,Ps=!1,fG=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Am(r,e){var t=r.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){en(r,e,n)}else t.current=null}function $C(r,e,t){try{t()}catch(n){en(r,e,n)}}var SF=!1;function pG(r,e){if(SC=S2,r=u5(),JR(r)){if("selectionStart"in r)var t={start:r.selectionStart,end:r.selectionEnd};else e:{t=(t=r.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{t.nodeType,i.nodeType}catch{t=null;break e}var a=0,o=-1,l=-1,c=0,u=0,f=r,p=null;t:for(;;){for(var m;f!==t||s!==0&&f.nodeType!==3||(o=a+s),f!==i||n!==0&&f.nodeType!==3||(l=a+n),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===r)break t;if(p===t&&++c===s&&(o=a),p===i&&++u===n&&(l=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}t=o===-1||l===-1?null:{start:o,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(EC={focusedElem:r,selectionRange:t},S2=!1,$e=e;$e!==null;)if(e=$e,r=e.child,(e.subtreeFlags&1028)!==0&&r!==null)r.return=e,$e=r;else for(;$e!==null;){e=$e;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,y=x.memoizedState,v=e.stateNode,w=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:vo(e.type,g),y);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(_){en(e,e.return,_)}if(r=e.sibling,r!==null){r.return=e.return,$e=r;break}$e=e.return}return x=SF,SF=!1,x}function ky(r,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&r)===r){var i=s.destroy;s.destroy=void 0,i!==void 0&&$C(e,t,i)}s=s.next}while(s!==n)}}function yE(r,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&r)===r){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function zC(r){var e=r.ref;if(e!==null){var t=r.stateNode;switch(r.tag){case 5:r=t;break;default:r=t}typeof e=="function"?e(r):e.current=r}}function aB(r){var e=r.alternate;e!==null&&(r.alternate=null,aB(e)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(e=r.stateNode,e!==null&&(delete e[Wl],delete e[Qy],delete e[CC],delete e[qV],delete e[ZV])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function oB(r){return r.tag===5||r.tag===3||r.tag===4}function EF(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||oB(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function HC(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(r,e):t.insertBefore(r,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(r,t)):(e=t,e.appendChild(r)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=T2));else if(n!==4&&(r=r.child,r!==null))for(HC(r,e,t),r=r.sibling;r!==null;)HC(r,e,t),r=r.sibling}function WC(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.insertBefore(r,e):t.appendChild(r);else if(n!==4&&(r=r.child,r!==null))for(WC(r,e,t),r=r.sibling;r!==null;)WC(r,e,t),r=r.sibling}var as=null,Mo=!1;function Bu(r,e,t){for(t=t.child;t!==null;)lB(r,e,t),t=t.sibling}function lB(r,e,t){if(Xl&&typeof Xl.onCommitFiberUnmount=="function")try{Xl.onCommitFiberUnmount(dE,t)}catch{}switch(t.tag){case 5:Ps||Am(t,e);case 6:var n=as,s=Mo;as=null,Bu(r,e,t),as=n,Mo=s,as!==null&&(Mo?(r=as,t=t.stateNode,r.nodeType===8?r.parentNode.removeChild(t):r.removeChild(t)):as.removeChild(t.stateNode));break;case 18:as!==null&&(Mo?(r=as,t=t.stateNode,r.nodeType===8?GA(r.parentNode,t):r.nodeType===1&&GA(r,t),Xy(r)):GA(as,t.stateNode));break;case 4:n=as,s=Mo,as=t.stateNode.containerInfo,Mo=!0,Bu(r,e,t),as=n,Mo=s;break;case 0:case 11:case 14:case 15:if(!Ps&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&$C(t,e,a),s=s.next}while(s!==n)}Bu(r,e,t);break;case 1:if(!Ps&&(Am(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(o){en(t,e,o)}Bu(r,e,t);break;case 21:Bu(r,e,t);break;case 22:t.mode&1?(Ps=(n=Ps)||t.memoizedState!==null,Bu(r,e,t),Ps=n):Bu(r,e,t);break;default:Bu(r,e,t)}}function AF(r){var e=r.updateQueue;if(e!==null){r.updateQueue=null;var t=r.stateNode;t===null&&(t=r.stateNode=new fG),e.forEach(function(n){var s=kG.bind(null,r,n);t.has(n)||(t.add(n),n.then(s,s))})}}function co(r,e){var t=e.deletions;if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];try{var i=r,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:as=o.stateNode,Mo=!1;break e;case 3:as=o.stateNode.containerInfo,Mo=!0;break e;case 4:as=o.stateNode.containerInfo,Mo=!0;break e}o=o.return}if(as===null)throw Error(ye(160));lB(i,a,s),as=null,Mo=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){en(s,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)cB(e,r),e=e.sibling}function cB(r,e){var t=r.alternate,n=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(co(e,r),al(r),n&4){try{ky(3,r,r.return),yE(3,r)}catch(g){en(r,r.return,g)}try{ky(5,r,r.return)}catch(g){en(r,r.return,g)}}break;case 1:co(e,r),al(r),n&512&&t!==null&&Am(t,t.return);break;case 5:if(co(e,r),al(r),n&512&&t!==null&&Am(t,t.return),r.flags&32){var s=r.stateNode;try{Wy(s,"")}catch(g){en(r,r.return,g)}}if(n&4&&(s=r.stateNode,s!=null)){var i=r.memoizedProps,a=t!==null?t.memoizedProps:i,o=r.type,l=r.updateQueue;if(r.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&RL(s,i),pC(o,a);var c=pC(o,i);for(a=0;a<l.length;a+=2){var u=l[a],f=l[a+1];u==="style"?ML(s,f):u==="dangerouslySetInnerHTML"?FL(s,f):u==="children"?Wy(s,f):BR(s,u,f,c)}switch(o){case"input":cC(s,i);break;case"textarea":jL(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Om(s,!!i.multiple,m,!1):p!==!!i.multiple&&(i.defaultValue!=null?Om(s,!!i.multiple,i.defaultValue,!0):Om(s,!!i.multiple,i.multiple?[]:"",!1))}s[Qy]=i}catch(g){en(r,r.return,g)}}break;case 6:if(co(e,r),al(r),n&4){if(r.stateNode===null)throw Error(ye(162));s=r.stateNode,i=r.memoizedProps;try{s.nodeValue=i}catch(g){en(r,r.return,g)}}break;case 3:if(co(e,r),al(r),n&4&&t!==null&&t.memoizedState.isDehydrated)try{Xy(e.containerInfo)}catch(g){en(r,r.return,g)}break;case 4:co(e,r),al(r);break;case 13:co(e,r),al(r),s=r.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(v4=dn())),n&4&&AF(r);break;case 22:if(u=t!==null&&t.memoizedState!==null,r.mode&1?(Ps=(c=Ps)||u,co(e,r),Ps=c):co(e,r),al(r),n&8192){if(c=r.memoizedState!==null,(r.stateNode.isHidden=c)&&!u&&r.mode&1)for($e=r,u=r.child;u!==null;){for(f=$e=u;$e!==null;){switch(p=$e,m=p.child,p.tag){case 0:case 11:case 14:case 15:ky(4,p,p.return);break;case 1:Am(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){n=p,t=p.return;try{e=n,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(g){en(n,t,g)}}break;case 5:Am(p,p.return);break;case 22:if(p.memoizedState!==null){CF(f);continue}}m!==null?(m.return=p,$e=m):CF(f)}u=u.sibling}e:for(u=null,f=r;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=f.stateNode,l=f.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=DL("display",a))}catch(g){en(r,r.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){en(r,r.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===r)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:co(e,r),al(r),n&4&&AF(r);break;case 21:break;default:co(e,r),al(r)}}function al(r){var e=r.flags;if(e&2){try{e:{for(var t=r.return;t!==null;){if(oB(t)){var n=t;break e}t=t.return}throw Error(ye(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Wy(s,""),n.flags&=-33);var i=EF(r);WC(r,i,s);break;case 3:case 4:var a=n.stateNode.containerInfo,o=EF(r);HC(r,o,a);break;default:throw Error(ye(161))}}catch(l){en(r,r.return,l)}r.flags&=-3}e&4096&&(r.flags&=-4097)}function mG(r,e,t){$e=r,uB(r)}function uB(r,e,t){for(var n=(r.mode&1)!==0;$e!==null;){var s=$e,i=s.child;if(s.tag===22&&n){var a=s.memoizedState!==null||__;if(!a){var o=s.alternate,l=o!==null&&o.memoizedState!==null||Ps;o=__;var c=Ps;if(__=a,(Ps=l)&&!c)for($e=s;$e!==null;)a=$e,l=a.child,a.tag===22&&a.memoizedState!==null?NF(s):l!==null?(l.return=a,$e=l):NF(s);for(;i!==null;)$e=i,uB(i),i=i.sibling;$e=s,__=o,Ps=c}TF(r)}else s.subtreeFlags&8772&&i!==null?(i.return=s,$e=i):TF(r)}}function TF(r){for(;$e!==null;){var e=$e;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ps||yE(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Ps)if(t===null)n.componentDidMount();else{var s=e.elementType===e.type?t.memoizedProps:vo(e.type,t.memoizedProps);n.componentDidUpdate(s,t.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&dF(e,i,n);break;case 3:var a=e.updateQueue;if(a!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}dF(e,a,t)}break;case 5:var o=e.stateNode;if(t===null&&e.flags&4){t=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Xy(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}Ps||e.flags&512&&zC(e)}catch(p){en(e,e.return,p)}}if(e===r){$e=null;break}if(t=e.sibling,t!==null){t.return=e.return,$e=t;break}$e=e.return}}function CF(r){for(;$e!==null;){var e=$e;if(e===r){$e=null;break}var t=e.sibling;if(t!==null){t.return=e.return,$e=t;break}$e=e.return}}function NF(r){for(;$e!==null;){var e=$e;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{yE(4,e)}catch(l){en(e,t,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(l){en(e,s,l)}}var i=e.return;try{zC(e)}catch(l){en(e,i,l)}break;case 5:var a=e.return;try{zC(e)}catch(l){en(e,a,l)}}}catch(l){en(e,e.return,l)}if(e===r){$e=null;break}var o=e.sibling;if(o!==null){o.return=e.return,$e=o;break}$e=e.return}}var gG=Math.ceil,L2=ju.ReactCurrentDispatcher,g4=ju.ReactCurrentOwner,Za=ju.ReactCurrentBatchConfig,Pt=0,Kn=null,bn=null,hs=0,ta=0,Tm=Xh(0),Cn=0,i1=null,x0=0,wE=0,x4=0,Sy=null,bi=null,v4=0,Fx=1/0,gc=null,B2=!1,VC=null,Sh=null,k_=!1,hh=null,U2=0,Ey=0,GC=null,bk=-1,_k=0;function ri(){return Pt&6?dn():bk!==-1?bk:bk=dn()}function Eh(r){return r.mode&1?Pt&2&&hs!==0?hs&-hs:QV.transition!==null?(_k===0&&(_k=XL()),_k):(r=er,r!==0||(r=window.event,r=r===void 0?16:t5(r.type)),r):1}function Go(r,e,t,n){if(50<Ey)throw Ey=0,GC=null,Error(ye(185));Ob(r,t,n),(!(Pt&2)||r!==Kn)&&(r===Kn&&(!(Pt&2)&&(wE|=t),Cn===4&&ed(r,hs)),Ai(r,n),t===1&&Pt===0&&!(e.mode&1)&&(Fx=dn()+500,gE&&Yh()))}function Ai(r,e){var t=r.callbackNode;QW(r,e);var n=k2(r,r===Kn?hs:0);if(n===0)t!==null&&LO(t),r.callbackNode=null,r.callbackPriority=0;else if(e=n&-n,r.callbackPriority!==e){if(t!=null&&LO(t),e===1)r.tag===0?JV(PF.bind(null,r)):w5(PF.bind(null,r)),XV(function(){!(Pt&6)&&Yh()}),t=null;else{switch(YL(n)){case 1:t=WR;break;case 4:t=GL;break;case 16:t=_2;break;case 536870912:t=KL;break;default:t=_2}t=vB(t,dB.bind(null,r))}r.callbackPriority=e,r.callbackNode=t}}function dB(r,e){if(bk=-1,_k=0,Pt&6)throw Error(ye(327));var t=r.callbackNode;if(Lm()&&r.callbackNode!==t)return null;var n=k2(r,r===Kn?hs:0);if(n===0)return null;if(n&30||n&r.expiredLanes||e)e=$2(r,n);else{e=n;var s=Pt;Pt|=2;var i=fB();(Kn!==r||hs!==e)&&(gc=null,Fx=dn()+500,l0(r,e));do try{yG();break}catch(o){hB(r,o)}while(!0);n4(),L2.current=i,Pt=s,bn!==null?e=0:(Kn=null,hs=0,e=Cn)}if(e!==0){if(e===2&&(s=yC(r),s!==0&&(n=s,e=KC(r,s))),e===1)throw t=i1,l0(r,0),ed(r,n),Ai(r,dn()),t;if(e===6)ed(r,n);else{if(s=r.current.alternate,!(n&30)&&!xG(s)&&(e=$2(r,n),e===2&&(i=yC(r),i!==0&&(n=i,e=KC(r,i))),e===1))throw t=i1,l0(r,0),ed(r,n),Ai(r,dn()),t;switch(r.finishedWork=s,r.finishedLanes=n,e){case 0:case 1:throw Error(ye(345));case 2:cf(r,bi,gc);break;case 3:if(ed(r,n),(n&130023424)===n&&(e=v4+500-dn(),10<e)){if(k2(r,0)!==0)break;if(s=r.suspendedLanes,(s&n)!==n){ri(),r.pingedLanes|=r.suspendedLanes&s;break}r.timeoutHandle=TC(cf.bind(null,r,bi,gc),e);break}cf(r,bi,gc);break;case 4:if(ed(r,n),(n&4194240)===n)break;for(e=r.eventTimes,s=-1;0<n;){var a=31-Vo(n);i=1<<a,a=e[a],a>s&&(s=a),n&=~i}if(n=s,n=dn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*gG(n/1960))-n,10<n){r.timeoutHandle=TC(cf.bind(null,r,bi,gc),n);break}cf(r,bi,gc);break;case 5:cf(r,bi,gc);break;default:throw Error(ye(329))}}}return Ai(r,dn()),r.callbackNode===t?dB.bind(null,r):null}function KC(r,e){var t=Sy;return r.current.memoizedState.isDehydrated&&(l0(r,e).flags|=256),r=$2(r,e),r!==2&&(e=bi,bi=t,e!==null&&XC(e)),r}function XC(r){bi===null?bi=r:bi.push.apply(bi,r)}function xG(r){for(var e=r;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var n=0;n<t.length;n++){var s=t[n],i=s.getSnapshot;s=s.value;try{if(!el(i(),s))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===r)break;for(;e.sibling===null;){if(e.return===null||e.return===r)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ed(r,e){for(e&=~x4,e&=~wE,r.suspendedLanes|=e,r.pingedLanes&=~e,r=r.expirationTimes;0<e;){var t=31-Vo(e),n=1<<t;r[t]=-1,e&=~n}}function PF(r){if(Pt&6)throw Error(ye(327));Lm();var e=k2(r,0);if(!(e&1))return Ai(r,dn()),null;var t=$2(r,e);if(r.tag!==0&&t===2){var n=yC(r);n!==0&&(e=n,t=KC(r,n))}if(t===1)throw t=i1,l0(r,0),ed(r,e),Ai(r,dn()),t;if(t===6)throw Error(ye(345));return r.finishedWork=r.current.alternate,r.finishedLanes=e,cf(r,bi,gc),Ai(r,dn()),null}function y4(r,e){var t=Pt;Pt|=1;try{return r(e)}finally{Pt=t,Pt===0&&(Fx=dn()+500,gE&&Yh())}}function v0(r){hh!==null&&hh.tag===0&&!(Pt&6)&&Lm();var e=Pt;Pt|=1;var t=Za.transition,n=er;try{if(Za.transition=null,er=1,r)return r()}finally{er=n,Za.transition=t,Pt=e,!(Pt&6)&&Yh()}}function w4(){ta=Tm.current,Sr(Tm)}function l0(r,e){r.finishedWork=null,r.finishedLanes=0;var t=r.timeoutHandle;if(t!==-1&&(r.timeoutHandle=-1,KV(t)),bn!==null)for(t=bn.return;t!==null;){var n=t;switch(e4(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&C2();break;case 3:jx(),Sr(Si),Sr(Ms),c4();break;case 5:l4(n);break;case 4:jx();break;case 13:Sr(Lr);break;case 19:Sr(Lr);break;case 10:s4(n.type._context);break;case 22:case 23:w4()}t=t.return}if(Kn=r,bn=r=Ah(r.current,null),hs=ta=e,Cn=0,i1=null,x4=wE=x0=0,bi=Sy=null,_f!==null){for(e=0;e<_f.length;e++)if(t=_f[e],n=t.interleaved,n!==null){t.interleaved=null;var s=n.next,i=t.pending;if(i!==null){var a=i.next;i.next=s,n.next=a}t.pending=n}_f=null}return r}function hB(r,e){do{var t=bn;try{if(n4(),vk.current=I2,M2){for(var n=Hr.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}M2=!1}if(g0=0,Wn=An=Hr=null,_y=!1,r1=0,g4.current=null,t===null||t.return===null){Cn=1,i1=e,bn=null;break}e:{var i=r,a=t.return,o=t,l=e;if(e=hs,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=o,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=xF(a);if(m!==null){m.flags&=-257,vF(m,a,o,i,e),m.mode&1&&gF(i,c,e),e=m,l=c;var x=e.updateQueue;if(x===null){var g=new Set;g.add(l),e.updateQueue=g}else x.add(l);break e}else{if(!(e&1)){gF(i,c,e),b4();break e}l=Error(ye(426))}}else if(Rr&&o.mode&1){var y=xF(a);if(y!==null){!(y.flags&65536)&&(y.flags|=256),vF(y,a,o,i,e),t4(Ox(l,o));break e}}i=l=Ox(l,o),Cn!==4&&(Cn=2),Sy===null?Sy=[i]:Sy.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=Y5(i,l,e);uF(i,v);break e;case 1:o=l;var w=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Sh===null||!Sh.has(b)))){i.flags|=65536,e&=-e,i.lanes|=e;var _=q5(i,o,e);uF(i,_);break e}}i=i.return}while(i!==null)}mB(t)}catch(T){e=T,bn===t&&t!==null&&(bn=t=t.return);continue}break}while(!0)}function fB(){var r=L2.current;return L2.current=I2,r===null?I2:r}function b4(){(Cn===0||Cn===3||Cn===2)&&(Cn=4),Kn===null||!(x0&268435455)&&!(wE&268435455)||ed(Kn,hs)}function $2(r,e){var t=Pt;Pt|=2;var n=fB();(Kn!==r||hs!==e)&&(gc=null,l0(r,e));do try{vG();break}catch(s){hB(r,s)}while(!0);if(n4(),Pt=t,L2.current=n,bn!==null)throw Error(ye(261));return Kn=null,hs=0,Cn}function vG(){for(;bn!==null;)pB(bn)}function yG(){for(;bn!==null&&!WW();)pB(bn)}function pB(r){var e=xB(r.alternate,r,ta);r.memoizedProps=r.pendingProps,e===null?mB(r):bn=e,g4.current=null}function mB(r){var e=r;do{var t=e.alternate;if(r=e.return,e.flags&32768){if(t=hG(t,e),t!==null){t.flags&=32767,bn=t;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Cn=6,bn=null;return}}else if(t=dG(t,e,ta),t!==null){bn=t;return}if(e=e.sibling,e!==null){bn=e;return}bn=e=r}while(e!==null);Cn===0&&(Cn=5)}function cf(r,e,t){var n=er,s=Za.transition;try{Za.transition=null,er=1,wG(r,e,t,n)}finally{Za.transition=s,er=n}return null}function wG(r,e,t,n){do Lm();while(hh!==null);if(Pt&6)throw Error(ye(327));t=r.finishedWork;var s=r.finishedLanes;if(t===null)return null;if(r.finishedWork=null,r.finishedLanes=0,t===r.current)throw Error(ye(177));r.callbackNode=null,r.callbackPriority=0;var i=t.lanes|t.childLanes;if(eV(r,i),r===Kn&&(bn=Kn=null,hs=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||k_||(k_=!0,vB(_2,function(){return Lm(),null})),i=(t.flags&15990)!==0,t.subtreeFlags&15990||i){i=Za.transition,Za.transition=null;var a=er;er=1;var o=Pt;Pt|=4,g4.current=null,pG(r,t),cB(t,r),UV(EC),S2=!!SC,EC=SC=null,r.current=t,mG(t),VW(),Pt=o,er=a,Za.transition=i}else r.current=t;if(k_&&(k_=!1,hh=r,U2=s),i=r.pendingLanes,i===0&&(Sh=null),XW(t.stateNode),Ai(r,dn()),e!==null)for(n=r.onRecoverableError,t=0;t<e.length;t++)s=e[t],n(s.value,{componentStack:s.stack,digest:s.digest});if(B2)throw B2=!1,r=VC,VC=null,r;return U2&1&&r.tag!==0&&Lm(),i=r.pendingLanes,i&1?r===GC?Ey++:(Ey=0,GC=r):Ey=0,Yh(),null}function Lm(){if(hh!==null){var r=YL(U2),e=Za.transition,t=er;try{if(Za.transition=null,er=16>r?16:r,hh===null)var n=!1;else{if(r=hh,hh=null,U2=0,Pt&6)throw Error(ye(331));var s=Pt;for(Pt|=4,$e=r.current;$e!==null;){var i=$e,a=i.child;if($e.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for($e=c;$e!==null;){var u=$e;switch(u.tag){case 0:case 11:case 15:ky(8,u,i)}var f=u.child;if(f!==null)f.return=u,$e=f;else for(;$e!==null;){u=$e;var p=u.sibling,m=u.return;if(aB(u),u===c){$e=null;break}if(p!==null){p.return=m,$e=p;break}$e=m}}}var x=i.alternate;if(x!==null){var g=x.child;if(g!==null){x.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}$e=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,$e=a;else e:for(;$e!==null;){if(i=$e,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ky(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,$e=v;break e}$e=i.return}}var w=r.current;for($e=w;$e!==null;){a=$e;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,$e=b;else e:for(a=w;$e!==null;){if(o=$e,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:yE(9,o)}}catch(T){en(o,o.return,T)}if(o===a){$e=null;break e}var _=o.sibling;if(_!==null){_.return=o.return,$e=_;break e}$e=o.return}}if(Pt=s,Yh(),Xl&&typeof Xl.onPostCommitFiberRoot=="function")try{Xl.onPostCommitFiberRoot(dE,r)}catch{}n=!0}return n}finally{er=t,Za.transition=e}}return!1}function RF(r,e,t){e=Ox(t,e),e=Y5(r,e,1),r=kh(r,e,1),e=ri(),r!==null&&(Ob(r,1,e),Ai(r,e))}function en(r,e,t){if(r.tag===3)RF(r,r,t);else for(;e!==null;){if(e.tag===3){RF(e,r,t);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Sh===null||!Sh.has(n))){r=Ox(t,r),r=q5(e,r,1),e=kh(e,r,1),r=ri(),e!==null&&(Ob(e,1,r),Ai(e,r));break}}e=e.return}}function bG(r,e,t){var n=r.pingCache;n!==null&&n.delete(e),e=ri(),r.pingedLanes|=r.suspendedLanes&t,Kn===r&&(hs&t)===t&&(Cn===4||Cn===3&&(hs&130023424)===hs&&500>dn()-v4?l0(r,0):x4|=t),Ai(r,e)}function gB(r,e){e===0&&(r.mode&1?(e=f_,f_<<=1,!(f_&130023424)&&(f_=4194304)):e=1);var t=ri();r=wu(r,e),r!==null&&(Ob(r,e,t),Ai(r,t))}function _G(r){var e=r.memoizedState,t=0;e!==null&&(t=e.retryLane),gB(r,t)}function kG(r,e){var t=0;switch(r.tag){case 13:var n=r.stateNode,s=r.memoizedState;s!==null&&(t=s.retryLane);break;case 19:n=r.stateNode;break;default:throw Error(ye(314))}n!==null&&n.delete(e),gB(r,t)}var xB;xB=function(r,e,t){if(r!==null)if(r.memoizedProps!==e.pendingProps||Si.current)ki=!0;else{if(!(r.lanes&t)&&!(e.flags&128))return ki=!1,uG(r,e,t);ki=!!(r.flags&131072)}else ki=!1,Rr&&e.flags&1048576&&b5(e,R2,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;wk(r,e),r=e.pendingProps;var s=Nx(e,Ms.current);Im(e,t),s=d4(null,e,n,r,s,t);var i=h4();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ei(n)?(i=!0,N2(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,a4(e),s.updater=vE,e.stateNode=s,s._reactInternals=e,FC(e,n,r,t),e=IC(null,e,n,!0,i,t)):(e.tag=0,Rr&&i&&QR(e),qs(null,e,s,t),e=e.child),e;case 16:n=e.elementType;e:{switch(wk(r,e),r=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=EG(n),r=vo(n,r),s){case 0:e=MC(null,e,n,r,t);break e;case 1:e=bF(null,e,n,r,t);break e;case 11:e=yF(null,e,n,r,t);break e;case 14:e=wF(null,e,n,vo(n.type,r),t);break e}throw Error(ye(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:vo(n,s),MC(r,e,n,s,t);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:vo(n,s),bF(r,e,n,s,t);case 3:e:{if(eB(e),r===null)throw Error(ye(387));n=e.pendingProps,i=e.memoizedState,s=i.element,T5(r,e),F2(e,n,null,t);var a=e.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Ox(Error(ye(423)),e),e=_F(r,e,n,t,s);break e}else if(n!==s){s=Ox(Error(ye(424)),e),e=_F(r,e,n,t,s);break e}else for(da=_h(e.stateNode.containerInfo.firstChild),ha=e,Rr=!0,Io=null,t=E5(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Px(),n===s){e=bu(r,e,t);break e}qs(r,e,n,t)}e=e.child}return e;case 5:return C5(e),r===null&&RC(e),n=e.type,s=e.pendingProps,i=r!==null?r.memoizedProps:null,a=s.children,AC(n,s)?a=null:i!==null&&AC(n,i)&&(e.flags|=32),Q5(r,e),qs(r,e,a,t),e.child;case 6:return r===null&&RC(e),null;case 13:return tB(r,e,t);case 4:return o4(e,e.stateNode.containerInfo),n=e.pendingProps,r===null?e.child=Rx(e,null,n,t):qs(r,e,n,t),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:vo(n,s),yF(r,e,n,s,t);case 7:return qs(r,e,e.pendingProps,t),e.child;case 8:return qs(r,e,e.pendingProps.children,t),e.child;case 12:return qs(r,e,e.pendingProps.children,t),e.child;
vendor: 4,552 bytes, line 40
40case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,xr(j2,n._currentValue),n._currentValue=a,i!==null)if(el(i.value,a)){if(i.children===s.children&&!Si.current){e=bu(r,e,t);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=du(-1,t&-t),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=t,l=i.alternate,l!==null&&(l.lanes|=t),jC(i.return,t,e),o.lanes|=t;break}l=l.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ye(341));a.lanes|=t,o=a.alternate,o!==null&&(o.lanes|=t),jC(a,t,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}qs(r,e,s.children,t),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,Im(e,t),s=eo(s),n=n(s),e.flags|=1,qs(r,e,n,t),e.child;case 14:return n=e.type,s=vo(n,e.pendingProps),s=vo(n.type,s),wF(r,e,n,s,t);case 15:return Z5(r,e,e.type,e.pendingProps,t);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:vo(n,s),wk(r,e),e.tag=1,Ei(n)?(r=!0,N2(e)):r=!1,Im(e,t),X5(e,n,s),FC(e,n,s,t),IC(null,e,n,!0,r,t);case 19:return rB(r,e,t);case 22:return J5(r,e,t)}throw Error(ye(156,e.tag))};function vB(r,e){return VL(r,e)}function SG(r,e,t,n){this.tag=r,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ya(r,e,t,n){return new SG(r,e,t,n)}function _4(r){return r=r.prototype,!(!r||!r.isReactComponent)}function EG(r){if(typeof r=="function")return _4(r)?1:0;if(r!=null){if(r=r.$$typeof,r===$R)return 11;if(r===zR)return 14}return 2}function Ah(r,e){var t=r.alternate;return t===null?(t=Ya(r.tag,e,r.key,r.mode),t.elementType=r.elementType,t.type=r.type,t.stateNode=r.stateNode,t.alternate=r,r.alternate=t):(t.pendingProps=e,t.type=r.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=r.flags&14680064,t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,e=r.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=r.sibling,t.index=r.index,t.ref=r.ref,t}function kk(r,e,t,n,s,i){var a=2;if(n=r,typeof r=="function")_4(r)&&(a=1);else if(typeof r=="string")a=5;else e:switch(r){case xm:return c0(t.children,s,i,e);case UR:a=8,s|=8;break;case sC:return r=Ya(12,t,e,s|2),r.elementType=sC,r.lanes=i,r;case iC:return r=Ya(13,t,e,s),r.elementType=iC,r.lanes=i,r;case aC:return r=Ya(19,t,e,s),r.elementType=aC,r.lanes=i,r;case CL:return bE(t,s,i,e);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case AL:a=10;break e;case TL:a=9;break e;case $R:a=11;break e;case zR:a=14;break e;case qu:a=16,n=null;break e}throw Error(ye(130,r==null?r:typeof r,""))}return e=Ya(a,t,e,s),e.elementType=r,e.type=n,e.lanes=i,e}function c0(r,e,t,n){return r=Ya(7,r,n,e),r.lanes=t,r}function bE(r,e,t,n){return r=Ya(22,r,n,e),r.elementType=CL,r.lanes=t,r.stateNode={isHidden:!1},r}function eT(r,e,t){return r=Ya(6,r,null,e),r.lanes=t,r}function tT(r,e,t){return e=Ya(4,r.children!==null?r.children:[],r.key,e),e.lanes=t,e.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},e}function AG(r,e,t,n,s){this.tag=e,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=DA(0),this.expirationTimes=DA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=DA(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function k4(r,e,t,n,s,i,a,o,l){return r=new AG(r,e,t,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Ya(3,null,null,e),r.current=i,i.stateNode=r,i.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},a4(i),r}function TG(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,595 bytes, line 40
40return{$$typeof:gm,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}function yB(r){if(!r)return Ph;r=r._reactInternals;e:{if(F0(r)!==r||r.tag!==1)throw Error(ye(170));var e=r;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ei(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ye(171))}if(r.tag===1){var t=r.type;if(Ei(t))return y5(r,t,e)}return e}function wB(r,e,t,n,s,i,a,o,l){return r=k4(t,n,!0,r,s,i,a,o,l),r.context=yB(null),t=r.current,n=ri(),s=Eh(t),i=du(n,s),i.callback=e??null,kh(t,i,s),r.current.lanes=s,Ob(r,s,n),Ai(r,n),r}function _E(r,e,t,n){var s=e.current,i=ri(),a=Eh(s);return t=yB(t),e.context===null?e.context=t:e.pendingContext=t,e=du(i,a),e.payload={element:r},n=n===void 0?null:n,n!==null&&(e.callback=n),r=kh(s,e,a),r!==null&&(Go(r,s,a,i),xk(r,s,a)),a}function z2(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function jF(r,e){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var t=r.retryLane;r.retryLane=t!==0&&t<e?t:e}}function S4(r,e){jF(r,e),(r=r.alternate)&&jF(r,e)}function CG(){return null}var bB=typeof reportError=="function"?reportError:function(r){console.error(r)};function E4(r){this._internalRoot=r}kE.prototype.render=E4.prototype.render=function(r){var e=this._internalRoot;if(e===null)throw Error(ye(409));_E(r,e,null,null)};kE.prototype.unmount=E4.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var e=r.containerInfo;v0(function(){_E(null,r,null,null)}),e[yu]=null}};function kE(r){this._internalRoot=r}kE.prototype.unstable_scheduleHydration=function(r){if(r){var e=JL();r={blockedOn:null,target:r,priority:e};for(var t=0;t<Qu.length&&e!==0&&e<Qu[t].priority;t++);Qu.splice(t,0,r),t===0&&e5(r)}};function A4(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function SE(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function OF(){}function NG(r,e,t,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var c=z2(a);i.call(c)}}var a=wB(e,n,r,0,null,!1,!1,"",OF);return r._reactRootContainer=a,r[yu]=a.current,Zy(r.nodeType===8?r.parentNode:r),v0(),a}for(;s=r.lastChild;)r.removeChild(s);if(typeof n=="function"){var o=n;n=function(){var c=z2(l);o.call(c)}}var l=k4(r,0,!1,null,null,!1,!1,"",OF);return r._reactRootContainer=l,r[yu]=l.current,Zy(r.nodeType===8?r.parentNode:r),v0(function(){_E(e,l,t,n)}),l}function EE(r,e,t,n,s){var i=t._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var o=s;s=function(){var l=z2(a);o.call(l)}}_E(e,a,r,s)}else a=NG(t,e,r,s,n);return z2(a)}qL=function(r){switch(r.tag){case 3:var e=r.stateNode;if(e.current.memoizedState.isDehydrated){var t=$v(e.pendingLanes);t!==0&&(VR(e,t|1),Ai(e,dn()),!(Pt&6)&&(Fx=dn()+500,Yh()))}break;case 13:v0(function(){var n=wu(r,1);if(n!==null){var s=ri();Go(n,r,1,s)}}),S4(r,1)}};GR=function(r){if(r.tag===13){var e=wu(r,134217728);if(e!==null){var t=ri();Go(e,r,134217728,t)}S4(r,134217728)}};ZL=function(r){if(r.tag===13){var e=Eh(r),t=wu(r,e);if(t!==null){var n=ri();Go(t,r,e,n)}S4(r,e)}};JL=function(){return er};QL=function(r,e){var t=er;try{return er=r,e()}finally{er=t}};gC=function(r,e,t){switch(e){case"input":if(cC(r,t),e=t.name,t.type==="radio"&&e!=null){for(t=r;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var n=t[e];if(n!==r&&n.form===r.form){var s=mE(n);if(!s)throw Error(ye(90));PL(n),cC(n,s)}}}break;case"textarea":jL(r,t);break;case"select":e=t.value,e!=null&&Om(r,!!t.multiple,e,!1)}};BL=y4;UL=v0;var PG={usingClientEntryPoint:!1,Events:[Db,bm,mE,IL,LL,y4]},Nv={findFiberByHostInstance:bf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RG={bundleType:Nv.bundleType,version:Nv.version,rendererPackageName:Nv.rendererPackageName,rendererConfig:Nv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ju.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=HL(r),r===null?null:r.stateNode},findFiberByHostInstance:Nv.findFiberByHostInstance||CG,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var S_=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!S_.isDisabled&&S_.supportsFiber)try{dE=S_.inject(RG),Xl=S_}catch{}}va.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PG;va.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A4(e))throw Error(ye(200));return TG(r,e,null,t)};va.createRoot=function(r,e){if(!A4(r))throw Error(ye(299));var t=!1,n="",s=bB;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=k4(r,1,!1,null,null,t,!1,n,s),r[yu]=e.current,Zy(r.nodeType===8?r.parentNode:r),new E4(e)};va.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var e=r._reactInternals;if(e===void 0)throw typeof r.render=="function"?Error(ye(188)):(r=Object.keys(r).join(","),Error(ye(268,r)));return r=HL(e),r=r===null?null:r.stateNode,r};va.flushSync=function(r){return v0(r)};va.hydrate=function(r,e,t){if(!SE(e))throw Error(ye(200));return EE(null,r,e,!0,t)};va.hydrateRoot=function(r,e,t){if(!A4(r))throw Error(ye(405));var n=t!=null&&t.hydratedSources||null,s=!1,i="",a=bB;if(t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),e=wB(e,null,r,1,t??null,s,!1,i,a),r[yu]=e.current,Zy(r),n)for(r=0;r<n.length;r++)t=n[r],s=t._getVersion,s=s(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,s]:e.mutableSourceEagerHydrationData.push(t,s);return new kE(e)};va.render=function(r,e,t){if(!SE(e))throw Error(ye(200));return EE(null,r,e,!1,t)};va.unmountComponentAtNode=function(r){if(!SE(r))throw Error(ye(40));return r._reactRootContainer?(v0(function(){EE(null,null,r,!1,function(){r._reactRootContainer=null,r[yu]=null})}),!0):!1};va.unstable_batchedUpdates=y4;va.unstable_renderSubtreeIntoContainer=function(r,e,t,n){if(!SE(t))throw Error(ye(200));if(r==null||r._reactInternals===void 0)throw Error(ye(38));return EE(r,e,t,!1,n)};va.version="18.3.1-next-f1338f8080-20240426";function _B(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_B)}catch(r){console.error(r)}}_B(),_L.exports=va;var Ib=_L.exports;const kB=jR(Ib);var SB,FF=Ib;SB=FF.createRoot,FF.hydrateRoot;var AE=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},TE=typeof window>"u"||"Deno"in globalThis;function yo(){}function jG(r,e){return typeof r=="function"?r(e):r}function OG(r){return typeof r=="number"&&r>=0&&r!==1/0}function FG(r,e){return Math.max(r+(e||0)-Date.now(),0)}function YC(r,e){return typeof r=="function"?r(e):r}function DG(r,e){return typeof r=="function"?r(e):r}function DF(r,e){const{type:t="all",exact:n,fetchStatus:s,predicate:i,queryKey:a,stale:o}=r;if(a){if(n){if(e.queryHash!==T4(a,e.options))return!1}else if(!o1(e.queryKey,a))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||s&&s!==e.state.fetchStatus||i&&!i(e))}function MF(r,e){const{exact:t,status:n,predicate:s,mutationKey:i}=r;if(i){if(!e.options.mutationKey)return!1;if(t){if(a1(e.options.mutationKey)!==a1(i))return!1}else if(!o1(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function T4(r,e){return((e==null?void 0:e.queryKeyHashFn)||a1)(r)}function a1(r){return JSON.stringify(r,(e,t)=>qC(t)?Object.keys(t).sort().reduce((n,s)=>(n[s]=t[s],n),{}):t)}function o1(r,e){return r===e?!0:typeof r!=typeof e?!1:r&&e&&typeof r=="object"&&typeof e=="object"?Object.keys(e).every(t=>o1(r[t],e[t])):!1}function EB(r,e){if(r===e)return r;const t=IF(r)&&IF(e);if(t||qC(r)&&qC(e)){const n=t?r:Object.keys(r),s=n.length,i=t?e:Object.keys(e),a=i.length,o=t?[]:{},l=new Set(n);let c=0;for(let u=0;u<a;u++){const f=t?u:i[u];(!t&&l.has(f)||t)&&r[f]===void 0&&e[f]===void 0?(o[f]=void 0,c++):(o[f]=EB(r[f],e[f]),o[f]===r[f]&&r[f]!==void 0&&c++)}return s===a&&c===s?r:o}return e}function IF(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function qC(r){if(!LF(r))return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!LF(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function LF(r){return Object.prototype.toString.call(r)==="[object Object]"}function MG(r){return new Promise(e=>{setTimeout(e,r)})}function IG(r,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(r,e):t.structuralSharing!==!1?EB(r,e):e}function LG(r,e,t=0){const n=[...r,e];return t&&n.length>t?n.slice(1):n}function BG(r,e,t=0){const n=[e,...r];return t&&n.length>t?n.slice(0,-1):n}var C4=Symbol();function AB(r,e){return!r.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!r.queryFn||r.queryFn===C4?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}
vendor: 5,570 bytes, line 40
40var Cf,id,Xm,tL,UG=(tL=class extends AE{constructor(){super();R(this,Cf);R(this,id);R(this,Xm);C(this,Xm,e=>{if(!TE&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){h(this,id)||this.setEventListener(h(this,Xm))}onUnsubscribe(){var e;this.hasListeners()||((e=h(this,id))==null||e.call(this),C(this,id,void 0))}setEventListener(e){var t;C(this,Xm,e),(t=h(this,id))==null||t.call(this),C(this,id,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){h(this,Cf)!==e&&(C(this,Cf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof h(this,Cf)=="boolean"?h(this,Cf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Cf=new WeakMap,id=new WeakMap,Xm=new WeakMap,tL),TB=new UG,Ym,ad,qm,rL,$G=(rL=class extends AE{constructor(){super();R(this,Ym,!0);R(this,ad);R(this,qm);C(this,qm,e=>{if(!TE&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){h(this,ad)||this.setEventListener(h(this,qm))}onUnsubscribe(){var e;this.hasListeners()||((e=h(this,ad))==null||e.call(this),C(this,ad,void 0))}setEventListener(e){var t;C(this,qm,e),(t=h(this,ad))==null||t.call(this),C(this,ad,e(this.setOnline.bind(this)))}setOnline(e){h(this,Ym)!==e&&(C(this,Ym,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return h(this,Ym)}},Ym=new WeakMap,ad=new WeakMap,qm=new WeakMap,rL),H2=new $G;function zG(){let r,e;const t=new Promise((s,i)=>{r=s,e=i});t.status="pending",t.catch(()=>{});function n(s){Object.assign(t,s),delete t.resolve,delete t.reject}return t.resolve=s=>{n({status:"fulfilled",value:s}),r(s)},t.reject=s=>{n({status:"rejected",reason:s}),e(s)},t}function HG(r){return Math.min(1e3*2**r,3e4)}function CB(r){return(r??"online")==="online"?H2.isOnline():!0}var NB=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function rT(r){return r instanceof NB}function PB(r){let e=!1,t=0,n=!1,s;const i=zG(),a=g=>{var y;n||(p(new NB(g)),(y=r.abort)==null||y.call(r))},o=()=>{e=!0},l=()=>{e=!1},c=()=>TB.isFocused()&&(r.networkMode==="always"||H2.isOnline())&&r.canRun(),u=()=>CB(r.networkMode)&&r.canRun(),f=g=>{var y;n||(n=!0,(y=r.onSuccess)==null||y.call(r,g),s==null||s(),i.resolve(g))},p=g=>{var y;n||(n=!0,(y=r.onError)==null||y.call(r,g),s==null||s(),i.reject(g))},m=()=>new Promise(g=>{var y;s=v=>{(n||c())&&g(v)},(y=r.onPause)==null||y.call(r)}).then(()=>{var g;s=void 0,n||(g=r.onContinue)==null||g.call(r)}),x=()=>{if(n)return;let g;const y=t===0?r.initialPromise:void 0;try{g=y??r.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(f).catch(v=>{var A;if(n)return;const w=r.retry??(TE?0:3),b=r.retryDelay??HG,_=typeof b=="function"?b(t,v):b,T=w===!0||typeof w=="number"&&t<w||typeof w=="function"&&w(t,v);if(e||!T){p(v);return}t++,(A=r.onFail)==null||A.call(r,t,v),MG(_).then(()=>c()?void 0:m()).then(()=>{e?p(v):x()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:l,canStart:u,start:()=>(u()?x():m().then(x),i)}}var WG=r=>setTimeout(r,0);function VG(){let r=[],e=0,t=o=>{o()},n=o=>{o()},s=WG;const i=o=>{e?r.push(o):s(()=>{t(o)})},a=()=>{const o=r;r=[],o.length&&s(()=>{n(()=>{o.forEach(l=>{t(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{t=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{s=o}}}var ei=VG(),Nf,nL,RB=(nL=class{constructor(){R(this,Nf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),OG(this.gcTime)&&C(this,Nf,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(TE?1/0:5*60*1e3))}clearGcTimeout(){h(this,Nf)&&(clearTimeout(h(this,Nf)),C(this,Nf,void 0))}},Nf=new WeakMap,nL),Zm,Pf,Pa,Rf,Ss,W1,jf,bo,fc,sL,GG=(sL=class extends RB{constructor(e){super();R(this,bo);R(this,Zm);R(this,Pf);R(this,Pa);R(this,Rf);R(this,Ss);R(this,W1);R(this,jf);C(this,jf,!1),C(this,W1,e.defaultOptions),this.setOptions(e.options),this.observers=[],C(this,Rf,e.client),C(this,Pa,h(this,Rf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,C(this,Zm,XG(this.options)),this.state=e.state??h(this,Zm),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=h(this,Ss))==null?void 0:e.promise}setOptions(e){this.options={...h(this,W1),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&h(this,Pa).remove(this)}setData(e,t){const n=IG(this.state.data,e,this.options);return j(this,bo,fc).call(this,{data:n,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e,t){j(this,bo,fc).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var n,s;const t=(n=h(this,Ss))==null?void 0:n.promise;return(s=h(this,Ss))==null||s.cancel(e),t?t.then(yo).catch(yo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(h(this,Zm))}isActive(){return this.observers.some(e=>DG(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===C4||this.state.dataUpdateCount+this.state.errorUpdate
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>YC(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!FG(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=h(this,Ss))==null||t.continue()}onOnline(){var t;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=h(this,Ss))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),h(this,Pa).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(h(this,Ss)&&(h(this,jf)?h(this,Ss).cancel({revert:!0}):h(this,Ss).cancelRetry()),this.scheduleGc()),h(this,Pa).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||j(this,bo,fc).call(this,{type:"invalidate"})}fetch(e,t){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(h(this,Ss))return h(this,Ss).continueRetry(),h(this,Ss).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const n=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(C(this,jf,!0),n.signal)})},i=()=>{const p=AB(this.options,t),x=(()=>{const g={client:h(this,Rf),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return C(this,jf,!1),this.options.persister?this.options.persister(p,x,this):p(x)},o=(()=>{const p={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:h(this,Rf),state:this.state,fetchFn:i};return s(p),p})();(c=this.options.behavior)==null||c.onFetch(o,this),C(this,Pf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&j(this,bo,fc).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=p=>{var m,x,g,y;rT(p)&&p.silent||j(this,bo,fc).call(this,{type:"error",error:p}),rT(p)||((x=(m=h(this,Pa).config).onError)==null||x.call(m,p,this),(y=(g=h(this,Pa).config).onSettled)==null||y.call(g,this.state.data,p,this)),this.scheduleGc()};return C(this,Ss,PB({initialPromise:t==null?void 0:t.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:p=>{var m,x,g,y;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(v){l(v);return}(x=(m=h(this,Pa).config).onSuccess)==null||x.call(m,p,this),(y=(g=h(this,Pa).config).onSettled)==null||y.call(g,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,m)=>{j(this,bo,fc).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{j(this,bo,fc).call(this,{type:"pause"})},onContinue:()=>{j(this,bo,fc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),h(this,Ss).start()}},Zm=new WeakMap,Pf=new WeakMap,Pa=new WeakMap,Rf=new WeakMap,Ss=new WeakMap,W1=new WeakMap,jf=new WeakMap,bo=new WeakSet,fc=function(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...KG(n.data,this.options),fetchMeta:e.meta??null};case"success":return C(this,Pf,void 0),{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return rT(s)&&s.revert&&h(this,Pf)?{...h(this,Pf),fetchStatus:"idle"}
vendor: 5,088 bytes, line 40
40:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ei.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),h(this,Pa).notify({query:this,type:"updated",action:e})})},sL);function KG(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:CB(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function XG(r){const e=typeof r.initialData=="function"?r.initialData():r.initialData,t=e!==void 0,n=t?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var gl,iL,YG=(iL=class extends AE{constructor(e={}){super();R(this,gl);this.config=e,C(this,gl,new Map)}build(e,t,n){const s=t.queryKey,i=t.queryHash??T4(s,t);let a=this.get(i);return a||(a=new GG({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){h(this,gl).has(e.queryHash)||(h(this,gl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=h(this,gl).get(e.queryHash);t&&(e.destroy(),t===e&&h(this,gl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ei.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return h(this,gl).get(e)}getAll(){return[...h(this,gl).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>DF(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>DF(e,n)):t}notify(e){ei.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ei.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ei.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gl=new WeakMap,iL),xl,Hs,Of,vl,Gu,aL,qG=(aL=class extends RB{constructor(e){super();R(this,vl);R(this,xl);R(this,Hs);R(this,Of);this.mutationId=e.mutationId,C(this,Hs,e.mutationCache),C(this,xl,[]),this.state=e.state||ZG(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){h(this,xl).includes(e)||(h(this,xl).push(e),this.clearGcTimeout(),h(this,Hs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){C(this,xl,h(this,xl).filter(t=>t!==e)),this.scheduleGc(),h(this,Hs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){h(this,xl).length||(this.state.status==="pending"?this.scheduleGc():h(this,Hs).remove(this))}continue(){var e;return((e=h(this,Of))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,a,o,l,c,u,f,p,m,x,g,y,v,w,b,_,T,A,N,k;const t=()=>{j(this,vl,Gu).call(this,{type:"continue"})};C(this,Of,PB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,P)=>{j(this,vl,Gu).call(this,{type:"failed",failureCount:E,error:P})},onPause:()=>{j(this,vl,Gu).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>h(this,Hs).canRun(this)}));const n=this.state.status==="pending",s=!h(this,Of).canStart();try{if(n)t();else{j(this,vl,Gu).call(this,{type:"pending",variables:e,isPaused:s}),await((a=(i=h(this,Hs).config).onMutate)==null?void 0:a.call(i,e,this));const P=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e));P!==this.state.context&&j(this,vl,Gu).call(this,{type:"pending",context:P,variables:e,isPaused:s})}const E=await h(this,Of).start();return await((u=(c=h(this,Hs).config).onSuccess)==null?void 0:u.call(c,E,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,E,e,this.state.context)),await((x=(m=h(this,Hs).config).onSettled)==null?void 0:x.call(m,E,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,E,null,e,this.state.context)),j(this,vl,Gu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(v=h(this,Hs).config).onError)==null?void 0:w.call(v,E,e,this.state.context,this)),await((_=(b=this.options).onError)==null?void 0:_.call(b,E,e,this.state.context)),await((A=(T=h(this,Hs).config).onSettled)==null?void 0:A.call(T,void 0,E,this.state.variables,this.state.context,this)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,void 0,E,e,this.state.context)),E}finally{j(this,vl,Gu).call(this,{type:"error",error:E})}}finally{h(this,Hs).runNext(this)}}},xl=new WeakMap,Hs=new WeakMap,Of=new WeakMap,vl=new WeakSet,Gu=function(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
40case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ei.batch(()=>{h(this,xl).forEach(n=>{n.onMutationUpdate(e)}),h(this,Hs).notify({mutation:this,type:"updated",action:e})})},aL);function ZG(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sc,_o,V1,oL,JG=(oL=class extends AE{constructor(e={}){super();R(this,Sc);R(this,_o);R(this,V1);this.config=e,C(this,Sc,new Set),C(this,_o,new Map),C(this,V1,0)}build(e,t,n){const s=new qG({mutationCache:this,mutationId:++tr(this,V1)._,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){h(this,Sc).add(e);const t=E_(e);if(typeof t=="string"){const n=h(this,_o).get(t);n?n.push(e):h(this,_o).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(h(this,Sc).delete(e)){const t=E_(e);if(typeof t=="string"){const n=h(this,_o).get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&h(this,_o).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=E_(e);if(typeof t=="string"){const n=h(this,_o).get(t),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const t=E_(e);if(typeof t=="string"){const s=(n=h(this,_o).get(t))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ei.batch(()=>{h(this,Sc).forEach(e=>{this.notify({type:"removed",mutation:e})}),h(this,Sc).clear(),h(this,_o).clear()})}getAll(){return Array.from(h(this,Sc))}find(e){const t={exact:!0,...e};return this.getAll().find(n=>MF(t,n))}findAll(e={}){return this.getAll().filter(t=>MF(e,t))}notify(e){ei.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>
vendor: 4,420 bytes, line 40
40t.state.isPaused);return ei.batch(()=>Promise.all(e.map(t=>t.continue().catch(yo))))}},Sc=new WeakMap,_o=new WeakMap,V1=new WeakMap,oL);function E_(r){var e;return(e=r.options.scope)==null?void 0:e.id}function BF(r){return{onFetch:(e,t)=>{var u,f,p,m,x;const n=e.options,s=(p=(f=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const y=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},v=AB(e.options,e.fetchOptions),w=async(b,_,T)=>{if(g)return Promise.reject();if(_==null&&b.pages.length)return Promise.resolve(b);const N=(()=>{const O={client:e.client,queryKey:e.queryKey,pageParam:_,direction:T?"backward":"forward",meta:e.options.meta};return y(O),O})(),k=await v(N),{maxPages:E}=e.options,P=T?BG:LG;return{pages:P(b.pages,k,E),pageParams:P(b.pageParams,_,E)}};if(s&&i.length){const b=s==="backward",_=b?QG:UF,T={pages:i,pageParams:a},A=_(n,T);o=await w(T,A,b)}else{const b=r??i.length;do{const _=l===0?a[0]??n.initialPageParam:UF(n,o);if(l>0&&_==null)break;o=await w(o,_),l++}while(l<b)}return o};e.options.persister?e.fetchFn=()=>{var g,y;return(y=(g=e.options).persister)==null?void 0:y.call(g,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=c}}}function UF(r,{pages:e,pageParams:t}){const n=e.length-1;return e.length>0?r.getNextPageParam(e[n],e,t[n],t):void 0}function QG(r,{pages:e,pageParams:t}){var n;return e.length>0?(n=r.getPreviousPageParam)==null?void 0:n.call(r,e[0],e,t[0],t):void 0}var Kr,od,ld,Jm,Qm,cd,eg,tg,lL,eK=(lL=class{constructor(r={}){R(this,Kr);R(this,od);R(this,ld);R(this,Jm);R(this,Qm);R(this,cd);R(this,eg);R(this,tg);C(this,Kr,r.queryCache||new YG),C(this,od,r.mutationCache||new JG),C(this,ld,r.defaultOptions||{}),C(this,Jm,new Map),C(this,Qm,new Map),C(this,cd,0)}mount(){tr(this,cd)._++,h(this,cd)===1&&(C(this,eg,TB.subscribe(async r=>{r&&(await this.resumePausedMutations(),h(this,Kr).onFocus())})),C(this,tg,H2.subscribe(async r=>{r&&(await this.resumePausedMutations(),h(this,Kr).onOnline())})))}unmount(){var r,e;tr(this,cd)._--,h(this,cd)===0&&((r=h(this,eg))==null||r.call(this),C(this,eg,void 0),(e=h(this,tg))==null||e.call(this),C(this,tg,void 0))}isFetching(r){return h(this,Kr).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return h(this,od).findAll({...r,status:"pending"}).length}getQueryData(r){var t;const e=this.defaultQueryOptions({queryKey:r});return(t=h(this,Kr).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(r){const e=this.defaultQueryOptions(r),t=h(this,Kr).build(this,e),n=t.state.data;return n===void 0?this.fetchQuery(r):(r.revalidateIfStale&&t.isStaleByTime(YC(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(r){return h(this,Kr).findAll(r).map(({queryKey:e,state:t})=>{const n=t.data;return[e,n]})}setQueryData(r,e,t){const n=this.defaultQueryOptions({queryKey:r}),s=h(this,Kr).get(n.queryHash),i=s==null?void 0:s.state.data,a=jG(e,i);if(a!==void 0)return h(this,Kr).build(this,n).setData(a,{...t,manual:!0})}setQueriesData(r,e,t){return ei.batch(()=>h(this,Kr).findAll(r).map(({queryKey:n})=>[n,this.setQueryData(n,e,t)]))}getQueryState(r){var t;const e=this.defaultQueryOptions({queryKey:r});return(t=h(this,Kr).get(e.queryHash))==null?void 0:t.state}removeQueries(r){const e=h(this,Kr);ei.batch(()=>{e.findAll(r).forEach(t=>{e.remove(t)})})}resetQueries(r,e){const t=h(this,Kr);return ei.batch(()=>(t.findAll(r).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){const t={revert:!0,...e},n=ei.batch(()=>h(this,Kr).findAll(r).map(s=>s.cancel(t)));return Promise.all(n).then(yo).catch(yo)}invalidateQueries(r,e={}){return ei.batch(()=>(h(this,Kr).findAll(r).forEach(t=>{t.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},e)))}refetchQueries(r,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},n=ei.batch(()=>h(this,Kr).findAll(r).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,t);return t.throwOnError||(i=i.catch(yo)),s.state.fetchStatus==="paused"?Promise.resolve():i}
40));return Promise.all(n).then(yo)}fetchQuery(r){const e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);const t=h(this,Kr).build(this,e);return t.isStaleByTime(YC(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(yo).catch(yo)}fetchInfiniteQuery(r){return r.behavior=BF(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(yo).catch(yo)}ensureInfiniteQueryData(r){return r.behavior=BF(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return H2.isOnline()?h(this,od).resumePausedMutations():Promise.resolve()}getQueryCache(){return h(this,Kr)}getMutationCache(){return h(this,od)}getDefaultOptions(){return h(this,ld)}setDefaultOptions(r){C(this,ld,r)}setQueryDefaults(r,e){h(this,Jm).set(a1(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){const e=[...h(this,Jm).values()],t={};return e.forEach(n=>{o1(r,n.queryKey)&&Object.assign(t,n.defaultOptions)}),t}setMutationDefaults(r,e){h(this,Qm).set(a1(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){const e=[...h(this,Qm).values()],t={};return e.forEach(n=>{o1(r,n.mutationKey)&&Object.assign(t,n.defaultOptions)}),t}defaultQueryOptions(r){if(r._defaulted)return r;const e={...h(this,ld).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=T4(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===C4&&(e.enabled=!1),e}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...h(this,ld).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){h(this,Kr).clear(),h(this,od).clear()}},Kr=new WeakMap,od=new WeakMap,ld=new WeakMap,Jm=new WeakMap,Qm=new WeakMap,cd=new WeakMap,eg=new WeakMap,tg=new WeakMap,lL),tK=S.createContext(void 0),rK=({client:r,children:e})=>(S.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),d.jsx(tK.Provider,{value:r,children:e}));/** 41 * react-router v7.18.1 42 * 43 * Copyright (c) Remix Software Inc. 44 * 45 * This source code is licensed under the MIT license found in the 46 * LICENSE.md file in the root directory of this source tree. 47 * 48 * @license MIT 49 */var N4=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,jB=/^[\\/]{2}/;function nK(r,e){return e+r.replace(/\\/g,"/")}var $F="popstate";function zF(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function sK(r={}){function e(n,s){var c;let i=(c=s.state)==null?void 0:c.masked,{pathname:a,search:o,hash:l}=i||n.location;return ZC("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default",i?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function t(n,s){return typeof s=="string"?s:l1(s)}return aK(e,t,null,r)}function jr(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function ro(r,e){if(!r){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function iK(){return Math.random().toString(36).substring(2,10)}function HF(r,e){return{usr:r.state,key:r.key,idx:e,masked:r.mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function ZC(r,e,t=null,n,s){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof e=="string"?tv(e):e,state:t,key:e&&e.key||n||iK(),mask:s}}function l1({pathname:r="/",search:e="",hash:t=""}){return e&&e!=="?"&&(r+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(r+=t.charAt(0)==="#"?t:"#"+t),r}function tv(r){let e={};if(r){let t=r.indexOf("#");t>=0&&(e.hash=r.substring(t),r=r.substring(0,t));let n=r.indexOf("?");n>=0&&(e.search=r.substring(n),r=r.substring(0,n)),r&&(e.pathname=r)}return e}function aK(r,e,t,n={}){let{window:s=document.defaultView,v5Compat:i=!1}=n,a=s.history,o="POP",l=null,c=u();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function u(){return(a.state||{idx:null}).idx}function f(){o="POP";let y=u(),v=y==null?null:y-c;c=y,l&&l({action:o,location:g.location,delta:v})}function p(y,v){o="PUSH";let w=zF(y)?y:ZC(g.location,y,v);c=u()+1;let b=HF(w,c),_=g.createHref(w.mask||w);try{a.pushState(b,"",_)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;s.location.assign(_)}i&&l&&l({action:o,location:g.location,delta:1})}function m(y,v){o="REPLACE";let w=zF(y)?y:ZC(g.location,y,v);c=u();let b=HF(w,c),_=g.createHref(w.mask||w);a.replaceState(b,"",_),i&&l&&l({action:o,location:g.location,delta:0})}function x(y){return oK(s,y)}let g={get action(){return o},get location(){return r(s,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener($F,f),l=y,()=>{s.removeEventListener($F,f),l=null}},createHref(y){return e(s,y)},createURL:x,encodeLocation(y){let v=x(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(y){return a.go(y)}};return g}function oK(r,e,t=!1){let n="http://localhost";r&&(n=r.location.origin!=="null"?r.location.origin:r.location.href),jr(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:l1(e);return s=s.replace(/ $/,"%20"),!t&&jB.test(s)&&(s=n+s),new URL(s,n)}function OB(r,e,t="/"){return lK(r,e,t,!1)}function lK(r,e,t,n,s){let i=typeof e=="string"?tv(e):e,a=_u(i.pathname||"/",t);if(a==null)return null;let o=cK(r),l=null,c=wK(a);for(let u=0;l==null&&u<o.length;++u)l=yK(o[u],c,n);return l}function cK(r){let e=FB(r);return uK(e),e}function FB(r,e=[],t=[],n="",s=!1){let i=(a,o,l=s,c)=>{let u={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(n)&&l)return;jr(u.relativePath.startsWith(n),`Absolute route path "${u.relativePath}" nested under path "${n}
49" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(n.length)}let f=Ko([n,u.relativePath]),p=t.concat(u);a.children&&a.children.length>0&&(jr(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),FB(a.children,e,p,f,l)),!(a.path==null&&!a.index)&&e.push({path:f,score:xK(f,a.index),routesMeta:p.map((m,x)=>{let[g,y]=IB(m.relativePath,m.caseSensitive,x===p.length-1);return{...m,matcher:g,compiledParams:y}})})};return r.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of DB(a.path))i(a,o,!0,c)}),e}function DB(r){let e=r.split("/");if(e.length===0)return[];let[t,...n]=e,s=t.endsWith("?"),i=t.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let a=DB(n.join("/")),o=[];return o.push(...a.map(l=>l===""?i:[i,l].join("/"))),s&&o.push(...a),o.map(l=>r.startsWith("/")&&l===""?"/":l)}function uK(r){r.sort((e,t)=>e.score!==t.score?t.score-e.score:vK(e.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}var dK=/^:[\w-]+$/,hK=3,fK=2,pK=1,mK=10,gK=-2,WF=r=>r==="*";function xK(r,e){let t=r.split("/"),n=t.length;return t.some(WF)&&(n+=gK),e&&(n+=fK),t.filter(s=>!WF(s)).reduce((s,i)=>s+(dK.test(i)?hK:i===""?pK:mK),n)}function vK(r,e){return r.length===e.length&&r.slice(0,-1).every((n,s)=>n===e[s])?r[r.length-1]-e[e.length-1]:0}function yK(r,e,t=!1){let{routesMeta:n}=r,s={},i="/",a=[];for(let o=0;o<n.length;++o){let l=n[o],c=o===n.length-1,u=i==="/"?e:e.slice(i.length)||"/",f={path:l.relativePath,caseSensitive:l.caseSensitive,end:c},p=l.matcher&&l.compiledParams?MB(f,u,l.matcher,l.compiledParams):W2(f,u),m=l.route;if(!p&&c&&t&&!n[n.length-1].route.index&&(p=W2({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!p)return null;
49Object.assign(s,p.params),a.push({params:s,pathname:Ko([i,p.pathname]),pathnameBase:kK(Ko([i,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(i=Ko([i,p.pathnameBase]))}return a}function W2(r,e){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[t,n]=IB(r.path,r.caseSensitive,r.end);return MB(r,e,t,n)}function MB(r,e,t,n){let s=e.match(t);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:n.reduce((c,{paramName:u,isOptional:f},p)=>{if(u==="*"){let x=o[p]||"";a=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const m=o[p];return f&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:r}}function IB(r,e=!1,t=!0){ro(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let n=[],s="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l,c,u)=>{if(n.push({paramName:o,isOptional:l!=null}),l){let f=u.charAt(c+a.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(n.push({paramName:"*"}),s+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?s+="\\/*$":r!==""&&r!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function wK(r){try{return r.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ro(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),r}}function _u(r,e){if(e==="/")return r;if(!r.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,n=r.charAt(t);return n&&n!=="/"?null:r.slice(t)||"/"}function bK(r,e="/"){let{pathname:t,search:n="",hash:s=""}
49=typeof r=="string"?tv(r):r,i;return t?(t=LB(t),t.startsWith("/")?i=VF(t.substring(1),"/"):i=VF(t,e)):i=e,{pathname:i,search:SK(n),hash:EK(s)}}function VF(r,e){let t=V2(e).split("/");return r.split("/").forEach(s=>{s===".."?t.length>1&&t.pop():s!=="."&&t.push(s)}),t.length>1?t.join("/"):"/"}function nT(r,e,t,n){return`Cannot include a '${r}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. 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 _K(r){return r.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function P4(r){let e=_K(r);return e.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)}function CE(r,e,t,n=!1){let s;typeof r=="string"?s=tv(r):(s={...r},jr(!s.pathname||!s.pathname.includes("?"),nT("?","pathname","search",s)),jr(!s.pathname||!s.pathname.includes("#"),nT("#","pathname","hash",s)),jr(!s.search||!s.search.includes("#"),nT("#","search","hash",s)));let i=r===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=t;else{let f=e.length-1;if(!n&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}o=f>=0?e[f]:"/"}let l=bK(s,o),c=a&&a!=="/"&&a.endsWith("/"),u=(i||a===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var LB=r=>r.replace(/[\\/]{2,}/g,"/"),Ko=r=>LB(r.join("/")),V2=r=>r.replace(/\/+$/,""),kK=r=>V2(r).replace(/^\/*/,"/"),SK=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,EK=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,AK=class{constructor(r,e,t,n=!1){this.status=r,this.statusText=e||"",this.internal=n,t instanceof Error?(this.data=t.toString(),this.error=t):this.data=t}};function TK(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function CK(r){let e=r.map(t=>t.route.path).filter(Boolean);return Ko(e)||"/"}var BB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function UB(r,e){let t=r;if(typeof t!="string"||!N4.test(t))return{absoluteURL:void 0,isExternal:!1,to:t};let n=t,s=!1;if(BB)try{let i=new URL(window.location.href),a=jB.test(t)?new URL(nK(t,i.protocol)):new URL(t),o=_u(a.pathname,e);a.origin===i.origin&&o!=null?t=o+a.search+a.hash:s=!0}catch{ro(!1,`<Link to="${t}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:s,to:t}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $B=["POST","PUT","PATCH","DELETE"];new Set($B);var NK=["GET",...$B];new Set(NK);var PK=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function RK(r){try{return PK.includes(new URL(r).protocol)}catch{return!1}}var rv=S.createContext(null);rv.displayName="DataRouter";var NE=S.createContext(null);NE.displayName="DataRouterState";var zB=S.createContext(!1);function jK(){return S.useContext(zB)}var HB=S.createContext({isTransitioning:!1});HB.displayName="ViewTransition";var OK=S.createContext(new Map);OK.displayName="Fetchers";var FK=S.createContext(null);FK.displayName="Await";var wa=S.createContext(null);wa.displayName="Navigation";var Lb=S.createContext(null);Lb.displayName="Location";var ao=S.createContext({outlet:null,matches:[],isDataRoute:!1});ao.displayName="Route";var R4=S.createContext(null);R4.displayName="RouteError";var WB="REACT_ROUTER_ERROR",DK="REDIRECT",MK="ROUTE_ERROR_RESPONSE";function IK(r){if(r.startsWith(`${WB}:${DK}:{`))try{let e=JSON.parse(r.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function LK(r){if(r.startsWith(`${WB}:${MK}:{`))try{let e=JSON.parse(r.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new AK(e.status,e.statusText,e.data)}catch{}}function BK(r,{relative:e}={}){jr(nv(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:n}=S.useContext(wa),{hash:s,pathname:i,search:a}=Bb(r,{relative:e}),o=i;return t!=="/"&&(o=i==="/"?t:Ko([t,i])),n.createHref({pathname:o,search:a,hash:s})}function nv(){return S.useContext(Lb)!=null}function Ni(){return jr(nv(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Lb).location}var VB="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function GB(r){S.useContext(wa).static||S.useLayoutEffect(r)}function ba(){let{isDataRoute:r}=S.useContext(ao);return r?tX():UK()}function UK(){jr(nv(),"useNavigate() may be used only in the context of a <Router> component.");
49let r=S.useContext(rv),{basename:e,navigator:t}=S.useContext(wa),{matches:n}=S.useContext(ao),{pathname:s}=Ni(),i=JSON.stringify(P4(n)),a=S.useRef(!1);return GB(()=>{a.current=!0}),S.useCallback((l,c={})=>{if(ro(a.current,VB),!a.current)return;if(typeof l=="number"){t.go(l);return}let u=CE(l,JSON.parse(i),s,c.relative==="path");r==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Ko([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,i,s,r])}var $K=S.createContext(null);function zK(r){let e=S.useContext(ao).outlet;return S.useMemo(()=>e&&S.createElement($K.Provider,{value:r},e),[e,r])}function HK(){let{matches:r}=S.useContext(ao),e=r[r.length-1];return(e==null?void 0:e.params)??{}}function Bb(r,{relative:e}={}){let{matches:t}=S.useContext(ao),{pathname:n}=Ni(),s=JSON.stringify(P4(t));return S.useMemo(()=>CE(r,JSON.parse(s),n,e==="path"),[r,s,n,e])}function WK(r,e){return KB(r,e)}function KB(r,e,t){var y;jr(nv(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=S.useContext(wa),{matches:s}=S.useContext(ao),i=s[s.length-1],a=i?i.params:{},o=i?i.pathname:"/",l=i?i.pathnameBase:"/",c=i&&i.route;{let v=c&&c.path||"";YB(o,!c||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${v}">) 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. 50 51Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let u=Ni(),f;if(e){let v=typeof e=="string"?tv(e):e;jr(l==="/"||((y=v.pathname)==null?void 0:y.startsWith(l)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=u;let p=f.pathname||"/",m=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=t&&t.state.matches.length?t.state.matches.map(v=>Object.assign(v,{route:t.manifest[v.route.id]||v.route})):OB(r,{pathname:m});ro(c||x!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ro(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.`);let g=YK(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Ko([l,n.encodeLocation?n.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Ko([l,n.encodeLocation?n.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),s,t);return e&&g?S.createElement(Lb.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function VK(){let r=eX(),e=TK(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),t=r instanceof Error?r.stack:null,n="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},a=null;return console.error("Error handled by React Router default ErrorBoundary:",r),a=S.createElement(S.Fragment,null,S.createElement("p",null,"ð¿ Hey developer ð"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:i},"ErrorBoundary")," or"," ",S.createElement("code",{style:i},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),t?S.createElement("pre",{style:s},t):null,a)}var GK=S.createElement(VK,null),XB=class extends S.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,e){return e.location!==r.location||e.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:e.error,location:e.location,revalidation:r.revalidation||e.revalidation}}componentDidCatch(r,e){this.props.onError?this.props.onError(r,e):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const t=LK(r.digest);t&&(r=t)}let e=r!==void 0?S.createElement(ao.Provider,{value:this.props.routeContext},S.createElement(R4.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?S.createElement(KK,{error:r},e):e}};XB.contextType=zB;var sT=new WeakMap;function KK({children:r,error:e}){let{basename:t}=S.useContext(wa);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=IK(e.digest);if(n){let s=sT.get(e);if(s)throw s;let i=UB(n.location,t),a=i.absoluteURL||i.to;
51if(RK(a))throw new Error("Invalid redirect location");if(BB&&!sT.get(e))if(i.isExternal||n.reloadDocument)window.location.href=a;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw sT.set(e,o),o}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a}`})}}return r}function XK({routeContext:r,match:e,children:t}){let n=S.useContext(rv);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),S.createElement(ao.Provider,{value:r},t)}function YK(r,e=[],t){let n=t==null?void 0:t.state;if(r==null){if(!n)return null;if(n.errors)r=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)r=n.matches;else return null}let s=r,i=n==null?void 0:n.errors;if(i!=null){let u=s.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);jr(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let a=!1,o=-1;if(t&&n){a=n.renderFallback;for(let u=0;u<s.length;u++){let f=s[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(o=u),f.route.id){let{loaderData:p,errors:m}=n,x=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!m||m[f.route.id]===void 0);if(f.route.lazy||x){t.isStatic&&(a=!0),o>=0?s=s.slice(0,o+1):s=[s[0]];break}}}}let l=t==null?void 0:t.onError,c=n&&l?(u,f)=>{var p,m;l(u,{location:n.location,params:((m=(p=n.matches)==null?void 0:p[0])==null?void 0:m.params)??{},pattern:CK(n.matches),errorInfo:f})}:void 0;return s.reduceRight((u,f,p)=>{let m,x=!1,g=null,y=null;n&&(m=i&&f.route.id?i[f.route.id]:void 0,g=f.route.errorElement||GK,a&&(o<0&&p===0?(YB("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,y=null):o===p&&(x=!0,y=f.route.hydrateFallbackElement||null)));let v=e.concat(s.slice(0,p+1)),w=()=>{let b;return m?b=g:x?b=y:f.route.Component?b=S.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=u,S.createElement(XK,{match:f,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?S.createElement(XB,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:c}):w()},null)}function j4(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qK(r){let e=S.useContext(rv);return jr(e,j4(r)),e}function ZK(r){let e=S.useContext(NE);return jr(e,j4(r)),e}function JK(r){let e=S.useContext(ao);return jr(e,j4(r)),e}function O4(r){let e=JK(r),t=e.matches[e.matches.length-1];return jr(t.route.id,`${r} can only be used on routes that contain a unique "id"`),t.route.id}function QK(){return O4("useRouteId")}function eX(){var n;let r=S.useContext(R4),e=ZK("useRouteError"),t=O4("useRouteError");return r!==void 0?r:(n=e.errors)==null?void 0:n[t]}function tX(){let{router:r}=qK("useNavigate"),e=O4("useNavigate"),t=S.useRef(!1);return GB(()=>{t.current=!0}),S.useCallback(async(s,i={})=>{ro(t.current,VB),t.current&&(typeof s=="number"?await r.navigate(s):await r.navigate(s,{fromRouteId:e,...i}))},[r,e])}var GF={};function YB(r,e,t){!e&&!GF[r]&&(GF[r]=!0,ro(!1,t))}S.memo(rX);function rX({routes:r,manifest:e,future:t,state:n,isStatic:s,onError:i}){return KB(r,void 0,{manifest:e,state:n,isStatic:s,onError:i,future:t})}function nX({to:r,replace:e,state:t,relative:n}){jr(nv(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=S.useContext(wa);ro(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=S.useContext(ao),{pathname:a}=Ni(),o=ba(),l=CE(r,P4(i),a,n==="path"),c=JSON.stringify(l);return S.useEffect(()=>{o(JSON.parse(c),{replace:e,state:t,relative:n})},[o,c,n,e,t]),null}function sX(r){return zK(r.context)}function Dr(r){jr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iX({basename:r="/",children:e=null,location:t,navigationType:n="POP",navigator:s,static:i=!1,useTransitions:a}){jr(!nv(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=r.replace(/^\/*/,"/"),l=S.useMemo(()=>({basename:o,navigator:s,static:i,useTransitions:a,future:{}}),[o,s,i,a]);typeof t=="string"&&(t=tv(t));let{pathname:c="/",search:u="",hash:f="",state:p=null,key:m="default",mask:x}=t,g=S.useMemo(()=>{let y=_u(c,o);
51return y==null?null:{location:{pathname:y,search:u,hash:f,state:p,key:m,mask:x},navigationType:n}},[o,c,u,f,p,m,n,x]);return ro(g!=null,`<Router basename="${o}"> is not able to match the URL "${c}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:S.createElement(wa.Provider,{value:l},S.createElement(Lb.Provider,{children:e,value:g}))}function aX({children:r,location:e}){return WK(JC(r),e)}function JC(r,e=[]){let t=[];return S.Children.forEach(r,(n,s)=>{if(!S.isValidElement(n))return;let i=[...e,s];if(n.type===S.Fragment){t.push.apply(t,JC(n.props.children,i));return}jr(n.type===Dr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),jr(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=JC(n.props.children,i)),t.push(a)}),t}var Sk="get",Ek="application/x-www-form-urlencoded";function PE(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function oX(r){return PE(r)&&r.tagName.toLowerCase()==="button"}function lX(r){return PE(r)&&r.tagName.toLowerCase()==="form"}function cX(r){return PE(r)&&r.tagName.toLowerCase()==="input"}function uX(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function dX(r,e){return r.button===0&&(!e||e==="_self")&&!uX(r)}function QC(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((e,t)=>{let n=r[t];return e.concat(Array.isArray(n)?n.map(s=>[t,s]):[[t,n]])},[]))}function hX(r,e){let t=QC(r);return e&&e.forEach((n,s)=>{t.has(s)||e.getAll(s).forEach(i=>{t.append(s,i)})}),t}var A_=null;function fX(){if(A_===null)try{new FormData(document.createElement("form"),0),A_=!1}catch{A_=!0}return A_}var pX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function iT(r){return r!=null&&!pX.has(r)?(ro(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ek}"`),null):r}function mX(r,e){let t,n,s,i,a;if(lX(r)){let o=r.getAttribute("action");n=o?_u(o,e):null,t=r.getAttribute("method")||Sk,s=iT(r.getAttribute("enctype"))||Ek,i=new FormData(r)}else if(oX(r)||cX(r)&&(r.type==="submit"||r.type==="image")){let o=r.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=r.getAttribute("formaction")||o.getAttribute("action");if(n=l?_u(l,e):null,t=r.getAttribute("formmethod")||o.getAttribute("method")||Sk,s=iT(r.getAttribute("formenctype"))||iT(o.getAttribute("enctype"))||Ek,i=new FormData(o,r),!fX()){let{name:c,type:u,value:f}=r;if(u==="image"){let p=c?`${c}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else c&&i.append(c,f)}}else{if(PE(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=Sk,n=null,s=Ek,a=r}return i&&s==="text/plain"&&(a=i,i=void 0),{action:n,method:t.toLowerCase(),encType:s,formData:i,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function F4(r,e){if(r===!1||r===null||typeof r>"u")throw new Error(e)}function qB(r,e,t,n){let s=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return t?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${n}`:s.pathname=`${s.pathname}.${n}`:s.pathname==="/"?s.pathname=`_root.${n}`:e&&_u(s.pathname,e)==="/"?s.pathname=`${V2(e)}/_root.${n}`:s.pathname=`${V2(s.pathname)}.${n}`,s}async function gX(r,e){if(r.id in e)return e[r.id];try{let t=await import(r.module);return e[r.id]=t,t}catch(t){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
51isSpaMode,window.location.reload(),new Promise(()=>{})}}function xX(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function vX(r,e,t){let n=await Promise.all(r.map(async s=>{let i=e.routes[s.route.id];if(i){let a=await gX(i,t);return a.links?a.links():[]}return[]}));return _X(n.flat(1).filter(xX).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function KF(r,e,t,n,s,i){let a=(l,c)=>t[c]?l.route.id!==t[c].route.id:!0,o=(l,c)=>{var u;return t[c].pathname!==l.pathname||((u=t[c].route.path)==null?void 0:u.endsWith("*"))&&t[c].params["*"]!==l.params["*"]};return i==="assets"?e.filter((l,c)=>a(l,c)||o(l,c)):i==="data"?e.filter((l,c)=>{var f;let u=n.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(a(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let p=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((f=t[0])==null?void 0:f.params)||{},nextUrl:new URL(r,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function yX(r,e,{includeHydrateFallback:t}={}){return wX(r.map(n=>{let s=e.routes[n.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),t&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function wX(r){return[...new Set(r)]}function bX(r){let e={},t=Object.keys(r).sort();for(let n of t)e[n]=r[n];return e}function _X(r,e){let t=new Set;return new Set(e),r.reduce((n,s)=>{let i=JSON.stringify(bX(s));return t.has(i)||(t.add(i),n.push({key:i,link:s})),n},[])}function D4(){let r=S.useContext(rv);return F4(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function kX(){let r=S.useContext(NE);return F4(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var M4=S.createContext(void 0);M4.displayName="FrameworkContext";function RE(){let r=S.useContext(M4);return F4(r,"You must render this element inside a <HydratedRouter> element"),r}function SX(r,e){let t=S.useContext(M4),[n,s]=S.useState(!1),[i,a]=S.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:f}=e,p=S.useRef(null);S.useEffect(()=>{if(r==="render"&&a(!0),r==="viewport"){let g=v=>{v.forEach(w=>{a(w.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return p.current&&y.observe(p.current),()=>{y.disconnect()}}},[r]),S.useEffect(()=>{if(n){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[n]);let m=()=>{s(!0)},x=()=>{s(!1),a(!1)};return t?r!=="intent"?[i,p,{}]:[i,p,{onFocus:Pv(o,m),onBlur:Pv(l,x),onMouseEnter:Pv(c,m),onMouseLeave:Pv(u,x),onTouchStart:Pv(f,m)}]:[!1,p,{}]}function Pv(r,e){return t=>{r&&r(t),t.defaultPrevented||e(t)}}function EX({page:r,...e}){let t=jK(),{nonce:n}=RE(),{router:s}=D4(),i=S.useMemo(()=>OB(s.routes,r,s.basename),[s.routes,r,s.basename]);return i?(e.nonce==null&&n&&(e={...e,nonce:n}),t?S.createElement(TX,{page:r,matches:i,...e}):S.createElement(CX,{page:r,matches:i,...e})):null}function AX(r){let{manifest:e,routeModules:t}=RE(),[n,s]=S.useState([]);return S.useEffect(()=>{let i=!1;return vX(r,e,t).then(a=>{i||s(a)}),()=>{i=!0}},[r,e,t]),n}function TX({page:r,matches:e,...t}){let n=Ni(),{future:s}=RE(),{basename:i}=D4(),a=S.useMemo(()=>{if(r===n.pathname+n.search+n.hash)return[];let o=qB(r,i,s.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,c=[];for(let u of e)typeof u.route.shouldRevalidate=="function"?l=!0:c.push(u.route.id);return l&&c.length>0&&o.searchParams.set("_routes",c.join(",")),[o.pathname+o.search]},[i,s.v8_trailingSlashAwareDataRequests,r,n,e]);return S.createElement(S.Fragment,null,a.map(o=>S.createElement("link",{key:o,rel:"prefetch",as:"fetch",href:o,...t})))}function CX({page:r,matches:e,...t}){let n=Ni(),{future:s,manifest:i,routeModules:a}=RE(),{basename:o}=D4(),{loaderData:l,matches:c}=kX(),u=S.useMemo(()=>KF(r,e,c,i,n,"data"),[r,e,c,i,n]),f=S.useMemo(()=>KF(r,e,c,i,n,"assets"),[r,e,c,i,n]),p=S.useMemo(()=>
51{if(r===n.pathname+n.search+n.hash)return[];let g=new Set,y=!1;if(e.forEach(w=>{var _;let b=i.routes[w.route.id];!b||!b.hasLoader||(!u.some(T=>T.route.id===w.route.id)&&w.route.id in l&&((_=a[w.route.id])!=null&&_.shouldRevalidate)||b.hasClientLoader?y=!0:g.add(w.route.id))}),g.size===0)return[];let v=qB(r,o,s.v8_trailingSlashAwareDataRequests,"data");return y&&g.size>0&&v.searchParams.set("_routes",e.filter(w=>g.has(w.route.id)).map(w=>w.route.id).join(",")),[v.pathname+v.search]},[o,s.v8_trailingSlashAwareDataRequests,l,n,i,u,e,r,a]),m=S.useMemo(()=>yX(f,i),[f,i]),x=AX(f);return S.createElement(S.Fragment,null,p.map(g=>S.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...t})),m.map(g=>S.createElement("link",{key:g,rel:"modulepreload",href:g,...t})),x.map(({key:g,link:y})=>S.createElement("link",{key:g,nonce:t.nonce,...y,crossOrigin:y.crossOrigin??t.crossOrigin})))}function NX(...r){return e=>{r.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var PX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PX&&(window.__reactRouterVersion="7.18.1")}catch{}function RX({basename:r,children:e,useTransitions:t,window:n}){let s=S.useRef();s.current==null&&(s.current=sK({window:n,v5Compat:!0}));let i=s.current,[a,o]=S.useState({action:i.action,location:i.location}),l=S.useCallback(c=>{t===!1?o(c):S.startTransition(()=>o(c))},[t]);return S.useLayoutEffect(()=>i.listen(l),[i,l]),S.createElement(iX,{basename:r,children:e,location:a.location,navigationType:a.action,navigator:i,useTransitions:t})}var Jt=S.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:s,reloadDocument:i,replace:a,mask:o,state:l,target:c,to:u,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...x},g){let{basename:y,navigator:v,useTransitions:w}=S.useContext(wa),b=typeof u=="string"&&N4.test(u),_=UB(u,y);u=_.to;let T=BK(u,{relative:s}),A=Ni(),N=null;if(o){let ee=CE(o,[],A.mask?A.mask.pathname:"/",!0);y!=="/"&&(ee.pathname=ee.pathname==="/"?y:Ko([y,ee.pathname])),N=v.createHref(ee)}let[k,E,P]=SX(n,x),O=FX(u,{replace:a,mask:o,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:p,defaultShouldRevalidate:m,useTransitions:w});function D(ee){e&&e(ee),ee.defaultPrevented||O(ee)}let H=!(_.isExternal||i),B=S.createElement("a",{...x,...P,href:(H?N:void 0)||_.absoluteURL||T,onClick:H?D:e,ref:NX(g,E),target:c,"data-discover":!b&&t==="render"?"true":void 0});return k&&!b?S.createElement(S.Fragment,null,B,S.createElement(EX,{page:T})):B});Jt.displayName="Link";var ZB=S.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:s=!1,style:i,to:a,viewTransition:o,children:l,...c},u){let f=Bb(a,{relative:c.relative}),p=Ni(),m=S.useContext(NE),{navigator:x,basename:g}=S.useContext(wa),y=m!=null&&BX(f)&&o===!0,v=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,w=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(w=w.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=_u(b,g)||b);const _=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let T=w===v||!s&&w.startsWith(v)&&w.charAt(_)==="/",A=b!=null&&(b===v||!s&&b.startsWith(v)&&b.charAt(v.length)==="/"),N={isActive:T,isPending:A,isTransitioning:y},k=T?e:void 0,E;typeof n=="function"?E=n(N):E=[n,T?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P=typeof i=="function"?i(N):i;return S.createElement(Jt,{...c,"aria-current":k,className:E,ref:u,style:P,to:a,viewTransition:o},typeof l=="function"?l(N):l)});ZB.displayName="NavLink";var jX=S.forwardRef(({discover:r="render",fetcherKey:e,navigate:t,reloadDocument:n,replace:s,state:i,method:a=Sk,action:o,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},x)=>{let{useTransitions:g}=S.useContext(wa),y=IX(),v=LX(o,{relative:c}
51),w=a.toLowerCase()==="get"?"get":"post",b=typeof o=="string"&&N4.test(o),_=T=>{if(l&&l(T),T.defaultPrevented)return;T.preventDefault();let A=T.nativeEvent.submitter,N=(A==null?void 0:A.getAttribute("formmethod"))||a,k=()=>y(A||T.currentTarget,{fetcherKey:e,method:N,navigate:t,replace:s,state:i,relative:c,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p});g&&t!==!1?S.startTransition(()=>k()):k()};return S.createElement("form",{ref:x,method:w,action:v,onSubmit:n?l:_,...m,"data-discover":!b&&r==="render"?"true":void 0})});jX.displayName="Form";function OX(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JB(r){let e=S.useContext(rv);return jr(e,OX(r)),e}function FX(r,{target:e,replace:t,mask:n,state:s,preventScrollReset:i,relative:a,viewTransition:o,defaultShouldRevalidate:l,useTransitions:c}={}){let u=ba(),f=Ni(),p=Bb(r,{relative:a});return S.useCallback(m=>{if(dX(m,e)){m.preventDefault();let x=t!==void 0?t:l1(f)===l1(p),g=()=>u(r,{replace:x,mask:n,state:s,preventScrollReset:i,relative:a,viewTransition:o,defaultShouldRevalidate:l});c?S.startTransition(()=>g()):g()}},[f,u,p,t,n,s,e,r,i,a,o,l,c])}function I4(r){ro(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=S.useRef(QC(r)),t=S.useRef(!1),n=Ni(),s=S.useMemo(()=>hX(n.search,t.current?null:e.current),[n.search]),i=ba(),a=S.useCallback((o,l)=>{const c=QC(typeof o=="function"?o(new URLSearchParams(s)):o);t.current=!0,i("?"+c,l)},[i,s]);return[s,a]}var DX=0,MX=()=>`__${String(++DX)}__`;function IX(){let{router:r}=JB("useSubmit"),{basename:e}=S.useContext(wa),t=QK(),n=r.fetch,s=r.navigate;return S.useCallback(async(i,a={})=>{let{action:o,method:l,encType:c,formData:u,body:f}=mX(i,e);if(a.navigate===!1){let p=a.fetcherKey||MX();await n(p,t,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:f,formMethod:a.method||l,formEncType:a.encType||c,flushSync:a.flushSync})}else await s(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:f,formMethod:a.method||l,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,s,e,t])}function LX(r,{relative:e}={}){let{basename:t}=S.useContext(wa),n=S.useContext(ao);jr(n,"useFormAction must be used inside a RouteContext");let[s]=n.matches.slice(-1),i={...Bb(r||".",{relative:e})},a=Ni();if(r==null){i.search=a.search;let o=new URLSearchParams(i.search),l=o.getAll("index");if(l.some(u=>u==="")){o.delete("index"),l.filter(f=>f).forEach(f=>o.append("index",f));let u=o.toString();i.search=u?`?${u}
51`:""}}return(!r||r===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(i.pathname=i.pathname==="/"?t:Ko([t,i.pathname])),l1(i)}function BX(r,{relative:e}={}){let t=S.useContext(HB);jr(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=JB("useViewTransitionState"),s=Bb(r,{relative:e});if(!t.isTransitioning)return!1;let i=_u(t.currentLocation.pathname,n)||t.currentLocation.pathname,a=_u(t.nextLocation.pathname,n)||t.nextLocation.pathname;return W2(s.pathname,a)!=null||W2(s.pathname,i)!=null}var XF=["light","dark"],UX="(prefers-color-scheme: dark)",$X=S.createContext(void 0),zX={setTheme:r=>{},themes:[]},HX=()=>{var r;return(r=S.useContext($X))!=null?r:zX};S.memo(({forcedTheme:r,storageKey:e,attribute:t,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:a,attrs:o,nonce:l})=>{let c=i==="system",u=t==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${t}',s='setAttribute';`,f=s?XF.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(x,g=!1,y=!0)=>{let v=a?a[x]:x,w=g?x+"|| ''":`'${v}'`,b="";return s&&y&&!g&&XF.includes(x)&&(b+=`d.style.colorScheme = '${x}';`),t==="class"?g||v?b+=`c.add(${w})`:b+="null":v&&(b+=`d[s](n,${w})`),b},m=r?`!function(){${u}${p(r)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${UX}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${c?"":"else{"+p(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${f}}catch(t){}}();`;return S.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})});var WX=r=>{switch(r){case"success":return KX;case"info":return YX;case"warning":return XX;case"error":return qX;default:return null}},VX=Array(12).fill(0),GX=({visible:r,className:e})=>be.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":r},be.createElement("div",{className:"sonner-spinner"},VX.map((t,n)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),KX=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),XX=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),YX=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qX=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ZX=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),JX=()=>{let[r,e]=be.useState(document.hidden);return be.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),r},eN=1,QX=class{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{let e=this.subscribers.indexOf(r);this.subscribers.splice(e,1)}),this.publish=r=>
51{this.subscribers.forEach(e=>e(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var e;let{message:t,...n}=r,s=typeof(r==null?void 0:r.id)=="number"||((e=r.id)==null?void 0:e.length)>0?r.id:eN++,i=this.toasts.find(o=>o.id===s),a=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(o=>o.id===s?(this.publish({...o,...r,id:s,title:t}),{...o,...r,id:s,dismissible:a,title:t}):o):this.addToast({title:t,...n,dismissible:a,id:s}),s},this.dismiss=r=>(this.dismissedToasts.add(r),r||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:r,dismiss:!0})),r),this.message=(r,e)=>this.create({...e,message:r}),this.error=(r,e)=>this.create({...e,message:r,type:"error"}),this.success=(r,e)=>this.create({...e,type:"success",message:r}),this.info=(r,e)=>this.create({...e,type:"info",message:r}),this.warning=(r,e)=>this.create({...e,type:"warning",message:r}),this.loading=(r,e)=>this.create({...e,type:"loading",message:r}),this.promise=(r,e)=>{if(!e)return;let t;e.loading!==void 0&&(t=this.create({...e,promise:r,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=r instanceof Promise?r:r(),s=t!==void 0,i,a=n.then(async l=>{if(i=["resolve",l],be.isValidElement(l))s=!1,this.create({id:t,type:"default",message:l});else if(tY(l)&&!l.ok){s=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:t,type:"error",message:c,description:u})}else if(e.success!==void 0){s=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"success",message:c,description:u})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"error",message:c,description:u})}}).finally(()=>{var l;s&&(this.dismiss(t),t=void 0),(l=e.finally)==null||l.call(e)}),o=()=>new Promise((l,c)=>a.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof t!="string"&&typeof t!="number"?{unwrap:o}:Object.assign(t,{unwrap:o})},this.custom=(r,e)=>{let t=(e==null?void 0:e.id)||eN++;return this.create({jsx:r(t),id:t,...e}),t},this.getActiveToasts=()=>this.toasts.filter(r=>!this.dismissedToasts.has(r.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},vi=new QX,eY=(r,e)=>{let t=(e==null?void 0:e.id)||eN++;return vi.addToast({title:r,...e,id:t}),t},tY=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",rY=eY,nY=()=>vi.toasts,sY=()=>vi.getActiveToasts(),le=Object.assign(rY,{success:vi.success,info:vi.info,warning:vi.warning,error:vi.error,custom:vi.custom,message:vi.message,promise:vi.promise,dismiss:vi.dismiss,loading:vi.loading},{getHistory:nY,getToasts:sY});function iY(r,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r))}iY(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
51left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
51:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
51--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 52`);function T_(r){return r.label!==void 0}var aY=3,oY="32px",lY="16px",YF=4e3,cY=356,uY=14,dY=20,hY=200;function uo(...r){return r.filter(Boolean).join(" ")}function fY(r){let[e,t]=r.split("-"),n=[];return e&&n.push(e),t&&n.push(t),n}var pY=r=>{var e,t,n,s,i,a,o,l,c,u,f;let{invert:p,toast:m,unstyled:x,interacting:g,setHeights:y,visibleToasts:v,heights:w,index:b,toasts:_,expanded:T,removeToast:A,defaultRichColors:N,closeButton:k,style:E,cancelButtonStyle:P,actionButtonStyle:O,className:D="",descriptionClassName:H="",duration:B,position:ee,gap:X,loadingIcon:W,expandByDefault:Y,classNames:F,icons:J,closeButtonAriaLabel:ne="Close toast",pauseWhenPageIsHidden:I}=r,[z,M]=be.useState(null),[U,te]=be.useState(null),[re,se]=be.useState(!1),[ie,ae]=be.useState(!1),[ge,G]=be.useState(!1),[Ue,Re]=be.useState(!1),[He,Te]=be.useState(!1),[we,Me]=be.useState(0),[at,Tr]=be.useState(0),pe=be.useRef(m.duration||B||YF),je=be.useRef(null),nt=be.useRef(null),tt=b===0,Nt=b+1<=v,ht=m.type,Et=m.dismissible!==!1,cr=m.className||"",gs=m.descriptionClassName||"",it=be.useMemo(()=>w.findIndex(ot=>ot.toastId===m.id)||0,[w,m.id]),$t=be.useMemo(()=>{var ot;return(ot=m.closeButton)!=null?ot:k},[m.closeButton,k]),dr=be.useMemo(()=>m.duration||B||YF,[m.duration,B]),Gt=be.useRef(0),Yn=be.useRef(0),mv=be.useRef(0),Lu=be.useRef(null),[EA,o_]=ee.split("-"),gv=be.useMemo(()=>w.reduce((ot,zt,hr)=>hr>=it?ot:ot+zt.height,0),[w,it]),xv=JX(),AA=m.invert||p,vv=ht==="loading";Yn.current=be.useMemo(()=>it*X+gv,[it,gv]),be.useEffect(()=>{pe.current=dr},[dr]),be.useEffect(()=>{se(!0)},[]),be.useEffect(()=>{let ot=nt.current;if(ot){let zt=ot.getBoundingClientRect().height;return Tr(zt),y(hr=>[{toastId:m.id,height:zt,position:m.position},...hr]),()=>y(hr=>hr.filter(Ri=>Ri.toastId!==m.id))}},[y,m.id]),be.useLayoutEffect(()=>{if(!re)return;let ot=nt.current,zt=ot.style.height;ot.style.height="auto";let hr=ot.getBoundingClientRect().height;ot.style.height=zt,Tr(hr),y(Ri=>Ri.find(ji=>ji.toastId===m.id)?Ri.map(ji=>ji.toastId===m.id?{...ji,height:hr}:ji):[{toastId:m.id,height:hr,position:m.position},...Ri])},[re,m.title,m.description,y,m.id]);let Pi=be.useCallback(()=>{ae(!0),Me(Yn.current),y(ot=>ot.filter(zt=>zt.toastId!==m.id)),setTimeout(()=>{A(m)},hY)},[m,A,y,Yn]);be.useEffect(()=>{if(m.promise&&ht==="loading"||m.duration===1/0||m.type==="loading")return;let ot;return T||g||I&&xv?(()=>{if(mv.current<Gt.current){let zt=new Date().getTime()-Gt.current;pe.current=pe.current-zt}
52mv.current=new Date().getTime()})():pe.current!==1/0&&(Gt.current=new Date().getTime(),ot=setTimeout(()=>{var zt;(zt=m.onAutoClose)==null||zt.call(m,m),Pi()},pe.current)),()=>clearTimeout(ot)},[T,g,m,ht,I,xv,Pi]),be.useEffect(()=>{m.delete&&Pi()},[Pi,m.delete]);function TA(){var ot,zt,hr;return J!=null&&J.loading?be.createElement("div",{className:uo(F==null?void 0:F.loader,(ot=m==null?void 0:m.classNames)==null?void 0:ot.loader,"sonner-loader"),"data-visible":ht==="loading"},J.loading):W?be.createElement("div",{className:uo(F==null?void 0:F.loader,(zt=m==null?void 0:m.classNames)==null?void 0:zt.loader,"sonner-loader"),"data-visible":ht==="loading"},W):be.createElement(GX,{className:uo(F==null?void 0:F.loader,(hr=m==null?void 0:m.classNames)==null?void 0:hr.loader),visible:ht==="loading"})}return be.createElement("li",{tabIndex:0,ref:nt,className:uo(D,cr,F==null?void 0:F.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,F==null?void 0:F.default,F==null?void 0:F[ht],(t=m==null?void 0:m.classNames)==null?void 0:t[ht]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:N,"data-styled":!(m.jsx||m.unstyled||x),"data-mounted":re,"data-
52promise":!!m.promise,"data-swiped":He,"data-removed":ie,"data-visible":Nt,"data-y-position":EA,"data-x-position":o_,"data-index":b,"data-front":tt,"data-swiping":ge,"data-dismissible":Et,"data-type":ht,"data-invert":AA,"data-swipe-out":Ue,"data-swipe-direction":U,"data-expanded":!!(T||Y&&re),style:{"--index":b,"--toasts-before":b,"--z-index":_.length-b,"--offset":`${ie?we:Yn.current}px`,"--initial-height":Y?"auto":`${at}px`,...E,...m.style},onDragEnd:()=>{G(!1),M(null),Lu.current=null},onPointerDown:ot=>{vv||!Et||(je.current=new Date,Me(Yn.current),ot.target.setPointerCapture(ot.pointerId),ot.target.tagName!=="BUTTON"&&(G(!0),Lu.current={x:ot.clientX,y:ot.clientY}))},onPointerUp:()=>{var ot,zt,hr,Ri;if(Ue||!Et)return;Lu.current=null;let ji=Number(((ot=nt.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sl=Number(((zt=nt.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lc=new Date().getTime()-((hr=je.current)==null?void 0:hr.getTime()),Us=z==="x"?ji:sl,il=Math.abs(Us)/lc;if(Math.abs(Us)>=dY||il>.11){Me(Yn.current),(Ri=m.onDismiss)==null||Ri.call(m,m),te(z==="x"?ji>0?"right":"left":sl>0?"down":"up"),Pi(),Re(!0),Te(!1);return}G(!1),M(null)},onPointerMove:ot=>{var zt,hr,Ri,ji;if(!Lu.current||!Et||((zt=window.getSelection())==null?void 0:zt.toString().length)>0)return;let sl=ot.clientY-Lu.current.y,lc=ot.clientX-Lu.current.x,Us=(hr=r.swipeDirections)!=null?hr:fY(ee);!z&&(Math.abs(lc)>1||Math.abs(sl)>1)&&M(Math.abs(lc)>Math.abs(sl)?"x":"y");let il={x:0,y:0};z==="y"?(Us.includes("top")||Us.includes("bottom"))&&(Us.includes("top")&&sl<0||Us.includes("bottom")&&sl>0)&&(il.y=sl):z==="x"&&(Us.includes("left")||Us.includes("right"))&&(Us.includes("left")&&lc<0||Us.includes("right")&&lc>0)&&(il.x=lc),(Math.abs(il.x)>0||Math.abs(il.y)>0)&&Te(!0),(Ri=nt.current)==null||Ri.style.setProperty("--swipe-amount-x",`${il.x}px`),(ji=nt.current)==null||ji.style.setProperty("--swipe-amount-y",`${il.y}px`)}},$t&&!m.jsx?be.createElement("button",{"aria-label":ne,"data-disabled":vv,"data-close-button":!0,onClick:vv||!Et?()=>{}:()=>{var ot;Pi(),(ot=m.onDismiss)==null||ot.call(m,m)},className:uo(F==null?void 0:F.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(i=J==null?void 0:J.close)!=null?i:ZX):null,m.jsx||S.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:be.createElement(be.Fragment,null,ht||m.icon||m.promise?be.createElement("div",{"data-icon":"",className:uo(F==null?void 0:F.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||TA():null,m.type!=="loading"?m.
vendor: 4,496 bytes, line 52
52icon||(J==null?void 0:J[ht])||WX(ht):null):null,be.createElement("div",{"data-content":"",className:uo(F==null?void 0:F.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},be.createElement("div",{"data-title":"",className:uo(F==null?void 0:F.title,(l=m==null?void 0:m.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?be.createElement("div",{"data-description":"",className:uo(H,gs,F==null?void 0:F.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),S.isValidElement(m.cancel)?m.cancel:m.cancel&&T_(m.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||P,onClick:ot=>{var zt,hr;T_(m.cancel)&&Et&&((hr=(zt=m.cancel).onClick)==null||hr.call(zt,ot),Pi())},className:uo(F==null?void 0:F.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,S.isValidElement(m.action)?m.action:m.action&&T_(m.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||O,onClick:ot=>{var zt,hr;T_(m.action)&&((hr=(zt=m.action).onClick)==null||hr.call(zt,ot),!ot.defaultPrevented&&Pi())},className:uo(F==null?void 0:F.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function qF(){if(typeof window>"u"||typeof document>"u")return"ltr";let r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function mY(r,e){let t={};return[r,e].forEach((n,s)=>{let i=s===1,a=i?"--mobile-offset":"--offset",o=i?lY:oY;function l(c){["top","right","bottom","left"].forEach(u=>{t[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?t[`${a}-${c}`]=o:t[`${a}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(o)}),t}var gY=S.forwardRef(function(r,e){let{invert:t,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:a,className:o,offset:l,mobileOffset:c,theme:u="light",richColors:f,duration:p,style:m,visibleToasts:x=aY,toastOptions:g,dir:y=qF(),gap:v=uY,loadingIcon:w,icons:b,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:T}=r,[A,N]=be.useState([]),k=be.useMemo(()=>Array.from(new Set([n].concat(A.filter(I=>I.position).map(I=>I.position)))),[A,n]),[E,P]=be.useState([]),[O,D]=be.useState(!1),[H,B]=be.useState(!1),[ee,X]=be.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=be.useRef(null),Y=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=be.useRef(null),J=be.useRef(!1),ne=be.useCallback(I=>{N(z=>{var M;return(M=z.find(U=>U.id===I.id))!=null&&M.delete||vi.dismiss(I.id),z.filter(({id:U})=>U!==I.id)})},[]);return be.useEffect(()=>vi.subscribe(I=>{if(I.dismiss){N(z=>z.map(M=>M.id===I.id?{...M,delete:!0}:M));return}setTimeout(()=>{kB.flushSync(()=>{N(z=>{let M=z.findIndex(U=>U.id===I.id);return M!==-1?[...z.slice(0,M),{...z[M],...I},...z.slice(M+1)]:[I,...z]})})})}),[]),be.useEffect(()=>{if(u!=="system"){X(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:z})=>{X(z?"dark":"light")})}catch{I.addListener(({matches:M})=>{try{X(M?"dark":"light")}catch(U){console.error(U)}})}},[u]),be.useEffect(()=>{A.length<=1&&D(!1)},[A]),be.useEffect(()=>{let I=z=>{var M,U;s.every(te=>z[te]||z.code===te)&&(D(!0),(M=W.current)==null||M.focus()),z.code==="Escape"&&(document.activeElement===W.current||(U=W.current)!=null&&U.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[s]),be.useEffect(()=>{if(W.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,J.current=!1)}},[W.current]),be.createElement("section",{ref:e,"aria-label":`${_} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((I,z)=>{var M;let[U,te]=I.split("-");return A.length?be.createElement("ol",{key:I,dir:y==="auto"?qF():y,tabIndex:-1,ref:W,className:o,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":U,"data-lifted":O&&A.length>
521&&!i,"data-x-position":te,style:{"--front-toast-height":`${((M=E[0])==null?void 0:M.height)||0}px`,"--width":`${cY}px`,"--gap":`${v}px`,...m,...mY(l,c)},onBlur:re=>{J.current&&!re.currentTarget.contains(re.relatedTarget)&&(J.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||J.current||(J.current=!0,F.current=re.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{H||D(!1)},onDragEnd:()=>D(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},A.filter(re=>!re.position&&z===0||re.position===I).map((re,se)=>{var ie,ae;return be.createElement(pY,{key:re.id,icons:b,index:se,toast:re,defaultRichColors:f,duration:(ie=g==null?void 0:g.duration)!=null?ie:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:x,closeButton:(ae=g==null?void 0:g.closeButton)!=null?ae:a,interacting:H,position:I,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ne,toasts:A.filter(ge=>ge.position==re.position),heights:E.filter(ge=>ge.position==re.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:w,expanded:O,pauseWhenPageIsHidden:T,swipeDirections:r.swipeDirections})})):null}))});const xY=({...r})=>{const{theme:e="system"}=HX();return d.jsx(gY,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:opacity-80",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",success:"group-[.toaster]:bg-accent group-[.toaster]:text-accent-foreground group-[.toaster]:border-accent",info:"group-[.toaster]:bg-accent group-[.toaster]:text-accent-foreground group-[.toaster]:border-accent"}},...r})},vY=1,yY=1e6;let aT=0;function wY(){return aT=(aT+1)%Number.MAX_SAFE_INTEGER,aT.toString()}const oT=new Map,ZF=r=>{if(oT.has(r))return;const e=setTimeout(()=>{oT.delete(r),Ay({type:"REMOVE_TOAST",toastId:r})},yY);oT.set(r,e)},bY=(r,e)=>{switch(e.type){case"ADD_TOAST":return{...r,toasts:[e.toast,...r.toasts].slice(0,vY)};case"UPDATE_TOAST":return{...r,toasts:r.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?ZF(t):r.toasts.forEach(n=>{ZF(n.id)}),{...r,toasts:r.toasts.map(n=>n.id===t||t===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...r,toasts:[]}:{...r,toasts:r.toasts.filter(t=>t.id!==e.toastId)}}},Ak=[];let Tk={toasts:[]};function Ay(r){Tk=bY(Tk,r),Ak.forEach(e=>{e(Tk)})}function _Y({...r}){const e=wY(),t=s=>Ay({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Ay({type:"DISMISS_TOAST",toastId:e});return Ay({type:"ADD_TOAST",toast:{...r,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:t}}function kY(){const[r,e]=S.useState(Tk);return S.useEffect(()=>(Ak.push(e),()=>{const t=Ak.indexOf(e);t>-1&&Ak.splice(t,1)}),[r]),{...r,toast:_Y,dismiss:t=>Ay({type:"DISMISS_TOAST",toastId:t})}}function kr(r,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(r==null||r(s),t===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function JF(r,e){if(typeof r=="function")return r(e);r!=null&&(r.current=e)}function QB(...r){return e=>{let t=!1;const n=r.map(s=>{const i=JF(s,e);return!t&&typeof i=="function"&&(t=!0),i});if(t)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():JF(r[s],null)}}}}function ms(...r){return S.useCallback(QB(...r),r)}function SY(r,e){const t=S.createContext(e),n=i=>{const{children:a,...o}=i,l=S.useMemo(()=>o,Object.values(o));return d.jsx(t.Provider,{value:l,children:a})};n.displayName=r+"Provider";function s(i){const a=S.useContext(t);if(a)return a;
vendor: 10,265 bytes, line 52
52if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${r}\``)}return[n,s]}function sv(r,e=[]){let t=[];function n(i,a){const o=S.createContext(a),l=t.length;t=[...t,a];const c=f=>{var v;const{scope:p,children:m,...x}=f,g=((v=p==null?void 0:p[r])==null?void 0:v[l])||o,y=S.useMemo(()=>x,Object.values(x));return d.jsx(g.Provider,{value:y,children:m})};c.displayName=i+"Provider";function u(f,p){var g;const m=((g=p==null?void 0:p[r])==null?void 0:g[l])||o,x=S.useContext(m);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,u]}const s=()=>{const i=t.map(a=>S.createContext(a));return function(o){const l=(o==null?void 0:o[r])||i;return S.useMemo(()=>({[`__scope${r}`]:{...o,[r]:l}}),[o,l])}};return s.scopeName=r,[n,EY(s,...e)]}function EY(...r){const e=r[0];if(r.length===1)return e;const t=()=>{const n=r.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=n.reduce((o,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...o,...f}},{});return S.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return t.scopeName=e.scopeName,t}function G2(r){const e=AY(r),t=S.forwardRef((n,s)=>{const{children:i,...a}=n,o=S.Children.toArray(i),l=o.find(CY);if(l){const c=l.props.children,u=o.map(f=>f===l?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:f);return d.jsx(e,{...a,ref:s,children:S.isValidElement(c)?S.cloneElement(c,void 0,u):null})}return d.jsx(e,{...a,ref:s,children:i})});return t.displayName=`${r}.Slot`,t}function AY(r){const e=S.forwardRef((t,n)=>{const{children:s,...i}=t;if(S.isValidElement(s)){const a=PY(s),o=NY(i,s.props);return s.type!==S.Fragment&&(o.ref=n?QB(n,a):a),S.cloneElement(s,o)}return S.Children.count(s)>1?S.Children.only(null):null});return e.displayName=`${r}.SlotClone`,e}var e8=Symbol("radix.slottable");function TY(r){const e=({children:t})=>d.jsx(d.Fragment,{children:t});return e.displayName=`${r}.Slottable`,e.__radixId=e8,e}function CY(r){return S.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===e8}function NY(r,e){const t={...e};for(const n in e){const s=r[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?t[n]=(...o)=>{const l=i(...o);return s(...o),l}:s&&(t[n]=s):n==="style"?t[n]={...s,...i}:n==="className"&&(t[n]=[s,i].filter(Boolean).join(" "))}return{...r,...t}}function PY(r){var n,s;let e=(n=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?r.ref:(e=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?r.props.ref:r.props.ref||r.ref)}function RY(r){const e=r+"CollectionProvider",[t,n]=sv(e),[s,i]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:v}=g,w=be.useRef(null),b=be.useRef(new Map).current;return d.jsx(s,{scope:y,itemMap:b,collectionRef:w,children:v})};a.displayName=e;const o=r+"CollectionSlot",l=G2(o),c=be.forwardRef((g,y)=>{const{scope:v,children:w}=g,b=i(o,v),_=ms(y,b.collectionRef);return d.jsx(l,{ref:_,children:w})});c.displayName=o;const u=r+"CollectionItemSlot",f="data-radix-collection-item",p=G2(u),m=be.forwardRef((g,y)=>{const{scope:v,children:w,...b}=g,_=be.useRef(null),T=ms(y,_),A=i(u,v);return be.useEffect(()=>(A.itemMap.set(_,{ref:_,...b}),()=>void A.itemMap.delete(_))),d.jsx(p,{[f]:"",ref:T,children:w})});m.displayName=u;function x(g){const y=i(r+"CollectionConsumer",g);return be.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((A,N)=>b.indexOf(A.ref.current)-b.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:m},x,n]}var jY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sn=jY.reduce((r,e)=>{const t=G2(`Primitive.${e}`),n=S.forwardRef((s,i)=>{const{asChild:a,...o}=s,l=a?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...r,[e]:n}},{});function t8(r,e){r&&Ib.flushSync(()=>r.dispatchEvent(e))}function Ql(r){const e=S.useRef(r);return S.useEffect(()=>{e.current=r}),S.useMemo(()=>(...t)=>{var n;return(n=e.current)==null?void 0:n.call(e,...t)},[])}function OY(r,e=globalThis==null?void 0:globalThis.document){const t=Ql(r);S.useEffect(()=>{const n=s=>{s.key==="Escape"&&t(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[t,e])}var FY="DismissableLayer",tN="dismissableLayer.update",DY="dismissableLayer.pointerDownOutside",MY="dismissableLayer.focusOutside",QF,r8=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jE=S.forwardRef((r,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...l}=r,c=S.useContext(r8),[u,f]=S.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),x=ms(e,N=>f(N)),g=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),w=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,_=w>=v,T=LY(N=>{const k=N.target,E=[...c.branches].some(P=>P.contains(k));!_||E||(s==null||s(N),a==null||a(N),N.defaultPrevented||o==null||o())},p),A=BY(N=>{const k=N.target;[...c.branches].some(P=>P.contains(k))||(i==null||i(N),a==null||a(N),N.defaultPrevented||o==null||o())},p);return OY(N=>{w===c.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&o&&(N.preventDefault(),o()))},p),S.useEffect(()=>{if(u)return t&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(QF=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),e3(),()=>{t&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=QF)}},[u,p,t,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),e3())},[u,c]),S.useEffect(()=>{const N=()=>m({});return document.addEventListener(tN,N),()=>document.removeEventListener(tN,N)},[]),d.jsx(sn.div,{...l,ref:x,style:{pointerEvents:b?_?"auto":"none":void 0,...r.style},onFocusCapture:kr(r.onFocusCapture,A.onFocusCapture),onBlurCapture:kr(r.onBlurCapture,A.onBlurCapture),onPointerDownCapture:kr(r.onPointerDownCapture,T.onPointerDownCapture)})});jE.displayName=FY;var IY="DismissableLayerBranch",n8=S.forwardRef((r,e)=>{const t=S.useContext(r8),n=S.useRef(null),s=ms(e,n);return S.useEffect(()=>{const i=n.current;if(i)return t.branches.add(i),()=>{t.branches.delete(i)}},[t.branches]),d.jsx(sn.div,{...r,ref:s})});n8.displayName=IY;function LY(r,e=globalThis==null?void 0:globalThis.document){const t=Ql(r),n=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const i=o=>{if(o.target&&!n.current){let l=function(){s8(DY,t,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,t]),{onPointerDownCapture:()=>n.current=!0}}function BY(r,e=globalThis==null?void 0:globalThis.document){const t=Ql(r),n=S.useRef(!1);return S.useEffect(()=>{const s=i=>{i.target&&!n.current&&s8(MY,t,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function e3(){const r=new CustomEvent(tN);document.dispatchEvent(r)}function s8(r,e,t,{discrete:n}){const s=t.originalEvent.target,i=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:t});e&&s.addEventListener(r,e,{once:!0}),n?t8(s,i):s.dispatchEvent(i)}var UY=jE,$Y=n8,ku=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},zY="Portal",L4=S.forwardRef((r,e)=>{var o;const{container:t,...n}=r,[s,i]=S.useState(!1);ku(()=>i(!0),[]);const a=t||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?kB.createPortal(d.jsx(sn.div,{...n,ref:e}),a):null});L4.displayName=zY;function HY(r,e){return S.useReducer((t,n)=>e[t][n]??t,r)}var iv=r=>{const{present:e,children:t}=r,n=WY(e),s=typeof t=="function"?t({present:n.isPresent}):S.Children.only(t),i=ms(n.ref,VY(s));return typeof t=="function"||n.isPresent?S.cloneElement(s,{ref:i}):null};iv.displayName="Presence";function WY(r){const[e,t]=S.useState(),n=S.useRef(null),s=S.useRef(r),i=S.useRef("none"),a=r?"mounted":"unmounted",[o,l]=HY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=C_(n.current);i.current=o==="mounted"?c:"none"},[o]),ku(()=>{const c=n.current,u=s.current;if(u!==r){const p=i.current,m=C_(c);r?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=r}},[r,l]),ku(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,f=m=>{const g=C_(n.current).includes(m.animationName);if(m.target===e&&g&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},p=m=>{m.target===e&&(i.current=C_(n.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:S.useCallback(c=>{n.current=c?getComputedStyle(c):null,t(c)},[])}}function C_(r){return(r==null?void 0:r.animationName)||"none"}function VY(r){var n,s;let e=(n=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.
52isReactWarning;return t?r.ref:(e=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?r.props.ref:r.props.ref||r.ref)}var GY=wL[" useInsertionEffect ".trim().toString()]||ku;function B4({prop:r,defaultProp:e,onChange:t=()=>{},caller:n}){const[s,i,a]=KY({defaultProp:e,onChange:t}),o=r!==void 0,l=o?r:s;{const u=S.useRef(r!==void 0);S.useEffect(()=>{const f=u.current;f!==o&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=o},[o,n])}const c=S.useCallback(u=>{var f;if(o){const p=XY(u)?u(r):u;p!==r&&((f=a.current)==null||f.call(a,p))}else i(u)},[o,r,i,a]);return[l,c]}function KY({defaultProp:r,onChange:e}){const[t,n]=S.useState(r),s=S.useRef(t),i=S.useRef(e);return GY(()=>{i.current=e},[e]),S.useEffect(()=>{var a;s.current!==t&&((a=i.current)==null||a.call(i,t),s.current=t)},[t,s]),[t,n,i]}function XY(r){return typeof r=="function"}var YY=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qY="VisuallyHidden",OE=S.forwardRef((r,e)=>d.jsx(sn.span,{...r,ref:e,style:{...YY,...r.style}}));OE.displayName=qY;var ZY=OE,U4="ToastProvider",[$4,JY,QY]=RY("Toast"),[i8,h1e]=sv("Toast",[QY]),[eq,FE]=i8(U4),a8=r=>{const{__scopeToast:e,label:t="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=r,[o,l]=S.useState(null),[c,u]=S.useState(0),f=S.useRef(!1),p=S.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${U4}\`. Expected non-empty \`string\`.`),d.jsx($4.Provider,{scope:e,children:d.jsx(eq,{scope:e,label:t,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:c,viewport:o,onViewportChange:l,onToastAdd:S.useCallback(()=>u(m=>m+1),[]),onToastRemove:S.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};a8.displayName=U4;var o8="ToastViewport",tq=["F8"],rN="toast.viewportPause",nN="toast.viewportResume",l8=S.forwardRef((r,e)=>{const{__scopeToast:t,hotkey:n=tq,label:s="Notifications ({hotkey})",...i}=r,a=FE(o8,t),o=JY(t),l=S.useRef(null),c=S.useRef(null),u=S.useRef(null),f=S.useRef(null),p=ms(e,f,a.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=a.toastCount>0;S.useEffect(()=>{const y=v=>{var b;n.length!==0&&n.every(_=>v[_]||v.code===_)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),S.useEffect(()=>{const y=l.current,v=f.current;if(x&&y&&v){const w=()=>{if(!a.isClosePausedRef.current){const A=new CustomEvent(rN);v.dispatchEvent(A),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const A=new CustomEvent(nN);v.dispatchEvent(A),a.isClosePausedRef.current=!1}},_=A=>{!y.contains(A.relatedTarget)&&b()},T=()=>{y.contains(document.activeElement)||b()};return y.addEventListener("focusin",w),y.addEventListener("focusout",_),y.addEventListener("pointermove",w),y.addEventListener("pointerleave",T),window.addEventListener("blur",w),window.addEventListener("focus",b),()=>{y.removeEventListener("focusin",w),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",w),y.removeEventListener("pointerleave",T),window.removeEventListener("blur",w),window.removeEventListener("focus",b)}}},[x,a.isClosePausedRef]);const g=S.useCallback(({tabbingDirection:y})=>{const w=o().map(b=>{const _=b.ref.current,T=[_,...pq(_)];return y==="forwards"?T:T.reverse()});return(y==="forwards"?w.reverse():w).flat()},[o]);return S.useEffect(()=>{const y=f.current;if(y){const v=w=>{var T,A,N;const b=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!b){const k=document.activeElement,E=w.shiftKey;if(w.target===y&&E){(T=c.current)==null||T.focus();return}const D=g({tabbingDirection:E?"backwards":"forwards"}),H=D.findIndex(B=>B===k);lT(D.slice(H+1))?w.preventDefault():E?(A=c.current)==null||A.focus():(N=u.current)==null||N.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[o,g]),d.jsxs($Y,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&d.jsx(sN,{ref:c,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});lT(y)}}),d.jsx($4.Slot,{scope:t,children:d.jsx(sn.ol,{tabIndex:-1,...i,ref:p})}),x&&d.jsx(sN,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});lT(y)}})]})});l8.displayName=o8;var c8="ToastFocusProxy",sN=S.forwardRef((r,e)=>
52{const{__scopeToast:t,onFocusFromOutsideViewport:n,...s}=r,i=FE(c8,t);return d.jsx(OE,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const o=a.relatedTarget;!((c=i.viewport)!=null&&c.contains(o))&&n()}})});sN.displayName=c8;var Ub="Toast",rq="toast.swipeStart",nq="toast.swipeMove",sq="toast.swipeCancel",iq="toast.swipeEnd",u8=S.forwardRef((r,e)=>{const{forceMount:t,open:n,defaultOpen:s,onOpenChange:i,...a}=r,[o,l]=B4({prop:n,defaultProp:s??!0,onChange:i,caller:Ub});return d.jsx(iv,{present:t||o,children:d.jsx(lq,{open:o,...a,ref:e,onClose:()=>l(!1),onPause:Ql(r.onPause),onResume:Ql(r.onResume),onSwipeStart:kr(r.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:kr(r.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:kr(r.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:kr(r.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});u8.displayName=Ub;var[aq,oq]=i8(Ub,{onClose(){}}),lq=S.forwardRef((r,e)=>{const{__scopeToast:t,type:n="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...x}=r,g=FE(Ub,t),[y,v]=S.useState(null),w=ms(e,B=>v(B)),b=S.useRef(null),_=S.useRef(null),T=s||g.duration,A=S.useRef(0),N=S.useRef(T),k=S.useRef(0),{onToastAdd:E,onToastRemove:P}=g,O=Ql(()=>{var ee;(y==null?void 0:y.contains(document.activeElement))&&((ee=g.viewport)==null||ee.focus()),a()}),D=S.useCallback(B=>{!B||B===1/0||(window.clearTimeout(k.current),A.current=new Date().getTime(),k.current=window.setTimeout(O,B))},[O]);S.useEffect(()=>{const B=g.viewport;if(B){const ee=()=>{D(N.current),c==null||c()},X=()=>{const W=new Date().getTime()-A.current;N.current=N.current-W,window.clearTimeout(k.current),l==null||l()};return B.addEventListener(rN,X),B.addEventListener(nN,ee),()=>{B.removeEventListener(rN,X),B.removeEventListener(nN,ee)}}},[g.viewport,T,l,c,D]),S.useEffect(()=>{i&&!g.isClosePausedRef.current&&D(T)},[i,T,g.isClosePausedRef,D]),S.useEffect(()=>(E(),()=>P()),[E,P]);const H=S.useMemo(()=>y?x8(y):null,[y]);return g.viewport?d.jsxs(d.Fragment,{children:[H&&d.jsx(cq,{__scopeToast:t,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:H}),d.jsx(aq,{scope:t,onClose:O,children:Ib.createPortal(d.jsx($4.ItemSlot,{scope:t,children:d.jsx(UY,{asChild:!0,onEscapeKeyDown:kr(o,()=>{g.isFocusedToastEscapeKeyDownRef.current||O(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(sn.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:w,style:{userSelect:"none",touchAction:"none",...r.style},onKeyDown:kr(r.onKeyDown,B=>{B.key==="Escape"&&(o==null||o(B.nativeEvent),B.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:kr(r.onPointerDown,B=>{B.button===0&&(b.current={x:B.clientX,y:B.clientY})}),onPointerMove:kr(r.onPointerMove,B=>{if(!b.current)return;const ee=B.clientX-b.current.x,X=B.clientY-b.current.y,W=!!_.current,Y=["left","right"].includes(g.swipeDirection),F=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,J=Y?F(0,ee):0,ne=Y?0:F(0,X),I=B.pointerType==="touch"?10:2,z={x:J,y:ne},M={originalEvent:B,delta:z};W?(_.current=z,N_(nq,f,M,{discrete:!1})):t3(z,g.swipeDirection,I)?(_.current=z,N_(rq,u,M,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(ee)>I||Math.abs(X)>
52I)&&(b.current=null)}),onPointerUp:kr(r.onPointerUp,B=>{const ee=_.current,X=B.target;if(X.hasPointerCapture(B.pointerId)&&X.releasePointerCapture(B.pointerId),_.current=null,b.current=null,ee){const W=B.currentTarget,Y={originalEvent:B,delta:ee};t3(ee,g.swipeDirection,g.swipeThreshold)?N_(iq,m,Y,{discrete:!0}):N_(sq,p,Y,{discrete:!0}),W.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),cq=r=>{const{__scopeToast:e,children:t,...n}=r,s=FE(Ub,e),[i,a]=S.useState(!1),[o,l]=S.useState(!1);return hq(()=>a(!0)),S.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),o?null:d.jsx(L4,{asChild:!0,children:d.jsx(OE,{...n,children:i&&d.jsxs(d.Fragment,{children:[s.label," ",t]})})})},uq="ToastTitle",d8=S.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r;return d.jsx(sn.div,{...n,ref:e})});d8.displayName=uq;var dq="ToastDescription",h8=S.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r;return d.jsx(sn.div,{...n,ref:e})});h8.displayName=dq;var f8="ToastAction",p8=S.forwardRef((r,e)=>{const{altText:t,...n}=r;return t.trim()?d.jsx(g8,{altText:t,asChild:!0,children:d.jsx(z4,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${f8}\`. Expected non-empty \`string\`.`),null)});p8.displayName=f8;var m8="ToastClose",z4=S.forwardRef((r,e)=>{const{__scopeToast:t,...n}=r,s=oq(m8,t);return d.jsx(g8,{asChild:!0,children:d.jsx(sn.button,{type:"button",...n,ref:e,onClick:kr(r.onClick,s.onClose)})})});z4.displayName=m8;var g8=S.forwardRef((r,e)=>{const{__scopeToast:t,altText:n,...s}=r;return d.jsx(sn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function x8(r){const e=[];return Array.from(r.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),fq(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=n.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...x8(n))}}),e}function N_(r,e,t,{discrete:n}){const s=t.originalEvent.currentTarget,i=new CustomEvent(r,{bubbles:!0,cancelable:!0,detail:t});e&&s.addEventListener(r,e,{once:!0}),n?t8(s,i):s.dispatchEvent(i)}var t3=(r,e,t=0)=>{const n=Math.abs(r.x),s=Math.abs(r.y),i=n>s;return e==="left"||e==="right"?i&&n>t:!i&&s>t};function hq(r=()=>{}){const e=Ql(r);ku(()=>{let t=0,n=0;return t=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(n)}},[e])}function fq(r){return r.nodeType===r.ELEMENT_NODE}function pq(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function lT(r){const e=document.activeElement;return r.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var mq=a8,v8=l8,y8=u8,w8=d8,b8=h8,_8=p8,k8=z4;function S8(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(e=0;e<s;e++)r[e]&&(t=S8(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function E8(){for(var r,e,t=0,n="",s=arguments.length;t<s;t++)(r=arguments[t])&&(e=S8(r))&&(n&&(n+=" "),n+=e);return n}const r3=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,n3=E8,A8=(r,e)=>t=>{var n;if((e==null?void 0:e.variants)==null)return n3(r,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(c=>{const u=t==null?void 0:t[c],f=i==null?void 0:i[c];if(u===null)return null;const p=r3(u)||r3(f);return s[c][p]}),o=t&&Object.entries(t).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:f,className:p,...m}=u;return Object.entries(m).every(x=>{let[g,y]=x;return Array.isArray(y)?y.includes({...i,...o}[g]):{...i,...o}[g]===y})?[...c,f,p]:c},[]);return n3(r,a,l,t==null?void 0:t.class,t==null?void 0:t.className)};/** 53 * @license lucide-react v0.462.0 - ISC 54 * 55 * This source code is licensed under the ISC license. 56 * See the LICENSE file in the root directory of this source tree. 57 */const gq=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),T8=(...r)=>
vendor: 4,489 bytes, lines 57-117
57r.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();/** 58 * @license lucide-react v0.462.0 - ISC 59 * 60 * This source code is licensed under the ISC license. 61 * See the LICENSE file in the root directory of this source tree. 62 */var xq={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"};/** 63 * @license lucide-react v0.462.0 - ISC 64 * 65 * This source code is licensed under the ISC license. 66 * See the LICENSE file in the root directory of this source tree. 67 */const vq=S.forwardRef(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:a,...o},l)=>S.createElement("svg",{ref:l,...xq,width:e,height:e,stroke:r,strokeWidth:n?Number(t)*24/Number(e):t,className:T8("lucide",s),...o},[...a.map(([c,u])=>S.createElement(c,u)),...Array.isArray(i)?i:[i]]));/** 68 * @license lucide-react v0.462.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const Fe=(r,e)=>{const t=S.forwardRef(({className:n,...s},i)=>S.createElement(vq,{ref:i,iconNode:e,className:T8(`lucide-${gq(r)}`,n),...s}));return t.displayName=`${r}`,t};/** 73 * @license lucide-react v0.462.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */const yq=Fe("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]);/** 78 * @license lucide-react v0.462.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const wq=Fe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 83 * @license lucide-react v0.462.0 - ISC 84 * 85 * This source code is licensed under the ISC license. 86 * See the LICENSE file in the root directory of this source tree. 87 */const _i=Fe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 88 * @license lucide-react v0.462.0 - ISC 89 * 90 * This source code is licensed under the ISC license. 91 * See the LICENSE file in the root directory of this source tree. 92 */const Dx=Fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 93 * @license lucide-react v0.462.0 - ISC 94 * 95 * This source code is licensed under the ISC license. 96 * See the LICENSE file in the root directory of this source tree. 97 */const bq=Fe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 98 * @license lucide-react v0.462.0 - ISC 99 * 100 * This source code is licensed under the ISC license. 101 * See the LICENSE file in the root directory of this source tree. 102 */const _q=Fe("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]);/** 103 * @license lucide-react v0.462.0 - ISC 104 * 105 * This source code is licensed under the ISC license. 106 * See the LICENSE file in the root directory of this source tree. 107 */const y0=Fe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 108 * @license lucide-react v0.462.0 - ISC 109 * 110 * This source code is licensed under the ISC license. 111 * See the LICENSE file in the root directory of this source tree. 112 */const Ty=Fe("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 113 * @license lucide-react v0.462.0 - ISC 114 * 115 * This source code is licensed under the ISC license. 116 * See the LICENSE file in the root directory of this source tree. 117 */const C8=Fe("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
117],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 118 * @license lucide-react v0.462.0 - ISC 119 * 120 * This source code is licensed under the ISC license. 121 * See the LICENSE file in the root directory of this source tree. 122 */const kq=Fe("Bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);/** 123 * @license lucide-react v0.462.0 - ISC 124 * 125 * This source code is licensed under the ISC license. 126 * See the LICENSE file in the root directory of this source tree. 127 */const Sq=Fe("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/** 128 * @license lucide-react v0.462.0 - ISC 129 * 130 * This source code is licensed under the ISC license. 131 * See the LICENSE file in the root directory of this source tree. 132 */const Su=Fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 133 * @license lucide-react v0.462.0 - ISC 134 * 135 * This source code is licensed under the ISC license. 136 * See the LICENSE file in the root directory of this source tree. 137 */const N8=Fe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 138 * @license lucide-react v0.462.0 - ISC 139 * 140 * This source code is licensed under the ISC license. 141 * See the LICENSE file in the root directory of this source tree. 142 */const P8=Fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 143 * @license lucide-react v0.462.0 - ISC 144 * 145 * This source code is licensed under the ISC license. 146 * See the LICENSE file in the root directory of this source tree. 147 */const DE=Fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 148 * @license lucide-react v0.462.0 - ISC 149 * 150 * This source code is licensed under the ISC license. 151 * See the LICENSE file in the root directory of this source tree. 152 */const Mx=Fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 153 * @license lucide-react v0.462.0 - ISC 154 * 155 * This source code is licensed under the ISC license. 156 * See the LICENSE file in the root directory of this source tree. 157 */const R8=Fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 158 * @license lucide-react v0.462.0 - ISC 159 * 160 * This source code is licensed under the ISC license. 161 * See the LICENSE file in the root directory of this source tree. 162 */const j8=Fe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 163 * @license lucide-react v0.462.0 - ISC 164 * 165 * This source code is licensed under the ISC license. 166 * See the LICENSE file in the root directory of this source tree. 167 */const $b=Fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 168 * @license lucide-react v0.462.0 - ISC 169 * 170 * This source code is licensed under the ISC license. 171 * See the LICENSE file in the root directory of this source tree. 172 */const Eq=Fe("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 173 * @license lucide-react v0.462.0 - ISC 174 * 175 * This source code is licensed under the ISC license. 176 * See the LICENSE file in the root directory of this source tree. 177 */const ME=Fe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 178 * @license lucide-react v0.462.0 - ISC 179 * 180 * This source code is licensed under the ISC license. 181 * See the LICENSE file in the root directory of this source tree. 182 */const O8=Fe("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/** 183 * @license lucide-react v0.462.0 - ISC 184 * 185 * This source code is licensed under the ISC license. 186 * See the LICENSE file in the root directory of this source tree. 187 */const Aq=Fe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 188 * @license lucide-react v0.462.0 - ISC 189 * 190 * This source code is licensed under the ISC license. 191 * See the LICENSE file in the root directory of this source tree. 192 */const F8=Fe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 193 * @license lucide-react v0.462.0 - ISC 194 * 195 * This source code is licensed under the ISC license. 196 * See the LICENSE file in the root directory of this source tree. 197 */const H4=Fe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 198 * @license lucide-react v0.462.0 - ISC 199 * 200 * This source code is licensed under the ISC license. 201 * See the LICENSE file in the root directory of this source tree. 202 */const s3=Fe("FileSpreadsheet",[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 203 * @license lucide-react v0.462.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */const iN=Fe("FileText",[["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"}]]);/** 208 * @license lucide-react v0.462.0 - ISC 209 * 210 * This source code is licensed under the ISC license. 211 * See the LICENSE file in the root directory of this source tree. 212 */const D8=Fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 213 * @license lucide-react v0.462.0 - ISC 214 * 215 * This source code is licensed under the ISC license. 216 * See the LICENSE file in the root directory of this source tree. 217 */const W4=Fe("GraduationCap",[["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"}]]);/** 218 * @license lucide-react v0.462.0 - ISC 219 * 220 * This source code is licensed under the ISC license. 221 * See the LICENSE file in the root directory of this source tree. 222 */const Tq=Fe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 223 * @license lucide-react v0.462.0 - ISC 224 * 225 * This source code is licensed under the ISC license. 226 * See the LICENSE file in the root directory of this source tree. 227 */const aN=Fe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 228 * @license lucide-react v0.462.0 - ISC 229 * 230 * This source code is licensed under the ISC license. 231 * See the LICENSE file in the root directory of this source tree. 232 */const D0=Fe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 233 * @license lucide-react v0.462.0 - ISC 234 * 235 * This source code is licensed under the ISC license. 236 * See the LICENSE file in the root directory of this source tree. 237 */const M8=Fe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 238 * @license lucide-react v0.462.0 - ISC 239 * 240 * This source code is licensed under the ISC license. 241 * See the LICENSE file in the root directory of this source tree.
242 */const Cq=Fe("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 243 * @license lucide-react v0.462.0 - ISC 244 * 245 * This source code is licensed under the ISC license. 246 * See the LICENSE file in the root directory of this source tree. 247 */const kn=Fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 248 * @license lucide-react v0.462.0 - ISC 249 * 250 * This source code is licensed under the ISC license. 251 * See the LICENSE file in the root directory of this source tree. 252 */const i3=Fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 253 * @license lucide-react v0.462.0 - ISC 254 * 255 * This source code is licensed under the ISC license. 256 * See the LICENSE file in the root directory of this source tree. 257 */const I8=Fe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 258 * @license lucide-react v0.462.0 - ISC 259 * 260 * This source code is licensed under the ISC license. 261 * See the LICENSE file in the root directory of this source tree. 262 */const Pn=Fe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 263 * @license lucide-react v0.462.0 - ISC 264 * 265 * This source code is licensed under the ISC license. 266 * See the LICENSE file in the root directory of this source tree. 267 */const Ix=Fe("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** 268 * @license lucide-react v0.462.0 - ISC 269 * 270 * This source code is licensed under the ISC license. 271 * See the LICENSE file in the root directory of this source tree. 272 */const oN=Fe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 273 * @license lucide-react v0.462.0 - ISC 274 * 275 * This source code is licensed under the ISC license. 276 * See the LICENSE file in the root directory of this source tree. 277 */const Lx=Fe("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 278 * @license lucide-react v0.462.0 - ISC 279 * 280 * This source code is licensed under the ISC license. 281 * See the LICENSE file in the root directory of this source tree. 282 */const Nq=Fe("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/** 283 * @license lucide-react v0.462.0 - ISC 284 * 285 * This source code is licensed under the ISC license. 286 * See the LICENSE file in the root directory of this source tree. 287 */const L8=Fe("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/** 288 * @license lucide-react v0.462.0 - ISC 289 * 290 * This source code is licensed under the ISC license. 291 * See the LICENSE file in the root directory of this source tree. 292 */const B8=Fe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** 293 * @license lucide-react v0.462.0 - ISC 294 * 295 * This source code is licensed under the ISC license. 296 * See the LICENSE file in the root directory of this source tree. 297 */const av=Fe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 298 * @license lucide-react v0.462.0 - ISC 299 * 300 * This source code is licensed under the ISC license. 301 * See the LICENSE file in the root directory of this source tree. 302 */const Pq=Fe("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/** 303 * @license lucide-react v0.462.0 - ISC 304 * 305 * This source code is licensed under the ISC license. 306 * See the LICENSE file in the root directory of this source tree. 307 */const U8=Fe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 308 * @license lucide-react v0.462.0 - ISC 309 * 310 * This source code is licensed under the ISC license. 311 * See the LICENSE file in the root directory of this source tree. 312 */const qh=Fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 313 * @license lucide-react v0.462.0 - ISC 314 * 315 * This source code is licensed under the ISC license. 316 * See the LICENSE file in the root directory of this source tree. 317 */const Rq=Fe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/** 318 * @license lucide-react v0.462.0 - ISC 319 * 320 * This source code is licensed under the ISC license. 321 * See the LICENSE file in the root directory of this source tree. 322 */const Ou=Fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 323 * @license lucide-react v0.462.0 - ISC 324 * 325 * This source code is licensed under the ISC license. 326 * See the LICENSE file in the root directory of this source tree. 327 */const K2=Fe("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
327kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 328 * @license lucide-react v0.462.0 - ISC 329 * 330 * This source code is licensed under the ISC license. 331 * See the LICENSE file in the root directory of this source tree. 332 */const c1=Fe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 333 * @license lucide-react v0.462.0 - ISC 334 * 335 * This source code is licensed under the ISC license. 336 * See the LICENSE file in the root directory of this source tree. 337 */const jq=Fe("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** 338 * @license lucide-react v0.462.0 - ISC 339 * 340 * This source code is licensed under the ISC license. 341 * See the LICENSE file in the root directory of this source tree. 342 */const IE=Fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 343 * @license lucide-react v0.462.0 - ISC 344 * 345 * This source code is licensed under the ISC license. 346 * See the LICENSE file in the root directory of this source tree. 347 */const Oq=Fe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 348 * @license lucide-react v0.462.0 - ISC 349 * 350 * This source code is licensed under the ISC license. 351 * See the LICENSE file in the root directory of this source tree. 352 */const Fq=Fe("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/** 353 * @license lucide-react v0.462.0 - ISC 354 * 355 * This source code is licensed under the ISC license. 356 * See the LICENSE file in the root directory of this source tree. 357 */const cT=Fe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 358 * @license lucide-react v0.462.0 - ISC 359 * 360 * This source code is licensed under the ISC license. 361 * See the LICENSE file in the root directory of this source tree. 362 */const Dq=Fe("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 363 * @license lucide-react v0.462.0 - ISC 364 * 365 * This source code is licensed under the ISC license. 366 * See the LICENSE file in the root directory of this source tree. 367 */const Bx=Fe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 368 * @license lucide-react v0.462.0 - ISC 369 * 370 * This source code is licensed under the ISC license. 371 * See the LICENSE file in the root directory of this source tree. 372 */const $8=Fe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 373 * @license lucide-react v0.462.0 - ISC 374 * 375 * This source code is licensed under the ISC license. 376 * See the LICENSE file in the root directory of this source tree. 377 */const Rh=Fe("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);/** 378 * @license lucide-react v0.462.0 - ISC 379 * 380 * This source code is licensed under the ISC license. 381 * See the LICENSE file in the root directory of this source tree. 382 */const Mq=Fe("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 383 * @license lucide-react v0.462.0 - ISC 384 * 385 * This source code is licensed under the ISC license. 386 * See the LICENSE file in the root directory of this source tree. 387 */const Iq=Fe("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/** 388 * @license lucide-react v0.462.0 - ISC 389 * 390 * This source code is licensed under the ISC license. 391 * See the LICENSE file in the root directory of this source tree. 392 */const fs=Fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 9,576 bytes, lines 392-437
392],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 393 * @license lucide-react v0.462.0 - ISC 394 * 395 * This source code is licensed under the ISC license. 396 * See the LICENSE file in the root directory of this source tree. 397 */const V4=Fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 398 * @license lucide-react v0.462.0 - ISC 399 * 400 * This source code is licensed under the ISC license. 401 * See the LICENSE file in the root directory of this source tree. 402 */const Ux=Fe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 403 * @license lucide-react v0.462.0 - ISC 404 * 405 * This source code is licensed under the ISC license. 406 * See the LICENSE file in the root directory of this source tree. 407 */const zb=Fe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 408 * @license lucide-react v0.462.0 - ISC 409 * 410 * This source code is licensed under the ISC license. 411 * See the LICENSE file in the root directory of this source tree. 412 */const Lq=Fe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 413 * @license lucide-react v0.462.0 - ISC 414 * 415 * This source code is licensed under the ISC license. 416 * See the LICENSE file in the root directory of this source tree. 417 */const Bq=Fe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 418 * @license lucide-react v0.462.0 - ISC 419 * 420 * This source code is licensed under the ISC license. 421 * See the LICENSE file in the root directory of this source tree. 422 */const ec=Fe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 423 * @license lucide-react v0.462.0 - ISC 424 * 425 * This source code is licensed under the ISC license. 426 * See the LICENSE file in the root directory of this source tree. 427 */const Uq=Fe("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]]);/** 428 * @license lucide-react v0.462.0 - ISC 429 * 430 * This source code is licensed under the ISC license. 431 * See the LICENSE file in the root directory of this source tree. 432 */const $q=Fe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** 433 * @license lucide-react v0.462.0 - ISC 434 * 435 * This source code is licensed under the ISC license. 436 * See the LICENSE file in the root directory of this source tree. 437 */const Xn=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),G4="-",zq=r=>{const e=Wq(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=r;return{getClassGroupId:a=>{const o=a.split(G4);return o[0]===""&&o.length!==1&&o.shift(),z8(o,e)||Hq(a)},getConflictingClassGroupIds:(a,o)=>{const l=t[a]||[];return o&&n[a]?[...l,...n[a]]:l}}},z8=(r,e)=>{var a;if(r.length===0)return e.classGroupId;const t=r[0],n=e.nextPart.get(t),s=n?z8(r.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=r.join(G4);return(a=e.validators.find(({validator:o})=>o(i)))==null?void 0:a.classGroupId},a3=/^\[(.+)\]$/,Hq=r=>{if(a3.test(r)){const e=a3.exec(r)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Wq=r=>{const{theme:e,prefix:t}=r,n={nextPart:new Map,validators:[]};return Gq(Object.entries(r.classGroups),t).forEach(([i,a])=>{lN(a,n,i,e)}),n},lN=(r,e,t,n)=>{r.forEach(s=>{if(typeof s=="string"){const i=s===""?e:o3(e,s);i.classGroupId=t;return}if(typeof s=="function"){if(Vq(s)){lN(s(n),e,t,n);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([i,a])=>{lN(a,o3(e,i),t,n)})})},o3=(r,e)=>{let t=r;return e.split(G4).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},Vq=r=>r.isThemeGetter,Gq=(r,e)=>e?r.map(([t,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,o])=>[e+a,o])):i);return[t,s]}):r,Kq=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const s=(i,a)=>{t.set(i,a),e++,e>r&&(e=0,n=t,t=new Map)};return{get(i){let a=t.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return s(i,a),a},set(i,a){t.has(i)?t.set(i,a):s(i,a)}}},H8="!",Xq=r=>{const{separator:e,experimentalParseClassName:t}=r,n=e.length===1,s=e[0],i=e.length,a=o=>{const l=[];let c=0,u=0,f;for(let y=0;y<o.length;y++){let v=o[y];if(c===0){if(v===s&&(n||o.slice(y,y+i)===e)){l.push(o.slice(u,y)),u=y+i;continue}if(v==="/"){f=y;continue}}v==="["?c++:v==="]"&&c--}const p=l.length===0?o:o.substring(u),m=p.startsWith(H8),x=m?p.substring(1):p,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:g}};return t?o=>t({className:o,parseClassName:a}):a},Yq=r=>{if(r.length<=1)return r;const e=[];let t=[];return r.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},qq=r=>({cache:Kq(r.cacheSize),parseClassName:Xq(r),...zq(r)}),Zq=/\s+/,Jq=(r,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],a=r.trim().split(Zq);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=t(c);let x=!!m,g=n(x?p.substring(0,m):p);if(!g){if(!x){o=c+(o.length>0?" "+o:o);continue}if(g=n(p),!g){o=c+(o.length>0?" "+o:o);continue}x=!1}const y=Yq(u).join(":"),v=f?y+H8:y,w=v+g;if(i.includes(w))continue;i.push(w);const b=s(g,x);for(let _=0;_<b.length;++_){const T=b[_];i.push(v+T)}o=c+(o.length>0?" "+o:o)}return o};function Qq(){let r=0,e,t,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=W8(e))&&(n&&(n+=" "),n+=t);return n}const W8=r=>{if(typeof r=="string")return r;let e,t="";for(let n=0;n<r.length;n++)r[n]&&(e=W8(r[n]))&&(t&&(t+=" "),t+=e);return t};function eZ(r,...e){let t,n,s,i=a;function a(l){const c=e.reduce((u,f)=>f(u),r());return t=qq(c),n=t.cache.get,s=t.cache.set,i=o,o(l)}function o(l){const c=n(l);if(c)return c;const u=Jq(l,t);return s(l,u),u}return function(){return i(Qq.apply(null,arguments))}}const vr=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},V8=/^\[(?:([a-z-]+):)?(.+)\]$/i,tZ=/^\d+\/\d+$/,rZ=new Set(["px","full","screen"]),nZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sZ=/\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$/,iZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,aZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uc=r=>Bm(r)||rZ.has(r)||tZ.test(r),Uu=r=>ov(r,"length",mZ),Bm=r=>!!r&&!Number.isNaN(Number(r)),uT=r=>ov(r,"number",Bm),Rv=r=>!!r&&Number.isInteger(Number(r)),lZ=r=>r.endsWith("%")&&Bm(r.slice(0,-1)),xt=r=>V8.test(r),$u=r=>nZ.test(r),cZ=new Set(["length","size","percentage"]),uZ=r=>ov(r,cZ,G8),dZ=r=>ov(r,"position",G8),hZ=new Set(["image","url"]),fZ=r=>ov(r,hZ,xZ),pZ=r=>ov(r,"",gZ),jv=()=>!0,ov=(r,e,t)=>{const n=V8.exec(r);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},mZ=r=>sZ.test(r)&&!iZ.test(r),G8=()=>!1,gZ=r=>aZ.test(r),xZ=r=>oZ.test(r),vZ=()=>{const r=vr("colors"),e=vr("spacing"),t=vr("blur"),n=vr("brightness"),s=vr("borderColor"),i=vr("borderRadius"),a=vr("borderSpacing"),o=vr("borderWidth"),l=vr("contrast"),c=vr("grayscale"),u=vr("hueRotate"),f=vr("invert"),p=vr("gap"),m=vr("gradientColorStops"),x=vr("gradientColorStopPositions"),g=vr("inset"),y=vr("margin"),v=vr("opacity"),w=vr("padding"),b=vr("saturate"),_=vr("scale"),T=vr("sepia"),A=vr("skew"),N=vr("space"),k=vr("translate"),E=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",xt,e],D=()=>[xt,e],H=()=>["",uc,Uu],B=()=>["auto",Bm,xt],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",xt],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ne=()=>[Bm,xt];return{cacheSize:500,separator:":",theme:{colors:[jv],spacing:[uc,Uu],blur:["none","",$u,xt],brightness:ne(),borderColor:[r],borderRadius:["n
437one","","full",$u,xt],borderSpacing:D(),borderWidth:H(),contrast:ne(),grayscale:F(),hueRotate:ne(),invert:F(),gap:D(),gradientColorStops:[r],gradientColorStopPositions:[lZ,Uu],inset:O(),margin:O(),opacity:ne(),padding:D(),saturate:ne(),scale:ne(),sepia:F(),skew:ne(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[$u]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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"],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:[...ee(),xt]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rv,xt]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Rv,xt]}],"grid-cols":[{"grid-cols":[jv]}],"col-start-end":[{col:["auto",{span:["full",Rv,xt]},xt]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[jv]}],"row-start-end":[{row:["auto",{span:[Rv,xt]},xt]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xt,e]}],"min-w":[{"min-w":[xt,e,"min","max","fit"]}],"max-w":[{"max-w":[xt,e,"none","full","min","max","fit","prose",{screen:[$u]},$u]}],h:[{h:[xt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",$u,Uu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uT]}],"font-family":[{font:[jv]}],"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:["tighter","tight","normal","wide","wider","widest",xt]}],"line-clamp":[{"line-clamp":["none",Bm,uT]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",uc,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",uc,Uu]}],"underline-offset":[{"underline-offset":["auto",uc,xt]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),dZ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uZ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fZ]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[x]}
vendor: 5,182 bytes, line 437
437],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:X()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[uc,xt]}],"outline-w":[{outline:[uc,Uu]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[uc,Uu]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",$u,pZ]}],"shadow-color":[{shadow:[jv]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$u,xt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xt]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Rv,xt]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],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",xt]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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"]}
vendor: 4,647 bytes, line 437
437],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",xt]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[uc,Uu,uT]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},yZ=eZ(vZ);function Is(...r){return yZ(E8(r))}const wZ=mq,K8=S.forwardRef(({className:r,...e},t)=>d.jsx(v8,{ref:t,className:Is("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...e}));K8.displayName=v8.displayName;const bZ=A8("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),X8=S.forwardRef(({className:r,variant:e,...t},n)=>d.jsx(y8,{ref:n,className:Is(bZ({variant:e}),r),...t}));X8.displayName=y8.displayName;const _Z=S.forwardRef(({className:r,...e},t)=>d.jsx(_8,{ref:t,className:Is("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",r),...e}));_Z.displayName=_8.displayName;const Y8=S.forwardRef(({className:r,...e},t)=>d.jsx(k8,{ref:t,className:Is("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 4,170 bytes, line 437
437/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...e,children:d.jsx(Xn,{className:"h-4 w-4"})}));Y8.displayName=k8.displayName;const q8=S.forwardRef(({className:r,...e},t)=>d.jsx(w8,{ref:t,className:Is("text-sm font-semibold",r),...e}));q8.displayName=w8.displayName;const Z8=S.forwardRef(({className:r,...e},t)=>d.jsx(b8,{ref:t,className:Is("text-sm opacity-90",r),...e}));Z8.displayName=b8.displayName;function kZ(){const{toasts:r}=kY();return d.jsxs(wZ,{children:[r.map(function({id:e,title:t,description:n,action:s,...i}){return d.jsxs(X8,{...i,children:[d.jsxs("div",{className:"grid gap-1",children:[t&&d.jsx(q8,{children:t}),n&&d.jsx(Z8,{children:n})]}),s,d.jsx(Y8,{})]},e)}),d.jsx(K8,{})]})}var SZ=wL[" useId ".trim().toString()]||(()=>{}),EZ=0;function dT(r){const[e,t]=S.useState(SZ());return ku(()=>{r||t(n=>n??String(EZ++))},[r]),r||(e?`radix-${e}`:"")}const AZ=["top","right","bottom","left"],jh=Math.min,sa=Math.max,X2=Math.round,P_=Math.floor,Oh=r=>({x:r,y:r}),TZ={left:"right",right:"left",bottom:"top",top:"bottom"},CZ={start:"end",end:"start"};function cN(r,e,t){return sa(r,jh(e,t))}function Eu(r,e){return typeof r=="function"?r(e):r}function Au(r){return r.split("-")[0]}function lv(r){return r.split("-")[1]}function K4(r){return r==="x"?"y":"x"}function X4(r){return r==="y"?"height":"width"}function Fh(r){return["top","bottom"].includes(Au(r))?"y":"x"}function Y4(r){return K4(Fh(r))}function NZ(r,e,t){t===void 0&&(t=!1);const n=lv(r),s=Y4(r),i=X4(s);let a=s==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Y2(a)),[a,Y2(a)]}function PZ(r){const e=Y2(r);return[uN(r),e,uN(e)]}function uN(r){return r.replace(/start|end/g,e=>CZ[e])}function RZ(r,e,t){const n=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(r){case"top":case"bottom":return t?e?s:n:e?n:s;case"left":case"right":return e?i:a;default:return[]}}function jZ(r,e,t,n){const s=lv(r);let i=RZ(Au(r),t==="start",n);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(uN)))),i}function Y2(r){return r.replace(/left|right|bottom|top/g,e=>TZ[e])}function OZ(r){return{top:0,right:0,bottom:0,left:0,...r}}function J8(r){return typeof r!="number"?OZ(r):{top:r,right:r,bottom:r,left:r}}function q2(r){const{x:e,y:t,width:n,height:s}=r;return{width:n,height:s,top:t,left:e,right:e+n,bottom:t+s,x:e,y:t}}function l3(r,e,t){let{reference:n,floating:s}=r;const i=Fh(e),a=Y4(e),o=X4(a),l=Au(e),c=i==="y",u=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[o]/2-s[o]/2;let m;switch(l){case"top":m={x:u,y:n.y-s.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(lv(e)){case"start":m[a]-=p*(t&&c?-1:1);break;case"end":m[a]+=p*(t&&c?-1:1);break}return m}const FZ=async(r,e,t)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:a}=t,o=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:r,floating:e,strategy:s}),{x:u,y:f}=l3(c,n,l),p=n,m={},x=0;for(let g=0;g<o.length;g++){const{name:y,fn:v}=o[g],{x:w,y:b,data:_,reset:T}=await v({x:u,y:f,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:r,floating:e}});u=w??u,f=b??f,m={...m,[y]:{...m[y],..._}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:r,floating:e,strategy:s}):T.rects),{x:u,y:f}=l3(c,p,l)),g=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:m}};async function u1(r,e){var t;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:a,elements:o,strategy:l}=r,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=Eu(e,r),x=J8(m),y=o[p?f==="floating"?"reference":"floating":f],v=q2(await i.getClippingRect
vendor: 8,729 bytes, line 437
437({element:(t=await(i.isElement==null?void 0:i.isElement(y)))==null||t?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),w=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),_=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},T=q2(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:b,strategy:l}):w);return{top:(v.top-T.top+x.top)/_.y,bottom:(T.bottom-v.bottom+x.bottom)/_.y,left:(v.left-T.left+x.left)/_.x,right:(T.right-v.right+x.right)/_.x}}const DZ=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:s,rects:i,platform:a,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=Eu(r,e)||{};if(c==null)return{};const f=J8(u),p={x:t,y:n},m=Y4(s),x=X4(m),g=await a.getDimensions(c),y=m==="y",v=y?"top":"left",w=y?"bottom":"right",b=y?"clientHeight":"clientWidth",_=i.reference[x]+i.reference[m]-p[m]-i.floating[x],T=p[m]-i.reference[m],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let N=A?A[b]:0;(!N||!await(a.isElement==null?void 0:a.isElement(A)))&&(N=o.floating[b]||i.floating[x]);const k=_/2-T/2,E=N/2-g[x]/2-1,P=jh(f[v],E),O=jh(f[w],E),D=P,H=N-g[x]-O,B=N/2-g[x]/2+k,ee=cN(D,B,H),X=!l.arrow&&lv(s)!=null&&B!==ee&&i.reference[x]/2-(B<D?P:O)-g[x]/2<0,W=X?B<D?B-D:B-H:0;return{[m]:p[m]+W,data:{[m]:ee,centerOffset:B-ee-W,...X&&{alignmentOffset:W}},reset:X}}}),MZ=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...y}=Eu(r,e);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const v=Au(s),w=Fh(o),b=Au(o)===o,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=p||(b||!g?[Y2(o)]:PZ(o)),A=x!=="none";!p&&A&&T.push(...jZ(o,g,x,_));const N=[o,...T],k=await u1(e,y),E=[];let P=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&E.push(k[v]),f){const B=NZ(s,a,_);E.push(k[B[0]],k[B[1]])}if(P=[...P,{placement:s,overflows:E}],!E.every(B=>B<=0)){var O,D;const B=(((O=i.flip)==null?void 0:O.index)||0)+1,ee=N[B];if(ee)return{data:{index:B,overflows:P},reset:{placement:ee}};let X=(D=P.filter(W=>W.overflows[0]<=0).sort((W,Y)=>W.overflows[1]-Y.overflows[1])[0])==null?void 0:D.placement;if(!X)switch(m){case"bestFit":{var H;const W=(H=P.filter(Y=>{if(A){const F=Fh(Y.placement);return F===w||F==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(F=>F>0).reduce((F,J)=>F+J,0)]).sort((Y,F)=>Y[1]-F[1])[0])==null?void 0:H[0];W&&(X=W);break}case"initialPlacement":X=o;break}if(s!==X)return{reset:{placement:X}}}return{}}}};function c3(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function u3(r){return AZ.some(e=>r[e]>=0)}const IZ=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...s}=Eu(r,e);switch(n){case"referenceHidden":{const i=await u1(e,{...s,elementContext:"reference"}),a=c3(i,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:u3(a)}}}case"escaped":{const i=await u1(e,{...s,altBoundary:!0}),a=c3(i,t.floating);return{data:{escapedOffsets:a,escaped:u3(a)}}}default:return{}}}}};async function LZ(r,e){const{placement:t,platform:n,elements:s}=r,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=Au(t),o=lv(t),l=Fh(t)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,f=Eu(e,r);let{mainAxis:p,crossAxis:m,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof x=="number"&&(m=o==="end"?x*-1:x),l?{x:m*u,y:p*c}:{x:p*c,y:m*u}}const BZ=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:s,y:i,placement:a,middlewareData:o}=e,l=await LZ(e,r);return a===((t=o.offset)==null?void 0:t.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:a}}}}},UZ=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:y=>{let{x:v,y:w}=y;return{x:v,y:w}}},...l}=Eu(r,e),c={x:t,y:n},u=await u1(e,l),f=Fh(Au(s)),p=K4(f);let m=c[p],x=c[f];if(i){const y=p==="y"?"top":"left",v=p==="y"?"bottom":"right",w=m+u[y],b=m-u[v];m=cN(w,m,b)}if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=x+u[y],b=x-u[v];x=cN(w,x,b)}const g=o.fn({...e,[p]:m,[f]:x});return{...g,data:{x:g.x-t,y:g.y-n,enabled:{[p]:i,[f]:a}}}}}},$Z=function(r){return r===void 0&&(r={}),{options:r,fn(e){const{x:t,y:n,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Eu(r,e),u={x:t,y:n},f=Fh(s),p=K4(f);let m=u[p],x=u[f];const g=Eu(o,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=p==="y"?"height":"width",_=i.reference[p]-i.floating[b]+y.mainAxis,T=i.reference[p]+i.reference[b]-y.mainAxis;m<_?m=_:m>T&&(m=T)}if(c){var v,w;const b=p==="y"?"width":"height",_=["top","left"].includes(Au(s)),T=i.reference[f]-i.floating[b]+(_&&((v=a.offset)==null?void 0:v[f])||0)+(_?0:y.crossAxis),A=i.reference[f]+i.reference[b]+(_?0:((w=a.offset)==null?void 0:w[f])||0)-(_?y.crossAxis:0);x<T?x=T:x>A&&(x=A)}return{[p]:m,[f]:x}}}},zZ=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:s,rects:i,platform:a,elements:o}=e,{apply:l=()=>{},...c}=Eu(r,e),u=await u1(e,c),f=Au(s),p=lv(s),m=Fh(s)==="y",{width:x,height:g}=i.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=p===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(v=f,y=p==="end"?"top":"bottom");const w=g-u.top-u.bottom,b=x-u.left-u.right,_=jh(g-u[y],w),T=jh(x-u[v],b),A=!e.middlewareData.shift;let N=_,k=T;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(k=b),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(N=w),A&&!p){const P=sa(u.left,0),O=sa(u.right,0),D=sa(u.top,0),H=sa(u.bottom,0);m?k=x-2*(P!==0||O!==0?P+O:sa(u.left,u.right)):N=g-2*(D!==0||H!==0?D+H:sa(u.top,u.bottom))}await l({...e,availableWidth:k,availableHeight:N});const E=await a.getDimensions(o.floating);return x!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function LE(){return typeof window<"u"}function cv(r){return Q8(r)?(r.nodeName||"").toLowerCase():"#document"}function fa(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function ic(r){var e;return(e=(Q8(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function Q8(r){return LE()?r instanceof Node||r instanceof fa(r).Node:!1}function tl(r){return LE()?r instanceof Element||r instanceof fa(r).Element:!1}function tc(r){return LE()?r instanceof HTMLElement||r instanceof fa(r).HTMLElement:!1}function d3(r){return!LE()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof fa(r).ShadowRoot}function Hb(r){const{overflow:e,overflowX:t,overflowY:n,display:s}=rl(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(s)}function HZ(r){return["table","td","th"].includes(cv(r))}function BE(r){return[":popover-open",":modal"].some(e=>{try{return r.matches(e)}catch{return!1}})}function q4(r){const e=Z4(),t=tl(r)?rl(r):r;return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function WZ(r){let e=Dh(r);for(;tc(e)&&!$x(e);){if(q4(e))return e;if(BE(e))return null;e=Dh(e)}return null}function Z4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $x(r){return["html","body","#document"].includes(cv(r))}function rl(r){return fa(r).getComputedStyle(r)}function UE(r){return tl(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Dh(r){if(cv(r)==="html")return r;const e=r.assignedSlot||r.parentNode||d3(r)&&r.host||ic(r);return d3(e)?e.host:e}function e6(r){const e=Dh(r);return $x(e)?r.ownerDocument?r.ownerDocument.body:r.body:tc(e)&&Hb(e)?e:e6(e)}function d1(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=e6(r),i=s===((n=r.ownerDocument)==null?void 0:n.body),a=fa(s);if(i){const o=dN(a);
vendor: 6,878 bytes, line 437
437return e.concat(a,a.visualViewport||[],Hb(s)?s:[],o&&t?d1(o):[])}return e.concat(s,d1(s,[],t))}function dN(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function t6(r){const e=rl(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=tc(r),i=s?r.offsetWidth:t,a=s?r.offsetHeight:n,o=X2(t)!==i||X2(n)!==a;return o&&(t=i,n=a),{width:t,height:n,$:o}}function J4(r){return tl(r)?r:r.contextElement}function Um(r){const e=J4(r);if(!tc(e))return Oh(1);const t=e.getBoundingClientRect(),{width:n,height:s,$:i}=t6(e);let a=(i?X2(t.width):t.width)/n,o=(i?X2(t.height):t.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const VZ=Oh(0);function r6(r){const e=fa(r);return!Z4()||!e.visualViewport?VZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GZ(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==fa(r)?!1:e}function w0(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=r.getBoundingClientRect(),i=J4(r);let a=Oh(1);e&&(n?tl(n)&&(a=Um(n)):a=Um(r));const o=GZ(i,t,n)?r6(i):Oh(0);let l=(s.left+o.x)/a.x,c=(s.top+o.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(i){const p=fa(i),m=n&&tl(n)?fa(n):n;let x=p,g=dN(x);for(;g&&n&&m!==x;){const y=Um(g),v=g.getBoundingClientRect(),w=rl(g),b=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,_=v.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=b,c+=_,x=fa(g),g=dN(x)}}return q2({width:u,height:f,x:l,y:c})}function KZ(r){let{elements:e,rect:t,offsetParent:n,strategy:s}=r;const i=s==="fixed",a=ic(n),o=e?BE(e.floating):!1;if(n===a||o&&i)return t;let l={scrollLeft:0,scrollTop:0},c=Oh(1);const u=Oh(0),f=tc(n);if((f||!f&&!i)&&((cv(n)!=="body"||Hb(a))&&(l=UE(n)),tc(n))){const p=w0(n);c=Um(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+u.x,y:t.y*c.y-l.scrollTop*c.y+u.y}}function XZ(r){return Array.from(r.getClientRects())}function hN(r,e){const t=UE(r).scrollLeft;return e?e.left+t:w0(ic(r)).left+t}function YZ(r){const e=ic(r),t=UE(r),n=r.ownerDocument.body,s=sa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=sa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+hN(r);const o=-t.scrollTop;return rl(n).direction==="rtl"&&(a+=sa(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:a,y:o}}function qZ(r,e){const t=fa(r),n=ic(r),s=t.visualViewport;let i=n.clientWidth,a=n.clientHeight,o=0,l=0;if(s){i=s.width,a=s.height;const c=Z4();(!c||c&&e==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:i,height:a,x:o,y:l}}function ZZ(r,e){const t=w0(r,!0,e==="fixed"),n=t.top+r.clientTop,s=t.left+r.clientLeft,i=tc(r)?Um(r):Oh(1),a=r.clientWidth*i.x,o=r.clientHeight*i.y,l=s*i.x,c=n*i.y;return{width:a,height:o,x:l,y:c}}function h3(r,e,t){let n;if(e==="viewport")n=qZ(r,t);else if(e==="document")n=YZ(ic(r));else if(tl(e))n=ZZ(e,t);else{const s=r6(r);n={...e,x:e.x-s.x,y:e.y-s.y}}return q2(n)}function n6(r,e){const t=Dh(r);return t===e||!tl(t)||$x(t)?!1:rl(t).position==="fixed"||n6(t,e)}function JZ(r,e){const t=e.get(r);if(t)return t;let n=d1(r,[],!1).filter(o=>tl(o)&&cv(o)!=="body"),s=null;const i=rl(r).position==="fixed";let a=i?Dh(r):r;for(;tl(a)&&!$x(a);){const o=rl(a),l=q4(a);!l&&o.position==="fixed"&&(s=null),(i?!l&&!s:!l&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Hb(a)&&!l&&n6(r,a))?n=n.filter(u=>u!==a):s=o,a=Dh(a)}return e.set(r,n),n}function QZ(r){let{element:e,boundary:t,rootBoundary:n,strategy:s}=r;const a=[...t==="clippingAncestors"?BE(e)?[]:JZ(e,this._c):[].concat(t),n],o=a[0],l=a.reduce((c,u)=>{const f=h3(e,u,s);return c.top=sa(f.top,c.top),c.right=jh(f.right,c.right),c.bottom=jh(f.bottom,c.bottom),c.left=sa(f.left,c.left),c},h3(e,o,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eJ(r){const{width:e,height:t}=t6(r);return{width:e,height:t}}function tJ(r,e,t){const n=tc(e),s=ic(e),i=t==="fixed",a=w0(r,!0,i,e);let o={scrollLeft:0,scrollTop:0};const l=Oh(0);if(n||!n&&!i)if((cv(e)!=="body"||Hb(s))&&(o=UE(e)),n){const m=w0(e,!0,i,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else s&&(l.x=hN(s));let c=0,u=0;if(s&&!n&&!i){const m=s.getBoundingClientRect();u=m.top+o.scrollTop,c=m.left+o.scrollLeft-hN(s,m)}const f=a.left+o.scrollLeft-l.x-c,p=a.top+o.scrollTop-l.y-u;return{x:f,y:p,width:a.width,height:a.height}}function hT(r){return rl(r).position==="static"}function f3(r,e){if(!tc(r)||rl(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return ic(r)===t&&(t=t.ownerDocument.body),t}function s6(r,e){const t=fa(r);if(BE(r))return t;if(!tc(r)){let s=Dh(r);for(;s&&!$x(s);){if(tl(s)&&!hT(s))return s;s=Dh(s)}return t}let n=f3(r,e);for(;n&&HZ(n)&&hT(n);)n=f3(n,e);return n&&$x(n)&&hT(n)&&!q4(n)?t:n||WZ(r)||t}const rJ=async function(r){const e=this.getOffsetParent||s6,t=this.getDimensions,n=await t(r.floating);return{reference:tJ(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function nJ(r){return rl(r).direction==="rtl"}const sJ={convertOffsetParentRelativeRectToViewportRelativeRect:KZ,getDocumentElement:ic,getClippingRect:QZ,getOffsetParent:s6,getElementRects:rJ,getClientRects:XZ,getDimensions:eJ,getScale:Um,isElement:tl,isRTL:nJ};function iJ(r,e){let t=null,n;const s=ic(r);function i(){var o;clearTimeout(n),(o=t)==null||o.disconnect(),t=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:p}=r.getBoundingClientRect();if(o||e(),!f||!p)return;const m=P_(u),x=P_(s.clientWidth-(c+f)),g=P_(s.clientHeight-(u+p)),y=P_(c),w={rootMargin:-m+"px "+-x+"px "+-g+"px "+-y+"px",threshold:sa(0,jh(1,l))||1};let b=!0;function _(T){const A=T[0].intersectionRatio;if(A!==l){if(!b)return a();A?a(!1,A):n=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{t=new IntersectionObserver(_,{...w,root:s.ownerDocument})}catch{t=new IntersectionObserver(_,w)}t.observe(r)}return a(!0),i}function aJ(r,e,t,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=J4(r),u=s||i?[...c?d1(c):[],...d1(e)]:[];u.forEach(v=>{s&&v.addEventListener("scroll",t,{passive:!0}),i&&v.addEventListener("resize",t)});const f=c&&o?iJ(c,t):null;let p=-1,m=null;a&&(m=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),t()}),c&&!l&&m.observe(c),m.observe(e));let x,g=l?w0(r):null;l&&y();function y(){const v=w0(r);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&t(),g=v,x=requestAnimationFrame(y)}return t(),()=>{var v;u.forEach(w=>{s&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),f==null||f(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(x)}}
vendor: 4,383 bytes, line 437
437const oJ=BZ,lJ=UZ,cJ=MZ,uJ=zZ,dJ=IZ,p3=DZ,hJ=$Z,fJ=(r,e,t)=>{const n=new Map,s={platform:sJ,...t},i={...s.platform,_c:n};return FZ(r,e,{...s,platform:i})};var Ck=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Z2(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(typeof r=="function"&&r.toString()===e.toString())return!0;let t,n,s;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(t=r.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!Z2(r[n],e[n]))return!1;return!0}if(s=Object.keys(r),t=s.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=t;n--!==0;){const i=s[n];if(!(i==="_owner"&&r.$$typeof)&&!Z2(r[i],e[i]))return!1}return!0}return r!==r&&e!==e}function i6(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function m3(r,e){const t=i6(r);return Math.round(e*t)/t}function fT(r){const e=S.useRef(r);return Ck(()=>{e.current=r}),e}function pJ(r){r===void 0&&(r={});const{placement:e="bottom",strategy:t="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=r,[u,f]=S.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=S.useState(n);Z2(p,n)||m(n);const[x,g]=S.useState(null),[y,v]=S.useState(null),w=S.useCallback(Y=>{Y!==A.current&&(A.current=Y,g(Y))},[]),b=S.useCallback(Y=>{Y!==N.current&&(N.current=Y,v(Y))},[]),_=i||x,T=a||y,A=S.useRef(null),N=S.useRef(null),k=S.useRef(u),E=l!=null,P=fT(l),O=fT(s),D=fT(c),H=S.useCallback(()=>{if(!A.current||!N.current)return;const Y={placement:e,strategy:t,middleware:p};O.current&&(Y.platform=O.current),fJ(A.current,N.current,Y).then(F=>{const J={...F,isPositioned:D.current!==!1};B.current&&!Z2(k.current,J)&&(k.current=J,Ib.flushSync(()=>{f(J)}))})},[p,e,t,O,D]);Ck(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(Y=>({...Y,isPositioned:!1})))},[c]);const B=S.useRef(!1);Ck(()=>(B.current=!0,()=>{B.current=!1}),[]),Ck(()=>{if(_&&(A.current=_),T&&(N.current=T),_&&T){if(P.current)return P.current(_,T,H);H()}},[_,T,H,P,E]);const ee=S.useMemo(()=>({reference:A,floating:N,setReference:w,setFloating:b}),[w,b]),X=S.useMemo(()=>({reference:_,floating:T}),[_,T]),W=S.useMemo(()=>{const Y={position:t,left:0,top:0};if(!X.floating)return Y;const F=m3(X.floating,u.x),J=m3(X.floating,u.y);return o?{...Y,transform:"translate("+F+"px, "+J+"px)",...i6(X.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:F,top:J}},[t,o,X.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:H,refs:ee,elements:X,floatingStyles:W}),[u,H,ee,X,W])}const mJ=r=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:r,fn(t){const{element:n,padding:s}=typeof r=="function"?r(t):r;return n&&e(n)?n.current!=null?p3({element:n.current,padding:s}).fn(t):{}:n?p3({element:n,padding:s}).fn(t):{}}}},gJ=(r,e)=>({...oJ(r),options:[r,e]}),xJ=(r,e)=>({...lJ(r),options:[r,e]}),vJ=(r,e)=>({...hJ(r),options:[r,e]}),yJ=(r,e)=>({...cJ(r),options:[r,e]}),wJ=(r,e)=>({...uJ(r),options:[r,e]}),bJ=(r,e)=>({...dJ(r),options:[r,e]}),_J=(r,e)=>({...mJ(r),options:[r,e]});var kJ="Arrow",a6=S.forwardRef((r,e)=>{const{children:t,width:n=10,height:s=5,...i}=r;return d.jsx(sn.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?t:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});a6.displayName=kJ;var SJ=a6;function o6(r){const[e,t]=S.useState(void 0);return ku(()=>{if(r){t({width:r.offsetWidth,height:r.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,o;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=r.offsetWidth,o=r.offsetHeight;t({width:a,height:o})});return n.observe(r,{box:"border-box"}),()=>n.unobserve(r)}else t(void 0)},[r]),e}var l6="Popper",[c6,u6]=sv(l6),[f1e,d6]=c6(l6),h6="PopperAnchor",f6=S.forwardRef((r,e)=>{const{__scopePopper:t,virtualRef:n,...s}=r,i=d6(h6,t),a=S.useRef(null),o=ms(e,a);return S.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:d.jsx(sn.div,{...s,ref:o})});f6.displayName=h6;var Q4="PopperContent",[EJ,AJ]=c6(Q4),p6=S.forwardRef((r,e)=>{var re,se,ie,ae,ge,G;const{__scopePopper:t,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l
vendor: 5,085 bytes, line 437
437=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:x,...g}=r,y=d6(Q4,t),[v,w]=S.useState(null),b=ms(e,Ue=>w(Ue)),[_,T]=S.useState(null),A=o6(_),N=(A==null?void 0:A.width)??0,k=(A==null?void 0:A.height)??0,E=n+(i!=="center"?"-"+i:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(c)?c:[c],D=O.length>0,H={padding:P,boundary:O.filter(CJ),altBoundary:D},{refs:B,floatingStyles:ee,placement:X,isPositioned:W,middlewareData:Y}=pJ({strategy:"fixed",placement:E,whileElementsMounted:(...Ue)=>aJ(...Ue,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[gJ({mainAxis:s+k,alignmentAxis:a}),l&&xJ({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?vJ():void 0,...H}),l&&yJ({...H}),wJ({...H,apply:({elements:Ue,rects:Re,availableWidth:He,availableHeight:Te})=>{const{width:we,height:Me}=Re.reference,at=Ue.floating.style;at.setProperty("--radix-popper-available-width",`${He}px`),at.setProperty("--radix-popper-available-height",`${Te}px`),at.setProperty("--radix-popper-anchor-width",`${we}px`),at.setProperty("--radix-popper-anchor-height",`${Me}px`)}}),_&&_J({element:_,padding:o}),NJ({arrowWidth:N,arrowHeight:k}),p&&bJ({strategy:"referenceHidden",...H})]}),[F,J]=x6(X),ne=Ql(x);ku(()=>{W&&(ne==null||ne())},[W,ne]);const I=(re=Y.arrow)==null?void 0:re.x,z=(se=Y.arrow)==null?void 0:se.y,M=((ie=Y.arrow)==null?void 0:ie.centerOffset)!==0,[U,te]=S.useState();return ku(()=>{v&&te(window.getComputedStyle(v).zIndex)},[v]),d.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:W?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:U,"--radix-popper-transform-origin":[(ae=Y.transformOrigin)==null?void 0:ae.x,(ge=Y.transformOrigin)==null?void 0:ge.y].join(" "),...((G=Y.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:d.jsx(EJ,{scope:t,placedSide:F,onArrowChange:T,arrowX:I,arrowY:z,shouldHideArrow:M,children:d.jsx(sn.div,{"data-side":F,"data-align":J,...g,ref:b,style:{...g.style,animation:W?void 0:"none"}})})})});p6.displayName=Q4;var m6="PopperArrow",TJ={top:"bottom",right:"left",bottom:"top",left:"right"},g6=S.forwardRef(function(e,t){const{__scopePopper:n,...s}=e,i=AJ(m6,n),a=TJ[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(SJ,{...s,ref:t,style:{...s.style,display:"block"}})})});g6.displayName=m6;function CJ(r){return r!==null}var NJ=r=>({name:"transformOrigin",options:r,fn(e){var y,v,w;const{placement:t,rects:n,middlewareData:s}=e,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:r.arrowWidth,l=a?0:r.arrowHeight,[c,u]=x6(t),f={start:"0%",center:"50%",end:"100%"}[u],p=(((v=s.arrow)==null?void 0:v.x)??0)+o/2,m=(((w=s.arrow)==null?void 0:w.y)??0)+l/2;let x="",g="";return c==="bottom"?(x=a?f:`${p}px`,g=`${-l}px`):c==="top"?(x=a?f:`${p}px`,g=`${n.floating.height+l}px`):c==="right"?(x=`${-l}px`,g=a?f:`${m}px`):c==="left"&&(x=`${n.floating.width+l}px`,g=a?f:`${m}px`),{data:{x,y:g}}}});function x6(r){const[e,t="center"]=r.split("-");return[e,t]}var PJ=f6,RJ=p6,jJ=g6,[$E,p1e]=sv("Tooltip",[u6]),ej=u6(),v6="TooltipProvider",OJ=700,g3="tooltip.open",[FJ,y6]=$E(v6),w6=r=>{const{__scopeTooltip:e,delayDuration:t=OJ,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=r,a=S.useRef(!0),o=S.useRef(!1),l=S.useRef(0);return S.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(FJ,{scope:e,isOpenDelayedRef:a,delayDuration:t,onOpen:S.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:o,onPointerInTransitChange:S.useCallback(c=>{o.current=c},[]),disableHoverableContent:s,children:i})};w6.displayName=v6;var b6="Tooltip",[m1e,zE]=$E(b6),fN="TooltipTrigger",DJ=S.forwardRef((r,e)=>{const{__scopeTooltip:t,...n}=r,s=zE(fN,t),i=y6(fN,t),a=ej(t),o=S.useRef(null),l=ms(e,o,s.onTriggerChange),c=S.useRef(!1),u=S.useRef(!1),f=S.useCallback(()=>c.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(PJ,{asChild:!0,...a,children:d.jsx(sn.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:kr(r.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:kr(r.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:kr(r.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:kr(r.onFocus,()=>{c.current||s.onOpen()}
vendor: 1,444 bytes, line 437
437),onBlur:kr(r.onBlur,s.onClose),onClick:kr(r.onClick,s.onClose)})})});DJ.displayName=fN;var MJ="TooltipPortal",[g1e,IJ]=$E(MJ,{forceMount:void 0}),zx="TooltipContent",_6=S.forwardRef((r,e)=>{const t=IJ(zx,r.__scopeTooltip),{forceMount:n=t.forceMount,side:s="top",...i}=r,a=zE(zx,r.__scopeTooltip);return d.jsx(iv,{present:n||a.open,children:a.disableHoverableContent?d.jsx(k6,{side:s,...i,ref:e}):d.jsx(LJ,{side:s,...i,ref:e})})}),LJ=S.forwardRef((r,e)=>{const t=zE(zx,r.__scopeTooltip),n=y6(zx,r.__scopeTooltip),s=S.useRef(null),i=ms(e,s),[a,o]=S.useState(null),{trigger:l,onClose:c}=t,u=s.current,{onPointerInTransitChange:f}=n,p=S.useCallback(()=>{o(null),f(!1)},[f]),m=S.useCallback((x,g)=>{const y=x.currentTarget,v={x:x.clientX,y:x.clientY},w=HJ(v,y.getBoundingClientRect()),b=WJ(v,w),_=VJ(g.getBoundingClientRect()),T=KJ([...b,..._]);o(T),f(!0)},[f]);return S.useEffect(()=>()=>p(),[p]),S.useEffect(()=>{if(l&&u){const x=y=>m(y,u),g=y=>m(y,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",g)}}},[l,u,m,p]),S.useEffect(()=>{if(a){const x=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),b=!GJ(v,a);w?p():b&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,a,c,p]),d.jsx(k6,{...r,ref:i})}
437),[BJ,UJ]=$E(b6,{isInside:!1}),$J=TY("TooltipContent"),k6=S.forwardRef((r,e)=>{const{__scopeTooltip:t,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=r,l=zE(zx,t),c=ej(t),{onClose:u}=l;return S.useEffect(()=>(document.addEventListener(g3,u),()=>document.removeEventListener(g3,u)),[u]),S.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),d.jsx(jE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(RJ,{"data-state":l.stateAttribute,...c,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx($J,{children:n}),d.jsx(BJ,{scope:t,isInside:!0,children:d.jsx(ZY,{id:l.contentId,role:"tooltip",children:s||n})})]})})});_6.displayName=zx;var S6="TooltipArrow",zJ=S.forwardRef((r,e)=>{const{__scopeTooltip:t,...n}=r,s=ej(t);return UJ(S6,t).isInside?null:d.jsx(jJ,{...s,...n,ref:e})});zJ.displayName=S6;function HJ(r,e){const t=Math.abs(e.top-r.y),n=Math.abs(e.bottom-r.y),s=Math.abs(e.right-r.x),i=Math.abs(e.left-r.x);switch(Math.min(t,n,s,i)){case i:return"left";case s:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function WJ(r,e,t=5){const n=[];switch(e){case"top":n.push({x:r.x-t,y:r.y+t},{x:r.x+t,y:r.y+t});break;case"bottom":n.push({x:r.x-t,y:r.y-t},{x:r.x+t,y:r.y-t});break;case"left":n.push({x:r.x+t,y:r.y-t},{x:r.x+t,y:r.y+t});break;case"right":n.push({x:r.x-t,y:r.y-t},{x:r.x-t,y:r.y+t});break}return n}function VJ(r){const{top:e,right:t,bottom:n,left:s}=r;return[{x:s,y:e},{x:t,y:e},{x:t,y:n},{x:s,y:n}]}function GJ(r,e){const{x:t,y:n}=r;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const o=e[i],l=e[a],c=o.x,u=o.y,f=l.x,p=l.y;u>n!=p>n&&t<(f-c)*(n-u)/(p-u)+c&&(s=!s)}return s}function KJ(r){const e=r.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),XJ(e)}function XJ(r){if(r.length<=1)return r.slice();const e=[];for(let n=0;n<r.length;n++){const s=r[n];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const t=[];for(let n=r.length-1;n>=0;n--){const s=r[n];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var YJ=w6,E6=_6;const qJ=YJ,ZJ=S.forwardRef(({className:r,sideOffset:e=4,...t},n)=>d.jsx(E6,{ref:n,sideOffset:e,className:Is("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...t}));ZJ.displayName=E6.displayName;const tj="sb_user";function J2(){try{const r=localStorage.getItem(tj);return r?JSON.parse(r):null}catch{return null}}function rj(r){localStorage.setItem(tj,JSON.stringify(r)),window.dispatchEvent(new Event("sb_user_change"))}function x3(){localStorage.removeItem(tj),window.dispatchEvent(new Event("sb_user_change"))}function Zh(){const[r,e]=S.useState(()=>J2());return S.useEffect(()=>{const t=()=>e(J2());return window.addEventListener("sb_user_change",t),window.addEventListener("storage",t),()=>{window.removeEventListener("sb_user_change",t),window.removeEventListener("storage",t)}},[]),r}const nj="sb_exhibitor";function pN(){try{const r=localStorage.getItem(nj);return r?JSON.parse(r):null}catch{return null}}function sj(r){localStorage.setItem(nj,JSON.stringify(r)),window.dispatchEvent(new Event("sb_user_change"))}function v3(){localStorage.removeItem(nj),window.dispatchEvent(new Event("sb_user_change"))}function ij(){const[r,e]=S.useState(()=>pN());return S.useEffect(()=>{const t=()=>e(pN());return window.addEventListener("sb_user_change",t),()=>window.removeEventListener("sb_user_change",t)},[]),r}function JJ(){const r=Zh(),e=ij(),t=(r==null?void 0:r.role)==="exhibitor"||!!e,n=t?"/aussteller-dashboard":"/home";return d.jsx("nav",{className:"border-t border-border bg-background/90 backdrop-blur safe-bottom",children:d.jsx("div",{className:"px-5 py-3",children:d.jsxs(ZB,{to:n,className:({isActive:s})=>`flex items-center justify-center gap-2 w-full rounded-2xl py-3.5 font-display font-extrabold ta
437p-scale shadow-pop ${s?"gradient-hero text-primary-foreground":"gradient-accent text-accent-foreground"}`,children:[d.jsx(Tq,{className:"w-5 h-5",strokeWidth:2.5}),d.jsx("span",{children:t?"Zum Ausstellerbereich":"Zur Startseite"})]})})})}function QJ(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?i(u.value):s(u.value).then(o,l)}c((n=n.apply(r,e||[])).next())})}const eQ=r=>r?(...e)=>r(...e):(...e)=>fetch(...e);class aj extends Error{constructor(e,t="FunctionsError",n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class tQ extends aj{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class y3 extends aj{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class w3 extends aj{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var mN;(function(r){r.Any="any",r.ApNortheast1="ap-northeast-1",r.ApNortheast2="ap-northeast-2",r.ApSouth1="ap-south-1",r.ApSoutheast1="ap-southeast-1",r.ApSoutheast2="ap-southeast-2",r.CaCentral1="ca-central-1",r.EuCentral1="eu-central-1",r.EuWest1="eu-west-1",r.EuWest2="eu-west-2",r.EuWest3="eu-west-3",r.SaEast1="sa-east-1",r.UsEast1="us-east-1",r.UsWest1="us-west-1",r.UsWest2="us-west-2"})(mN||(mN={}));class rQ{constructor(e,{headers:t={},customFetch:n,region:s=mN.Any}={}){this.url=e,this.headers=t,this.region=s,this.fetch=eQ(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return QJ(this,arguments,void 0,function*(t,n={}){var s;let i,a;try{const{headers:o,method:l,body:c,signal:u,timeout:f}=n;let p={},{region:m}=n;m||(m=this.region);const x=new URL(`${this.url}/${t}`);m&&m!=="any"&&(p["x-region"]=m,x.searchParams.set("forceFunctionRegion",m));let g;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(p["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(p["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let y=u;f&&(a=new AbortController,i=setTimeout(()=>a.abort(),f),u?(y=a.signal,u.addEventListener("abort",()=>a.abort())):y=a.signal);const v=yield this.fetch(x.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),o),body:g,signal:y}).catch(T=>{throw new tQ(T)}),w=v.headers.get("x-relay-error");if(w&&w==="true")throw new y3(v);if(!v.ok)throw new w3(v);let b=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return b==="application/json"?_=yield v.json():b==="application/octet-stream"||b==="application/pdf"?_=yield v.blob():b==="text/event-stream"?_=v:b==="multipart/form-data"?_=yield v.formData():_=yield v.text(),{data:_,error:null,response:v}}catch(o){return{data:null,error:o,response:o instanceof w3||o instanceof y3?o.context:void 0}}finally{i&&clearTimeout(i)}})}}const A6=3,b3=r=>Math.min(1e3*2**r,3e4),nQ=[520,503],T6=["GET","HEAD","OPTIONS"];var sQ=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.co
437de=r.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function _3(r,e){return new Promise(t=>{if(e!=null&&e.aborted){t();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),t()},r);function s(){clearTimeout(n),t()}e==null||e.addEventListener("abort",s)})}function iQ(r,e,t,n){return!(!n||t>=A6||!T6.includes(r)||!nQ.includes(e))}var aQ=class{constructor(r){var e,t,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=r.method,this.url=r.url,this.headers=new Headers(r.headers),this.schema=r.schema,this.body=r.body,this.shouldThrowOnError=(e=r.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=r.signal,this.isMaybeSingle=(t=r.isMaybeSingle)!==null&&t!==void 0?t:!1,this.shouldStripNulls=(n=r.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=r.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=r.retry)!==null&&i!==void 0?i:!0,r.fetch?this.fetch=r.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(r,e){return this.headers=new Headers(this.headers),this.headers.set(r,e),this}retry(r){return this.retryEnabled=r,this}then(r,e){var t=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const a=this.headers.get("Accept");a==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!a||a==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let a=0;for(;;){const c=new Headers(t.headers);a>0&&c.set("X-Retry-Count",String(a));let u;try{u=await n(t.url.toString(),{method:t.method,headers:c,body:JSON.stringify(t.body,(f,p)=>typeof p=="bigint"?p.toString():p),signal:t.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!T6.includes(t.method))throw f;if(t.retryEnabled&&a<A6){const p=b3(a);a++,await _3(p,t.signal);continue}throw f}if(iQ(t.method,u.status,a,t.retryEnabled)){var o,l;const f=(o=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&o!==void 0?o:null,p=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:b3(a);await u.text(),a++,await _3(p,t.signal);continue}return await t.processResponse(u)}})();return this.shouldThrowOnError||(i=i.catch(a=>{var o;let l="",c="",u="";const f=a==null?void 0:a.cause;if(f){var p,m,x,g;const w=(p=f==null?void 0:f.message)!==null&&p!==void 0?p:"",b=(m=f==null?void 0:f.code)!==null&&m!==void 0?m:"";l=`${(x=a==null?void 0:a.name)!==null&&x!==void 0?x:"FetchError"}: ${a==null?void 0:a.message}`,l+=` 438 439Caused by: ${(g=f==null?void 0:f.name)!==null&&g!==void 0?g:"Error"}: ${w}`,b&&(l+=` (${b})`),f!=null&&f.stack&&(l+=` 440${f.stack}`)}else{var y;l=(y=a==null?void 0:a.stack)!==null&&y!==void 0?y:""}const v=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(c+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}}
440)),i.then(r,e)}async processResponse(r){var e=this;let t=null,n=null,s=null,i=r.status,a=r.statusText;if(r.ok){var o,l;if(e.method!=="HEAD"){var c;const p=await r.text();p===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((c=e.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?n=p:n=JSON.parse(p))}const u=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),f=(l=r.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&f&&f.length>1&&(s=parseInt(f[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(t={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,a="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const u=await r.text();try{t=JSON.parse(u),Array.isArray(t)&&r.status===404&&(n=[],t=null,i=200,a="OK")}catch{r.status===404&&u===""?(i=204,a="No Content"):t={message:u}}if(t&&e.shouldThrowOnError)throw new sQ(t)}return{success:t===null,error:t,data:n,count:s,status:i,statusText:a}}returns(){return this}overrideTypes(){return this}},oQ=class extends aQ{select(r){let e=!1;const t=(r??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",t),this.headers.append("Prefer","return=representation"),this}order(r,{ascending:e=!0,nullsFirst:t,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${r}.${e?"asc":"desc"}${t===void 0?"":t?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:e,referencedTable:t=e}={}){const n=typeof t>"u"?"limit":`${t}.limit`;return this.url.searchParams.set(n,`${r}`),this}range(r,e,{foreignTable:t,referencedTable:n=t}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${r}`),this.url.searchParams.set(i,`${e-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:r=!1,verbose:e=!1,settings:t=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;const o=[r?"analyze":null,e?"verbose":null,t?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(r){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${r}`),this}};const k3=new RegExp("[,()]");var sm=class extends oQ{eq(r,e){return this.url.searchParams.append(r,`eq.${e}`),this}neq(r,e){return this.url.searchParams.append(r,`neq.${e}`),this}gt(r,e){return this.url.searchParams.append(r,`gt.${e}`),this}gte(r,e){return this.url.searchParams.append(r,`gte.${e}`),this}lt(r,e){return this.url.searchParams.append(r,`lt.${e}`),this}lte(r,e){return this.url.searchParams.append(r,`lte.${e}`),this}like(r,e){return this.url.searchParams.append(r,`like.${e}`),this}likeAllOf(r,e){return this.url.searchParams.append(r,`like(all).{${e.join(",")}}`),this}likeAnyOf(r,e){return this.url.searchParams.append(r,`like(any).{${e.join(",")}}`),this}ilike(r,e){return this.url.searchParams.append(r,`ilike.${e}`),this}ilikeAllOf(r,e){return this.url.searchParams.append(r,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(r,e){return this.url.searchParams.append(r,`ilike(any).{${e.join(",")}}`),this}regexMatch(r,e){return this.url.searchParams.append(r,`match.${e}`),this}regexIMatch(r,e){return this.url.searchParams.append(r,`imatch.${e}`),this}is(r,e){return this.url.searchParams.append(r,`is.${e}`),this}isDistinct(r,e){return this.url.searchParams.append(r,`isdistinct.${e}`),this}in(r,e){const t=Array.from(new Set(e)).map(n=>typeof n=="string"&&k3.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(r,`in.(${t})`),this}notIn(r,e){const t=Array.from(new Set(e)).map(n=>typeof n=="string"&&k3.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(r,`not.in.(${t})`),this}contains(r,e){return typeof e=="string"?this.url.searchParams.append(r,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(r,`cs.{${e.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(e)}`),this}containedBy(r,e){return typeof e=="string"?this.url.searchParams.append(r,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(r,`cd.{${e.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(e)}`),this}rangeGt(r,e){return this.url.searchParams.append(r,`sr.${e}`),this}rangeGte(r,e){return this.url.searchParams.append(r,`nxl.${e}`),this}rangeLt(r,e){return this.url.searchParams.append(r,`sl.${e}`),this}rangeLte(r,e){return this.url.searchParams.append(r,`nxr.${e}`),this}rangeAdjacent(r,e){return this.url.searchParams.append(r,`adj.${e}`),this}overlaps(r,e){return typeof e=="string"?this.url.searchParams.append(r,`ov.${e}`):this.url.searchParams.append(r,`ov.{${e.join(",")}}`),this}textSearch(r,e,{config:t,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=t===void 0?"":`(${t})`;return this.url.searchParams.append(r,`${s}fts${i}.${e}`),this}match(r){return Object.entries(r).filter(([e,t])=>
440t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(r,e,t){return this.url.searchParams.append(r,`not.${e}.${t}`),this}or(r,{foreignTable:e,referencedTable:t=e}={}){const n=t?`${t}.or`:"or";return this.url.searchParams.append(n,`(${r})`),this}filter(r,e,t){return this.url.searchParams.append(r,`${e}.${t}`),this}},lQ=class{constructor(r,{headers:e={},schema:t,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=r,this.headers=new Headers(e),this.schema=t,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(r,e){const{head:t=!1,count:n}=e??{},s=t?"HEAD":"GET";let i=!1;const a=(r??"*").split("").map(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",a),n&&l.append("Prefer",`count=${n}`),new sm({method:s,url:o,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(r,{count:e,defaultToNull:t=!0}={}){var n;const s="POST",{url:i,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),t||a.append("Prefer","missing=default"),Array.isArray(r)){const o=r.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new sm({method:s,url:i,headers:a,schema:this.schema,body:r,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(r,{onConflict:e,ignoreDuplicates:t=!1,count:n,defaultToNull:s=!0}={}){var i;const a="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${t?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(r)){const c=r.reduce((u,f)=>u.concat(Object.keys(f)),[]);if(c.length>0){const u=[...new Set(c)].map(f=>`"${f}"`);o.searchParams.set("columns",u.join(","))}}return new sm({method:a,url:o,headers:l,schema:this.schema,body:r,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(r,{count:e}={}){var t;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new sm({method:n,url:s,headers:i,schema:this.schema,body:r,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:r}={}){var e;const t="DELETE",{url:n,headers:s}=this.cloneRequestState();return r&&s.append("Prefer",`count=${r}`),new sm({method:t,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function h1(r){"@babel/helpers - typeof";return h1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h1(r)}function cQ(r,e){if(h1(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(h1(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function uQ(r){var e=cQ(r,"string");return h1(e)=="symbol"?e:e+""}function dQ(r,e,t){return(e=uQ(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function S3(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function R_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?S3(Object(t),!0).forEach(function(n){dQ(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):S3(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var hQ=class C6{constructor(e,{headers:t={},schema:n,fetch:s,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const f=new AbortController,p=setTimeout(()=>f.abort(),i),m=u==null?void 0:u.signal;if(m){if(m.aborted)return clearTimeout(p),l(c,u);const x=()=>{clearTimeout(p),f.abort()};return m.addEventListener("abort",x,{once:!0}),l(c,R_(R_({},u),{}
440,{signal:f.signal})).finally(()=>{clearTimeout(p),m.removeEventListener("abort",x)})}return l(c,R_(R_({},u),{},{signal:f.signal})).finally(()=>clearTimeout(p))}:this.fetch=l,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new lQ(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new C6(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:s=!1,count:i}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let c;const u=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(u)),f=n&&Object.values(t).some(u);f?(o="POST",c=t):n||s?(o=n?"HEAD":"GET",Object.entries(t).filter(([m,x])=>x!==void 0).map(([m,x])=>[m,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([m,x])=>{l.searchParams.append(m,x)})):(o="POST",c=t);const p=new Headers(this.headers);return f?p.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&p.set("Prefer",`count=${i}`),new sm({method:o,url:l,headers:p,schema:this.schemaName,body:c,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class fQ{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const t=globalThis.process;if(t){const n=t.versions;if(n&&n.node){const s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 441import ws from "ws" 442new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=` 443 444Suggested solution: ${e.workaround}`),new Error(t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const pQ="2.105.1",mQ=`realtime-js/${pQ}`,gQ="1.0.0",N6="2.0.0",xQ=N6,vQ=1e4,yQ=100,td={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},P6={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},gN={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class wQ{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer((t=e.payload)===null||t===void 0?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,n;const s=(n=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var t,n;const s=(n=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}
444_encodeUserBroadcastPush(e,t,n){var s,i;const a=e.topic,o=(s=e.ref)!==null&&s!==void 0?s:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",c=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+c.length+f.length,m=new ArrayBuffer(this.HEADER_LENGTH+p);let x=new DataView(m),g=0;x.setUint8(g++,this.KINDS.userBroadcastPush),x.setUint8(g++,l.length),x.setUint8(g++,o.length),x.setUint8(g++,a.length),x.setUint8(g++,c.length),x.setUint8(g++,f.length),x.setUint8(g++,t),Array.from(l,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(o,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(a,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(c,v=>x.setUint8(g++,v.charCodeAt(0))),Array.from(f,v=>x.setUint8(g++,v.charCodeAt(0)));var y=new Uint8Array(m.byteLength+n.byteLength);return y.set(new Uint8Array(m),0),y.set(new Uint8Array(n),m.byteLength),y.buffer}decode(e,t){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return t(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,i,a,o,l]=n;return t({join_ref:s,ref:i,topic:a,event:o,payload:l})}return t({})}_binaryDecode(e){const t=new DataView(e),n=t.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,s)}}_decodeUserBroadcast(e,t,n){const s=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4);let l=this.HEADER_LENGTH+4;const c=n.decode(e.slice(l,l+s));l=l+s;const u=n.decode(e.slice(l,l+i));l=l+i;const f=n.decode(e.slice(l,l+a));l=l+a;const p=e.slice(l,e.byteLength),m=o===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,x={type:this.BROADCAST_EVENT,event:u,payload:m};return a>0&&(x.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>t.includes(n)))}}var fr;(function(r){r.abstime="abstime",r.bool="bool",r.date="date",r.daterange="daterange",r.float4="float4",r.float8="float8",r.int2="int2",r.int4="int4",r.int4range="int4range",r.int8="int8",r.int8range="int8range",r.json="json",r.jsonb="jsonb",r.money="money",r.numeric="numeric",r.oid="oid",r.reltime="reltime",r.text="text",r.time="time",r.timestamp="timestamp",r.timestamptz="timestamptz",r.timetz="timetz",r.tsrange="tsrange",r.tstzrange="tstzrange"})(fr||(fr={}));const E3=(r,e,t={})=>{var n;const s=(n=t.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,a)=>(i[a]=bQ(a,r,e,s),i),{}):{}},bQ=(r,e,t,n)=>{const s=e.find(o=>o.name===r),i=s==null?void 0:s.type,a=t[r];return i&&!n.includes(i)?R6(i,a):xN(a)},R6=(r,e)=>{if(r.charAt(0)==="_"){const t=r.slice(1,r.length);return EQ(e,t)}switch(r){case fr.bool:return _Q(e);case fr.float4:case fr.float8:case fr.int2:case fr.int4:case fr.int8:case fr.numeric:case fr.oid:return kQ(e);case fr.json:case fr.jsonb:return SQ(e);case fr.timestamp:return AQ(e);case fr.abstime:case fr.date:case fr.daterange:case fr.int4range:case fr.int8range:case fr.money:case fr.reltime:case fr.text:case fr.time:case fr.timestamptz:case fr.timetz:case fr.tsrange:case fr.tstzrange:return xN(e);default:return xN(e)}},xN=r=>r,_Q=r=>{switch(r){case"t":return!0;case"f":return!1;default:return r}},kQ=r=>{if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return e}return r},SQ=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch{return r}return r},EQ=(r,e)=>{if(typeof r!="string")return r;const t=r.length-1,n=r[t];if(r[0]==="{"&&n==="}"){let i;const a=r.slice(1,t);try{i=JSON.parse("["+a+"]")}catch{i=a?a.split(","):[]}return i.map(o=>R6(e,o))}return r},AQ=r=>typeof r=="string"?r.replace(" ","T"):r,j6=r=>{const e=new URL(r);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Cy=r=>typeof r=="function"?r:function(){return r},TQ=typeof self<"u"?self:null,im=typeof window<"u"?window:null,ml=TQ||im||globalThis,CQ="2.0.0",NQ=1e4,PQ=1e3,Hl={connecting:0,open:1,closing:2,closed:3},oi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},xc={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},vN={longpoll:"longpoll",websocket:"websocket"},RQ={complete:4},yN="base64url.bearer.phx.",j_=class{constructor(r,e,t,n){this.channel=r,this.event=e,this.payload=t||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHo
vendor: 21,698 bytes, lines 444-445
444oks=[],this.sent=!1,this.ref=void 0}resend(r){this.timeout=r,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(r,e){return this.hasReceived(r)&&e(this.receivedResp.response),this.recHooks.push({status:r,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:r,response:e,_ref:t}){this.recHooks.filter(n=>n.status===r).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,r=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=r,this.matchReceive(r)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(r){return this.receivedResp&&this.receivedResp.status===r}trigger(r,e){this.channel.trigger(this.refEvent,{status:r,response:e})}},O6=class{constructor(r,e){this.callback=r,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},jQ=class{constructor(r,e,t){this.state=oi.closed,this.topic=r,this.params=Cy(e||{}),this.socket=t,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new j_(this,xc.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new O6(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=oi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=oi.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=oi.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=oi.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new j_(this,xc.leave,Cy({}),this.timeout).send(),this.state=oi.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(xc.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(r=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=r,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(r=>r.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=oi.closed,this.bindings=[]}onClose(r){this.on(xc.close,r)}onError(r){return this.on(xc.error,e=>r(e))}on(r,e){let t=this.bindingRef++;return this.bindings.push({event:r,ref:t,callback:e}),t}off(r,e){this.bindings=this.bindings.filter(t=>!(t.event===r&&(typeof e>"u"||e===t.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(r,e,t=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${r}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new j_(this,r,function(){return e},t);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(r=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=oi.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(xc.close,"leave")},t=new j_(this,xc.leave,Cy({}),r);return t.receive("ok",()=>e()).receive("timeout",()=>e()),t.send(),this.canPush()||t.trigger("ok",{}),t}onMessage(r,e,t){return e}filterBindings(r,e,t){return!0}isMember(r,e,t,n){return this.topic!==r?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:r,event:e,payload:t,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(r=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=oi.joining,this.joinPush.resend(r))}trigger(r,e,t,n){let s=this.onMessage(r,e,t,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(a=>a.event===r&&this.filterBindings(a,e,t));for(let a=0;a<i.length;a++)i[a].callback(s,t,n||this.joinRef())}replyEventName(r){return`chan_reply_${r}`}isClosed(){return this.state===oi.closed}isErrored(){return this.state===oi.errored}isJoined(){return this.state===oi.joined}isJoining(){return this.state===oi.joining}isLeaving(){return this.state===oi.leaving}},Q2=class{static request(r,e,t,n,s,i,a){if(ml.XDomainRequest){let o=new ml.XDomainRequest;return this.xdomainRequest(o,r,e,n,s,i,a)}else if(ml.XMLHttpRequest){let o=new ml.XMLHttpRequest;return this.xhrRequest(o,r,e,t,n,s,i,a)}else{if(ml.fetch&&ml.AbortController)return this.fetchRequest(r,e,t,n,s,i,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(r,e,t,n,s,i,a){let o={method:r,headers:t,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),ml.fetch(e,o).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>a&&a(c)).catch(c=>{c.name==="AbortError"&&i?i():a&&a(null)}),l}static xdomainRequest(r,e,t,n,s,i,a){return r.timeout=s,r.open(e,t),r.onload=()=>{let o=this.parseJSON(r.responseText);a&&a(o)},i&&(r.ontimeout=i),r.onprogress=()=>{},r.send(n),r}static xhrRequest(r,e,t,n,s,i,a,o){r.open(e,t,!0),r.timeout=i;for(let[l,c]of Object.entries(n))r.setRequestHeader(l,c);return r.onerror=()=>o&&o(null),r.onreadystatechange=()=>{if(r.readyState===RQ.complete&&o){let l=this.parseJSON(r.responseText);o(l)}},a&&(r.ontimeout=a),r.send(s),r}static parseJSON(r){if(!r||r==="")return null;try{return JSON.parse(r)}catch{return console&&console.log("failed to parse JSON response",r),null}}static serialize(r,e){let t=[];for(var n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;let s=e?`${e}[${n}]`:n,i=r[n];typeof i=="object"?t.push(this.serialize(i,s)):t.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return t.join("&")}static appendParams(r,e){if(Object.keys(e).length===0)return r;let t=r.match(/\?/)?"&":"?";return`${r}${t}${this.serialize(e)}`}},OQ=r=>{let e="",t=new Uint8Array(r),n=t.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(t[s]);return btoa(e)},V0=class{constructor(r,e){e&&e.length===2&&e[1].startsWith(yN)&&(this.authToken=atob(e[1].slice(yN.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(r),this.readyState=Hl.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(r){return r.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+vN.websocket),"$1/"+vN.longpoll)}endpointURL(){return Q2.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(r,e,t){this.close(r,e,t),this.readyState=Hl.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Hl.open||this.readyState===Hl.connecting}poll(){const r={Accept:"application/json"};this.authToken&&(r["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",r,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:s}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else t=0;switch(t){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Hl.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(r){typeof r!="string"&&(r=OQ(r)),this.currentBatch?this.currentBatch.push(r):this.awaitingBatchAck?this.batchBuffer.push(r):(this.currentBatch=[r],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(r){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},r.join(` 445`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(r,e,t){for(let s of this.reqs)s.abort();this.readyState=Hl.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:r,reason:e,wasClean:t});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(r,e,t,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=Q2.request(r,this.endpointURL(),e,t,this.timeout,a,o=>{this.reqs.delete(i),this.isActive()&&s(o)}),this.reqs.add(i)}},FQ=class Hv{constructor(e,t={}){let n=t.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:i,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Hv.syncState(this.state,s,i,a),this.pendingDiffs.forEach(l=>{this.state=Hv.syncDiff(this.state,l,i,a)}),this.pendingDiffs=[],o()}),this.channel.on(n.diff,s=>{let{onJoin:i,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Hv.syncDiff(this.state,s,i,a),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Hv.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,s){let i=this.clone(e),a={},o={};return this.map(i,(l,c)=>{t[l]||(o[l]=c)}),this.map(t,(l,c)=>{let u=i[l];if(u){let f=c.metas.map(g=>g.phx_ref),p=u.metas.map(g=>g.phx_ref),m=c.metas.filter(g=>p.indexOf(g.phx_ref)<0),x=u.metas.filter(g=>f.indexOf(g.phx_ref)<0);m.length>0&&(a[l]=c,a[l].metas=m),x.length>0&&(o[l]=this.clone(u),o[l].metas=x)}else a[l]=c}),this.syncDiff(i,{joins:a,leaves:o},n,s)}static syncDiff(e,t,n,s){let{joins:i,leaves:a}=this.clone(t);return n||(n=function(){}),s||(s=function(){}),this.map(i,(o,l)=>{let c=e[o];if(e[o]=this.clone(l),c){let u=e[o].metas.map(p=>p.phx_ref),f=c.metas.filter(p=>u.indexOf(p.phx_ref)<0);e[o].metas.unshift(...f)}n(o,c,l)}),this.map(a,(o,l)=>{let c=e[o];if(!c)return;let u=l.metas.map(f=>f.phx_ref);c.metas=c.metas.filter(f=>u.indexOf(f.phx_ref)<0),s(o,c,l),c.metas.length===0&&delete e[o]}),e}static list(e,t){return t||(t=function(n,s){return s}),this.map(e,(n,s)=>t(n,s))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},O_={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(r,e){if(r.payload.constructor===ArrayBuffer)return e(this.binaryEncode(r));{let t=[r.join_ref,r.ref,r.topic,r.event,r.payload];return e(JSON.stringify(t))}},decode(r,e){if(r.constructor===ArrayBuffer)return e(this.binaryDecode(r));{let[t,n,s,i,a]=JSON.parse(r);return e({join_ref:t,ref:n,topic:s,event:i,payload:a})}},binaryEncode(r){let{join_ref:e,ref:t,event:n,topic:s,payload:i}=r,a=this.META_LENGTH+e.length+t.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,e.length),l.setUint8(c++,t.length),l.setUint8(c++,s.length),l.setUint8(c++,n.length),Array.from(e,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(t,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(s,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(n,f=>l.setUint8(c++,f.charCodeAt(0)));var u=new Uint8Array(o.byteLength+i.byteLength);return u.set(new Uint8Array(o),0),u.set(new Uint8Array(i),o.byteLength),u.buffer},binaryDecode(r){let e=new DataView(r),t=e.getUint8(0),n=new TextDecoder;switch(t){case this.KINDS.push:return this.decodePush(r,e,n);case this.KINDS.reply:return this.decodeReply(r,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(r,e,n)}},decodePush(r,e,t){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=t.decode(r.slice(a,a+n));a=a+n;let l=t.decode(r.slice(a,a+s));a=a+s;let c=t.decode(r.slice(a,a+i));a=a+i;let u=r.slice(a,r.byteLength);return{join_ref:o,ref:null,topic:l,event:c,payload:u}},decodeReply(r,e,t){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),a=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=t.decode(r.slice(o,o+n));o=o+n;let c=t.decode(r.slice(o,o+s));o=o+s;let u=t.decode(r.slice(o,o+i));o=o+i;let f=t.decode(r.slice(o,o+a));o=o+a;let p=r.slice(o,r.byteLength),m={status:f,response:p};return{join_ref:l,ref:c,topic:u,event:xc.reply,payload:m}},decodeBroadcast(r,e,t){let n=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,a=t.decode(r.slice(i,i+n));i=i+n;let o=t.decode(r.slice(i,i+s));i=i+s;let l=r.slice(i,r.byteLength);return{join_ref:null,ref:null,topic:a,event:o,payload:l}}},DQ=class{constructor(r,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||NQ,this.transport=e.transport||ml.WebSocket||V0,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||ml&&ml.sessionStorage,this.establishedConnections=0,this.defaultEncoder=O_.encode.bind(O_),this.defaultDecoder=O_.decode.bind(O_),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==V0?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let t=null;im&&im.addEventListener&&(im.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),t=this.connectClock)}),im.addEventListener("pageshow",n=>{t===this.connectClock&&(t=null,this.connect())}),im.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,i)=>{console.log(`${n}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Cy(e.params||{}),this.endPoint=`${r}/${vN.websocket}`,this.vsn=e.vsn||CQ,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new O6(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return V0}replaceTransport(r){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=r}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let r=Q2.appendParams(Q2.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return r.charAt(0)!=="/"?r:r.charAt(1)==="/"?`${this.protocol()}:${r}`:`${this.protocol()}://${location.host}${r}`}disconnect(r,e,t){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,r&&r()},e,t)}connect(r){r&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Cy(r)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==V0?this.connectWithFallback(V0,this.longPollFallbackMs):this.transportConnect())}log(r,e,t){this.logger&&this.logger(r,e,t)}hasLogger(){return this.logger!==null}onOpen(r){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,r]),e}onClose(r){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,r]),e}onError(r){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,r]),e}onMessage(r){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,r]),e}onHeartbeat(r){this.heartbeatCallback=r}ping(r){if(!this.isConnected())return!1;let e=this.makeRef(),t=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),r(Date.now()-t))});return!0}transportName(r){switch(r){case V0:return"LongPoll";default:return r.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let r;this.authToken&&(r=["phoenix",`${yN}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),r),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(r){return this.sessionStore&&this.sessionStore.getItem(r)}storeSession(r,e){this.sessionStore&&this.sessionStore.setItem(r,e)}connectWithFallback(r,e=2500){clearTimeout(this.fallbackTimer);let t=!1,n=!0,s,i,a=this.transportName(r),o=l=>{this.log("transport",`falling back to ${a}...`,l),this.off([s,i]),n=!1,this.replaceTransport(r),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),i=this.onError(l=>{this.log("transport","error",l),n&&!t&&(clearTimeout(this.fallbackTimer),o(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(t=!0,!n){let l=this.transportName(r);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),PQ,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(r,e,t){if(!this.conn)return r&&r();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,t||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),r&&r()})})}waitForBufferDone(r,e,t=1){if(t===5||!r.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(r,e,t+1)},150*t)}waitForSocketClosed(r,e,t=1){if(t===5||r.readyState===Hl.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(r,e,t+1)},150*t)}onConnClose(r){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",r),this.triggerChanError(r),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",r)}onConnError(r){this.hasLogger()&&this.log("transport","error",r);let e=this.transport,t=this.establishedConnections;this.triggerStateCallbacks("error",r,e,t),(e===this.transport||t>0)&&this.triggerChanError(r)}
445triggerChanError(r){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(xc.error,r)})}connectionState(){switch(this.conn&&this.conn.readyState){case Hl.connecting:return"connecting";case Hl.open:return"open";case Hl.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(r){this.off(r.stateChangeRefs),this.channels=this.channels.filter(e=>e!==r)}off(r){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([t])=>r.indexOf(t)===-1)}channel(r,e={}){let t=new jQ(r,e,this);return this.channels.push(t),t}push(r){if(this.hasLogger()){let{topic:e,event:t,payload:n,ref:s,join_ref:i}=r;this.log("push",`${e} ${t} (${i}, ${s})`,n)}this.isConnected()?this.encode(r,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(r,e=>this.conn.send(e)))}makeRef(){let r=this.ref+1;return r===this.ref?this.ref=0:this.ref=r,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(r=>r()),this.sendBuffer=[])}onConnMessage(r){this.decode(r.data,e=>{let{topic:t,event:n,payload:s,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",o)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${t} ${n} ${i&&"("+i+")"||""}`.trim(),s);for(let o=0;o<this.channels.length;o++){const l=this.channels[o];l.isMember(t,n,s,a)&&l.trigger(n,s,i,a)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(r,...e){try{this.stateChangeCallbacks[r].forEach(([t,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${r} callback`,s)}})}catch(t){this.log("error",`error triggering ${r} callbacks`,t)}}leaveOpenTopic(r){let e=this.channels.find(t=>t.topic===r&&(t.isJoined()||t.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${r}"`),e.leave())}};class Ny{constructor(e,t){const n=IQ(t);this.presence=new FQ(e.getChannel(),n),this.presence.onJoin((s,i,a)=>{const o=Ny.onJoinPayload(s,i,a);e.getChannel().trigger("presence",o)}),this.presence.onLeave((s,i,a)=>{const o=Ny.onLeavePayload(s,i,a);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ny.transformState(this.presence.state)}static transformState(e){return e=MQ(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{const s=e[n];return t[n]=Nk(s),t},{})}static onJoinPayload(e,t,n){const s=A3(t),i=Nk(n);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,t,n){const s=A3(t),i=Nk(n);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function Nk(r){return r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function MQ(r){return JSON.parse(JSON.stringify(r))}function IQ(r){return(r==null?void 0:r.events)&&{events:r.events}}function A3(r){return r!=null&&r.metas?Nk(r):[]}var T3;(function(r){r.SYNC="sync",r.JOIN="join",r.LEAVE="leave"})(T3||(T3={}));class LQ{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Ny(this.channel.channelAdapter,t)}}function BQ(r){if(r instanceof Error)return r;if(typeof r=="string")return new Error(r);if(r&&typeof r=="object"){const e=r;
445if(typeof e.code=="number"){const t=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${t}`,{cause:r})}return new Error("channel error: transport failure",{cause:r})}return new Error("channel error: connection lost")}class UQ{constructor(e,t,n){const s=$Q(n);this.channel=e.getSocket().channel(t,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let s;try{s=this.channel.push(e,t,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>yQ){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===td.joined}isJoined(){return this.state===td.joined}isJoining(){return this.state===td.joining}isClosed(){return this.state===td.closed}isLeaving(){return this.state===td.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function $Q(r){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config)}}var C3;(function(r){r.ALL="*",r.INSERT="INSERT",r.UPDATE="UPDATE",r.DELETE="DELETE"})(C3||(C3={}));var Cm;(function(r){r.BROADCAST="broadcast",r.PRESENCE="presence",r.POSTGRES_CHANGES="postgres_changes",r.SYSTEM="system"})(Cm||(Cm={}));var vc;(function(r){r.SUBSCRIBED="SUBSCRIBED",r.TIMED_OUT="TIMED_OUT",r.CLOSED="CLOSED",r.CHANNEL_ERROR="CHANNEL_ERROR"})(vc||(vc={}));class Py{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){var s,i;if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new UQ(this.socket.socketAdapter,e,this.params),this.presence=new LQ(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=j6(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:a,presence:o,private:l}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[Cm.PRESENCE]&&this.bindings[Cm.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},p={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>{e==null||e(vc.CHANNEL_ERROR,BQ(m))}),this._onClose(()=>e==null?void 0:e(vc.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:m})=>
445{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){e==null||e(vc.SUBSCRIBED);return}this._updatePostgresBindings(m,e)}).receive("error",m=>{this.state=td.errored;const x=Object.values(m).join(", ")||"error";e==null||e(vc.CHANNEL_ERROR,new Error(x,{cause:m}))}).receive("timeout",()=>{e==null||e(vc.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var n;const s=this.bindings.postgres_changes,i=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,a=[];for(let o=0;o<i;o++){const l=s[o],{filter:{event:c,schema:u,table:f,filter:p}}=l,m=e&&e[o];if(m&&m.event===c&&Py.isFilterValueEqual(m.schema,u)&&Py.isFilterValueEqual(m.table,f)&&Py.isFilterValueEqual(m.filter,p))a.push(Object.assign(Object.assign({},l),{id:m.id}));else{this.unsubscribe(),this.state=td.errored,t==null||t(vc.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=a,this.state!=td.errored&&t&&t(vc.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Cm.PRESENCE||e===Cm.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){var s;if(t==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;try{const c=await o.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(e,t={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
445in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:a}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:a,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=t.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var a,o,l;const c=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:s.signal}));return clearTimeout(i),a}_on(e,t,n){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,n),a={type:s,filter:t,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{var s,i,a,o,l,c,u;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const p=(s=this.bindings[f])===null||s===void 0?void 0:s.find(m=>m.ref===e.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in p){const m=p.id,x=(i=p.filter)===null||i===void 0?void 0:i.event;return m&&((a=t.ids)===null||a===void 0?void 0:a.includes(m))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((o=t.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const m=(c=(l=p==null?void 0:p.filter)===null||l===void 0?void 0:l.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return m==="*"||m===((u=t==null?void 0:t.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,t){const{close:n,error:s,leave:i,join:a}=P6;return t&&[n,s,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t=="object"&&"ids"in t){const s=t.data,{schema:i,table:a,commit_timestamp:o,type:l,errors:c}=s;return Object.assign(Object.assign({},{schema:i,table:a,commit_timestamp:o,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return t})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const t in e.bindings)for(const n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=E3(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=E3(e.columns,e.old_record)),t}}class zQ{constructor(e,t){this.socket=new DQ(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==gN.connecting}isDisconnecting(){return this.socket.connectionState()==gN.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const N3={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},HQ=[1e3,2e3,5e3,1e4],WQ=1e4,VQ=` 446 addEventListener("message", (e) => { 447 if (e.data.event === "start") { 448 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 449 } 450 });`;class GQ{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
450,this.ref=0,this.serializer=new wQ,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...a)=>i(...a):(...a)=>fetch(...a),!(!((n=t==null?void 0:t.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const s=this._initializeOptions(t);this.socketAdapter=new zQ(e,s),this.httpEndpoint=j6(e),this.fetch=this._resolveFetch(t==null?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const t=e.message;throw t.includes("Node.js")?new Error(`${t} 451 452To use Realtime in Node.js, you need to provide a WebSocket implementation: 453 454Option 1: Use Node.js 22+ which has native WebSocket support 455Option 2: Install and provide the "ws" package: 456 457 npm install ws 458 459 import ws from "ws" 460 const client = new RealtimeClient(url, { 461 ...options, 462 transport: ws 463 })`):new Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return t==="ok"&&e.teardown(),t}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||gN.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new Py(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
463this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(s=>{const i={access_token:t,version:mQ};t&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(P6.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(t=>{this.log("error","error waiting for auth on connect",t)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t=="sent"&&this._setAuthSafely(),e&&e(t,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{const n=new Blob([VQ],{type:"application/javascript"});t=URL.createObjectURL(n)}return t}_initializeOptions(e){var t,n,s,i,a,o,l,c,u,f,p;this.worker=(t=e==null?void 0:e.worker)!==null&&t!==void 0?t:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const m={};m.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:vQ,m.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:N3.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(a=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&a!==void 0?a:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:N3.HEARTBEAT_INTERVAL),m.transport=(l=e==null?void 0:e.transport)!==null&&l!==void 0?l:fQ.getWebSocketConstructor(),m.params=e==null?void 0:e.params,m.logger=e==null?void 0:e.logger,m.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),m.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:v=>HQ[v-1]||WQ;let x,g;const y=(u=e==null?void 0:e.vsn)!==null&&u!==void 0?u:xQ;switch(y){case gQ:x=(v,w)=>w(JSON.stringify(v)),g=(v,w)=>w(JSON.parse(v));break;case N6:x=this.serializer.encode.bind(this.serializer),g=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${m.vsn}`)}if(m.vsn=y,m.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:x,m.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:g,m.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,m.params=Object.assign(Object.assign({},m.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,m.autoSendHeartbeat=!this.worker}return m}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
463var f1=class extends Error{constructor(r,e){var t;super(r),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((t=e.icebergType)==null?void 0:t.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function KQ(r,e,t){const n=new URL(e,r);if(t)for(const[s,i]of Object.entries(t))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function XQ(r){return!r||r.type==="none"?{}:r.type==="bearer"?{Authorization:`Bearer ${r.token}`}:r.type==="header"?{[r.name]:r.value}:r.type==="custom"?await r.getHeaders():{}}function YQ(r){const e=r.fetchImpl??globalThis.fetch;return{async request({method:t,path:n,query:s,body:i,headers:a}){const o=KQ(r.baseUrl,n,s),l=await XQ(r.auth),c=await e(o,{method:t,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),u=await c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),p=f&&u?JSON.parse(u):u;if(!c.ok){const m=f?p:void 0,x=m==null?void 0:m.error;throw new f1((x==null?void 0:x.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:m})}return{status:c.status,headers:c.headers,data:p}}}}function F_(r){return r.join("�")}var qQ=class{constructor(r,e=""){this.client=r,this.prefix=e}async listNamespaces(r){const e=r?{parent:F_(r.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(r,e){const t={namespace:r.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:t})).data}async dropNamespace(r){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${F_(r.namespace)}`})}async loadNamespaceMetadata(r){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${F_(r.namespace)}`})).data.properties}}async namespaceExists(r){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${F_(r.namespace)}`}),!0}catch(e){if(e instanceof f1&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(r,e){try{return await this.createNamespace(r,e)}catch(t){if(t instanceof f1&&t.status===409)return;throw t}}};function G0(r){return r.join("�")}var ZQ=class{constructor(r,e="",t){this.client=r,this.prefix=e,this.accessDelegation=t}async listTables(r){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables`})).data.identifiers}async createTable(r,e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables`,body:e,headers:t})).data.metadata}async updateTable(r,e){const t=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables/${r.name}`,body:e});return{"metadata-location":t.data["metadata-location"],metadata:t.data.metadata}}async dropTable(r,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables/${r.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(r){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables/${r.name}`,headers:e})).data.metadata}async tableExists(r){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${G0(r.namespace)}/tables/${r.name}`,headers:e}),!0}catch(t){if(t instanceof f1&&t.status===404)return!1;throw t}}async createTableIfNotExists(r,e){try{return await this.createTable(r,e)}catch(t){if(t instanceof f1&&t.status===409)return await this.loadTable({namespace:r.namespace,name:e.name});throw t}}},JQ=class{constructor(r){var n;let e="v1";r.catalogName&&(e+=`/${r.catalogName}`);const t=r.baseUrl.endsWith("/")?r.baseUrl:`${r.baseUrl}/`;this.client=YQ({baseUrl:t,auth:r.auth,fetchImpl:r.fetch}),this.accessDelegation=(n=r.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new qQ(this.client,e),this.tableOps=new ZQ(this.client,e,this.accessDelegation)}async listNamespaces(r){return this.namespaceOps.listNamespaces(r)}async createNamespace(r,e){return this.namespaceOps.createNamespace(r,e)}async dropNamespace(r){await this.namespaceOps.dropNamespace(r)}async loadNamespaceMetadata(r){return this.namespaceOps.loadNamespaceMetadata(r)}
463async listTables(r){return this.tableOps.listTables(r)}async createTable(r,e){return this.tableOps.createTable(r,e)}async updateTable(r,e){return this.tableOps.updateTable(r,e)}async dropTable(r,e){await this.tableOps.dropTable(r,e)}async loadTable(r){return this.tableOps.loadTable(r)}async namespaceExists(r){return this.namespaceOps.namespaceExists(r)}async tableExists(r){return this.tableOps.tableExists(r)}async createNamespaceIfNotExists(r,e){return this.namespaceOps.createNamespaceIfNotExists(r,e)}async createTableIfNotExists(r,e){return this.tableOps.createTableIfNotExists(r,e)}};function p1(r){"@babel/helpers - typeof";return p1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p1(r)}function QQ(r,e){if(p1(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(p1(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function eee(r){var e=QQ(r,"string");return p1(e)=="symbol"?e:e+""}function tee(r,e,t){return(e=eee(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function P3(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function Ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?P3(Object(t),!0).forEach(function(n){tee(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):P3(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var HE=class extends Error{constructor(r,e="storage",t,n){super(r),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function WE(r){return typeof r=="object"&&r!==null&&"__isStorageError"in r}var wN=class extends HE{constructor(r,e,t,n="storage"){super(r,n,e,t),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=t}toJSON(){return Ze({},super.toJSON())}},F6=class extends HE{constructor(r,e,t="storage"){super(r,t),this.name=t==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function eS(r,e,t){const n=Ze({},r),s=e.toLowerCase();for(const i of Object.keys(n))i.toLowerCase()===s&&delete n[i];return n[s]=t,n}function ree(r){const e={};for(const[t,n]of Object.entries(r))e[t.toLowerCase()]=n;return e}const nee=r=>r?(...e)=>r(...e):(...e)=>fetch(...e),see=r=>{if(typeof r!="object"||r===null)return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},bN=r=>{if(Array.isArray(r))return r.map(t=>bN(t));if(typeof r=="function"||r!==Object(r))return r;const e={};return Object.entries(r).forEach(([t,n])=>{const s=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=bN(n)}),e},iee=r=>!r||typeof r!="string"||r.length===0||r.length>100||r.trim()!==r||r.includes("/")||r.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(r),R3=r=>{var e;return r.msg||r.message||r.error_description||(typeof r.error=="string"?r.error:(e=r.error)===null||e===void 0?void 0:e.message)||JSON.stringify(r)},aee=async(r,e,t,n)=>{if(r!==null&&typeof r=="object"&&typeof r.json=="function"){const s=r;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||i+"";e(new wN(R3(a),i,o,n))}).catch(()=>{const a=i+"";e(new wN(s.statusText||`HTTP ${i} error`,i,a,n))})}else e(new F6(R3(r),r,n))},oee=(r,e,t,n)=>{const s={method:r,headers:(e==null?void 0:e.headers)||{}};if(r==="GET"||r==="HEAD"||!n)return Ze(Ze({},s),t);if(see(n)){var i;const a=(e==null?void 0:e.headers)||{};let o;for(const[l,c]of Object.entries(a))l.toLowerCase()==="content-type"&&(o=c);s.headers=eS(a,"Content-Type",(i=o)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),Ze(Ze({},s),t)};async function Ov(r,e,t,n,s,i,a){return new Promise((o,l)=>{r(t,oee(e,n,s,i)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(a==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>o(c)).catch(c=>aee(c,l,n,a))})}function D6(r="storage"){return{get:async(e,t,n,s)=>Ov(e,"GET",t,n,s,void 0,r),post:async(e,t,n,s,i)=>Ov(e,"POST",t,s,i,n,r),put:async(e,t,n,s,i)=>Ov(e,"PUT",t,s,i,n,r),head:async(e,t,n,s)=>Ov(e,"HEAD",t,Ze(Ze({},n),{},{noResolveJson:!0}),s,void 0,r),remove:async(e,t,n,s,i)=>Ov(e,"DELETE",t,s,i,n,r)}}const lee=D6("storage"),{get:m1,post:wo,put:_N,head:cee,remove:oj}=lee,la=D6("vectors");var uv=class{constructor(r,e={},t,n="storage"){this.shouldThrowOnError=!1,this.url=r,this.headers=ree(e),this.fetch=nee(t),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(r,e){return this.headers=eS(this.headers,r,e),this}async handleOperation(r){var e=this;try{return{data:await r(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(WE(t))return{data:null,error:t};throw t}}},uee=class{constructor(r,e){this.downloadFn=r,this.shouldThrowOnError=e}then(r,e){return this.execute().then(r,e)}async execute(){var r=this;try{return{data:(await r.downloadFn()).body,error:null}}catch(e){if(r.shouldThrowOnError)throw e;if(WE(e))return{data:null,error:e};throw e}}};let M6;M6=Symbol.toStringTag;var dee=class{constructor(r,e){this.downloadFn=r,this.shouldThrowOnError=e,this[M6]="BlobDownloadBuilder",this.promise=null}asStream(){return new uee(this.downloadFn,this.shouldThrowOnError)}then(r,e){return this.getPromise().then(r,e)}catch(r){return this.getPromise().catch(r)}finally(r){return this.getPromise().finally(r)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var r=this;try{return{data:await(await r.downloadFn()).blob(),error:null}}catch(e){if(r.shouldThrowOnError)throw e;if(WE(e))return{data:null,error:e};throw e}}};const hee={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},j3={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var fee=class extends uv{constructor(r,e={},t,n){super(r,e,n,"storage"),this.bucketId=t}async uploadOrUpdate(r,e,t,n){var s=this;return s.handleOperation(async()=>{let i;const a=Ze(Ze({},j3),n);let o=Ze(Ze({},s.headers),r==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;if(typeof Blob<"u"&&t instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",t)):typeof FormData<"u"&&t instanceof FormData?(i=t,i.has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=t,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers)for(const[p,m]of Object.entries(n.headers))o=eS(o,p,m);const c=s._removeEmptyFolders(e),u=s._getFinalPath(c),f=await(r=="PUT"?_N:wo)(s.fetch,`${s.url}/object/${u}`,i,Ze({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:c,id:f.Id,fullPath:f.Key}})}async upload(r,e,t){return this.uploadOrUpdate("POST",r,e,t)}async uploadToSignedUrl(r,e,t,n){var s=this;const i=s._removeEmptyFolders(r),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),s.handleOperation(async()=>{let l;const c=Ze(Ze({},j3),n);let u=Ze(Ze({},s.headers),{"x-upsert":String(c.upsert)});const f=c.metadata;if(typeof Blob<"u"&&t instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),f&&l.append("metadata",s.encodeMetadata(f)),l.append("",t)):typeof FormData<"u"&&t instanceof FormData?(l=t,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),f&&!l.has("metadata")&&l.a
463ppend("metadata",s.encodeMetadata(f))):(l=t,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,f&&(u["x-metadata"]=s.toBase64(s.encodeMetadata(f))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!c.duplex&&(c.duplex="half")),n!=null&&n.headers)for(const[p,m]of Object.entries(n.headers))u=eS(u,p,m);return{path:i,fullPath:(await _N(s.fetch,o.toString(),l,Ze({headers:u},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(r,e){var t=this;return t.handleOperation(async()=>{let n=t._getFinalPath(r);const s=Ze({},t.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await wo(t.fetch,`${t.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(t.url+i.url),o=a.searchParams.get("token");if(!o)throw new HE("No token returned by API");return{signedUrl:a.toString(),path:r,token:o}})}async update(r,e,t){return this.uploadOrUpdate("PUT",r,e,t)}async move(r,e,t){var n=this;return n.handleOperation(async()=>await wo(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:r,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:n.headers}))}async copy(r,e,t){var n=this;return n.handleOperation(async()=>({path:(await wo(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:r,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(r,e,t){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(r);const i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0;let a=await wo(n.fetch,`${n.url}/object/sign/${s}`,Ze({expiresIn:e},i?{transform:t.transform}:{}),{headers:n.headers});const o=new URLSearchParams;t!=null&&t.download&&o.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const l=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(r,e,t){var n=this;return n.handleOperation(async()=>{const s=await wo(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:r},{headers:n.headers}),i=new URLSearchParams;t!=null&&t.download&&i.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&i.set("cacheNonce",String(t.cacheNonce));const a=i.toString();return s.map(o=>Ze(Ze({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${a?`&${a}`:""}`):null}))})}download(r,e,t){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const i=s.toString(),a=this._getFinalPath(r),o=()=>m1(this.fetch,`${this.url}/${n}/${a}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},t);return new dee(o,this.shouldThrowOnError)}async info(r){var e=this;const t=e._getFinalPath(r);return e.handleOperation(async()=>bN(await m1(e.fetch,`${e.url}/object/info/${t}`,{headers:e.headers})))}async exists(r){var e=this;const t=e._getFinalPath(r);try{return await cee(e.fetch,`${e.url}/object/${t}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(WE(s)){var n;const i=s instanceof wN?s.status:s instanceof F6?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(r,e){const t=this._getFinalPath(r),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${t}`)+(s?`?${s}`:"")}}}async remove(r){var e=this;return e.handleOperation(async()=>await oj(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:r},{headers:e.headers}))}async list(r,e,t){var n=this;return n.handleOperation(async()=>{const s=Ze(Ze(Ze({},hee),e),{},{prefix:r||""});return await wo(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},t)})}async listV2(r,e){var t=this;return t.handleOperation(async()=>{const n=Ze({},r);return await wo(t.fetch,`${t.url}/object/list-v2/${t.bucketId}`,n,{headers:t.headers},e)})}encodeMetadata(r){return JSON.stringify(r)}toBase64(r){return typeof Buffer<"u"?Buffer.from(r).toString("base64"):btoa(r)}_getFinalPath(r){return`${this.bucketId}/${r.replace(/^\/+/,"")}`}_removeEmptyFolders(r){return r.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(r,e){return e.width&&r.set("width",e.width.toString()),e.height&&r.set("height",e.height.toString()),e.resize&&r.set("resize",e.resize),e.format&&r.set("format",e.format),e.quality&&r.set("qual
463ity",e.quality.toString()),r}};const pee="2.105.1",Wb={"X-Client-Info":`storage-js/${pee}`};var mee=class extends uv{constructor(r,e={},t,n){const s=new URL(r);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),a=Ze(Ze({},Wb),e);super(i,a,t,"storage")}async listBuckets(r){var e=this;return e.handleOperation(async()=>{const t=e.listBucketOptionsToQueryString(r);return await m1(e.fetch,`${e.url}/bucket${t}`,{headers:e.headers})})}async getBucket(r){var e=this;return e.handleOperation(async()=>await m1(e.fetch,`${e.url}/bucket/${r}`,{headers:e.headers}))}async createBucket(r,e={public:!1}){var t=this;return t.handleOperation(async()=>await wo(t.fetch,`${t.url}/bucket`,{id:r,name:r,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async updateBucket(r,e){var t=this;return t.handleOperation(async()=>await _N(t.fetch,`${t.url}/bucket/${r}`,{id:r,name:r,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async emptyBucket(r){var e=this;return e.handleOperation(async()=>await wo(e.fetch,`${e.url}/bucket/${r}/empty`,{},{headers:e.headers}))}async deleteBucket(r){var e=this;return e.handleOperation(async()=>await oj(e.fetch,`${e.url}/bucket/${r}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(r){const e={};return r&&("limit"in r&&(e.limit=String(r.limit)),"offset"in r&&(e.offset=String(r.offset)),r.search&&(e.search=r.search),r.sortColumn&&(e.sortColumn=r.sortColumn),r.sortOrder&&(e.sortOrder=r.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},gee=class extends uv{constructor(r,e={},t){const n=r.replace(/\/$/,""),s=Ze(Ze({},Wb),e);super(n,s,t,"storage")}async createBucket(r){var e=this;return e.handleOperation(async()=>await wo(e.fetch,`${e.url}/bucket`,{name:r},{headers:e.headers}))}async listBuckets(r){var e=this;return e.handleOperation(async()=>{const t=new URLSearchParams;(r==null?void 0:r.limit)!==void 0&&t.set("limit",r.limit.toString()),(r==null?void 0:r.offset)!==void 0&&t.set("offset",r.offset.toString()),r!=null&&r.sortColumn&&t.set("sortColumn",r.sortColumn),r!=null&&r.sortOrder&&t.set("sortOrder",r.sortOrder),r!=null&&r.search&&t.set("search",r.search);const n=t.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await m1(e.fetch,s,{headers:e.headers})})}async deleteBucket(r){var e=this;return e.handleOperation(async()=>await oj(e.fetch,`${e.url}/bucket/${r}`,{},{headers:e.headers}))}from(r){var e=this;if(!iee(r))throw new HE("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const t=new JQ({baseUrl:this.url,catalogName:r,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(t,{get(s,i){const a=s[i];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(s,o),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},xee=class extends uv{constructor(r,e={},t){const n=r.replace(/\/$/,""),s=Ze(Ze({},Wb),{},{"Content-Type":"application/json"},e);super(n,s,t,"vectors")}async createIndex(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/CreateIndex`,r,{headers:e.headers})||{})}async getIndex(r,e){var t=this;return t.handleOperation(async()=>await la.post(t.fetch,`${t.url}/GetIndex`,{vectorBucketName:r,indexName:e},{headers:t.headers}))}async listIndexes(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/ListIndexes`,r,{headers:e.headers}))}async deleteIndex(r,e){var t=this;return t.handleOperation(async()=>await la.post(t.fetch,`${t.url}/DeleteIndex`,{vectorBucketName:r,indexName:e},{headers:t.headers})||{})}},vee=class extends uv{constructor(r,e={},t){const n=r.replace(/\/$/,""),s=Ze(Ze({},Wb),{},{"Content-Type":"application/json"},e);super(n,s,t,"vectors")}async putVectors(r){var e=this;if(r.vectors.length<1||r.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/PutVectors`,r,{headers:e.headers})||{})}async getVectors(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/GetVectors`,r,{headers:e.headers}))}async listVectors(r){var e=this;if(r.segmentCount!==void 0){if(r.segmentCount<1||r.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
463if(r.segmentIndex!==void 0&&(r.segmentIndex<0||r.segmentIndex>=r.segmentCount))throw new Error(`segmentIndex must be between 0 and ${r.segmentCount-1}`)}return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/ListVectors`,r,{headers:e.headers}))}async queryVectors(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/QueryVectors`,r,{headers:e.headers}))}async deleteVectors(r){var e=this;if(r.keys.length<1||r.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/DeleteVectors`,r,{headers:e.headers})||{})}},yee=class extends uv{constructor(r,e={},t){const n=r.replace(/\/$/,""),s=Ze(Ze({},Wb),{},{"Content-Type":"application/json"},e);super(n,s,t,"vectors")}async createBucket(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:r},{headers:e.headers})||{})}async getBucket(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:r},{headers:e.headers}))}async listBuckets(r={}){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/ListVectorBuckets`,r,{headers:e.headers}))}async deleteBucket(r){var e=this;return e.handleOperation(async()=>await la.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:r},{headers:e.headers})||{})}},wee=class extends yee{constructor(r,e={}){super(r,e.headers||{},e.fetch)}from(r){return new bee(this.url,this.headers,r,this.fetch)}async createBucket(r){var e=()=>super.createBucket,t=this;return e().call(t,r)}async getBucket(r){var e=()=>super.getBucket,t=this;return e().call(t,r)}async listBuckets(r={}){var e=()=>super.listBuckets,t=this;return e().call(t,r)}async deleteBucket(r){var e=()=>super.deleteBucket,t=this;return e().call(t,r)}},bee=class extends xee{constructor(r,e,t,n){super(r,e,n),this.vectorBucketName=t}async createIndex(r){var e=()=>super.createIndex,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName}))}async listIndexes(r={}){var e=()=>super.listIndexes,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName}))}async getIndex(r){var e=()=>super.getIndex,t=this;return e().call(t,t.vectorBucketName,r)}async deleteIndex(r){var e=()=>super.deleteIndex,t=this;return e().call(t,t.vectorBucketName,r)}index(r){return new _ee(this.url,this.headers,this.vectorBucketName,r,this.fetch)}},_ee=class extends vee{constructor(r,e,t,n,s){super(r,e,s),this.vectorBucketName=t,this.indexName=n}async putVectors(r){var e=()=>super.putVectors,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async getVectors(r){var e=()=>super.getVectors,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async listVectors(r={}){var e=()=>super.listVectors,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async queryVectors(r){var e=()=>super.queryVectors,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async deleteVectors(r){var e=()=>super.deleteVectors,t=this;return e().call(t,Ze(Ze({},r),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}},kee=class extends mee{constructor(r,e={},t,n){super(r,e,t,n)}from(r){return new fee(this.url,this.headers,r,this.fetch)}get vectors(){return new wee(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new gee(this.url+"/iceberg",this.headers,this.fetch)}};function VE(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}const I6="2.105.1",am=30*1e3,kN=3,pT=kN*am,See="http://localhost:9999",Eee="supabase.auth.token",Aee={"X-Client-Info":`gotrue-js/${I6}`},SN="X-Supabase-Api-Version",L6={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Tee=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Cee=10*60*1e3;
463class g1 extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Oe(r){return typeof r=="object"&&r!==null&&"__isAuthError"in r}class Nee extends g1{constructor(e,t,n){super(e,t,n),this.name="AuthApiError",this.status=t,this.code=n}}function Pee(r){return Oe(r)&&r.name==="AuthApiError"}class Lo extends g1{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class Fu extends g1{constructor(e,t,n,s){super(e,n,s),this.name=t,this.status=n}}class jn extends Fu{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function D_(r){return Oe(r)&&r.name==="AuthSessionMissingError"}class K0 extends Fu{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class M_ extends Fu{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class I_ extends Fu{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Ree(r){return Oe(r)&&r.name==="AuthImplicitGrantRedirectError"}class O3 extends Fu{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class jee extends Fu{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class EN extends Fu{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function mT(r){return Oe(r)&&r.name==="AuthRetryableFetchError"}class F3 extends Fu{constructor(e,t,n){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class AN extends Fu{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const tS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),D3=` 464\r=`.split(""),Oee=(()=>{const r=new Array(128);for(let e=0;e<r.length;e+=1)r[e]=-1;for(let e=0;e<D3.length;e+=1)r[D3[e].charCodeAt(0)]=-2;for(let e=0;e<tS.length;e+=1)r[tS[e].charCodeAt(0)]=e;return r})();function M3(r,e,t){if(r!==null)for(e.queue=e.queue<<8|r,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;t(tS[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;t(tS[n]),e.queuedBits-=6}}function B6(r,e,t){const n=Oee[r];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(r)}"`)}}function I3(r){const e=[],t=a=>{e.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=a=>{Mee(a,n,t)};for(let a=0;a<r.length;a+=1)B6(r.charCodeAt(a),s,i);return e.join("")}function Fee(r,e){if(r<=127){e(r);return}else if(r<=2047){e(192|r>>6),e(128|r&63);return}else if(r<=65535){e(224|r>>12),e(128|r>>6&63),e(128|r&63);return}else if(r<=1114111){e(240|r>>18),e(128|r>>12&63),e(128|r>>6&63),e(128|r&63);return}throw new Error(`Unrecognized Unicode codepoint: ${r.toString(16)}`)}function Dee(r,e){for(let t=0;t<r.length;t+=1){let n=r.charCodeAt(t);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(r.charCodeAt(t+1)-56320&65535|s)+65536,t+=1}Fee(n,e)}}function Mee(r,e,t){if(e.utf8seq===0){if(r<=127){t(r);return}for(let n=1;n<6;n+=1)if(!(r>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=r&31;else if(e.utf8seq===3)e.codepoint=r&15;else if(e.utf8seq===4)e.codepoint=r&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(r<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|r&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function $m(r){const e=[],t={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<r.length;s+=1)B6(r.charCodeAt(s),t,n);return new Uint8Array(e)}function Iee(r){const e=[];return Dee(r,t=>
464e.push(t)),new Uint8Array(e)}function Sf(r){const e=[],t={queue:0,queuedBits:0},n=s=>{e.push(s)};return r.forEach(s=>M3(s,t,n)),M3(null,t,n),e.join("")}function Lee(r){return Math.round(Date.now()/1e3)+r}function Bee(){return Symbol("auth-callback")}const Zn=()=>typeof window<"u"&&typeof document<"u",nf={tested:!1,writable:!1},U6=()=>{if(!Zn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(nf.tested)return nf.writable;const r=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(r,r),globalThis.localStorage.removeItem(r),nf.tested=!0,nf.writable=!0}catch{nf.tested=!0,nf.writable=!1}return nf.writable};function Uee(r){const e={},t=new URL(r);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return t.searchParams.forEach((n,s)=>{e[s]=n}),e}const $6=r=>r?(...e)=>r(...e):(...e)=>fetch(...e),$ee=r=>typeof r=="object"&&r!==null&&"status"in r&&"ok"in r&&"json"in r&&typeof r.json=="function",om=async(r,e,t)=>{await r.setItem(e,JSON.stringify(t))},sf=async(r,e)=>{const t=await r.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},qn=async(r,e)=>{await r.removeItem(e)};class GE{constructor(){this.promise=new GE.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}GE.promiseConstructor=Promise;function L_(r){const e=r.split(".");if(e.length!==3)throw new AN("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!Tee.test(e[n]))throw new AN("JWT not in base64url format");return{header:JSON.parse(I3(e[0])),payload:JSON.parse(I3(e[1])),signature:$m(e[2]),raw:{header:e[0],payload:e[1]}}}async function zee(r){return await new Promise(e=>{setTimeout(()=>e(null),r)})}function Hee(r,e){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const a=await r(i);if(!e(i,null,a)){n(a);return}}catch(a){if(!e(i,a)){s(a);return}}})()})}function Wee(r){return("0"+r.toString(16)).substr(-2)}function Vee(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=t.length;let s="";for(let i=0;i<56;i++)s+=t.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,Wee).join("")}async function Gee(r){const t=new TextEncoder().encode(r),n=await crypto.subtle.digest("SHA-256",t),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function Kee(r){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),r;const t=await Gee(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function X0(r,e,t=!1){const n=Vee();let s=n;t&&(s+="/recovery"),await om(r,`${e}-code-verifier`,s);const i=await Kee(n);return[i,n===i?"plain":"s256"]}const Xee=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Yee(r){const e=r.headers.get(SN);if(!e||!e.match(Xee))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function qee(r){if(!r)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(r<=e)throw new Error("JWT has expired")}function Zee(r){switch(r){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Jee=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function dc(r){if(!Jee.test(r))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function go(r){if(!r.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function gT(){const r={};return new Proxy(r,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const n=t.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Qee(r,e){return new Proxy(r,{get:(t,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
464if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(t,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(t,n,s)}})}function L3(r){return JSON.parse(JSON.stringify(r))}const uf=r=>r.msg||r.message||r.error_description||r.error||JSON.stringify(r),ete=[502,503,504,520,521,522,523,524,530];async function B3(r){var e;if(!$ee(r))throw new EN(uf(r),0);if(ete.includes(r.status))throw new EN(uf(r),r.status);let t;try{t=await r.json()}catch(i){throw new Lo(uf(i),i)}let n;const s=Yee(r);if(s&&s.getTime()>=L6["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?n=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(n=t.error_code),n){if(n==="weak_password")throw new F3(uf(t),r.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new jn}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,a)=>i&&typeof a=="string",!0))throw new F3(uf(t),r.status,t.weak_password.reasons);throw new Nee(uf(t),r.status||500,n)}const tte=(r,e,t,n)=>{const s={method:r,headers:(e==null?void 0:e.headers)||{}};return r==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),t))};async function ze(r,e,t,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[SN]||(i[SN]=L6["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const a=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await rte(r,e,t+o,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function rte(r,e,t,n,s,i){const a=tte(e,n,s,i);let o;try{o=await r(t,Object.assign({},a))}catch(l){throw console.error(l),new EN(uf(l),0)}if(o.ok||await B3(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(l){await B3(l)}}function Ea(r){var e;let t=null;ite(r)&&(t=Object.assign({},r),r.expires_at||(t.expires_at=Lee(r.expires_in)));const n=(e=r.user)!==null&&e!==void 0?e:r;return{data:{session:t,user:n},error:null}}function U3(r){const e=Ea(r);return!e.error&&r.weak_password&&typeof r.weak_password=="object"&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.message&&typeof r.weak_password.message=="string"&&r.weak_password.reasons.reduce((t,n)=>t&&typeof n=="string",!0)&&(e.data.weak_password=r.weak_password),e}function rd(r){var e;return{data:{user:(e=r.user)!==null&&e!==void 0?e:r},error:null}}function nte(r){return{data:r,error:null}}function ste(r){const{action_link:e,email_otp:t,hashed_token:n,redirect_to:s,verification_type:i}=r,a=VE(r,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:t,hashed_token:n,redirect_to:s,verification_type:i},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function $3(r){return r}function ite(r){return r.access_token&&r.refresh_token&&r.expires_in}const xT=["global","local","others"];class ate{constructor({url:e="",headers:t={},fetch:n,experimental:s}){this.url=e,this.headers=t,this.fetch=$6(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=xT[0]){if(xT.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${xT.join(", ")}`);try{return await ze(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Oe(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,t={}){try{return await ze(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:rd})}catch(n){if(Oe(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:t}=e,n=VE(e,["options"]),s=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await ze(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:ste,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(Oe(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await ze(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:rd})}catch(t){if(Oe(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,n,s,i,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},u=await ze(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:$3});if(u.error)throw u.error;const f=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(x.split(";")[1].split("=")[1]);c[`${y}Page`]=g}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(Oe(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){dc(e);try{return await ze(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:rd})}catch(t){if(Oe(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){dc(e);try{return await ze(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:rd})}catch(n){if(Oe(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,t=!1){dc(e);
464try{return await ze(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:rd})}catch(n){if(Oe(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){dc(e.userId);try{const{data:t,error:n}=await ze(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:t,error:n}}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _deleteFactor(e){dc(e.userId),dc(e.id);try{return{data:await ze(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,n,s,i,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},u=await ze(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:$3});if(u.error)throw u.error;const f=await u.json(),p=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(x.split(";")[1].split("=")[1]);c[`${y}Page`]=g}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(Oe(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await ze(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await ze(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await ze(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Oe(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await ze(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await ze(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _listCustomProviders(e){try{const t={};return e!=null&&e.type&&(t.type=e.type),await ze(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(t){if(Oe(t))return{data:{providers:[]},error:t};throw t}}async _createCustomProvider(e){try{return await ze(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _getCustomProvider(e){try{return await ze(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _updateCustomProvider(e,t){try{return await ze(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Oe(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await ze(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _adminListPasskeys(e){go(this.experimental),dc(e.userId);try{return await ze(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(Oe(t))return{data:null,error:t};throw t}}async _adminDeletePasskey(e){go(this.experimental),dc(e.userId),dc(e.passkeyId);
464try{return await ze(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(Oe(t))return{data:null,error:t};throw t}}}function z3(r={}){return{getItem:e=>r[e]||null,setItem:(e,t)=>{r[e]=t},removeItem:e=>{delete r[e]}}}const ol={debug:!!(globalThis&&U6()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class z6 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class H3 extends z6{}async function ote(r,e,t){ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",r,e);const n=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{n.abort(),ol.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",r)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(r,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){clearTimeout(s),ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",r,i.name);try{return await t()}finally{ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",r,i.name)}}else{if(e===0)throw ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",r),new H3(`Acquiring an exclusive Navigator LockManager lock "${r}" immediately failed`);if(ol.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await t()}})}catch(i){if(e>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&e>0){if(n.signal.aborted)return ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",r),console.warn(`@supabase/gotrue-js: Lock "${r}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(r,{mode:"exclusive",steal:!0},async a=>{if(a){ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",r,a.name);try{return await t()}finally{ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",r,a.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await t()}));throw ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",r),new H3(`Lock "${r}" was released because another request stole it`)}throw i}}function lte(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function H6(r){if(!/^0x[a-fA-F0-9]{40}$/.test(r))throw new Error(`@supabase/auth-js: Address "${r}" is invalid.`);return r.toLowerCase()}function cte(r){return parseInt(r,16)}function ute(r){const e=new TextEncoder().encode(r);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function dte(r){var e;const{chainId:t,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:c,scheme:u,uri:f,version:p}=r;{if(!Number.isInteger(t))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);
464if(!((e=r.statement)===null||e===void 0)&&e.includes(` 465`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${r.statement}`)}const m=H6(r.address),x=u?`${u}://${n}`:n,g=r.statement?`${r.statement} 466`:"",y=`${x} wants you to sign in with your Ethereum account: 467${m} 468 469${g}`;let v=`URI: ${f} 470Version: ${p} 471Chain ID: ${t}${a?` 472Nonce: ${a}`:""} 473Issued At: ${i.toISOString()}`;if(s&&(v+=` 474Expiration Time: ${s.toISOString()}`),o&&(v+=` 475Not Before: ${o.toISOString()}`),l&&(v+=` 476Request ID: ${l}`),c){let w=` 477Resources:`;for(const b of c){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);w+=` 478- ${b}`}v+=w}return`${y} 479${v}`}class wn extends Error{constructor({message:e,code:t,cause:n,name:s}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=t}}class rS extends wn{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function hte({error:r,options:e}){var t,n,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(e.signal instanceof AbortSignal)return new wn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else if(r.name==="ConstraintError"){if(((t=i.authenticatorSelection)===null||t===void 0?void 0:t.requireResidentKey)===!0)return new wn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:r});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new wn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:r});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new wn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:r})}else{if(r.name==="InvalidStateError")return new wn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:r});if(r.name==="NotAllowedError")return new wn({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="NotSupportedError")return i.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new wn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:r}):new wn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:r});if(r.name==="SecurityError"){const a=window.location.hostname;if(W6(a)){if(i.rp.id!==a)return new wn({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new wn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new wn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:r})}else if(r.name==="UnknownError")return new wn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:r})}return new wn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}function fte({error:r,options:e}){const{publicKey:t}=e;if(!t)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(e.signal instanceof AbortSignal)return new wn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else{if(r.name==="NotAllowedError")return new wn({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="SecurityError"){const n=window.location.hostname;if(W6(n)){if(t.rpId!==n)return new wn({message:`The RP ID "${t.rpId}
479" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new wn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.name==="UnknownError")return new wn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:r})}return new wn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}class pte{createNewAbortSignal(){if(this.controller){const t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const TN=new pte;function W3(r){if(!r)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(r);const{challenge:e,user:t,excludeCredentials:n}=r,s=VE(r,["challenge","user","excludeCredentials"]),i=$m(e).buffer,a=Object.assign(Object.assign({},t),{id:$m(t.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const c=n[l];o.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:$m(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function V3(r){if(!r)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(r);const{challenge:e,allowCredentials:t}=r,n=VE(r,["challenge","allowCredentials"]),s=$m(e).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(t&&t.length>0){i.allowCredentials=new Array(t.length);for(let a=0;a<t.length;a++){const o=t[a];i.allowCredentials[a]=Object.assign(Object.assign({},o),{id:$m(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return i}function G3(r){var e;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const t=r;return{id:r.id,rawId:r.id,response:{attestationObject:Sf(new Uint8Array(r.response.attestationObject)),clientDataJSON:Sf(new Uint8Array(r.response.clientDataJSON))},type:"public-key",clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function K3(r){var e;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const t=r,n=r.getClientExtensionResults(),s=r.response;return{id:r.id,rawId:r.id,response:{authenticatorData:Sf(new Uint8Array(s.authenticatorData)),clientDataJSON:Sf(new Uint8Array(s.clientDataJSON)),signature:Sf(new Uint8Array(s.signature)),userHandle:s.userHandle?Sf(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function W6(r){return r==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(r)}function nS(){var r,e;return!!(Zn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((r=navigator==null?void 0:navigator.credentials)===null||r===void 0?void 0:r.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function V6(r){try{const e=await navigator.credentials.create(r);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new rS("Browser returned unexpected credential type",e)}:{data:null,error:new rS("Empty credential response",e)}}catch(e){return{data:null,error:hte({error:e,options:r})}}}async function G6(r){try{const e=await navigator.credentials.get(r);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new rS("Browser returned unexpected credential type",e)}:{data:null,error:new rS("Empty credential response",e)}}catch(e){return{data:null,error:fte({error:e,options:r})}}}const mte={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},gte={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function sS(...r){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of r)if(s)for(const i in s){const a=s[i];if(a!==void 0)if(Array.isArray(a))n[i]=a;else if(t(a))n[i]=a;else if(e(a)){const o=n[i];e(o)?n[i]=sS(o,a):n[i]=sS(a)}else n[i]=a}return n}function xte(r,e){return sS(mte,r,e||{})}function vte(r,e){return sS(gte,r,e||{})}class yte{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:s},i){var a;try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:l};const c=s??TN.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;if(!u.name){const f=n;if(f)u.name=`${u.id}:${f}`;else{const m=(await this.client.getUser()).data.user,x=((a=m==null?void 0:m.user_metadata)===null||a===void 0?void 0:a.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";u.name=`${u.id}:${x}`}}u.displayName||(u.displayName=u.name)}
479switch(o.webauthn.type){case"create":{const u=xte(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:p}=await V6({publicKey:u,signal:c});return f?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}case"request":{const u=vte(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:p}=await G6(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:c}));return f?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}}}catch(o){return Oe(o)?{data:null,error:o}:{data:null,error:new Lo("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!t)return{data:null,error:new g1("rpId is required for WebAuthn authentication")};try{if(!nS())return{data:null,error:new Lo("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:s},{request:i});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:t,rpOrigins:n,credential_response:l.credential_response}})}catch(a){return Oe(a)?{data:null,error:a}:{data:null,error:new Lo("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!t)return{data:null,error:new g1("rpId is required for WebAuthn registration")};try{if(!nS())return{data:null,error:new Lo("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(u=>{var f;return(f=u.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:o};const{data:l,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:s},{create:i});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:t,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(a){return Oe(a)?{data:null,error:a}:{data:null,error:new Lo("Unexpected error in register",a)}}}}lte();const wte={url:See,storageKey:Eee,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Aee,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function X3(r,e,t){return await t()}const Y0={};class x1{get jwks(){var e,t;return(t=(e=Y0[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){Y0[this.storageKey]=Object.assign(Object.assign({},Y0[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=Y0[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Y0[this.storageKey]=Object.assign(Object.assign({},Y0[this.storageKey]),{cachedAt:e})}constructor(e){var t,n,s,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},wte),e);if(this.storageKey=a.storageKey,this.instanceID=(t=x1.nextInstanceID[this.storageKey])!==null&&t!==void 0?t:0,x1.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Zn()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.experimental=(n=a.experimental)!==null&&n!==void 0?n:{},this.admin=new ate({url:a.url,headers:a.headers,fetch:a.fetch,experimental:this.experimental}),this.url=a.url,this.headers=a.headers,this.fetch=$6(a.fetch),this.lock=a.lock||X3,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Zn()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=ote:this.lock=X3,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new yte(this)}
479,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:U6()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=z3(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=z3(this.memoryStorage)),Zn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}a.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${I6}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let t={},n="none";if(Zn()&&(t=Uee(window.location.href),this._isImplicitGrantCallback(t)?n="implicit":await this._isPKCECallback(t)&&(n="pkce")),Zn()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(t,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Ree(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:a,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return Oe(t)?this._returnResult({error:t}):this._returnResult({error:new Lo("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,n,s;try{const i=await ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ea}),{data:a,error:o}=i;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(Oe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var t,n,s;try{let i;if("email"in e){const{email:u,password:f,options:p}=e;let m=null,x=null;this.flowType==="pkce"&&([m,x]=await X0(this.storage,this.storageKey)),i=await ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:f,data:(t=p==null?void 0:p.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:x},xform:Ea})}else if("phone"in e){const{phone:u,password:f,options:p}=e;i=await ze(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Ea})}else throw new M_("You must provide either an email or phone number and a password");const{data:a,error:o}=i;if(o||!a)return await qn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:a,options:o}=e;t=await ze(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:U3})}else if("phone"in e){const{phone:i,password:a,options:o}=e;t=await ze(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:U3})}else throw new M_("You must provide either an email or phone number and a password");const{data:n,error:s}=t;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new K0;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(t){if(Oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,n,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,n,s,i,a,o,l,c,u,f,p;let m,x;if("message"in e)m=e.message,x=e.signature;else{const{chain:g,wallet:y,statement:v,options:w}=e;let b;if(Zn())if(typeof y=="object")b=y;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")b=E.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=y}const _=new URL((t=w==null?void 0:w.url)!==null&&t!==void 0?t:window.location.href),T=await b.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!T||T.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const A=H6(T[0]);let N=(n=w==null?void 0:w.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const E=await b.request({method:"eth_chainId"});N=cte(E)}const k={domain:_.host,address:A,statement:v,uri:_.href,version:"1",chainId:N,nonce:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=w==null?void 0:w.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=w==null?void 0:w.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=dte(k),x=await b.request({method:"personal_sign",params:[ute(m),A]})}try{const{data:g,error:y}=await ze(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:x},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ea});if(y)throw y;if(!g||!g.session||!g.user){const v=new K0;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(Oe(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var t,n,s,i,a,o,l,c,u,f,p,m;let x,g;if("message"in e)x=e.message,g=e.signature;else{const{chain:y,wallet:v,statement:w,options:b}=e;let _;if(Zn())if(typeof v=="object")_=v;else{const A=window;if("solana"in A&&typeof A.solana=="object"&&("signIn"in A.solana&&typeof A.solana.signIn=="function"||"signMessage"in A.solana&&typeof A.solana.signMessage=="function"))_=A.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=v}const T=new URL((t=b==null?void 0:b.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in _&&_.signIn){const A=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:T.host,uri:T.href}),w?{statement:w}:null));let N;if(Array.isArray(A)&&A[0]&&typeof A[0]=="object")N=A[0];else if(A&&typeof A=="object"&&"signedMessage"in A&&"signature"in A)N=A;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)x=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),g=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${T.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${T.href}`,`Issued At: ${(s=(n=b==null?void 0:b.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=b==null?void 0:b.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((f=(u=b==null?void 0:b.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...b.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(` 480`);const A=await _.signMessage(new TextEncoder().encode(x),"utf8");if(!A||!(A instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=A}}try{const{data:y,error:v}=await ze(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:Sf(g)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Ea});if(v)throw v;if(!y||!y.session||!y.user){const w=new K0;return this._returnResult({data:{user:null,session:null},error:w})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:v})}catch(y){if(Oe(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(e){const t=await sf(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(t??"").split("/");try{if(!n&&this.flowType==="pkce")throw new jee;const{data:i,error:a}=await ze(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Ea});if(await qn(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!i||!i.session||!i.user){const o=new K0;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:a})}catch(i){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:t,provider:n,token:s,access_token:i,nonce:a}=e,o=await ze(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:Ea}),{data:l,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new K0;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(t){if(Oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,n,s,i,a;try{if("email"in e){const{email:o,options:l}=e;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await X0(this.storage,this.storageKey));const{error:f}=await ze(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(t=l==null?void 0:l.data)!==null&&t!==void 0?t:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_meth
480od:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:o,options:l}=e,{data:c,error:u}=await ze(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new M_("You must provide either an email or phone number.")}catch(o){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,n;try{let s,i;"options"in e&&(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:o}=await ze(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Ea});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,c=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(Oe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var t,n,s,i,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await X0(this.storage,this.storageKey));const c=await ze(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:nte});return!((i=c.data)===null||i===void 0)&&i.url&&Zn()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new jn;const{error:s}=await ze(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(Oe(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:i}=e,{error:a}=await ze(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:n,type:s,options:i}=e,{data:a,error:o}=await ze(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new M_("You must provide either an email or phone number and a type")}catch(t){if(Oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=t();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await sf(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not val
480id"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<pT:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const a=await sf(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=gT()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=Qee(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await ze(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:rd}):await this._useSession(async t=>{var n,s,i;const{data:a,error:o}=t;if(o)throw o;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new jn}:await ze(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:rd})})}catch(t){if(Oe(t))return D_(t)&&(await this._removeSession(),await qn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new jn;const a=s.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await X0(this.storage,this.storageKey));const{data:c,error:u}=await ze(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:rd});if(u)throw u;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new jn;const t=Date.now()/1e3;let n=t,s=!0,i=null;const{payload:a}=L_(e.access_token);if(a.exp&&(n=a.exp,s=n<=t),s){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});i={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(t){if(Oe(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var n;if(!e){const{data:a,error:o}=t;if(o)throw o;e=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new jn;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(Oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){var n;
480try{if(!Zn())throw new I_("No browser detected.");if(e.error||e.error_description||e.error_code)throw new I_(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new O3("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new I_("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new O3("No code detected.");const{data:b,error:_}=await this._exchangeCodeForSession(e.code);if(_)throw _;const T=new URL(window.location.href);return T.searchParams.delete("code"),window.history.replaceState(window.history.state,"",T.toString()),{data:{session:b.session,redirectType:(n=b.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=e;if(!a||!l||!o||!u)throw new I_("No session defined in URL");const f=Math.round(Date.now()/1e3),p=parseInt(l);let m=f+p;c&&(m=parseInt(c));const x=m-f;x*1e3<=am&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${p}s`);const g=m-p;f-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,m,f):f-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,m,f);const{data:y,error:v}=await this._getUser(a);if(v)throw v;const w={provider_token:s,provider_refresh_token:i,access_token:a,expires_in:p,expires_at:m,refresh_token:o,token_type:u,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:e.type},error:null})}catch(s){if(Oe(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await sf(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var n;const{data:s,error:i}=t;if(i&&!D_(i))return this._returnResult({error:i});const a=(n=s.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(Pee(o)&&(o.status===404||o.status===401||o.status===403)||D_(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await qn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=Bee(),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{var n,s;try{const{data:{session:i},error:a}=t;if(a)throw a;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),D_(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(e,t={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await X0(this.storage,this.storageKey,!0));try{return await ze(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(i){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:t,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:n,error:s}=await this._useSession(async i=>{var a,o,l,c,u;const{data:f,error:p}=i;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await ze(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return Zn()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Oe(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var n;try{const{error:s,data:{session:i}}=t;if(s)throw s;const{options:a,provider:o,token:l,access_token:c,nonce:u}=e,f=await ze(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Ea}),{data:p,error:m}=f;return m?this._returnResult({data:{user:null,session:null},error:m}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new K0}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:m}))}catch(s){if(await qn(this.storage,`${this.storageKey}-code-verifier`),Oe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var n,s;const{data:i,error:a}=t;if(a)throw a;
480return await ze(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const n=Date.now();return await Hee(async s=>(s>0&&await zee(200*Math.pow(2,s-1)),this._debug(t,"refreshing attempt",s),await ze(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ea})),(s,i)=>{const a=200*Math.pow(2,s);return i&&mT(i)&&Date.now()+a-n<am})}catch(n){if(this._debug(t,"error",n),Oe(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",n),Zn()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await sf(this.storage,this.storageKey);if(s&&this.userStorage){let a=await sf(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await om(this.userStorage,this.storageKey+"-user",a)),s.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:gT()}else if(s&&!s.user&&!s.user){const a=await sf(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await qn(this.storage,this.storageKey+"-user"),await om(this.storage,this.storageKey,s)):s.user=gT()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((t=s.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<pT;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${pT}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),mT(a)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(s.access_token);!o&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(n,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var t,n;if(!e)throw new jn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new GE;const{data:i,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!i.session)throw new jn;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const o={data:i.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(i){if(this._debug(s,"error",i),Oe(i)){const a={data:null,error:i};return mT(i)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});const i=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,t)}catch(l){i.push(l)}});if(await Promise.all(a),i.length>0){for(let o=0;o<i.length;o+=1)console.error(i[o]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await qn(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await om(this.userStorage,this.storageKey+"-user",{user:t.user});const s=Object.assign({},t);delete s.user;const i=L3(s);await om(this.storage,this.storageKey,i)}else{const s=L3(t);await om(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await qn(this.storage,this.storageKey),await qn(this.storage,this.storageKey+"-code-verifier"),await qn(this.storage,this.storageKey+"-user"),this.userStorage&&await qn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Zn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
480catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),am);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/am);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${am}ms, refresh threshold is ${kN} ticks`),s<=kN&&await this._callRefreshToken(n.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof z6)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Zn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){const s=[`provider=${encodeURIComponent(t)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,a]=await X0(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(o.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var n;const{data:s,error:i}=t;return i?this._returnResult({data:null,error:i}):await ze(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var n,s;const{data:i,error:a}=t;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:c}=await ze(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?G3(e.webauthn.credential_response):K3(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await ze(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var n;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const a=await ze(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:W3(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:V3(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}})}async _challengeAndVerify(e){const{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=t==null?void 0:t.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,n,s,i;if(e)try{const{payload:m}=L_(e);let x=null;m.aal&&(x=m.aal);let g=x;const{data:{user:y},error:v}=await this.getUser(e);if(v)return this._returnResult({data:null,error:v});((n=(t=y==null?void 0:y.factors)===null||t===void 0?void 0:t.filter(_=>_.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const b=m.amr||[];return{data:{currentLevel:x,nextLevel:g,currentAuthenticationMethods:b},error:null}}catch(m){if(Oe(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:a},error:o}
480=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=L_(a.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((i=(s=a.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(u="aal2");const p=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;return s?this._returnResult({data:null,error:s}):n?await ze(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new jn})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new jn});const a=await ze(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&Zn()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(Oe(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new jn});const a=await ze(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&Zn()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(Oe(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await ze(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new jn})})}catch(e){if(Oe(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;return s?this._returnResult({data:null,error:s}):n?(await ze(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new jn})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(o=>o.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+Cee>s)return n;const{data:i,error:a}=await ze(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){const{data:m,error:x}
480=await this.getSession();if(x||!m.session)return this._returnResult({data:null,error:x});n=m.session.access_token}const{header:s,payload:i,signature:a,raw:{header:o,payload:l}}=L_(n);t!=null&&t.allowExpired||qee(i.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,t!=null&&t.keys?{keys:t.keys}:t==null?void 0:t.jwks);if(!c){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:i,header:s,signature:a},error:null}}const u=Zee(s.alg),f=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,a,Iee(`${o}.${l}`)))throw new AN("Invalid JWT signature");return{data:{claims:i,header:s,signature:a},error:null}}catch(n){if(Oe(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var t,n,s;go(this.experimental);try{if(!nS())return this._returnResult({data:null,error:new Lo("Browser does not support WebAuthn",null)});const{data:i,error:a}=await this._startPasskeyAuthentication({options:{captchaToken:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}});if(a||!i)return this._returnResult({data:null,error:a});const o=V3(i.options),l=(s=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:TN.createNewAbortSignal(),{data:c,error:u}=await G6({publicKey:o,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new Lo("WebAuthn ceremony failed",null)});const f=K3(c);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:f})}catch(i){if(Oe(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(e){var t,n;go(this.experimental);try{if(!nS())return this._returnResult({data:null,error:new Lo("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyRegistration();if(i||!s)return this._returnResult({data:null,error:i});const a=W3(s.options),o=(n=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.signal)!==null&&n!==void 0?n:TN.createNewAbortSignal(),{data:l,error:c}=await V6({publicKey:a,signal:o});if(c||!l)return this._returnResult({data:null,error:c??new Lo("WebAuthn ceremony failed",null)});const u=G3(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:u})}catch(s){if(Oe(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){go(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new jn});const{data:s,error:i}=await ze(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(Oe(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){go(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new jn});const{data:i,error:a}=await ze(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _startPasskeyAuthentication(e){var t;go(this.experimental);try{const{data:n,error:s}=await ze(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(Oe(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){go(this.experimental);try{const{data:t,error:n}=await ze(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Ea});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null}))}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _listPasskeys(){go(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new jn});const{data:s,error:i}=await ze(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:a=>({data:a,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(Oe(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){go(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new jn});const{data:i,error:a}=await ze(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}async _deletePasskey(e){go(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new jn});const{error:i}
480=await ze(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(t){if(Oe(t))return this._returnResult({data:null,error:t});throw t}}}x1.nextInstanceID={};const bte=x1,_te="2.105.1";let Wv="";typeof Deno<"u"?Wv="deno":typeof document<"u"?Wv="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Wv="react-native":Wv="node";const kte={"X-Client-Info":`supabase-js-${Wv}/${_te}`},Ste={headers:kte},Ete={schema:"public"},Ate={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Tte={};function v1(r){"@babel/helpers - typeof";return v1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v1(r)}function Cte(r,e){if(v1(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(v1(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Nte(r){var e=Cte(r,"string");return v1(e)=="symbol"?e:e+""}function Pte(r,e,t){return(e=Nte(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Y3(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,n)}return t}function Jr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Y3(Object(t),!0).forEach(function(n){Pte(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Y3(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}const Rte=r=>r?(...e)=>r(...e):(...e)=>fetch(...e),jte=()=>Headers,Ote=(r,e,t)=>{const n=Rte(t),s=jte();return async(i,a)=>{var o;const l=(o=await e())!==null&&o!==void 0?o:r;let c=new s(a==null?void 0:a.headers);return c.has("apikey")||c.set("apikey",r),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),n(i,Jr(Jr({},a),{},{headers:c}))}};function Fte(r){return r.endsWith("/")?r:r+"/"}function Dte(r,e){var t,n;const{db:s,auth:i,realtime:a,global:o}=r,{db:l,auth:c,realtime:u,global:f}=e,p={db:Jr(Jr({},l),s),auth:Jr(Jr({},c),i),realtime:Jr(Jr({},u),a),storage:{},global:Jr(Jr(Jr({},f),o),{},{headers:Jr(Jr({},(t=f==null?void 0:f.headers)!==null&&t!==void 0?t:{}),(n=o==null?void 0:o.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return r.accessToken?p.accessToken=r.accessToken:delete p.accessToken,p}function Mte(r){const e=r==null?void 0:r.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Fte(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Ite=class extends bte{constructor(r){super(r)}},Lte=class{constructor(r,e,t){var n,s;this.supabaseUrl=r,this.supabaseKey=e;const i=Mte(r);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const a=`sb-${i.hostname.split(".")[0]}-auth-token`,o={db:Ete,realtime:Tte,auth:Jr(Jr({},Ate),{},{storageKey:a}),global:Ste},l=Dte(t??{},o);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=Ote(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Jr({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new hQ(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new kee(this.storageUrl.href,this.headers,this.fetch,t==null?void 0:t.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new rQ(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(r){return this.rest.from(r)}schema(r){return this.rest.schema(r)}rpc(r,e={},t={head:!1,get:!1,count:void 0}){return this.rest.rpc(r,e,t)}channel(r,e={config:{}}){return this.realtime.channel(r,e)}getChannels(){return this.realtime.getChannels()}removeChannel(r){return this.realtime.removeChannel(r)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var r=this,e,t;if(r.accessToken)return await r.accessToken();const{data:n}=await r.auth.getSession();return(e=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&e!==void 0?e:r.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:r,persistSession:e,detectSessionInUrl:t,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:c,experimental:u},f,p){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Ite({url:this.authUrl.href,headers:Jr(Jr({},m),f),storageKey:i,autoRefreshToken:r,persistSession:e,detectSessionInUrl:t,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:c,experimental:u,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(r){return new GQ(this.realtimeUrl.href,Jr(Jr({},r),{},{params:Jr(Jr({},{apikey:this.supabaseKey}),r==null?void 0:r.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,e)=>{this._handleTokenChanged(r,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(r,e,t){(r==="TOKEN_REFRESHED"||r==="SIGNED_IN")&&this.changedAccessToken!==t?(this.changedAccessToken=t,this.realtime.setAuth(t)):r==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Bte=(r,e,t)=>new Lte(r,e,t);
480function Ute(){if(typeof window<"u")return!1;const r=globalThis.process;if(!r)return!1;const e=r.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}Ute()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function $te(){var y,v;if(typeof window>"u")return;const r=location.hostname,t=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(w=>r===w||r.endsWith("."+w)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=t?((y=r.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:y[1])??((v=r.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:v[1]):void 0,i=window.parent&&window.parent!==window;if(!s||!i)return localStorage;const a=r.endsWith(".lovableproject-dev.com")||r.endsWith(".gpt-eng.com"),o=a?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,l=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),c=l&&o.test(l)?[l]:a?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",f=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),m=(w,b,_)=>new Promise(T=>{const A=p();let N=!1,k;const E=D=>{N||(N=!0,clearTimeout(k),window.removeEventListener("message",P),T(D))},P=D=>{if(c.indexOf(D.origin)<0)return;const H=D.data;H&&H.type===u&&H.requestId===A&&E(H)};window.addEventListener("message",P);const O={type:w,requestId:A,projectId:s,key:b};_!==void 0&&(O.value=_);for(const D of c)window.parent.postMessage(O,D);k=setTimeout(()=>E(null),f)}
480);let x=!0;const g=250;return{getItem:async w=>{let b=await m("lovable-preview-auth:get",w);return!b&&x&&(await new Promise(_=>setTimeout(_,g)),b=await m("lovable-preview-auth:get",w)),x=!1,b&&b.ok&&typeof b.value=="string"?b.value===""?(localStorage.removeItem(w),null):b.value:localStorage.getItem(w)},setItem:(w,b)=>(localStorage.setItem(w,b),m("lovable-preview-auth:set",w,b).then(()=>{})),removeItem:w=>(localStorage.removeItem(w),m("lovable-preview-auth:remove",w).then(()=>{}))}}const zte="https://qmpifwedcjqrtdsavqpw.supabase.co",Hte="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFtcGlmd2VkY2pxcnRkc2F2cXB3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc2MzEzNDEsImV4cCI6MjA5MzIwNzM0MX0.s-qNQuEHE1a7UBnAk5I9TZ5Wag0Mtf_5pa07kMq6pvE",et=Bte(zte,Hte,{auth:{storage:$te(),persistSession:!0,autoRefreshToken:!0}});function Wte(){const[r,e]=S.useState(null),[t,n]=S.useState(new Set);if(S.useEffect(()=>{let i=!1;async function a(){const l=new Date,c=new Date(l.getTime()+15*6e4).toISOString(),{data:u}=await et.from("program_items").select("id,title,starts_at,location,exhibitor_id").gte("starts_at",l.toISOString()).lte("starts_at",c).order("starts_at",{ascending:!0}).limit(1);if(i)return;const f=(u==null?void 0:u[0])??null;f&&!t.has(f.id)?e(f):e(null)}a();const o=setInterval(a,6e4);return()=>{i=!0,clearInterval(o)}},[t]),!r)return null;const s=Math.max(0,Math.round((new Date(r.starts_at).getTime()-Date.now())/6e4));return d.jsxs("div",{className:"sticky z-40 mx-3 rounded-2xl gradient-accent shadow-pop text-accent-foreground p-3 flex items-start gap-3 animate-in slide-in-from-top",style:{top:"max(24px, calc(env(safe-area-inset-top) + 12px))",marginTop:"max(12px, calc(env(safe-area-inset-top) + 12px))"},children:[d.jsx("div",{className:"shrink-0 grid place-items-center w-9 h-9 rounded-xl bg-white/20",children:d.jsx(y0,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("p",{className:"text-xs font-semibold opacity-90",children:["In ",s," Min · ",r.location??"Vor Ort"]}),d.jsx("p",{className:"font-display font-bold leading-tight truncate",children:r.title}),r.exhibitor_id&&d.jsxs(Jt,{to:`/map?exhibitor=${r.exhibitor_id}`,className:"inline-flex items-center gap-1 text-xs font-semibold mt-1 underline-offset-2 hover:underline",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"})," Auf Karte zeigen"]})]}),d.jsx("button",{"aria-label":"SchlieÃen",onClick:()=>n(i=>new Set(i).add(r.id)),className:"shrink-0 grid place-items-center w-8 h-8 rounded-xl bg-white/15 hover:bg-white/25 tap-scale",children:d.jsx(Xn,{className:"w-4 h-4"})})]})}const q3="pwa_install_dismissed_session";function Vte(){var r;return typeof window>"u"?!1:((r=window.matchMedia)==null?void 0:r.call(window,"(display-mode: standalone)").matches)||window.navigator.standalone===!0}function Gte(){const r=window.navigator.userAgent,e=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t=r.includes("Mac")&&"ontouchend"in document;return e||t}function Kte(){const r=window.navigator.userAgent;return/FBAN|FBAV|Instagram|Line|Twitter|MicroMessenger/i.test(r)}function Xte(){const[r,e]=S.useState(null),[t,n]=S.useState(!1),[s,i]=S.useState(!1);S.useEffect(()=>{if(Vte()||sessionStorage.getItem(q3)==="1")return;const l=u=>{u.preventDefault(),e(u),n(!0)};if(window.addEventListener("beforeinstallprompt",l),Gte()&&!Kte()){const u=setTimeout(()=>{i(!0),n(!0)},1500);return()=>{clearTimeout(u),window.removeEventListener("beforeinstallprompt",l)}}const c=()=>{n(!1),e(null)};return window.addEventListener("appinstalled",c),()=>{window.removeEventListener("beforeinstallprompt",l),window.removeEventListener("appinstalled",c)}},[]);const a=()=>{sessionStorage.setItem(q3,"1"),n(!1)},o=async()=>{if(!r)return;await r.prompt();const{outcome:l}=await r.userChoice;l==="accepted"&&n(!1),e(null)};return t?s?d.jsx("div",{className:"fixed inset-x-0 bottom-0 z-[100] pointer-events-none",children:d.jsx("div",{className:"mx-auto max-w-md px-4 pb-4 safe-bottom pointer-events-auto",children:d.jsxs("div",{className:"relative rounded-2xl bg-card border border-border shadow-pop p-4",children:[d.jsx("button",{onClick:a,"aria-label":"SchlieÃen",className:"absolute top-2 right-2 grid place-items-center w-8 h-8 rounded-full hover:bg-muted",children:d.jsx(Xn,{className:"w-4 h-4"})}),d.jsxs("div",{className:"flex items-start gap-3 pr-6",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 rounded-xl gradient-accent text-accent-foreground shrink-0",children:d.jsx(qh,{className:"w-5 h-5"})}),d.jsxs("div",{className:"text-sm leading-snug",children:[d.jsx("p",{className:"font-display font-bold mb-1",children:"Messe-Guide installieren"}),d.jsxs("p",{className:"text-muted-foreground",children:["Tippe auf das Teilen-Symbol"," ",d.jsx(Fq,{className:"inline w-4 h-4 align-text-bottom text-accent"}),' und wähle âZum Home-Bildschirm", um deinen Messe-Guide jederzeit griffbereit zu haben!']})]})]}),d.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-4 h-4 rotate-45 bg-card border-r border-b border-border"})]})})}):d.jsx("div",{className:"fixed inset-x-0 bottom-20 z-[100] pointer-events-none",children:d.jsx("div",{className:"mx-auto max-w-md px-4 pointer-events-auto",children:d.jsxs("div",{className:"relative rounded-2xl gradient-accent text-accent-foreground shadow-pop p-3 pr-10 flex items-center gap-3",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 rounded-xl bg-white/20 shrink-0",children:d.jsx(ME,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-display font-bold text-sm leading-tight",children:"App zum Startbildschirm hinzufügen"}),d.jsx("p",{className:"text-xs opacity-85 leading-tight mt-0.5",children:"Immer griffbereit, auch ohne QR-Code"})]}),d.jsx("button",{onClick:o,className:"shrink-0 rounded-xl bg-white text-accent font-bold text-sm px-3 py-2 tap-scale",children:"Installieren"}),d.jsx("button",{onClick:a,"aria-label":"SchlieÃen",className:"absolute top-1 right-1 grid place-items-center w-7 h-7 rounded-full hover:bg-white/20",children:d.jsx(Xn,{className:"w-4 h-4"})})]})})}):null}const K6="sb_announcements_dismissed";function Z3(){try{const r=localStorage.getItem(K6);return new Set(r?JSON.parse(r):[])}catch{return new Set}}function Yte(r){try{localStorage.setItem(K6,JSON.stringify([...r].slice(-50)))}catch{}}function qte(){const[r,e]=S.useState(null);return S.useEffect(()=>{let t=!1;async function n(){const{data:i}=await et.from("announcements").select("id,title,body,created_at,expires_at,active").eq("active",!0).order("created_at",{ascending:!1}).limit(5);if(t)return;const a=Date.now(),o=Z3(),l=(i??[]).find(c=>!(o.has(c.id)||c.expires_at&&new Date(c.expires_at).getTime()<a));e(l??null)}n();const s=setInterval(n,6e4);return()=>{t=!0,clearInterval(s)}},[]),r?d.jsxs("div",{className:"sticky z-40 mx-3 rounded-2xl gradient-accent shadow-pop text-accent-foreground p-3 flex items-start gap-3 animate-in slide-in-from-top",style:{to
480p:"max(24px, calc(env(safe-area-inset-top) + 12px))",marginTop:"max(12px, calc(env(safe-area-inset-top) + 12px))"},children:[d.jsx("div",{className:"shrink-0 grid place-items-center w-9 h-9 rounded-xl bg-white/20",children:d.jsx(y0,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-xs font-semibold opacity-80",children:"Info"}),d.jsx("p",{className:"font-display font-bold leading-tight",children:r.title}),d.jsx("p",{className:"text-xs opacity-90 mt-0.5",children:r.body})]}),d.jsx("button",{"aria-label":"SchlieÃen",onClick:()=>{const t=Z3();t.add(r.id),Yte(t),e(null)},className:"shrink-0 grid place-items-center w-8 h-8 rounded-xl bg-white/15 hover:bg-white/25 tap-scale",children:d.jsx(Xn,{className:"w-4 h-4"})})]}):null}function Zte(){const r=Zh(),e=ij(),t=Ni(),n=!!r||!!e,s=t.pathname.startsWith("/map")||t.pathname.startsWith("/exhibitors")||t.pathname.startsWith("/categories")||t.pathname.startsWith("/exhibitor");if(!n&&t.pathname!=="/"&&!s)return d.jsx(nX,{to:"/",replace:!0});const i=t.pathname.startsWith("/rallye")||t.pathname.startsWith("/quiz")||t.pathname.startsWith("/level-up");return d.jsxs("div",{className:"app-shell relative",children:[!i&&d.jsx(qte,{}),!i&&d.jsx(Wte,{}),d.jsx("main",{className:"flex-1 pb-2",children:d.jsx(sX,{})}),d.jsx("div",{className:"sticky bottom-0 z-30 bg-background/80 backdrop-blur",children:d.jsx(JJ,{})}),d.jsx(Xte,{})]})}const X6=S.createContext(null),J3=6,Q3=8,eD="paidAdClickCount",tD="pushAdClickCount",rD="sb_interstitial_last_ad",nD="sb_interstitial_last_shown_at_click",sD="sb_pushad_last_shown_at_click",iD="sb_pushad_last",Jte=5e3,vT=400,Qte=["/quiz","/rallye","/level-up","/interessenscheck","/aussteller-login","/exhibitor/login","/admin"],aD=r=>Qte.some(e=>r===e||r.startsWith(e+"/"));function ere(){const r=S.useContext(X6);return r||{triggerAndGo:()=>{},incrementClicks:()=>{}}}function tre({children:r}){const e=ba(),t=Ni(),n=aD(t.pathname),s=S.useRef(t.pathname);S.useEffect(()=>{s.current=t.pathname},[t.pathname]);const[i,a]=S.useState([]),[o,l]=S.useState(null),c=S.useRef([]),u=S.useRef(!1);S.useEffect(()=>{c.current=i},[i]),S.useEffect(()=>{let O=!1;return(async()=>{const{data:D}=await et.from("ads").select("id,title,body,image_url,exhibitor_id,hall,stand_no,external_url,target_category").eq("active",!0);O||a(D??[])})(),()=>{O=!0}},[]);const f=S.useCallback(()=>{const O=c.current;if(!O.length)return null;const D=sessionStorage.getItem(rD);let H=[];try{const J=sessionStorage.getItem("sb_user_categories");J&&(H=JSON.parse(J))}catch{}const B=new Set(H.map(J=>{var ne;return(ne=String(J).match(/\d+/))==null?void 0:ne[0]}).filter(Boolean)),ee=J=>String(J.target_category??"").split(/[,;\s]+/).map(ne=>{var I;return(I=ne.match(/\d+/))==null?void 0:I[0]}).filter(Boolean),X=H.length?O.filter(J=>{const ne=ee(J);return ne.length?ne.some(I=>B.has(I)):!!J.target_category&&H.includes(J.target_category)}):[],W=O.filter(J=>!J.target_category);let Y=X.length?X:W;Y.length||(Y=O);const F=Y.length>1?Y.filter(J=>J.id!==D):Y;return(F.length?F:Y)[Math.floor(Math.random()*(F.length||Y.length))]??null},[]),p=S.useCallback((O,D)=>{et.rpc("increment_ad_impression",{p_ad_id:O,p_ad_type:D}).then(({error:H})=>{H&&console.warn("ad impression tracking failed:",H.message)})},[]),m=S.useCallback(()=>{if(u.current)return!1;const O=f();return O?(sessionStorage.setItem(rD,O.id),u.current=!0,l(O),p(O.id,"paid"),!0):!1},[f,p]),x=S.useRef([]),[g,y]=S.useState(null),[v,w]=S.useState(!1),b=S.useRef([]);S.useEffect(()=>{let O=!1;return(async()=>{const{data:D}=await et.from("push_ads").select("id,title,body,image_url,target_url,target_codes").eq("active",!0);O||(x.current=D??[])})(),()=>{O=!0}},[]);const _=S.useCallback(()=>{b.current.forEach(O=>window.clearTimeout(O)),b.current=[]},[]),T=S.useCallback((O=!1)=>{_(),w(!1),O?y(null):b.current.push(window.setTimeout(()=>y(null),vT))},[_]),A=S.useCallback(()=>{const O=x.current;if(!O.length)return!1;let D=new Set;try{const F=sessionStorage.getItem("sb_user_categories");F&&(D=new Set(JSON.parse(F).map(J=>{var ne;return(ne=String(J).match(/\d+/))==null?void 0:ne[0]}
480).filter(Boolean)))}catch{}const H=D.size?O.filter(F=>(F.target_codes??[]).some(J=>D.has(String(J)))):[],B=O.filter(F=>!(F.target_codes??[]).length);let ee=H.length?H:B;ee.length||(ee=O);const X=sessionStorage.getItem(iD),W=ee.length>1?ee.filter(F=>F.id!==X):ee,Y=(W.length?W:ee)[Math.floor(Math.random()*(W.length||ee.length))];return Y?(sessionStorage.setItem(iD,Y.id),_(),y(Y),p(Y.id,"push"),b.current.push(window.setTimeout(()=>w(!0),30)),b.current.push(window.setTimeout(()=>T(),Jte+30)),!0):!1},[_,T,p]);S.useEffect(()=>_,[_]);const N=S.useCallback(()=>{if(aD(s.current))return;const O=parseInt(sessionStorage.getItem(eD)||"0",10)+1;sessionStorage.setItem(eD,String(O));const D=parseInt(sessionStorage.getItem(tD)||"0",10)+1;if(sessionStorage.setItem(tD,String(D)),O>0&&O%J3===0){const H=parseInt(sessionStorage.getItem(nD)||"-999",10);O-H>=J3&&m()&&sessionStorage.setItem(nD,String(O))}if(D>0&&D%Q3===0){const H=parseInt(sessionStorage.getItem(sD)||"-999",10);D-H>=Q3&&A()&&sessionStorage.setItem(sD,String(D))}},[m,A]);S.useEffect(()=>{function O(D){const H=D.target;H&&(H.closest("[data-ad-interstitial]")||H.closest("a,button,[role='button'],[role='tab'],label,input,select")&&N())}return document.addEventListener("click",O,!0),()=>document.removeEventListener("click",O,!0)},[N]);const k=S.useCallback(O=>e(O),[e]);function E(){u.current=!1,l(null)}function P(){if(!o)return;const O=o;if(E(),O.external_url){window.open(O.external_url,"_blank","noopener,noreferrer");return}if(O.exhibitor_id||O.hall||O.stand_no){const D=new URLSearchParams;O.exhibitor_id&&D.set("exhibitor",O.exhibitor_id),O.hall&&D.set("hall",O.hall),O.stand_no&&D.set("stand",O.stand_no),e(`/map?${D.toString()}`)}}return d.jsxs(X6.Provider,{value:{triggerAndGo:k,incrementClicks:N},children:[r,g&&!n&&d.jsx("div",{"data-ad-interstitial":!0,className:"fixed left-0 right-0 z-[140] px-3 pointer-events-none",style:{top:"max(8px, calc(env(safe-area-inset-top) + 8px))"},children:d.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{const O=g.target_url;T(!0),O&&(/^https?:\/\//i.test(O)?window.open(O,"_blank","noopener,noreferrer"):e(O))},className:"pointer-events-auto mx-auto max-w-md rounded-2xl bg-card shadow-pop border border-border overflow-hidden flex items-stretch gap-3 cursor-pointer",style:{transform:v?"translateX(0)":"translateX(-115%)",opacity:v?1:0,transition:`transform ${vT}ms cubic-bezier(.22,1,.36,1), opacity ${vT}ms ease`},children:[g.image_url?d.jsx("img",{src:g.image_url,alt:g.title,className:"w-20 shrink-0 object-cover",loading:"lazy"}):d.jsx("div",{className:"w-14 shrink-0 gradient-hero grid place-items-center text-primary-foreground",children:d.jsx(Lx,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0 py-2.5",children:[d.jsx("p",{className:"text-[10px] font-extrabold uppercase tracking-wider text-primary",children:"Anzeige"}),d.jsx("p",{className:"font-display font-bold leading-tight truncate",children:g.title}),g.body&&d.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:g.body})]}),d.jsx("button",{"aria-label":"SchlieÃen",onClick:O=>{O.stopPropagation(),T()},className:"shrink-0 self-start m-2 grid place-items-center w-7 h-7 rounded-full bg-muted text-muted-foreground hover:bg-muted/70",children:d.jsx(Xn,{className:"w-3.5 h-3.5"})})]})}),o&&!n&&d.jsx("div",{"data-ad-interstitial":!0,className:"fixed inset-0 z-[150] bg-black/70 backdrop-blur-sm flex items-end sm:items-center justify-center p-3 animate-in fade-in duration-200",onClick:E,role:"dialog","aria-modal":"true",children:d.jsxs("div",{className:"w-full max-w-md rounded-3xl bg-card shadow-pop overflow-hidden animate-in slide-in-from-bottom-4 duration-300",onClick:O=>O.stopPropagation(),children:[d.jsxs("div",{className:"relative",children:[o.image_url?d.jsx("img",{src:o.image_url,alt:o.title,className:"w-full aspect-[16/9] object-cover"}):d.jsx("div",{className:"w-full aspect-[16/9] gradient-hero grid place-items-center text-primary-foreground",children:d.jsx(Lx,{className:"w-12 h-12 opacity-80"})}),d.jsx("button",{"aria-label":"SchlieÃen",onClick:E,className:"absolute top-2 right-2 grid place-items-center w-9 h-9 rounded-full bg-black/55 text-white hover:bg-black/75 tap-scale",children:d.jsx(Xn,{className:"w-4 h-4"})}),d.jsx("span",{className:"absolute top-2 left-2 text-[10px] font-extrabold uppercase tracking-wider bg-white/90 text-foreground px-2 py-0.5 rounded-full",children:"Anzeige"})]}),d.jsxs("div",{className:"p-4",children:[d.jsx("h3",{className:"font-display text-xl font-extrabold leading-tight",children:o.title}),o.body&&d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.body}),(o.hall||o.stand_no)&&d.jsxs("p",{className:"mt-2 text-xs font-bold text-primary flex items-center gap-1",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"}),o.hall?`Halle ${o.hall}`:"",o.hall&&o.stand_no?" · ":"",o.stand_no?`Stand ${o.stand_no}`:""]}),d.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-2",children:[(o.exhibitor_id||o.hall||o.stand_no||o.external_url)&&d.jsx("button",{onClick:P,className:"rounded-2xl gradient-hero text-primary-foreground font-display font-extrabold py-3.5 px-4 shadow-pop tap-scale inline-flex items-center justify-center gap-2",children:o.external_url?d.jsxs(d.Fragment,{children:[d.jsx(Aq,{className:"w-5 h-5"})," Zur Webseite"]}):d.jsxs(d.Fragment,{children:[d.jsx(Pn,{className:"w-5 h-5"})," Stand anzeigen"]})}),d.jsx("button",{onClick:E,className:"rounded-2xl bg-secondary text-secondary-foreground font-bold py-3 px-4 tap-scale",children:"SchlieÃen"})]})]})]})})]})}var Lt;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},r.getValidEnumValues=s=>{const i=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return r.objectValues(a)},r.objectValues=s=>r.objectKeys(s).map(function(i){return s[i]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},r.find=(s,i)=>{for(const a of s)if(i(a))return a},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(a=>
vendor: 1,174 bytes, line 480
480typeof a=="string"?`'${a}'`:a).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Lt||(Lt={}));var oD;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(oD||(oD={}));const Ve=Lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ju=r=>{switch(typeof r){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(r)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(r)?Ve.array:r===null?Ve.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Ve.promise:typeof Map<"u"&&r instanceof Map?Ve.map:typeof Set<"u"&&r instanceof Set?Ve.set:typeof Date<"u"&&r instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},_e=Lt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
480d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Tu extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let o=n,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return s(this),n}static assert(e){if(!(e instanceof Tu))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];t[i]=t[i]||[],t[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Tu.create=r=>new Tu(r);const CN=(r,e)=>{let t;switch(r.code){case _e.invalid_type:r.received===Ve.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case _e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,Lt.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Lt.joinValues(r.keys,", ")}`;break;case _e.invalid_union:t="Invalid input";break;case _e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Lt.joinValues(r.options)}`;break;case _e.invalid_enum_value:t=`Invalid enum value. Expected ${Lt.joinValues(r.options)}, received '${r.received}'`;break;case _e.invalid_arguments:t="Invalid function arguments";break;case _e.invalid_return_type:t="Invalid function return type";break;case _e.invalid_date:t="Invalid date";break;case _e.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:Lt.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case _e.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case _e.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case _e.custom:t="Invalid input";break;
vendor: 5,147 bytes, line 480
480case _e.invalid_intersection_types:t="Intersection results could not be merged";break;case _e.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case _e.not_finite:t="Number must be finite";break;default:t=e.defaultError,Lt.assertNever(r)}return{message:t}};let rre=CN;function nre(){return rre}const sre=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,i=[...t,...s.path||[]],a={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)o=c(a,{data:e,defaultError:o}).message;return{...s,path:i,message:o}};function Ie(r,e){const t=nre(),n=sre({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===CN?void 0:CN].filter(s=>!!s)});r.common.issues.push(n)}class ga{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return ut;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const i=await s.key,a=await s.value;n.push({key:i,value:a})}return ga.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:i,value:a}=s;if(i.status==="aborted"||a.status==="aborted")return ut;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}}const ut=Object.freeze({status:"aborted"}),Vv=r=>({status:"dirty",value:r}),oo=r=>({status:"valid",value:r}),lD=r=>r.status==="aborted",cD=r=>r.status==="dirty",Hx=r=>r.status==="valid",iS=r=>typeof Promise<"u"&&r instanceof Promise;var Ge;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ge||(Ge={}));class Mh{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uD=(r,e)=>{if(Hx(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Tu(r.common.issues);return this._error=t,this._error}}};function St(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{const{message:l}=r;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:s}}class Dt{get description(){return this._def.description}_getType(e){return Ju(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ju(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ga,ctx:{common:e.parent.common,data:e.data,parsedType:Ju(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(iS(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ju(e)},s=this._parseSync({data:e,path:n.path,parent:n});return uD(n,s)}"~validate"(e){var n,s;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ju(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Hx(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Hx(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ju(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(iS(s)?s:Promise.resolve(s));return uD(n,i)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:_e.custom,...n(s)});
vendor: 6,114 bytes, line 480
480return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new Vx({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Th.create(this,this._def)}nullable(){return Gx.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ql.create(this)}promise(){return cS.create(this,this._def)}or(e){return oS.create([this,e],this._def)}and(e){return lS.create(this,e,this._def)}transform(e){return new Vx({...St(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new PN({...St(this._def),innerType:this,defaultValue:t,typeName:dt.ZodDefault})}brand(){return new Tre({typeName:dt.ZodBranded,type:this,...St(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new RN({...St(this._def),innerType:this,catchValue:t,typeName:dt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return lj.create(this,e)}readonly(){return jN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ire=/^c[^\s-]{8,}$/i,are=/^[0-9a-z]+$/,ore=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lre=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cre=/^[a-z0-9_-]{21}$/i,ure=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dre=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fre="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let yT;const pre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yre=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wre=new RegExp(`^${Y6}$`);function q6(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function bre(r){return new RegExp(`^${q6(r)}$`)}function _re(r){let e=`${Y6}T${q6(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function kre(r,e){return!!((e==="v4"||!e)&&pre.test(r)||(e==="v6"||!e)&&gre.test(r))}function Sre(r,e){if(!ure.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Ere(r,e){return!!((e==="v4"||!e)&&mre.test(r)||(e==="v6"||!e)&&xre.test(r))}class fh extends Dt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ve.string){const i=this._getOrReturnCtx(e);
vendor: 17,372 bytes, line 480
480return Ie(i,{code:_e.invalid_type,expected:Ve.string,received:i.parsedType}),ut}const n=new ga;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?Ie(s,{code:_e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Ie(s,{code:_e.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")hre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"email",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")yT||(yT=new RegExp(fre,"u")),yT.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"emoji",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")lre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"uuid",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")cre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"nanoid",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")ire.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")are.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid2",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ore.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ulid",code:_e.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ie(s,{validation:"url",code:_e.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"regex",code:_e.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?_re(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?wre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?bre(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?dre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"duration",code:_e.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?kre(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ip",code:_e.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Sre(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"jwt",code:_e.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Ere(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cidr",code:_e.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?vre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64",code:_e.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?yre.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64url",code:_e.invalid_string,message:i.message}),n.dirty()):Lt.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:_e.invalid_string,...Ge.errToObj(n)})}_addCheck(e){return new fh({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ge.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ge.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ge.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ge.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ge.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ge.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ge.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Ge.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ge.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ge.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ge.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ge.errToObj(t)})}nonempty(e){return this.min(1,Ge.errToObj(e))}trim(){return new fh({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fh({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fh({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}fh.create=r=>new fh({checks:[],typeName:dt.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...St(r)});function Are(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,i=Number.parseInt(r.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return i%a/10**s}class y1 extends Dt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ve.number){const i=this._getOrReturnCtx(e);return Ie(i,{code:_e.invalid_type,expected:Ve.number,received:i.parsedType}),ut}let n;const s=new ga;for(const i of this._def.checks)i.kind==="int"?Lt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Are(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.not_finite,message:i.message}),s.dirty()):Lt.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,s){return new y1({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(s)}]})}_addCheck(e){return new y1({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Lt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}y1.create=r=>new y1({checks:[],typeName:dt.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...St(r)});class w1 extends Dt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ve.bigint)return this._getInvalidInput(e);let n;const s=new ga;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ie(n,{code:_e.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Lt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Ie(t,{code:_e.invalid_type,expected:Ve.bigint,received:t.parsedType}),ut}gte(e,t){return this.setLimit("min",e,!0,Ge.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ge.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ge.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ge.toString(t))}setLimit(e,t,n,s){return new w1({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ge.toString(s)}]})}_addCheck(e){return new w1({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ge.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}w1.create=r=>new w1({checks:[],typeName:dt.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...St(r)});class dD extends Dt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ve.boolean){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.boolean,received:n.parsedType}),ut}return oo(e.data)}}dD.create=r=>new dD({typeName:dt.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...St(r)});class aS extends Dt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ve.date){const i=this._getOrReturnCtx(e);return Ie(i,{code:_e.invalid_type,expected:Ve.date,received:i.parsedType}),ut}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ie(i,{code:_e.invalid_date}),ut}const n=new ga;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:_e.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Lt.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new aS({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ge.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ge.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}aS.create=r=>new aS({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:dt.ZodDate,...St(r)});class hD extends Dt{_parse(e){if(this._getType(e)!==Ve.symbol){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.symbol,received:n.parsedType}),ut}return oo(e.data)}}hD.create=r=>new hD({typeName:dt.ZodSymbol,...St(r)});class fD extends Dt{_parse(e){if(this._getType(e)!==Ve.undefined){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.undefined,received:n.parsedType}),ut}return oo(e.data)}}fD.create=r=>new fD({typeName:dt.ZodUndefined,...St(r)});class pD extends Dt{_parse(e){if(this._getType(e)!==Ve.null){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.null,received:n.parsedType}),ut}return oo(e.data)}}pD.create=r=>new pD({typeName:dt.ZodNull,...St(r)});class mD extends Dt{constructor(){super(...arguments),this._any=!0}_parse(e){return oo(e.data)}}mD.create=r=>new mD({typeName:dt.ZodAny,...St(r)});class gD extends Dt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oo(e.data)}}gD.create=r=>new gD({typeName:dt.ZodUnknown,...St(r)});class Ih extends Dt{_parse(e){const t=this._getOrReturnCtx(e);return Ie(t,{code:_e.invalid_type,expected:Ve.never,received:t.parsedType}),ut}}Ih.create=r=>new Ih({typeName:dt.ZodNever,...St(r)});class xD extends Dt{_parse(e){if(this._getType(e)!==Ve.undefined){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.void,received:n.parsedType}),ut}return oo(e.data)}}xD.create=r=>new xD({typeName:dt.ZodVoid,...St(r)});class ql extends Dt{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;
vendor: 5,494 bytes, line 480
480if(t.parsedType!==Ve.array)return Ie(t,{code:_e.invalid_type,expected:Ve.array,received:t.parsedType}),ut;if(s.exactLength!==null){const a=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(a||o)&&(Ie(t,{code:a?_e.too_big:_e.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(Ie(t,{code:_e.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(Ie(t,{code:_e.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>s.type._parseAsync(new Mh(t,a,t.path,o)))).then(a=>ga.mergeArray(n,a));const i=[...t.data].map((a,o)=>s.type._parseSync(new Mh(t,a,t.path,o)));return ga.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ql({...this._def,minLength:{value:e,message:Ge.toString(t)}})}max(e,t){return new ql({...this._def,maxLength:{value:e,message:Ge.toString(t)}})}length(e,t){return new ql({...this._def,exactLength:{value:e,message:Ge.toString(t)}})}nonempty(e){return this.min(1,e)}}ql.create=(r,e)=>new ql({type:r,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...St(e)});function lm(r){if(r instanceof Qr){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=Th.create(lm(n))}return new Qr({...r._def,shape:()=>e})}else return r instanceof ql?new ql({...r._def,type:lm(r.element)}):r instanceof Th?Th.create(lm(r.unwrap())):r instanceof Gx?Gx.create(lm(r.unwrap())):r instanceof b0?b0.create(r.items.map(e=>lm(e))):r}class Qr extends Dt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Lt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Ve.object){const c=this._getOrReturnCtx(e);return Ie(c,{code:_e.invalid_type,expected:Ve.object,received:c.parsedType}),ut}const{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ih&&this._def.unknownKeys==="strip"))for(const c in s.data)a.includes(c)||o.push(c);const l=[];for(const c of a){const u=i[c],f=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Mh(s,f,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Ih){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")o.length>0&&(Ie(s,{code:_e.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const f=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Mh(s,f,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,p=await u.value;c.push({key:f,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>ga.mergeObjectSync(n,c)):ga.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return Ge.errToObj,new Qr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,a;const s=((a=(i=this._def).errorMap)==null?void 0:a.call(i,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:Ge.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Qr({...this._def,unknownKeys:"strip"})}passthrough(){return new Qr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:dt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qr({...this._def,catchall:e})}pick(e){const t={};for(const n of Lt.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new Qr({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Lt.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new Qr({...this._def,shape:()=>t})}deepPartial(){return lm(this)}partial(e){const t={};for(const n of Lt.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new Qr({...this._def,shape:()=>t})}required(e){const t={};for(const n of Lt.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Th;)i=i._def.innerType;t[n]=i}return new Qr({...this._def,shape:()=>t})}keyof(){return Z6(Lt.objectKeys(this.shape))}}Qr.create=(r,e)=>new Qr({shape:()=>r,unknownKeys:"strip",catchall:Ih.create(),typeName:dt.ZodObject,...St(e)});Qr.strictCreate=(r,e)=>new Qr({shape:()=>r,unknownKeys:"strict",catchall:Ih.create(),typeName:dt.ZodObject,...St(e)});Qr.lazycreate=(r,e)=>new Qr({shape:r,unknownKeys:"strip",catchall:Ih.create(),typeName:dt.ZodObject,...St(e)});class oS extends Dt{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new Tu(o.ctx.common.issues));
vendor: 5,549 bytes, line 480
480return Ie(t,{code:_e.invalid_union,unionErrors:a}),ut}if(t.common.async)return Promise.all(n.map(async i=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const l of n){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(l=>new Tu(l));return Ie(t,{code:_e.invalid_union,unionErrors:o}),ut}}get options(){return this._def.options}}oS.create=(r,e)=>new oS({options:r,typeName:dt.ZodUnion,...St(e)});function NN(r,e){const t=Ju(r),n=Ju(e);if(r===e)return{valid:!0,data:r};if(t===Ve.object&&n===Ve.object){const s=Lt.objectKeys(e),i=Lt.objectKeys(r).filter(o=>s.indexOf(o)!==-1),a={...r,...e};for(const o of i){const l=NN(r[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===Ve.array&&n===Ve.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<r.length;i++){const a=r[i],o=e[i],l=NN(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===Ve.date&&n===Ve.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class lS extends Dt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(i,a)=>{if(lD(i)||lD(a))return ut;const o=NN(i.value,a.value);return o.valid?((cD(i)||cD(a))&&t.dirty(),{status:t.value,value:o.data}):(Ie(n,{code:_e.invalid_intersection_types}),ut)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>s(i,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}lS.create=(r,e,t)=>new lS({left:r,right:e,typeName:dt.ZodIntersection,...St(t)});class b0 extends Dt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ve.array)return Ie(n,{code:_e.invalid_type,expected:Ve.array,received:n.parsedType}),ut;if(n.data.length<this._def.items.length)return Ie(n,{code:_e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;!this._def.rest&&n.data.length>this._def.items.length&&(Ie(n,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Mh(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>ga.mergeArray(t,a)):ga.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new b0({...this._def,rest:e})}}b0.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new b0({items:r,typeName:dt.ZodTuple,rest:null,...St(e)})};class vD extends Dt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ve.map)return Ie(n,{code:_e.invalid_type,expected:Ve.map,received:n.parsedType}),ut;const s=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([o,l],c)=>({key:s._parse(new Mh(n,o,n.path,[c,"key"])),value:i._parse(new Mh(n,l,n.path,[c,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),o.set(c.value,u.value)}return{status:t.value,value:o}}}}vD.create=(r,e,t)=>new vD({valueType:e,keyType:r,typeName:dt.ZodMap,...St(t)});class b1 extends Dt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ve.set)return Ie(n,{code:_e.invalid_type,expected:Ve.set,received:n.parsedType}),ut;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Ie(n,{code:_e.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Ie(n,{code:_e.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ut;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const o=[...n.data.values()].map((l,c)=>i._parse(new Mh(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new b1({...this._def,minSize:{value:e,message:Ge.toString(t)}})}max(e,t){return new b1({...this._def,maxSize:{value:e,message:Ge.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}b1.create=(r,e)=>new b1({valueType:r,minSize:null,maxSize:null,typeName:dt.ZodSet,...St(e)});class yD extends Dt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}yD.create=(r,e)=>new yD({getter:r,typeName:dt.ZodLazy,...St(e)});class wD extends Dt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);
vendor: 5,468 bytes, line 480
480return Ie(t,{received:t.data,code:_e.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:e.data}}get value(){return this._def.value}}wD.create=(r,e)=>new wD({value:r,typeName:dt.ZodLiteral,...St(e)});function Z6(r,e){return new Wx({values:r,typeName:dt.ZodEnum,...St(e)})}class Wx extends Dt{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return Ie(t,{expected:Lt.joinValues(n),received:t.parsedType,code:_e.invalid_type}),ut}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Ie(t,{received:t.data,code:_e.invalid_enum_value,options:n}),ut}return oo(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Wx.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wx.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Wx.create=Z6;class bD extends Dt{_parse(e){const t=Lt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ve.string&&n.parsedType!==Ve.number){const s=Lt.objectValues(t);return Ie(n,{expected:Lt.joinValues(s),received:n.parsedType,code:_e.invalid_type}),ut}if(this._cache||(this._cache=new Set(Lt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Lt.objectValues(t);return Ie(n,{received:n.data,code:_e.invalid_enum_value,options:s}),ut}return oo(e.data)}get enum(){return this._def.values}}bD.create=(r,e)=>new bD({values:r,typeName:dt.ZodNativeEnum,...St(e)});class cS extends Dt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ve.promise&&t.common.async===!1)return Ie(t,{code:_e.invalid_type,expected:Ve.promise,received:t.parsedType}),ut;const n=t.parsedType===Ve.promise?t.data:Promise.resolve(t.data);return oo(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}cS.create=(r,e)=>new cS({type:r,typeName:dt.ZodPromise,...St(e)});class Vx extends Dt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{Ie(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return ut;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?ut:l.status==="dirty"||t.value==="dirty"?Vv(l.value):l});{if(t.value==="aborted")return ut;const o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?ut:o.status==="dirty"||t.value==="dirty"?Vv(o.value):o}}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ut:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?ut:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hx(a))return ut;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Hx(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:t.value,value:o})):ut);Lt.assertNever(s)}}Vx.create=(r,e,t)=>new Vx({schema:r,typeName:dt.ZodEffects,effect:e,...St(t)});Vx.createWithPreprocess=(r,e,t)=>new Vx({schema:e,effect:{type:"preprocess",transform:r},typeName:dt.ZodEffects,...St(t)});class Th extends Dt{_parse(e){return this._getType(e)===Ve.undefined?oo(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Th.create=(r,e)=>new Th({innerType:r,typeName:dt.ZodOptional,...St(e)});class Gx extends Dt{_parse(e){return this._getType(e)===Ve.null?oo(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Gx.create=(r,e)=>new Gx({innerType:r,typeName:dt.ZodNullable,...St(e)});class PN extends Dt{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Ve.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}PN.create=(r,e)=>new PN({innerType:r,typeName:dt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...St(e)});class RN extends Dt{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return iS(s)?s.then(i=>
480({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Tu(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tu(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}RN.create=(r,e)=>new RN({innerType:r,typeName:dt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...St(e)});class _D extends Dt{_parse(e){if(this._getType(e)!==Ve.nan){const n=this._getOrReturnCtx(e);return Ie(n,{code:_e.invalid_type,expected:Ve.nan,received:n.parsedType}),ut}return{status:"valid",value:e.data}}}_D.create=r=>new _D({typeName:dt.ZodNaN,...St(r)});class Tre extends Dt{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class lj extends Dt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ut:i.status==="dirty"?(t.dirty(),Vv(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ut:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new lj({in:e,out:t,typeName:dt.ZodPipeline})}}class jN extends Dt{_parse(e){const t=this._def.innerType._parse(e),n=s=>(Hx(s)&&(s.value=Object.freeze(s.value)),s);return iS(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}jN.create=(r,e)=>new jN({innerType:r,typeName:dt.ZodReadonly,...St(e)});Qr.lazycreate;var dt;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(dt||(dt={}));const uS=fh.create;Ih.create;ql.create;const J6=Qr.create;Qr.strictCreate;oS.create;lS.create;b0.create;const ON=Wx.create;cS.create;Th.create;Gx.create;function Lh({className:r=""}){return d.jsx("div",{className:`text-center py-4 ${r}`,children:d.jsx(Jt,{to:"/impressum",className:"text-[11px] font-semibold text-muted-foreground underline underline-offset-2 hover:text-foreground",children:"Impressum"})})}const Cre=1,Nre="f260125a-399c-45f2-b29c-0933479bac5c",Pre="57e338b8-5bef-4dfa-a296-9cd48805097b",Rre="/__l5e/assets-v1/f260125a-399c-45f2-b29c-0933479bac5c/SCHUB_26_Veranstaltungskachel_WB_700x500px.png",jre="a/v1/57e338b8-5bef-4dfa-a296-9cd48805097b/f260125a-399c-45f2-b29c-0933479bac5c/SCHUB_26_Veranstaltungskachel_WB_700x500px.png",Ore="SCHUB_26_Veranstaltungskachel_WB_700x500px.png",Fre=281857,Dre="image/png",Mre="2026-09-15T09:52:35Z",Ire={version:Cre,asset_id:Nre,project_id:Pre,url:Rre,r2_key:jre,original_filename:Ore,size:Fre,content_type:Dre,created_at:Mre},Q6=["Begleitperson/Eltern","Mittelschule","Polytechnischer Lehrgang","Sonderschule","Allgemeinbildende Höhere Schule (AHS)","Berufsbildende Mittlere Schule (BMS)","Berufsbildende Höhere Schule (BHS)","Sonstige"],Lre=J6({first_name:uS().trim().min(1,"Bitte Vornamen eingeben").max(60),zip_code:uS().trim().regex(/^[0-9]{3,10}$/,"Bitte gültige PLZ"),role:ON(["visitor","exhibitor"]),school:ON(Q6,{errorMap:()=>({message:"Bitte Schulform wählen"})})});function Bre(){const r=ba(),[e,t]=S.useState("role"),[n,s]=S.useState(""),[i,a]=S.useState(""),[o,l]=S.useState("visitor"),[c,u]=S.useState(""),[f,p]=S.useState(null),[m,x]=S.useState(!1);S.useEffect(()=>{if(J2()){r("/home",{replace:!0});return}pN()&&r("/exhibitor/portal",{replace:!0})},[r]);async function g(y){var w;y.preventDefault(),p(null);const v=Lre.safeParse({first_name:n,zip_code:i,role:o,school:c});if(!v.success){p(((w=v.error.issues[0])==null?void 0:w.message)??"
480Ungültige Eingabe");return}if(o==="exhibitor"){r("/exhibitor/login");return}x(!0);try{const{data:b,error:_}=await et.rpc("create_visitor_profile",{p_first_name:v.data.first_name,p_zip_code:v.data.zip_code,p_role:v.data.role,p_school:v.data.school,p_source:"onboarding"});if(_){console.error("create_visitor_profile error",_),p(`Speichern fehlgeschlagen: ${_.message}`);return}const T=Array.isArray(b)?b[0]:b;if(!T){p("Speichern fehlgeschlagen. Bitte erneut versuchen.");return}rj({id:T.id,first_name:T.first_name,zip_code:T.zip_code,role:T.role}),r("/home")}catch(b){console.error(b),p(`Netzwerkfehler: ${(b==null?void 0:b.message)??"Unbekannt"}`)}finally{x(!1)}}return e==="role"?d.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[d.jsx("header",{className:"px-5 safe-top",children:d.jsx("div",{className:"rounded-3xl overflow-hidden shadow-card border border-border bg-card",children:d.jsx("img",{src:Ire.url,alt:"Schule & Beruf â Messe Wieselburg, 17. bis 19. September 2026",className:"w-full h-auto block"})})}),d.jsxs("div",{className:"px-6 mt-6 text-center",children:[d.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-accent/10 text-accent px-3 py-1 text-[11px] font-bold mb-3",children:[d.jsx(Bx,{className:"w-3 h-3"})," Willkommen"]}),d.jsxs("h1",{className:"font-display text-[26px] font-extrabold leading-[1.1] text-foreground",children:["Deine Messe-App für",d.jsx("br",{}),d.jsx("span",{className:"text-primary",children:"Schule & Beruf"})]}),d.jsx("p",{className:"mt-2 text-muted-foreground text-sm max-w-xs mx-auto",children:"Bitte wähle deine Rolle, um fortzufahren."})]}),d.jsxs("div",{className:"flex-1 px-6 mt-8 pb-10 flex flex-col gap-4 justify-center",children:[d.jsxs("button",{onClick:()=>t("hero"),className:"group relative w-full rounded-3xl bg-card shadow-card hover:shadow-pop border border-border overflow-hidden p-6 text-left tap-scale transition-shadow",children:[d.jsx("div",{className:"absolute -top-8 -right-8 w-32 h-32 rounded-full bg-primary/10 blur-2xl pointer-events-none"}),d.jsxs("div",{className:"relative flex items-center gap-4",children:[d.jsx("div",{className:"w-14 h-14 rounded-2xl gradient-hero flex items-center justify-center shadow-soft shrink-0",children:d.jsx(W4,{className:"w-7 h-7 text-primary-foreground"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-display text-2xl font-extrabold text-foreground leading-tight",children:"Besucher"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Quiz, Rallye, Workshops & Hallenpläne entdecken."})]}),d.jsx(Mx,{className:"w-5 h-5 text-primary shrink-0 transition-transform group-hover:translate-x-1"})]})]}),d.jsxs("button",{onClick:()=>
480r("/aussteller-login"),className:"group relative w-full rounded-3xl bg-card shadow-card hover:shadow-pop border border-border overflow-hidden p-6 text-left tap-scale transition-shadow",children:[d.jsx("div",{className:"absolute -top-8 -right-8 w-32 h-32 rounded-full bg-accent/15 blur-2xl pointer-events-none"}),d.jsxs("div",{className:"relative flex items-center gap-4",children:[d.jsx("div",{className:"w-14 h-14 rounded-2xl gradient-accent flex items-center justify-center shadow-soft shrink-0",children:d.jsx(Ty,{className:"w-7 h-7 text-accent-foreground"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-display text-2xl font-extrabold text-foreground leading-tight",children:"Aussteller"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Mit Zugangscode ins Aussteller-Portal einloggen."})]}),d.jsx(Mx,{className:"w-5 h-5 text-accent shrink-0 transition-transform group-hover:translate-x-1"})]})]}),d.jsx("p",{className:"text-center text-[11px] text-muted-foreground mt-2",children:"© Messe Wieselburg · Volksfestplatz 3, 3250 Wieselburg"}),d.jsx(Lh,{className:"py-1"})]})]}):d.jsx("div",{className:"min-h-screen flex flex-col gradient-soft",children:d.jsxs("div",{className:"flex-1 px-6 safe-top pb-8 flex flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 text-primary font-display font-bold",children:[d.jsx(Eq,{className:"w-5 h-5"}),d.jsx("span",{children:"Messe Wieselburg"})]}),e==="hero"?d.jsxs("div",{className:"flex-1 flex flex-col justify-center",children:[d.jsxs("div",{className:"inline-flex items-center gap-2 self-start rounded-full bg-accent/10 text-accent px-3 py-1 text-xs font-bold mb-5",children:[d.jsx(Bx,{className:"w-3.5 h-3.5"})," Schule & Beruf 2026"]}),d.jsxs("h1",{className:"font-display text-5xl font-extrabold leading-[1.05] text-foreground",children:["Find deinen",d.jsx("br",{}),d.jsx("span",{className:"text-primary",children:"Traumberuf."})]}),d.jsx("p",{className:"mt-4 text-muted-foreground text-base",children:"Dein digitaler Guide durch die Messe. Quiz, Rallye, Workshops und die ganze Halle in der Hosentasche."}),d.jsxs("button",{onClick:()=>t("form"),className:"mt-10 group inline-flex items-center justify-center gap-2 gradient-hero text-primary-foreground font-display font-bold text-lg rounded-2xl py-4 shadow-pop tap-scale",children:["Start",d.jsx(Dx,{className:"w-5 h-5 transition-transform group-hover:translate-x-0.5"})]}),d.jsx("button",{onClick:()=>t("role"),className:"mt-3 text-sm font-semibold text-muted-foreground underline-offset-2 hover:underline",children:"Zurück"})]}):d.jsxs("form",{onSubmit:g,className:"flex-1 flex flex-col justify-center",children:[d.jsx("h2",{className:"font-display text-3xl font-extrabold",children:"Kurz vorstellen"}),d.jsx("p",{className:"mt-1 text-muted-foreground",children:"Damit dein Tag persönlich wird."}),d.jsx("label",{className:"block mt-7 text-sm font-bold text-foreground",children:"Vorname"}),d.jsx("input",{autoFocus:!0,value:n,onChange:y=>s(y.target.value),maxLength:60,className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"z. B. Mia"}),d.jsx("label",{className:"block mt-4 text-sm font-bold text-foreground",children:"PLZ"}),d.jsx("input",{value:i,onChange:y=>a(y.target.value.replace(/[^0-9]/g,"")),inputMode:"numeric",maxLength:10,className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"3250"}),d.jsx("label",{className:"block mt-4 text-sm font-bold text-foreground",children:"Schulform / Rolle"}),d.jsxs("select",{value:c,onChange:y=>u(y.target.value),className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary appearance-none",children:[d.jsx("option",{value:"",disabled:!0,children:"Bitte auswählenâ¦"}),Q6.map(y=>d.jsx("option",{value:y,children:y},y))]}),f&&d.jsx("p",{className:"mt-3 text-sm font-semibold text-destructive",children:f}),d.jsxs("button",{type:"submit",disabled:m,className:"mt-7 inline-flex items-center justify-center gap-2 gradient-hero text-primary-foreground font-display font-bold text-lg rounded-2xl py-4 shadow-pop tap-scale disabled:opacity-60",children:[m?"Lädtâ¦":"Los geht's",d.jsx(Dx,{className:"w-5 h-5"})]})]}),d.jsx(Lh,{className:"py-2"})]})})}const Ure="/assets/schule-beruf-logo-Da6YsKFk.png",eU=["Begleitperson/Eltern","Mittelschule","Polytechnischer Lehrgang","Sondersc
480hule","Allgemeinbildende Höhere Schule (AHS)","Berufsbildende Mittlere Schule (BMS)","Berufsbildende Höhere Schule (BHS)","Sonstige"],$re=J6({first_name:uS().trim().min(1,"Bitte Vornamen eingeben").max(60),zip_code:uS().trim().regex(/^[0-9]{3,10}$/,"Bitte gültige PLZ"),school:ON(eU,{errorMap:()=>({message:"Bitte Schulform wählen"})})});function zre(){const r=ba(),[e]=I4(),t=(e.get("source")||"").toLowerCase().trim(),n=["qrcode","link"].includes(t)?t:"link",[s,i]=S.useState(""),[a,o]=S.useState(""),[l,c]=S.useState(""),[u,f]=S.useState(null),[p,m]=S.useState(!1);S.useEffect(()=>{J2()&&r("/home",{replace:!0})},[r]);async function x(g){var v;g.preventDefault(),f(null);const y=$re.safeParse({first_name:s,zip_code:a,school:l});if(!y.success){f(((v=y.error.issues[0])==null?void 0:v.message)??"Ungültige Eingabe");return}m(!0);try{const{data:w,error:b}=await et.rpc("create_visitor_profile",{p_first_name:y.data.first_name,p_zip_code:y.data.zip_code,p_role:"visitor",p_school:y.data.school,p_source:n});if(b){console.error("create_visitor_profile error",b),f(`Registrierung fehlgeschlagen: ${b.message}`),le.error(`Registrierung fehlgeschlagen: ${b.message}`);return}const _=Array.isArray(w)?w[0]:w;if(!_){f("Registrierung fehlgeschlagen. Bitte erneut versuchen."),le.error("Registrierung fehlgeschlagen. Bitte erneut versuchen.");return}rj({id:_.id,first_name:_.first_name,zip_code:_.zip_code,role:"visitor"}),le.success("Erfolgreich registriert! Willkommen auf der Messe."),r("/home",{replace:!0})}catch(w){console.error(w),f(`Netzwerkfehler: ${(w==null?void 0:w.message)??"Unbekannt"}`),le.error(`Netzwerkfehler: ${(w==null?void 0:w.message)??"Unbekannt"}`)}finally{m(!1)}}return d.jsxs("div",{className:"min-h-screen flex flex-col gradient-soft",children:[d.jsx("header",{className:"px-5 safe-top",children:d.jsx("div",{className:"rounded-3xl overflow-hidden shadow-card border border-border bg-card",children:d.jsx("img",{src:Ure,alt:"Schule & Beruf",className:"w-full h-auto block"})})}),d.jsxs("div",{className:"flex-1 px-6 pt-6 pb-8 flex flex-col",children:[d.jsxs("div",{className:"inline-flex self-start items-center gap-1.5 rounded-full bg-accent/10 text-accent px-3 py-1 text-[11px] font-bold",children:[n==="qrcode"?d.jsx(Rq,{className:"w-3 h-3"}):d.jsx(Cq,{className:"w-3 h-3"}),n==="qrcode"?"QR-Code-Anmeldung":"Online-Anmeldung"]}),d.jsxs("h1",{className:"font-display text-3xl font-extrabold mt-4 flex items-center gap-2",children:[d.jsx(Bx,{className:"w-6 h-6 text-primary"}),"Willkommen!"]}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Melde dich in wenigen Sekunden an und entdecke die Messe."}),d.jsxs("form",{onSubmit:x,className:"mt-6 flex flex-col",children:[d.jsx("label",{className:"block text-sm font-bold text-foreground",children:"Vorname"}),d.jsx("input",{autoFocus:!0,value:s,onChange:g=>i(g.target.value),maxLength:60,className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"z. B. Mia"}),d.jsx("label",{className:"block mt-4 text-sm font-bold text-foreground",children:"Postleitzahl"}),d.jsx("input",{value:a,onChange:g=>o(g.target.value.replace(/[^0-9]/g,"")),inputMode:"numeric",maxLength:10,className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"3250"}),d.jsx("label",{className:"block mt-4 text-sm font-bold text-foreground",children:"Schulform / Rolle"}),d.jsxs("select",{value:l,onChange:g=>c(g.target.value),className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base focus:outline-none focus:ring-2 focus:ring-primary appearance-none",children:[d.jsx("option",{value:"",disabled:!0,children:"Bitte auswählenâ¦"}),eU.map(g=>d.jsx("option",{value:g,children:g},g))]}),u&&d.jsx("p",{className:"mt-3 text-sm font-semibold text-destructive",children:u}),d.jsxs("button",{type:"submit",disabled:p,className:"mt-7 inline-flex items-center justify-center gap-2 gradient-hero text-primary-foreground font-display font-bold text-lg rounded-2xl py-4 shadow-pop tap-scale disabled:opacity-60",children:[p?"Registriertâ¦":"Jetzt anmelden",d.jsx(Dx,{className:"w-5 h-5"})]}),d.jsx("p",{className:"mt-4 text-center text-[11px] text-muted-foreground",children:"© Messe Wieselburg · Volksfestplatz 3, 3250 Wieselburg"}),d.jsx(Lh,{className:"py-1"})]})]})]})}const kD=r=>`mw.notes.${r}`;function Hre(){const r=Zh(),[e,t]=S.useState([]),[n,s]=S.useState(""),[i,a]=S.useState(!1),o=S.useMemo(()=>{try{const u=localStorage.getItem("sb_interest_result");if(!u)return 0;const f=JSON.parse(u);return Array.isArray(f.top)?Math.min(f.top.length,5):0}catch{return 0}},[]);S.useEffect(()=>{if(!r)return;let u=!1;async function f(){const{data:p}=await et.rpc("get_my_workshop_bookings",{p_app_user_id:r.id}),m=p??[],x=Array.from(new Set(m.map(v=>
480v.workshop_id).filter(Boolean)));let g={};if(x.length>0){const{data:v}=await et.from("workshops").select("id,title,starts_at,uhrzeit,tag,room,exhibitor_id").in("id",x);(v??[]).forEach(w=>{g[w.id]=w})}const y=m.map(v=>{const w=g[v.workshop_id];return{id:v.id,workshop:w?{id:w.id,title:w.title,starts_at:w.starts_at,uhrzeit:w.uhrzeit??null,tag:w.tag??null,room:w.room,exhibitor_id:w.exhibitor_id}:null}}).filter(v=>v.workshop);if(!u){t(y);try{s(localStorage.getItem(kD(r.id))??"")}catch{}}}return f(),window.addEventListener("bookings:changed",f),()=>{u=!0,window.removeEventListener("bookings:changed",f)}},[r==null?void 0:r.id]);const l=S.useMemo(()=>[...e].sort((u,f)=>new Date(u.workshop.starts_at).getTime()-new Date(f.workshop.starts_at).getTime()),[e]);function c(){if(r){a(!0);try{localStorage.setItem(kD(r.id),n.slice(0,5e3)),le.success("Notiz gespeichert â (nur auf diesem Gerät)")}catch{le.error("Notiz nicht gespeichert")}a(!1)}}return d.jsxs("section",{className:"px-5 mt-7 mb-8",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"font-display text-xl font-extrabold",children:"Dein Tag"}),d.jsx(Jt,{to:"/program",className:"text-xs font-bold text-primary",children:"Vollständig â"})]}),d.jsx("div",{className:"mt-3",children:d.jsxs(Jt,{to:o>0?"/quiz?view=matches":"/quiz",className:"relative flex items-center gap-3 rounded-2xl bg-card shadow-card p-3 tap-scale",children:[d.jsx("span",{className:"grid place-items-center w-10 h-10 shrink-0 rounded-xl bg-primary/10 text-primary",children:d.jsx(Bx,{className:"w-5 h-5"})}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block font-display font-bold leading-tight",children:"Meine Matches"}),d.jsx("span",{className:"block text-xs text-muted-foreground",children:o>0?"Deine Top-Aussteller ansehen":"Interessenscheck starten"})]}),o>0&&d.jsxs("span",{className:"shrink-0 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-[10px] font-extrabold",children:[o," Matches"]}),d.jsx(Mx,{className:"w-4 h-4 shrink-0 text-muted-foreground"})]})}),d.jsx("div",{className:"mt-3",children:d.jsxs(Jt,{to:"/my-workshops",className:"relative flex items-center gap-3 rounded-2xl bg-card shadow-card p-3 tap-scale",children:[d.jsx("span",{className:"grid place-items-center w-10 h-10 shrink-0 rounded-xl bg-primary/10 text-primary",children:d.jsx(W4,{className:"w-5 h-5"})}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block font-display font-bold leading-tight",children:"Meine Workshops"}),d.jsx("span",{className:"block text-xs text-muted-foreground",children:l.length>0?"Deine gebuchten Workshops":"Noch keine Buchung â Workshops ansehen"})]}),l.length>0&&d.jsxs("span",{className:"shrink-0 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-[10px] font-extrabold",children:[l.length," gebucht"]}),d.jsx(Mx,{className:"w-4 h-4 shrink-0 text-muted-foreground"})]})}),d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[d.jsx(Nq,{className:"w-4 h-4"}),d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider",children:"Meine Notizen"})]}),d.jsx("textarea",{value:n,onChange:u=>s(u.target.value),maxLength:5e3,rows:4,placeholder:"Wichtige Stände, Ansprechpartner, Termineâ¦",className:"mt-2 w-full rounded-2xl border border-border bg-card p-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary"}),d.jsxs("button",{onClick:c,disabled:i,className:"mt-2 inline-flex items-center gap-1.5 gradient-hero text-primary-foreground rounded-xl px-4 py-2 text-sm font-bold tap-scale disabled:opacity-60",children:[d.jsx(c1,{className:"w-4 h-4"})," ",i?"Speichertâ¦":"Notiz speichern"]}),d.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Nur auf diesem Gerät gespeichert. Wird nicht an den Server übertragen."}),d.jsx("p",{className:"mt-2 rounded-xl border border-primary/30 bg-primary/10 px-3 py-2 text-[11px] font-semibold text-primary",children:"Hinweis: Gespeicherte Notizen werden nach 6 Monaten automatisch gelöscht, da die App-Daten für die nächste Messe aktualisiert werden."})]})]})}const Wre=1,Vre="8cecf318-9935-4e52-aa1f-c6d58931329d",Gre="57e338b8-5bef-4dfa-a296-9cd48805097b",Kre="/__l5e/assets-v1/8cecf318-9935-4e52-aa1f-c6d58931329d/schub-logo.png",Xre="a/v1/57e338b8-5bef-4dfa-a296-9cd48805097b/8cecf318-9935-4e52-aa1f-c6d58931329d/schub-logo.png",Yre="schub-logo.png",qre=232845,Zre="image/png",Jre="2026-08-03T15:51:32Z",tU={version:Wre,asset_id:Vre,project_id:Gre,url:Kre,r2_key:Xre,original_filename:Yre,size:qre,content_type:Zre,created_at:Jre},Qre=[{to:"/quiz",title:"Interessenscheck",subtitle:"Finde deine Top-5-Berufe",Icon:Bx},{to:"/rallye",title:"Messe-Rallye",subtitle:"Sammle Antworten und erkunde die Messe",Icon:Ux},{to:"/level-up",title:`Level Up 481Challenge`,subtitle:"Sammle Punkte und steig auf",Icon:K2},{to:"/workshops",title:"Workshops",subtitle:"Schnell buchen â Plätze begrenzt!",Icon:Su},{to:"/program",title:"Programm",subtitle:"Heute live",Icon:Su},{to:"/map",title:"Hallenpläne",subtitle:"",Icon:Ix},{to:"/exhibitors",title:"Aussteller",subtitle:"Alle Stände & Suche",Icon:ec}
481,{to:"/categories",title:`Kategorien- 482Verzeichnis`,subtitle:"Nach Warengruppe",Icon:Rh},{to:"/wissenswertes",title:"Wissenswertes",subtitle:"Ãffnungszeiten & Anreise",Icon:D0}];function ene(){const r=Zh(),{triggerAndGo:e}=ere();return d.jsxs("div",{children:[d.jsxs("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem] shadow-card",children:[d.jsx("div",{className:"flex items-start justify-end pr-10",children:d.jsx("img",{src:tU.url,alt:"Schule & Beruf",className:"h-16 w-auto object-contain drop-shadow-md"})}),d.jsxs("h1",{className:"font-display text-2xl font-extrabold -mt-4",children:["Hi ",(r==null?void 0:r.first_name)??"Du"," ð"]}),d.jsx("p",{className:"text-primary-foreground/85 text-xs mt-0.5",children:"Dein heutiger Plan, deine Treffer, dein Tag."}),d.jsxs(Jt,{to:"/quiz",className:"mt-5 flex items-center justify-between rounded-2xl bg-white/15 backdrop-blur px-4 py-3 hover:bg-white/20 tap-scale",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-bold opacity-80",children:"Empfohlen"}),d.jsx("p",{className:"font-display font-bold",children:"Checke hier deine Interessen"})]}),d.jsx(Dx,{className:"w-5 h-5"})]})]}),d.jsx("section",{className:"px-4 mt-5 grid grid-cols-2 gap-3",children:Qre.map(({to:t,title:n,subtitle:s,Icon:i})=>d.jsxs("a",{href:t,onClick:a=>{a.preventDefault(),e(t)},className:"group relative rounded-2xl p-4 shadow-card tap-scale overflow-hidden cursor-pointer bg-card text-card-foreground",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 rounded-xl bg-primary/10 text-primary",children:d.jsx(i,{className:"w-5 h-5"})}),d.jsx("p",{className:"mt-3 font-display font-bold leading-tight whitespace-pre-line",children:n}),s&&d.jsx("p",{className:"text-xs mt-0.5 text-muted-foreground",children:s})]},t))}),d.jsx(Hre,{}),d.jsx(Lh,{})]})}function no({fallback:r="/home",label:e="Zurück",className:t=""}){const n=ba();function s(){window.history.length>1?n(-1):n(r)}return d.jsxs("button",{onClick:s,className:`inline-flex items-center gap-1.5 rounded-xl bg-card border border-border px-3 py-2 text-sm font-bold text-foreground shadow-soft tap-scale ${t}`,"aria-label":e,children:[d.jsx(_i,{className:"w-4 h-4"})," ",e]})}const wT={a:"Technik & Handwerk",b:"IT & Digitalisierung",c:"Menschen, Wirtschaft & Organisation",d:"Kreativität & Gestaltung"},q0=[{question:"Was macht dir am meisten SpaÃ?",options:[{label:"Dinge bauen, reparieren oder mit Werkzeug arbeiten",field:"a"},{label:"Am Computer arbeiten, programmieren oder technische Lösungen finden",field:"b"},{label:"Mit Menschen arbeiten, beraten oder helfen",field:"c"},{label:"Kreativ gestalten, zeichnen oder etwas entwerfen",field:"d"}]},{question:"Welches Schulprojekt würdest du wählen?",options:[{label:"Ein Modell bauen oder eine Maschine testen",field:"a"},{label:"Eine App oder Website entwickeln",field:"b"},{label:"Ein Event organisieren oder eine Gruppe leiten",field:"c"},{label:"Ein Design-, Mode- oder Kunstprojekt gestalten",field:"d"}]},{question:"Worauf wärst du besonders stolz?",options:[{label:"Ein Fahrrad, Auto oder Gerät funktioniert wieder",field:"a"},{label:"Ein Computerproblem ist gelöst",field:"b"},{label:"Jemandem bei einem Problem geholfen zu haben",field:"c"},{label:"Etwas Schönes selbst geschaffen zu haben",field:"d"}]},{question:"Wie arbeitest du am liebsten?",options:[{label:"Praktisch mit den Händen",field:"a"},{label:"Logisch und mit Technik",field:"b"},{label:"Gemeinsam mit anderen Menschen",field:"c"},{label:"Kreativ und mit eigenen Ideen",field:"d"}]},{question:"Was würdest du auf der Messe zuerst ausprobieren?",options:[{label:"Metall-, Elektro-, Fahrzeug- oder Handwerks-Workshop",field:"a"},{label:"IT- oder Robotik-Station",field:"b"},{label:"Gesundheits-, Sozial-, Dienstleistungsberufe und Gastronomie",field:"c"},{label:"Kreativ-, Mode-, Floristik- oder Gestaltungsangebote",field:"d"}]},{question:"Wie verbringst du deine Freizeit am liebsten?",options:[{label:"Ich tüftle, repariere oder baue etwas.",field:"a"},{label:"Ich beschäftige mich mit Computern oder Games.",field:"b"},{label:"Ich treffe Menschen oder engagiere mich in Gruppen.",field:"c"},{label:"Ich gestalte, fotografiere oder mache kreative Projekte.",field:"d"}]},{question:"Welche Aufgabe klingt für dich am spannendsten?",options:[{label:"Eine Maschine zusammenbauen.",field:"a"},{label:"Eine digitale Lösung entwickeln.",field:"b"},{label:"Ein Team koordinieren.",field:"c"},{label:"Ein neues Design entwerfen.",field:"d"}]}],Pk="sb_interest_result",rU="sb_match_display_counts",SD=3;function tne(){try{return JSON.parse(localStorage.getItem(rU)||"{}")}catch{return{}}}function rne(r){try{localStorage.setItem(rU,JSON.stringify(r))}catch{}}function ED(){try{const r=localStorage.getItem(Pk);return r?JSON.parse(r):null}catch{return null}}function nne(){const[r]=I4(),[e,t]=S.useState(()=>ED()),[n,s]=S.useState(()=>r.get("view")==="matches"&&ED()?"matches":"intro"),[i,a]=S.useState(0),[o,l]=S.useState(()=>q0.map(()=>null)),[c,u]=S.useState([]),[f,p]=S.useState(!0),[m,x]=S.useState([]);S.useEffect(()=>{(async()=>{const{data:k}=await et.from("kvz_matching").select("kvz_nr,bezeichnung,hauptgruppe,ams_typ,anteil_a,anteil_b,anteil_c,anteil_d");u(k??[]),p(!1)})()},[]),S.useEffect(()=>{var ee;if(!e)return;if((ee=e.matches)!=null&&ee.length){x(e.matches);return}if(!c.length)return;const k=e.weights,E=X=>(X??"").toLowerCase().trim().replace(/\s+/g," "),P=X=>(k.a*X.anteil_a+k.b*X.anteil_b+k.c*X.anteil_c+k.d*X.anteil_d)/100,O=new Map,D=new Map,H=new Map;
482c.forEach(X=>{O.set(X.kvz_nr,{score:P(X),bezeichnung:X.bezeichnung}),[X.bezeichnung,X.hauptgruppe,X.ams_typ].forEach(W=>{W&&D.set(E(W),X.kvz_nr)}),E(X.bezeichnung).replace(/[():,\/]/g," ").split(/[\s\-]+/).map(W=>W.replace(/(:in|innen|:innen)$/,"")).filter(W=>W.length>=6).forEach(W=>{H.has(W)||H.set(W,X.kvz_nr)})});const B=[...O.values()].reduce((X,W)=>X+W.score,0)/(O.size||1);(async()=>{const{data:X}=await et.from("exhibitors").select("id,name,hall,stand_no,kvz_nrs,categories,keywords,promo_text,exclude_from_quiz").order("name"),W=tne(),Y=(X??[]).filter(U=>U.exclude_from_quiz!==!0).map(U=>{const te=new Set;if((U.kvz_nrs??[]).forEach(ie=>te.add(ie)),[...U.categories??[],...U.keywords??[]].forEach(ie=>{const ae=D.get(E(ie));ae&&te.add(ae)}),!te.size){const ie=E(`${U.name??""} ${U.promo_text??""} ${(U.keywords??[]).join(" ")}`);H.forEach((ae,ge)=>{ie.includes(ge)&&te.add(ae)})}let re={score:-1,bezeichnung:"",nr:-1},se=0;return te.forEach(ie=>{const ae=O.get(ie);ae&&(se+=1,ae.score>re.score&&(re={score:ae.score,bezeichnung:ae.bezeichnung,nr:ie}))}),re.score<0&&(re={score:B,bezeichnung:"",nr:-1}),{id:U.id,name:U.name,hall:U.hall,stand_no:U.stand_no,score:re.score,topic:re.bezeichnung,kvzNr:re.nr,matchCount:se}}).filter(U=>U.score>=0),F=new Map;Y.forEach(U=>{const te=Math.round(U.score/SD)*SD,re=F.get(te)??[];re.push(U),F.set(te,re)});const J=[];[...F.keys()].sort((U,te)=>te-U).forEach(U=>{F.get(U).map(re=>({e:re,rank:(W[re.id]??0)*2-re.matchCount+Math.random()*1.5})).sort((re,se)=>re.rank-se.rank).forEach(re=>J.push(re.e))});const ne=[],I=new Set,z=new Set;for(const U of J){if(ne.length>=5)break;I.has(U.hall??"")||U.kvzNr>=0&&z.has(U.kvzNr)||(ne.push(U),I.add(U.hall??""),U.kvzNr>=0&&z.add(U.kvzNr))}for(const U of J){if(ne.length>=5)break;ne.some(te=>te.id===U.id)||ne.push(U)}const M={...W};ne.forEach(U=>{M[U.id]=(M[U.id]??0)+1}),rne(M),x(ne),t(U=>{if(!U)return U;const te={...U,matches:ne};try{localStorage.setItem(Pk,JSON.stringify(te))}catch{}return te})})()},[e,c]);const g=S.useRef("");S.useEffect(()=>{if(n!=="matches"||!m.length)return;const k=m.map(P=>P.id).filter(Boolean);if(!k.length)return;const E=k.slice().sort().join(",");g.current!==E&&(g.current=E,et.rpc("increment_exhibitor_proposal",{p_exhibitor_ids:k}).then(({error:P})=>{P&&console.warn("proposal tracking failed:",P.message)}))},[n,m]);const y=q0.length,v=q0[i],w=o[i]??null;function b(k){l(E=>{const P=[...E];return P[i]=k,P})}function _(){if(w===null)return;if(i+1<y){a(i+1);return}const k={a:0,b:0,c:0,d:0};o.forEach((E,P)=>{E!==null&&(k[q0[P].options[E].field]+=1)}),T(k)}function T(k){const E=k.a+k.b+k.c+k.d||1,P={a:k.a/E*100,b:k.b/E*100,c:k.c/E*100,d:k.d/E*100},O=c.map(H=>({kvz_nr:H.kvz_nr,bezeichnung:H.bezeichnung,hauptgruppe:H.hauptgruppe,score:(P.a*H.anteil_a+P.b*H.anteil_b+P.c*H.anteil_c+P.d*H.anteil_d)/100})).sort((H,B)=>B.score-H.score).slice(0,5),D={weights:P,top:O,created_at:new Date().toISOString()};localStorage.setItem(Pk,JSON.stringify(D)),t(D),s("matches");try{const H=Object.keys(P).sort((B,ee)=>P[ee]-P[B]).map(B=>wT[B]);sessionStorage.setItem("sb_user_categories",JSON.stringify(H)),window.dispatchEvent(new Event("sb_user_categories_change"))}catch{}}function A(){localStorage.removeItem(Pk),sessionStorage.removeItem("sb_user_categories"),window.dispatchEvent(new Event("sb_user_categories_change")),t(null),l(q0.map(()=>null)),a(0),x([]),s("quiz")}const N=S.useMemo(()=>e?Object.keys(wT).map(k=>({f:k,label:wT[k],value:Math.round(e.weights[k])})):[],[e]);return d.jsxs("div",{className:"px-5 safe-top pb-8",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(Bx,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Interessenscheck"})]}),n==="quiz"?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-3 h-1.5 bg-secondary rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full gradient-accent transition-all duration-300",style:{width:`${(i+1)/y*100}%`}})}),d.jsxs("p",{className:"mt-1.5 text-[11px] font-bold text-muted-foreground",children:["Frage ",i+1," von ",y," · nur eine Antwort möglich"]}),d.jsx("h2",{className:"font-display text-lg sm:text-xl font-extrabold mt-3 leading-tight",children:v.question}),d.jsx("div",{className:"mt-3 flex flex-col gap-2",role:"radiogroup","aria-label":v.question,children:v.options.map((k,E)=>{const P=w===E;return d.jsxs("button",{role:"radio","aria-checked":P,onClick:()=>b(E),className:`flex items-start gap-2.5 text-left rounded-xl border-2 px-3 py-2.5 text-sm font-semibold leading-snug tap-scale transition-colors ${P?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:[d.jsx("span",{className:`mt-0.5 grid place-items-center w-4 h-4 shrink-0 rounded-full border-2 ${P?"border-primary":"border-muted-foreground
482/40"}`,children:P&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"})}),d.jsx("span",{children:k.label})]},E)})}),d.jsxs("div",{className:"sticky bottom-0 z-10 -mx-5 mt-3 px-5 pt-2 pb-2 bg-background/90 backdrop-blur-sm flex items-center gap-2",children:[i>0&&d.jsx("button",{onClick:()=>a(i-1),className:"rounded-xl border-2 border-border px-3 py-2.5 text-sm font-bold text-muted-foreground tap-scale",children:"Zurück"}),d.jsx("button",{onClick:_,disabled:w===null,className:"flex-1 gradient-hero text-primary-foreground rounded-xl py-3 font-display font-extrabold tap-scale shadow-pop disabled:opacity-40 disabled:shadow-none",children:i+1===y?"Auswertung starten":"Weiter"})]})]}):n==="intro"||!e?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-5 rounded-2xl bg-card shadow-card border border-border p-6 text-center",children:[d.jsx($8,{className:"w-8 h-8 mx-auto text-primary"}),d.jsx("h2",{className:"mt-3 font-display text-xl font-extrabold leading-tight",children:"Finde deine passenden Ausbildungsplätze"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Beantworte 7 kurze Fragen und finde heraus, welche Berufe und Aussteller am besten zu dir passen."}),d.jsx("button",{onClick:()=>{a(0),l(q0.map(()=>null)),s("quiz")},className:"mt-5 w-full bg-primary text-white rounded-2xl py-3.5 font-display font-extrabold tap-scale shadow-pop",children:"Jetzt Interessenscheck starten"})]}),d.jsx("button",{onClick:()=>s("matches"),disabled:!e,className:"mt-3 w-full rounded-2xl border-2 border-border bg-card py-3 text-sm font-bold text-primary tap-scale disabled:opacity-40",children:"ð Meine Matches anzeigen"}),!e&&d.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"Noch keine Ergebnisse vorhanden."})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-5 rounded-2xl bg-card shadow-card p-4",children:[d.jsx("p",{className:"font-display font-bold text-sm",children:"Dein Interessensprofil"}),d.jsx("div",{className:"mt-3 flex flex-col gap-2",children:N.map(k=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex justify-between text-[11px] font-semibold text-muted-foreground",children:[d.jsx("span",{children:k.label}),d.jsxs("span",{children:[k.value,"%"]})]}),d.jsx("div",{className:"h-1.5 bg-secondary rounded-full overflow-hidden mt-0.5",children:d.jsx("div",{className:"h-full bg-primary",style:{width:`${k.value}%`}})})]},k.f))})]}),d.jsx("h2",{className:"font-display text-xl font-extrabold mt-6",children:"Deine Top 5 Aussteller"}),d.jsx("div",{className:"mt-3 flex flex-col gap-3",children:m.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Aktuell sind keine passenden Aussteller eingetragen."}):m.map((k,E)=>d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("p",{className:"text-[11px] font-bold text-muted-foreground",children:["#",E+1]}),d.jsx("p",{className:"font-display font-bold leading-tight",children:k.name}),k.topic&&d.jsx("span",{className:"mt-1 inline-block text-[10px] font-bold uppercase tracking-wide bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:k.topic}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[k.hall,", Stand ",k.stand_no]})]}),d.jsxs("span",{className:"shrink-0 rounded-full bg-primary text-primary-foreground px-2.5 py-1 text-xs font-extrabold",children:[Math.round(k.score),"% Match"]})]}),d.jsxs(Jt,{to:`/map?exhibitor=${k.id}&hall=${encodeURIComponent(k.hall??"")}&stand=${encodeURIComponent(k.stand_no??"")}&focus=1&from=matches&topic=${encodeURIComponent(k.topic??"")}`,className:"mt-3 w-full inline-flex items-center justify-center gap-1.5 gradient-hero text-primary-foreground rounded-xl px-3 py-2.5 text-xs font-bold tap-scale",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"})," Auf dem Hallenplan anzeigen"]})]},k.id))}),d.jsxs("button",{onClick:A,className:"mt-6 mx-auto flex items-center gap-1.5 text-sm font-bold text-primary/80",children:[d.jsx(Ou,{className:"w-4 h-4"})," Interessenscheck wiederholen"]})]})]})}const B_="sb_rallye_step",sne="Glückwunsch! Du hast alle Fragen gemeistert. Viel Spaà noch auf der Messe Wieselburg!";function ine(){const r=Array.from({length:40}),e=["hsl(var(--primary))","hsl(var(--accent))","#bfd100","#ffd166","#ef6e00"];return d.jsx("div",{className:"pointer-events-none fixed inset-0 z-40 overflow-hidden","aria-hidden":!0,
482children:r.map((t,n)=>d.jsx("span",{className:"absolute top-[-10%] w-2 h-3 rounded-[2px] animate-[confettiFall_2.8s_linear_infinite]",style:{left:`${n*7.3%100}%`,background:e[n%e.length],animationDelay:`${n%10*.22}s`,transform:`rotate(${n*37%360}deg)`}},n))})}const AD=15,bT="sb_rallye_order";function TD(r){const e=[...r];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function ane(){const[r,e]=S.useState([]),[t,n]=S.useState([]),[s,i]=S.useState({}),[a,o]=S.useState(!0),[l,c]=S.useState(sne),[u,f]=S.useState(()=>Number(sessionStorage.getItem(B_)??0)),[p,m]=S.useState(null),[x,g]=S.useState(null),[y,v]=S.useState(null),[w,b]=S.useState(!1),_=S.useRef(null);if(S.useEffect(()=>((async()=>{const[{data:P},{data:O},{data:D}]=await Promise.all([et.rpc("get_rallye_questions"),et.from("rallye_settings").select("completion_message").limit(1).maybeSingle(),et.from("exhibitors").select("id,name,hall,stand_no")]),H=P??[];e(H);let B=null;try{const X=JSON.parse(sessionStorage.getItem(bT)??"null");if(Array.isArray(X)&&X.length){const W=new Map(H.map(F=>[F.id,F])),Y=X.map(F=>W.get(F)).filter(Boolean);Y.length===X.length&&(B=Y)}}catch{}B||(B=TD(H).slice(0,AD),sessionStorage.setItem(bT,JSON.stringify(B.map(X=>X.id))),sessionStorage.setItem(B_,"0"),f(0)),n(B);const ee={};for(const X of D??[])ee[X.id]=X;i(ee),O!=null&&O.completion_message&&c(O.completion_message),o(!1)})(),()=>{_.current&&clearTimeout(_.current)}),[]),S.useEffect(()=>{sessionStorage.setItem(B_,String(u))},[u]),a)return d.jsx("div",{className:"px-5 safe-top pt-10 text-sm text-muted-foreground",children:"Lädtâ¦"});if(!t.length)return d.jsxs("div",{className:"px-5 safe-top",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-accent mt-4",children:[d.jsx(Ux,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Messe-Rallye"})]}),d.jsx("div",{className:"mt-6 rounded-2xl bg-card border border-border p-8 text-center text-sm text-muted-foreground",children:"Keine aktiven Fragen verfügbar. Die Messe-Rallye wird vorbereitet."})]});const T=u>=t.length,A=t[Math.min(u,t.length-1)];async function N(P,O){if(w)return;O==null||O.blur(),b(!0),v(P);const{data:D,error:H}=await et.rpc("check_rallye_answer",{p_question_id:A.id,p_answer:P}),B=!H&&D===!0;document.activeElement instanceof HTMLElement&&document.activeElement.blur(),B?(m("correct"),g(null),_.current=setTimeout(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),m(null),b(!1),v(null),g(null),f(ee=>ee+1)},800)):(m("wrong"),g(P),_.current=setTimeout(()=>{m(null),b(!1),v(null),g(null)},800))}function k(){sessionStorage.removeItem(B_);const P=TD(r).slice(0,AD);sessionStorage.setItem(bT,JSON.stringify(P.map(O=>O.id))),n(P),f(0),m(null),g(null),v(null),b(!1)}const E=[{key:"a",label:"A",text:A.option_a},{key:"b",label:"B",text:A.option_b},{key:"c",label:"C",text:A.option_c}];return d.jsxs("div",{className:"px-5 safe-top relative",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-accent mt-4",children:[d.jsx(Ux,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Messe-Rallye"})]}),T?d.jsxs("div",{className:"mt-10 text-center pb-16",children:[d.jsx(ine,{}),d.jsx("div",{className:"inline-grid place-items-center w-24 h-24 rounded-full gradient-accent text-accent-foreground shadow-pop mx-auto",children:d.jsx(L8,{className:"w-11 h-11"})}),d.jsx("h2",{className:"font-display text-3xl font-extrabold mt-4",children:"Geschafft! ð"}),d.jsx("p",{className:"mt-3 text-base text-muted-foreground whitespace-pre-line px-2",children:l}),d.jsxs("div",{className:"mt-8 flex flex-col gap-2",children:[d.jsxs("button",{onClick:k,className:"inline-flex items-center justify-center gap-1.5 gradient-hero text-primary-foreground rounded-2xl py-3.5 font-display font-bold tap-scale",children:[d.jsx(Ou,{className:"w-4 h-4"})," Nochmal spielen"]}),d.jsx(Jt,{to:"/home",className:"text-sm font-bold text-primary py-2",children:"Zur Startseite"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-4 h-2 bg-secondary rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full gradient-accent transition-all duration-300",style:{width:`${(u+1)/t.length*100}%`}})}),d.jsxs("p",{className:"mt-2 text-xs font-bold text-muted-foreground",children:["Frage ",u+1," von ",t.length]}),d.jsx("h2",{className:"font-display text-xl font-extrabold mt-5 leading-snug",children:A.question}),A.target_exhibitor_id&&s[A.target_exhibitor_id]&&d.jsxs("div",{className:"mt-4 rounded-2xl border border-primary/30 bg-primary/5 p-3",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wide text-primary",children:"Tipp: Antwort findest du hier"}),d.jsx("p",{className:"font-display font-bold leading-tight mt-0.5 break-words",children:s[A.target_exhibitor_id].name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Halle ",s[A.target_exhibitor_id].hall," · Stand ",s[A.target_exhibitor_id].stand_no]}),d.jsxs(Jt,{to:`/map?exhibitor=${A.target_exhibitor_id}&from=rallye`,className:"mt-2 inline-flex items-center gap-1.5 gradient-hero text-primary-foreground rounded-xl px-3.5 py-2.5 text-sm font-bold tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Stand auf dem Hallenplan anzeigen"]})]}),d.jsx("div",{className:"mt-5 flex flex-col gap-3 pb-8",children:E.map(P=>{const O=x===P.key&&p==="wrong",D=y===P.key&&!O;return d.jsxs("button",{type:"button",onClick:H=>N(P.key,H.currentTarget),disabled:w,className:`flex items-center gap-3 rounded-2xl border-2 px-4 py-4 font-semibold text-left transition-colors outline-none focus:outline-none focus-visible:outline-none focus:ring-0 disabled:opacity-90 ${O?"border-destructive bg-destructive/10 animate-[shake_0.4s_ease-in-out]":D?"border-accent bg-accent/10":"border-border bg-card"}`,children:[d.jsx("span",{className:"grid place-items-center w-8 h-8 shrink-0 rounded-full bg-primary/10 text-primary font-extrabold",children:P.label}),d.jsx("span",{className:"min-w-0 break-words",children:P.text})]},`question-${u}-option-${P.key}`)})},`q-${u}-${A.id}`),p&&d.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-background/40 backdrop-blur-[2px] pointer-events-none",children:d.jsx("div",{className:`grid place-items-center w-32 h-32 rounded-full shadow-pop animate-[popIn_0.25s_ease-out] ${p==="correct"?"bg-success/90":"bg-destructive/90"}`,children:d.jsx("span",{className:"text-6xl",children:p==="correct"?"ð":"ð¢"})})})]})]})}const U_="sb_levelup_step",_T="sb_levelup_order",CD=15,one="Level Up! Du hast die Challenge gemeistert. Viel Spaà noch auf der Messe Wieselburg!";function lne(){const r=Array.from({length:40}),e=["hsl(var(--primary))","hsl(var(--accent))","#bfd100","#ffd166","#ef6e00"];return d.jsx("div",{className:"pointer-events-none fixed inset-0 z-40 overflow-hidden","aria-hidden":!0,
482children:r.map((t,n)=>d.jsx("span",{className:"absolute top-[-10%] w-2 h-3 rounded-[2px] animate-[confettiFall_2.8s_linear_infinite]",style:{left:`${n*7.3%100}%`,background:e[n%e.length],animationDelay:`${n%10*.22}s`,transform:`rotate(${n*37%360}deg)`}},n))})}function ND(r){const e=[...r];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function cne(){const r=Zh(),[e,t]=S.useState([]),[n,s]=S.useState([]),[i,a]=S.useState({}),[o,l]=S.useState(!0),[c,u]=S.useState(one),[f,p]=S.useState(()=>Number(sessionStorage.getItem(U_)??0)),[m,x]=S.useState(0),[g,y]=S.useState(0),[v,w]=S.useState(null),[b,_]=S.useState(null),[T,A]=S.useState(null),[N,k]=S.useState(!1),E=S.useRef(null),P=S.useRef(Date.now()),O=S.useRef(!1);S.useEffect(()=>((async()=>{const[{data:F},{data:J},{data:ne}]=await Promise.all([et.rpc("get_level_up_questions"),et.from("level_up_settings").select("completion_message").limit(1).maybeSingle(),et.from("exhibitors").select("id,name,hall,stand_no")]),I=F??[];t(I);let z=null;try{const U=JSON.parse(sessionStorage.getItem(_T)??"null");if(Array.isArray(U)&&U.length){const te=new Map(I.map(se=>[se.id,se])),re=U.map(se=>te.get(se)).filter(Boolean);re.length===U.length&&(z=re)}}catch{}z||(z=ND(I).slice(0,CD),sessionStorage.setItem(_T,JSON.stringify(z.map(U=>U.id))),sessionStorage.setItem(U_,"0"),p(0)),s(z);const M={};for(const U of ne??[])M[U.id]=U;a(M),J!=null&&J.completion_message&&u(J.completion_message),l(!1)})(),()=>{E.current&&clearTimeout(E.current)}),[]),S.useEffect(()=>{sessionStorage.setItem(U_,String(f))},[f]);const D=n.reduce((F,J)=>F+(Number(J.points)||1),0),H=n.length>0&&f>=n.length;if(S.useEffect(()=>{!H||O.current||(O.current=!0,et.rpc("save_level_up_result",{p_app_user_id:(r==null?void 0:r.id)??null,p_display_name:(r==null?void 0:r.first_name)??null,p_score:m,p_max_score:D,p_correct_count:g,p_question_count:n.length,p_duration_seconds:Math.round((Date.now()-P.current)/1e3)}).then(({error:F})=>{F&&console.warn("level_up result save failed",F.message)}))},[H,m,D,g,n.length,r]),o)return d.jsx("div",{className:"px-5 safe-top pt-10 text-sm text-muted-foreground",children:"Lädtâ¦"});if(!n.length)return d.jsxs("div",{className:"px-5 safe-top",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-accent mt-4",children:[d.jsx(K2,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Level Up Challenge"})]}),d.jsx("div",{className:"mt-6 rounded-2xl bg-card border border-border p-8 text-center text-sm text-muted-foreground",children:"Keine aktiven Fragen verfügbar. Die Level Up Challenge wird vorbereitet."})]});const B=H,ee=n[Math.min(f,n.length-1)];async function X(F,J){if(N)return;J==null||J.blur(),k(!0),A(F);const{data:ne,error:I}=await et.rpc("check_level_up_answer",{p_question_id:ee.id,p_answer:F}),z=!I&&ne===!0;document.activeElement instanceof HTMLElement&&document.activeElement.blur(),z?(w("correct"),_(null),x(M=>M+(Number(ee.points)||1)),y(M=>M+1),E.current=setTimeout(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),w(null),k(!1),A(null),_(null),p(M=>M+1)},800)):(w("wrong"),_(F),E.current=setTimeout(()=>{w(null),k(!1),A(null),_(null)},800))}function W(){sessionStorage.removeItem(U_);const F=ND(e).slice(0,CD);sessionStorage.setItem(_T,JSON.stringify(F.map(J=>J.id))),s(F),p(0),x(0),y(0),w(null),_(null),A(null),k(!1),P.current=Date.now(),O.current=!1}const Y=[{key:"a",label:"A",text:ee.option_a},{key:"b",label:"B",text:ee.option_b},{key:"c",label:"C",text:ee.option_c}];return d.jsxs("div",{className:"px-5 safe-top relative",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-accent mt-4",children:[d.jsx(K2,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Level Up Challenge"})]}),B?d.jsxs("div",{className:"mt-10 text-center pb-16",children:[d.jsx(lne,{}),d.jsx("div",{className:"inline-grid place-items-center w-24 h-24 rounded-full gradient-accent text-accent-foreground shadow-pop mx-auto",children:d.jsx(L8,{className:"w-11 h-11"})}),d.jsx("h2",{className:"font-display text-3xl font-extrabold mt-4",children:"Level Up! ð"}),d.jsxs("p",{className:"mt-2 font-display text-lg font-bold",children:[m," von ",D," Punkten · ",g,"/",n.length," richtig"]}),d.jsx("p",{className:"mt-3 text-base text-muted-foreground whitespace-pre-line px-2",children:c}),d.jsxs("div",{className:"mt-8 flex flex-col gap-2",children:[d.jsxs("button",{onClick:W,className:"inline-flex items-center justify-center gap-1.5 gradient-hero text-primary-foreground rounded-2xl py-3.5 font-display font-bold tap-scale",children:[d.jsx(Ou,{className:"w-4 h-4"})," Nochmal spielen"]}),d.jsx(Jt,{to:"/home",className:"text-sm font-bold text-primary py-2",children:"Zur Startseite"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-4 h-2 bg-secondary rounded-full overflow-hidden",children:d.jsx("div",{className:"h-full gradient-accent transition-all duration-300",style:{width:`${(f+1)/n.length*100}%`}})}),d.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs font-bold text-muted-foreground",children:[d.jsxs("span",{children:["Frage ",f+1," von ",n.length]}),d.jsxs("span",{children:[m," Punkte"]})]}),d.jsx("h2",{className:"font-display text-xl font-extrabold mt-5 leading-snug",children:ee.question}),ee.target_exhibitor_id&&i[ee.target_exhibitor_id]&&d.jsxs("div",{className:"mt-4 rounded-2xl border border-primary/30 bg-primary/5 p-3",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wide text-primary",children:"Tipp: Antwort findest du hier"}),d.jsx("p",{className:"font-display font-bold leading-tight mt-0.5 break-words",children:i[ee.target_exhibitor_id].name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Halle ",i[ee.target_exhibitor_id].hall," · Stand ",i[ee.target_exhibitor_id].stand_no]}),d.jsxs(Jt,{to:`/map?exhibitor=${ee.target_exhibitor_id}&from=levelup`,className:"mt-2 inline-flex items-center gap-1.5 gradient-hero text-primary-foreground rounded-xl px-3.5 py-2.5 text-sm font-bold tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Stand auf dem Hallenplan anzeigen"]})]}),d.jsx("div",{className:"mt-5 flex flex-col gap-3 pb-8",children:Y.map(F=>{const J=b===F.key&&v==="wrong",ne=T===F.key&&!J;return d.jsxs("button",{type:"button",onClick:I=>X(F.key,I.currentTarget),disabled:N,className:`flex items-center gap-3 rounded-2xl border-2 px-4 py-4 font-semibold text-left transition-colors outline-none focus:outline-none focus-visible:outline-none focus:ring-0 disabled:opacity-90 ${J?"border-destructive bg-destructive/10 animate-[shake_0.4s_ease-in-out]":ne?"border-accent bg-accent/10":"border-border bg-card"}`,children:[d.jsx("span",{className:"grid place-items-center w-8 h-8 shrink-0 rounded-full bg-primary/10 text-primary font-extrabold",children:F.label}),d.jsx("span",{className:"min-w-0 break-words",children:F.text})]},`question-${f}-option-${F.key}`)})},`q-${f}-${ee.id}`),v&&d.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-background/40 backdrop-blur-[2px] pointer-events-none",children:d.jsx("div",{className:`grid place-items-center w-32 h-32 rounded-full shadow-pop animate-[popIn_0.25s_ease-out] ${v==="correct"?"bg-success/90":"bg-destructive/90"}`,children:d.jsx("span",{className:"text-6xl",children:v==="correct"?"ð":"ð¢"})})})]})]})}const PD=["Donnerstag","Freitag","Samstag"],RD=45;function FN(r){const e=String(r.uhrzeit??"").match(/(\d{1,2})[:.](\d{2})/g)??[],t=n=>{const s=n.match(/(\d{1,2})[:.](\d{2})/);return Number(s[1])*60+Number(s[2])};if(e.length>=2)return[t(e[0]),t(e[1])];if(e.length===1)return[t(e[0]),t(e[0])+RD];if(r.starts_at){const n=new Date(r.starts_at);if(!isNaN(n.getTime())){const s=n.getHours()*60+n.getMinutes(),i=r.ends_at?new Date(r.ends_at):null,a=i&&!isNaN(i.getTime())?i.getHours()*60+i.getMinutes():s+RD;return[s,a]}}return null}function jD(r){return`${String(Math.floor(r/60)).padStart(2,"0")}
482:${String(r%60).padStart(2,"0")}`}function une(r,e){const t=FN(r);if(!t)return null;for(const n of e){if(n.id===r.id||(n.tag??"")!==(r.tag??""))continue;const s=FN(n);if(s&&t[0]<s[1]&&s[0]<t[1])return n}return null}function dne(){const r=Zh(),[e,t]=S.useState([]),[n,s]=S.useState({}),[i,a]=S.useState(new Set),[o,l]=S.useState(new Set),[c,u]=S.useState({}),[f,p]=S.useState(null),[m,x]=S.useState(null),[g,y]=S.useState(null),v=S.useRef(0),w=S.useRef(!1);function b(k){v.current=window.scrollY,p(k),window.history.pushState({workshopsSubmenu:!0},""),w.current=!0}function _(k=!1){if(p(null),w.current&&!k){w.current=!1,window.history.back();return}w.current=!1,requestAnimationFrame(()=>window.scrollTo({top:v.current,behavior:"auto"}))}S.useEffect(()=>{function k(){w.current&&(w.current=!1,_(!0))}return window.addEventListener("popstate",k),()=>window.removeEventListener("popstate",k)},[]);async function T(){const[{data:k},{data:E},{data:P},{data:O}]=await Promise.all([et.from("workshops").select("*").order("tag").order("uhrzeit"),et.rpc("get_workshop_counts"),r?et.rpc("get_my_workshop_bookings_detailed",{p_app_user_id:r.id}):Promise.resolve({data:[]}),et.from("exhibitors").select("id,name")]),D={};(E??[]).forEach(X=>{D[X.workshop_id]=Number(X.count)||0});const H=new Set,B=new Set;(P??[]).forEach(X=>{H.add(X.workshop_id),X.booking_type!=="group"&&B.add(X.workshop_id)});const ee={};(O??[]).forEach(X=>{ee[X.id]=X.name}),t(k??[]),s(D),a(H),l(B),u(ee)}S.useEffect(()=>{T()},[r==null?void 0:r.id]),S.useEffect(()=>{const k=et.channel("ws-bookings").on("postgres_changes",{event:"*",schema:"public",table:"workshop_bookings"},()=>T()).subscribe();return()=>{et.removeChannel(k)}},[r==null?void 0:r.id]);const A=S.useMemo(()=>{const k=new Map;for(const E of e){const P=`${E.title}||${E.exhibitor_id??""}`,O=n[E.id]??0,D=Math.max(0,E.max_capacity-O);let H=k.get(P);H||(H={key:P,title:E.title,exhibitorId:E.exhibitor_id,exhibitorName:E.exhibitor_id?c[E.exhibitor_id]??"":"",description:E.description,items:[],totalFree:0,totalCap:0},k.set(P,H)),H.items.push(E),H.totalFree+=D,H.totalCap+=E.max_capacity}return Array.from(k.values()).sort((E,P)=>E.title.localeCompare(P.title))},[e,n,c]),N=S.useMemo(()=>e.filter(k=>o.has(k.id)),[e,o]);return d.jsxs("div",{className:"px-5 safe-top pb-10",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(Su,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Workshops"})]}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Schnell buchen â die Teilnehmerzahl pro Workshop ist begrenzt!"}),d.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[A.length===0&&d.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"Es sind noch keine Workshops eingetragen."}),A.map(k=>{const E=f===k.key,P=k.totalFree<=0;return d.jsxs("article",{className:"rounded-2xl bg-card shadow-card overflow-hidden",children:[d.jsxs("button",{onClick:()=>E?_():b(k.key),className:"w-full text-left p-4 flex items-start justify-between gap-3 tap-scale",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:k.title}),k.exhibitorName&&d.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[d.jsx(C8,{className:"w-3.5 h-3.5"}),k.exhibitorName]}),d.jsx("div",{className:"mt-2",children:P?d.jsx("span",{className:"inline-block rounded-full bg-destructive/15 text-destructive px-3 py-1 text-xs font-extrabold uppercase tracking-wider",children:"Ausgebucht"}):d.jsxs("span",{className:"inline-block rounded-full bg-success/15 text-success px-3 py-1 text-xs font-bold",children:[k.items.length," ",k.items.length===1?"Termin":"Termine"," verfügbar"]})})]}),d.jsx(DE,{className:`w-5 h-5 shrink-0 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&d.jsxs("div",{className:"border-t border-border/60 bg-secondary/40 px-4 py-3 animate-in fade-in slide-in-from-top-1 duration-200",children:[d.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[d.jsxs("button",{onClick:()=>_(),className:"inline-flex items-center gap-1.5 rounded-xl bg-primary/10 text-primary px-3 py-2 text-sm font-extrabold ta
482p-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zur Ãbersicht"]}),k.exhibitorId&&d.jsxs(Jt,{to:`/map?exhibitor=${k.exhibitorId}`,className:"inline-flex items-center gap-1.5 rounded-xl border border-primary/30 text-primary px-3 py-2 text-sm font-bold tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Standort anzeigen"]})]}),k.description&&d.jsx("p",{className:"text-sm text-foreground/80 mb-3",children:k.description}),d.jsx(hne,{items:k.items,counts:n,mine:i,mineIndividual:o,booked:N,onBook:O=>x({w:O,mode:"individual"}),onConflict:(O,D)=>y({target:O,existing:D})})]})]},k.key)})]}),m&&d.jsx(fne,{workshop:m.w,defaultMode:m.mode,free:Math.max(0,m.w.max_capacity-(n[m.w.id]??0)),onClose:()=>x(null),onBooked:()=>{x(null),T()}}),g&&d.jsx(pne,{existing:g.existing,onClose:()=>y(null),onGroupBook:()=>{const k=g.target;y(null),x({w:k,mode:"group"})}})]})}function hne({items:r,counts:e,mine:t,mineIndividual:n,booked:s,onBook:i,onConflict:a}){const o=S.useMemo(()=>{const l=new Map;for(const c of r){const u=c.tag??"â";l.has(u)||l.set(u,[]),l.get(u).push(c)}for(const c of l.values())c.sort((u,f)=>(u.uhrzeit??"").localeCompare(f.uhrzeit??""));return Array.from(l.entries()).sort(([c],[u])=>PD.indexOf(c)+100-(PD.indexOf(u)+100))},[r]);return d.jsx("div",{className:"flex flex-col gap-4",children:o.map(([l,c])=>d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-extrabold uppercase tracking-wider text-primary mb-2",children:l}),d.jsx("ul",{className:"flex flex-col gap-2",children:c.map(u=>{const f=e[u.id]??0,p=Math.max(0,u.max_capacity-f),m=p<=0,x=n.has(u.id),g=t.has(u.id)&&!x,y=x?null:une(u,s);return d.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-xl bg-card border border-border/60 px-3 py-2",children:[d.jsxs("div",{className:"min-w-0 text-sm",children:[d.jsxs("p",{className:"font-bold inline-flex items-center gap-1.5",children:[d.jsx($b,{className:"w-3.5 h-3.5 text-muted-foreground"}),u.uhrzeit??""]}),d.jsxs("p",{className:"text-xs text-muted-foreground inline-flex flex-wrap items-center gap-x-3 mt-0.5",children:[d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Pn,{className:"w-3 h-3"}),u.room]}),d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(ec,{className:"w-3 h-3"}),f,"/",u.max_capacity]}),g&&d.jsx("span",{className:"inline-flex items-center gap-1 font-bold text-success",children:"Gruppe gebucht"})]})]}),x?d.jsx("span",{className:"shrink-0 rounded-lg bg-success/10 text-success px-2.5 py-1.5 text-xs font-bold",children:"Angemeldet"}):m?d.jsx("span",{className:"shrink-0 rounded-lg bg-muted text-muted-foreground px-2.5 py-1.5 text-xs font-bold",children:"Ausgebucht"}):y?d.jsxs("button",{onClick:()=>a(u,y),className:"shrink-0 inline-flex items-center gap-1.5 rounded-lg bg-destructive/10 text-destructive px-2.5 py-1.5 text-xs font-bold tap-scale",children:[d.jsx(V4,{className:"w-3.5 h-3.5"})," Termin überschneidet sich"]}):d.jsxs("button",{onClick:()=>i(u),className:"shrink-0 gradient-hero text-primary-foreground rounded-lg px-3 py-1.5 text-xs font-extrabold tap-scale",children:["Buchen · ",p," frei"]})]},u.id)})})]},l))})}function fne({workshop:r,free:e,onClose:t,onBooked:n,defaultMode:s="individual"}){const i=Zh(),[a,o]=S.useState(s),[l,c]=S.useState((i==null?void 0:i.first_name)??""),[u,f]=S.useState((i==null?void 0:i.zip_code)??""),[p,m]=S.useState(""),[x,g]=S.useState(""),[y,v]=S.useState(!1),[w,b]=S.useState(!1),_=Number(x)||0,T=a==="group"?y?e:_:1,A=a==="group"&&!y&&_>e;async function N(){if(!i){le.error("Bitte zuerst registrieren");return}if(!l.trim()){le.error("Name fehlt");return}if(!/^[0-9]{3,10}$/.test(u)){le.error("Gültige PLZ eingeben");return}if(a==="group"&&!p.trim()){le.error("Schule / Schulform fehlt");return}if(a==="group"&&!y&&_<1){le.error("Bitte gib die Anzahl der Personen ein");return}if(A){le.error(`Leider sind nur noch ${e} Plätze in diesem Slot frei.`);return}b(!0);try{const{data:k,error:E}=await et.rpc("book_workshop",{p_workshop_id:r.id,p_app_user_id:i.id,p_name:l.trim(),p_email:null,p_booking_type:a,p_seats:T,p_school:a==="group"?p.trim():null,p_zip_code:u.trim(),p_block_all:a==="group"&&y});
482if(E){console.error("[book_workshop] Supabase error:",E),le.error(`Buchung fehlgeschlagen: ${E.message}`);return}const P=k;if(!(P!=null&&P.ok)){console.error("[book_workshop] Buchung abgelehnt:",P),(P==null?void 0:P.error)==="full"?le.error("Workshop ausgebucht"):(P==null?void 0:P.error)==="already_booked"?le("Du bist schon angemeldet"):(P==null?void 0:P.error)==="not_enough_seats"?le.error(`Leider sind nur noch ${P.free} Plätze in diesem Slot frei.`):(P==null?void 0:P.error)==="no_user"?le.error("Bitte zuerst registrieren"):le.error("Buchung fehlgeschlagen");return}le.success("Workshop erfolgreich gebucht!",{description:a==="group"?`${P.seats} Plätze für ${r.title}`:r.title,style:{borderColor:"#ef6e00",color:"#ef6e00"}}),window.dispatchEvent(new Event("bookings:changed")),n()}catch(k){console.error("[book_workshop] Unerwarteter Fehler:",k),le.error(`Buchung fehlgeschlagen: ${(k==null?void 0:k.message)??"Unbekannter Fehler"}`)}finally{b(!1)}}return d.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 grid place-items-end sm:place-items-center p-0 sm:p-4",onClick:t,children:d.jsxs("div",{className:"bg-card w-full sm:max-w-md rounded-t-3xl sm:rounded-3xl p-5 shadow-card max-h-[90dvh] overflow-auto",onClick:k=>k.stopPropagation(),children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-muted-foreground font-bold uppercase tracking-wider",children:"Buchung"}),d.jsx("h2",{className:"font-display text-xl font-extrabold leading-tight",children:r.title}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.tag," · ",r.uhrzeit," · ",e," von ",r.max_capacity," Plätzen frei"]})]}),d.jsx("button",{onClick:t,className:"rounded-full p-1.5 hover:bg-muted",children:d.jsx(Xn,{className:"w-5 h-5"})})]}),d.jsx("div",{className:"mt-4 grid grid-cols-2 gap-2",children:["individual","group"].map(k=>d.jsx("button",{onClick:()=>o(k),className:`rounded-xl py-2.5 text-sm font-bold border tap-scale ${a===k?"gradient-hero text-primary-foreground border-transparent":"bg-card text-foreground border-border"}`,children:k==="individual"?"Schüler (Einzelplatz)":"Lehrer (Gruppe/Klasse)"},k))}),d.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[d.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[d.jsx("span",{className:"font-bold",children:a==="group"?"Name Lehrperson":"Vorname"}),d.jsx("input",{className:"rounded-xl border border-border bg-background px-3 py-2",value:l,onChange:k=>c(k.target.value)})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[d.jsx("span",{className:"font-bold",children:"PLZ"}),d.jsx("input",{inputMode:"numeric",className:"rounded-xl border border-border bg-background px-3 py-2",value:u,onChange:k=>f(k.target.value)})]}),a==="group"&&d.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[d.jsx("span",{className:"font-bold",children:"Anzahl der Schüler"}),d.jsx("input",{type:"number",inputMode:"numeric",min:1,max:e,placeholder:"z.B. 15",disabled:y,className:"rounded-xl border border-border bg-background px-3 py-2 disabled:opacity-50",value:x,onChange:k=>g(k.target.value.replace(/[^0-9]/g,""))})]})]}),a==="group"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[d.jsx("span",{className:"font-bold",children:"Schule / Schulform"}),d.jsx("input",{className:"rounded-xl border border-border bg-background px-3 py-2",placeholder:"z.B. Mittelschule Amstetten",value:p,onChange:k=>m(k.target.value)})]}),d.jsxs("label",{className:"flex items-start gap-2 text-sm cursor-pointer",children:[d.jsx("input",{type:"checkbox",className:"mt-1",checked:y,onChange:k=>v(k.target.checked)}),d.jsxs("span",{children:["Ganzen Workshop blockieren (alle ",e," verbleibenden Plätze buchen)"]})]}),A&&d.jsxs("p",{className:"text-sm text-destructive font-bold",children:["Leider sind nur noch ",e," Plätze in diesem Slot frei."]})]})]}),d.jsx("button",{onClick:N,disabled:w||A,className:"mt-5 w-full gradient-hero text-primary-foreground rounded-xl px-4 py-3 text-sm font-extrabold ta
482p-scale disabled:opacity-60",children:w?"Buchtâ¦":a==="group"?`${T} Plätze buchen`:"Platz buchen"}),d.jsxs("button",{onClick:t,className:"mt-2 w-full inline-flex items-center justify-center gap-1.5 rounded-xl border border-border px-4 py-2.5 text-sm font-bold tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zur Ãbersicht"]})]})})}function pne({existing:r,onClose:e,onGroupBook:t}){const n=FN(r),s=n?`${jD(n[0])} - ${jD(n[1])}`:r.uhrzeit??"";return d.jsx("div",{className:"fixed inset-0 z-[60] bg-black/50 grid place-items-end sm:place-items-center p-0 sm:p-4",onClick:e,children:d.jsxs("div",{className:"bg-card w-full sm:max-w-md rounded-t-3xl sm:rounded-3xl p-5 shadow-card",onClick:i=>i.stopPropagation(),role:"alertdialog","aria-modal":"true",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 shrink-0 rounded-xl bg-destructive/10 text-destructive",children:d.jsx(V4,{className:"w-5 h-5"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h2",{className:"font-display text-xl font-extrabold leading-tight",children:"Terminkollision!"}),d.jsxs("p",{className:"text-sm text-foreground/80 mt-2",children:["Du hast um diese Uhrzeit bereits den Workshop"," ",d.jsx("strong",{children:r.title})," (",s," Uhr",r.tag?`, ${r.tag}`:"",") als Einzelplatz gebucht."]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Lehrkräfte können parallele Workshops trotzdem als Gruppe buchen (z. B. Klasse aufteilen)."})]})]}),t&&d.jsx("button",{onClick:t,className:"mt-5 w-full gradient-hero text-primary-foreground rounded-xl px-4 py-3 text-sm font-extrabold tap-scale",children:"Trotzdem als Gruppe buchen"}),d.jsx("button",{onClick:e,className:`mt-2 w-full rounded-xl px-4 py-3 text-sm font-extrabold tap-scale ${t?"border border-border bg-card text-foreground":"gradient-hero text-primary-foreground"}`,children:"Verstanden / Zurück"}),d.jsx(Jt,{to:"/my-workshops",className:"mt-2 block text-center text-sm font-bold text-primary underline underline-offset-4",children:"Zu meinen Workshops"})]})})}function mne(){const r=Zh(),[e,t]=S.useState([]),[n,s]=S.useState(!0),[i,a]=S.useState(null),o=S.useCallback(async()=>{if(!r){t([]),s(!1);return}const{data:u,error:f}=await et.rpc("get_my_workshop_bookings_detailed",{p_app_user_id:r.id});f&&console.error("[my-workshops]",f),t(u??[]),s(!1)},[r==null?void 0:r.id]);S.useEffect(()=>{o()},[o]);const l=S.useMemo(()=>{const u=new Map;for(const f of e){const p=[f.tag,f.uhrzeit?`${f.uhrzeit} Uhr`:""].filter(Boolean).join(" · ")||"Termin offen";u.has(p)||u.set(p,[]),u.get(p).push(f)}return Array.from(u.entries())},[e]);async function c(u){if(r&&window.confirm(`Buchung für â${u.title}" wirklich stornieren?`)){a(u.booking_id);try{const{data:f,error:p}=await et.rpc("cancel_my_workshop_booking",{p_booking_id:u.booking_id,p_app_user_id:r.id}),m=f;if(p||!(m!=null&&m.ok)){le.error("Stornierung fehlgeschlagen");return}le.success("Buchung storniert"),window.dispatchEvent(new Event("bookings:changed")),o()}finally{a(null)}}}return d.jsxs("div",{className:"px-5 safe-top pb-10",children:[d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(W4,{className:"w-5 h-5"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Meine Workshops"})]}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Deine gebuchten Workshops im Ãberblick."}),n?d.jsx("p",{className:"text-sm text-muted-foreground text-center py-10",children:"Lädtâ¦"}):e.length===0?d.jsxs("div",{className:"mt-8 rounded-2xl bg-card shadow-card p-6 text-center",children:[d.jsx(Su,{className:"w-8 h-8 mx-auto text-primary"}),d.jsx("p",{className:"mt-3 font-display font-extrabold",children:"Du hast noch keine Workshops gebucht"}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sichere dir jetzt deinen Platz â die Teilnehmerzahl ist begrenzt."}),d.jsxs(Jt,{to:"/workshops",className:"mt-4 inline-flex items-center justify-center gap-1.5 gradient-hero text-primary-foreground rounded-xl px-4 py-3 text-sm font-extrabold ta
482p-scale",children:[d.jsx(IE,{className:"w-4 h-4"})," Jetzt Workshops entdecken"]})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-4 rounded-2xl bg-primary/10 border border-primary/20 px-4 py-3",children:[d.jsxs("p",{className:"text-sm font-bold text-primary",children:[e.length," ",e.length===1?"Buchung":"Buchungen"," ·"," ",e.reduce((u,f)=>u+(f.seats||0),0)," Plätze gesamt"]}),d.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Parallele Buchungen zur selben Uhrzeit sind für Gruppen möglich (z. B. Klasse aufteilen)."})]}),l.map(([u,f])=>d.jsxs("section",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[d.jsx("p",{className:"text-xs font-extrabold uppercase tracking-wider text-primary",children:u}),f.length>1&&d.jsxs("span",{className:"text-[11px] font-bold text-muted-foreground",children:[f.length," parallele Workshops · ",f.reduce((p,m)=>p+(m.seats||0),0)," Plätze"]})]}),d.jsx("ul",{className:"mt-2 flex flex-col gap-3",children:f.map(p=>d.jsxs("li",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:p.title}),d.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[p.tag&&d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Su,{className:"w-3.5 h-3.5"}),p.tag]}),d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx($b,{className:"w-3.5 h-3.5"}),p.uhrzeit??""," Uhr"]}),d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"}),p.room]}),d.jsxs("span",{className:"inline-flex items-center gap-1",children:[d.jsx(ec,{className:"w-3.5 h-3.5"}),p.seats," ",p.seats===1?"Platz":"Plätze",p.booking_type==="group"?" (Gruppe)":""]})]}),d.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[d.jsxs(Jt,{to:p.exhibitor_id?`/map?exhibitor=${p.exhibitor_id}`:"/map",className:"inline-flex items-center gap-1.5 rounded-xl border border-primary/30 text-primary px-3 py-2 text-sm font-bold tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Auf dem Hallenplan anzeigen"]}),d.jsxs("button",{onClick:()=>c(p),disabled:i===p.booking_id,className:"inline-flex items-center gap-1.5 rounded-xl bg-destructive/10 text-destructive px-3 py-2 text-sm font-bold tap-scale disabled:opacity-60",children:[d.jsx(fs,{className:"w-4 h-4"}),i===p.booking_id?"Storniertâ¦":"Buchung stornieren"]})]})]},p.booking_id))})]},u)),d.jsx(Jt,{to:"/workshops",className:"mt-5 block text-center text-sm font-bold text-primary underline underline-offset-4",children:"Weitere Workshops durchsuchen & buchen"})]})]})}var Ef=function(r,e){return Number(r.toFixed(e))},gne=function(r,e){return e},It=function(r,e,t){t&&typeof t=="function"&&t(r,e)},xne=function(r){return-Math.cos(r*Math.PI)/2+.5},vne=function(r){return r},yne=function(r){return r*r},wne=function(r){return r*(2-r)},bne=function(r){return r<.5?2*r*r:-1+(4-2*r)*r},_ne=function(r){return r*r*r},kne=function(r){return--r*r*r+1},Sne=function(r){return r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1},Ene=function(r){return r*r*r*r},Ane=function(r){return 1- --r*r*r*r},Tne=function(r){return r<.5?8*r*r*r*r:1-8*--r*r*r*r},Cne=function(r){return r*r*r*r*r},Nne=function(r){return 1+--r*r*r*r*r},Pne=function(r){return r<.5?16*r*r*r*r*r:1+16*--r*r*r*r*r},nU={easeOut:xne,linear:vne,easeInQuad:yne,easeOutQuad:wne,easeInOutQuad:bne,easeInCubic:_ne,easeOutCubic:kne,easeInOutCubic:Sne,easeInQuart:Ene,easeOutQuart:Ane,easeInOutQuart:Tne,easeInQuint:Cne,easeOutQuint:Nne,easeInOutQuint:Pne},sU=function(r){typeof r=="number"&&cancelAnimationFrame(r)},Bo=function(r){r.mounted&&(sU(r.animation),r.isAnimating=!1,r.animation=null,r.velocity=null)};function iU(r,e,t,n){if(r.mounted){var s=new Date().getTime(),i=1;Bo(r),r.animation=function(){if(!r.mounted)return sU(r.animation);var a=new Date().getTime()-s,o=a/t,l=nU[e],c=l(o);a>=t?(n(i),r.animation=null):r.animation&&(n(c),requestAnimationFrame(r.animation))},requestAnimationFrame(r.animation)}}function Rne(r){var e=r.scale,t=r.positionX,n=r.positionY;return!(Number.isNaN(e)||Number.isNaN(t)||Number.isNaN(n))}function Jh(r,e,t,n){var s=Rne(e);if(!(!r.mounted||!s)){var i=r.setState,a=r.state,o=a.scale,l=a.positionX,c=a.positionY,u=e.scale-o,f=e.positionX-l,p=e.positionY-c;t===0?i(e.scale,e.positionX,e.positionY):iU(r,n,t,function(m){m!==1?r.isAnimating=!0:r.isAnimating=!1;var x=o+u*m,g=l+f*m,y=c+p*m;i(x,g,y)})}}function jne(r,e,t){var n=r.offsetWidth,s=r.offsetHeight,i=e.offsetWidth,a=e.offsetHeight,o=i*t,l=a*t,c=n-o,u=s-l;
482return{wrapperWidth:n,wrapperHeight:s,newContentWidth:o,newDiffWidth:c,newContentHeight:l,newDiffHeight:u}}var One=function(r,e,t,n,s,i,a){var o=r>e?t*(a?.5:1):0,l=n>s?i*(a?.5:1):0,c=r-e-o,u=o,f=n-s-l,p=l;return{minPositionX:c,maxPositionX:u,minPositionY:f,maxPositionY:p,scaleWidthFactor:o,scaleHeightFactor:l}},cj=function(r,e){var t=r.wrapperComponent,n=r.contentComponent,s=r.setup,i=s.centerZoomedOut,a=s.disablePadding;if(!t||!n)throw new Error("Components are not mounted");var o=jne(t,n,e),l=o.wrapperWidth,c=o.wrapperHeight,u=o.newContentWidth,f=o.newContentHeight,p=o.newDiffWidth,m=o.newDiffHeight,x=One(l,u,p,c,f,m,!!i),g=l>=u&&c>=f;a&&g&&!i&&(x.minPositionX=0,x.maxPositionX=0,x.minPositionY=0,x.maxPositionY=0);var y=r.setup,v=y.minPositionX,w=y.maxPositionX,b=y.minPositionY,_=y.maxPositionY;return v!=null&&(x.minPositionX=l*(1-e)+v*e),w!=null&&(x.maxPositionX=w*e),b!=null&&(x.minPositionY=c*(1-e)+b*e),_!=null&&(x.maxPositionY=_*e),x},_1=function(r,e,t,n){return n?r<e?Ef(e,2):r>t?Ef(t,2):Ef(r,2):Ef(r,2)},Kx=function(r,e){var t=cj(r,e);return r.bounds=t,t};function Vb(r,e,t,n,s,i,a){var o=t.minPositionX,l=t.minPositionY,c=t.maxPositionX,u=t.maxPositionY,f=0,p=0;a&&(f=s,p=i);var m=_1(r,o-f,c+f,n),x=_1(e,l-p,u+p,n);return{x:m,y:x}}function KE(r,e,t,n,s,i){var a=r.state,o=a.scale,l=a.positionX,c=a.positionY,u=n-o;if(typeof e!="number"||typeof t!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:c};var f=l-e*u,p=c-t*u,m=Vb(f,p,s,i,0,0,null);return m}var OD=1e-7;function Gb(r,e,t,n,s){var i=s?n:0,a=Math.max(e-i,OD),o=t+i;return!Number.isNaN(t)&&r>=o?o:!Number.isNaN(e)&&r<=a?a:Math.max(r,OD)}var FD=function(r,e){var t=r.setup.panning.excluded,n=r.isInitialized,s=r.wrapperComponent,i=e.target,a="shadowRoot"in i&&"composedPath"in e,o=a?e.composedPath().some(function(u){return u instanceof Element?s==null?void 0:s.contains(u):!1}):s==null?void 0:s.contains(i),l=n&&i&&o;if(!l)return!1;var c=Kb(i,t);return!(c||i.getAttribute("draggable")==="true"||i.getAttribute("contenteditable")==="true"||i.isContentEditable)},DD=function(r){var e=r.isInitialized,t=r.isPanning,n=r.setup,s=n.panning.disabled,i=e&&t&&!s;return!!i},Fne=function(r,e){var t=r.state,n=t.positionX,s=t.positionY;r.isPanning=!0;var i=e.clientX,a=e.clientY;r.startCoords={x:i-n,y:a-s}},Dne=function(r,e){var t=e.touches,n=r.state,s=n.positionX,i=n.positionY;r.isPanning=!0;var a=t.length===1;if(a){var o=t[0].clientX,l=t[0].clientY;r.startCoords={x:o-s,y:l-i}}};function Mne(r){var e=r.state,t=e.positionX,n=e.positionY,s=e.scale,i=r.setup,a=i.disabled,o=i.limitToBounds,l=i.centerZoomedOut,c=r.wrapperComponent;if(!(a||!c||!r.bounds)){var u=r.bounds,f=u.maxPositionX,p=u.minPositionX,m=u.maxPositionY,x=u.minPositionY,g=t>f||t<p,y=n>m||n<x,v=t>f?c.offsetWidth:r.setup.minPositionX||0,w=n>m?c.offsetHeight:r.setup.minPositionY||0,b=KE(r,v,w,s,r.bounds,o||l),_=b.x,T=b.y;return{scale:s,positionX:g?_:t,positionY:y?T:n}}}function aU(r,e,t,n,s){var i=r.setup.limitToBounds,a=r.wrapperComponent,o=r.bounds,l=r.state,c=l.scale,u=l.positionX,f=l.positionY;if(!(a===null||o===null||e===u&&t===f)){var p=Vb(e,t,o,i,n,s,a),m=p.x,x=p.y;r.setState(c,m,x)}}var Ine=function(r,e,t){var n=r.startCoords,s=r.state,i=r.setup.panning,a=i.lockAxisX,o=i.lockAxisY,l=s.positionX,c=s.positionY;if(!n)return{x:l,y:c};var u=e-n.x,f=t-n.y,p=a?l:u,m=o?c:f;return{x:p,y:m}},Bh=function(r,e,t){var n=r.setup,s=r.state,i=n.minScale,a=n.disablePadding,o=n.centerZoomedOut,l=t??s.scale;return e>0&&l>=i&&!a&&!o?e:0},ph;(function(r){r.TRACK_PAD="track_pad",r.MOUSE="mouse",r.TOUCH="touch"})(ph||(ph={}));var Lne=function(r){var e=r.mounted,t=r.wrapperComponent,n=r.contentComponent,s=r.setup,i=s.disabled,a=s.velocityAnimation,o=s.limitToBounds,l=r.state.scale,c=a.disabled;if(c||i||!e||!t||!n)return!1;if(!o)return!0;var u=t.offsetWidth<n.offsetWidth*l||t.offsetHeight<n.offsetHeight*l;return u},Bne=function(r){var e=r.mounted,t=r.velocity,n=r.bounds,s=r.setup,i=s.disabled,a=s.velocityAnimation,o=a.disabled,l=!o&&!i&&e;return!(!l||!t||!n)};function Une(r,e){var t=r.setup.velocityAnimation,n=t.animationTime,s=t.maxAnimationTime,i=t.
482inertia;return Math.min(n*Math.max(1,Math.abs(e/i)),s)}function MD(r,e,t,n,s,i,a,o,l,c){if(s){if(e>a&&t>a){var u=a+(r-a)*c;return u>l?l:u<a?a:u}if(e<i&&t<i){var u=i+(r-i)*c;return u<o?o:u>i?i:u}}return n?e:_1(r,i,a,s)}function $ne(r){var e=1,t=r.offsetWidth/window.innerWidth;return Number.isNaN(t)?e:Math.min(e,t)}var kT=function(r,e,t){var n=0,s=r*t;return Number.isNaN(s)?n:r<0?Math.max(s,-e):Math.min(s,e)};function zne(r,e,t){var n,s,i=Lne(r);if(i){var a=r.lastMousePosition,o=r.velocityTime,l=r.setup,c=r.wrapperComponent,u=l.velocityAnimation,f=u.maxStrengthMouse,p=u.maxStrengthTouch,m=u.sensitivityTouch,x=u.sensitivityMouse,g=Date.now();if(a&&o&&c){var y=$ne(c),v=(n={},n[ph.TOUCH]=m,n[ph.MOUSE]=x,n)[t],w=(s={},s[ph.TOUCH]=p,s[ph.MOUSE]=f,s)[t],b=e.x-a.x,_=e.y-a.y,T=kT(b/y,w,v),A=kT(_/y,w,v),N=g-o,k=b*b+_*_,E=kT(Math.sqrt(k)/N,w,v);r.velocity={velocityX:T,velocityY:A,total:E}}r.lastMousePosition=e,r.velocityTime=g}}function Hne(r){var e=r.velocity,t=r.bounds,n=r.setup,s=r.wrapperComponent,i=Bne(r);if(!(!i||!e||!t||!s)){var a=e.velocityX,o=e.velocityY,l=e.total,c=t.maxPositionX,u=t.minPositionX,f=t.maxPositionY,p=t.minPositionY,m=n.limitToBounds,x=n.autoAlignment,g=n.zoomAnimation,y=n.panning,v=y.lockAxisY,w=y.lockAxisX,b=g.animationType,_=x.sizeX,T=x.sizeY,A=x.velocityAlignmentTime,N=A,k=Une(r,l),E=Math.max(k,N),P=Bh(r,_),O=Bh(r,T),D=P*s.offsetWidth/100,H=O*s.offsetHeight/100,B=c+D,ee=u-D,X=f+H,W=p-H,Y=r.state,F=new Date().getTime();iU(r,b,E,function(J){var ne=r.state,I=ne.scale,z=ne.positionX,M=ne.positionY,U=new Date().getTime()-F,te=U/N,re=nU[x.animationType],se=1-re(Math.min(1,te)),ie=1-J,ae=z+a*ie,ge=M+o*ie,G=MD(ae,Y.positionX,z,w,m,u,c,ee,B,se),Ue=MD(ge,Y.positionY,M,v,m,p,f,W,X,se);if(z!==ae||M!==ge){r.setState(I,G,Ue);var Re=r.props.onPanning;Re&&Re(Ct(r),{})}})}}function ID(r,e){var t=r.state,n=t.scale,s=t.positionX,i=t.positionY;r.panStartPosition={x:s,y:i},Bo(r),Kx(r,n),window.TouchEvent!==void 0&&e instanceof TouchEvent?Dne(r,e):Fne(r,e)}function oU(r,e){var t=r.state.scale,n=r.setup,s=n.minScale,i=n.autoAlignment,a=i.disabled,o=i.sizeX,l=i.sizeY,c=i.animationTime,u=i.animationType,f=a||t<s||!o&&!l;if(!f){var p=Mne(r);p&&Jh(r,p,c,u)}}function LD(r,e,t,n){var s=r.startCoords,i=r.setup,a=i.autoAlignment,o=a.sizeX,l=a.sizeY;if(s){var c=Ine(r,e,t),u=c.x,f=c.y,p=Bh(r,o),m=Bh(r,l);zne(r,{x:u,y:f},n),aU(r,u,f,p,m)}}function Wne(r,e){if(r.isPanning){var t=r.velocity,n=r.wrapperComponent,s=r.contentComponent;r.isPanning=!1;var i=r.state,a=i.positionX,o=i.positionY,l=i.scale,c=r.panStartPosition;if(r.panStartPosition=null,c){var u=a-c.x,f=o-c.y;if(u*u+f*f<=25)return}r.isAnimating=!1,r.animation=null;var p=(n==null?void 0:n.offsetWidth)||0,m=(n==null?void 0:n.offsetHeight)||0,x=((s==null?void 0:s.offsetWidth)||0)*l,g=((s==null?void 0:s.offsetHeight)||0)*l,y=!r.setup.limitToBounds||p<x||m<g,v=!e&&t&&t.total>.1&&y;v?Hne(r):oU(r)}}function uj(r,e,t,n){var s=r.setup,i=s.minScale,a=s.maxScale,o=s.limitToBounds,l=Gb(Ef(e,2),i,a,0,!1),c=Kx(r,l),u=KE(r,t,n,l,c,o),f=u.x,p=u.y;return{scale:l,positionX:f,positionY:p}}function dj(r,e,t){var n=r.state.scale,s=r.wrapperComponent,i=r.setup,a=i.minScale,o=i.maxScale,l=i.limitToBounds,c=i.zoomAnimation,u=c.disabled,f=c.animationTime,p=c.animationType,m=n>=a&&n<=o,x=u||m;if((n>=1||l)&&oU(r),!(x||!s||!r.mounted)){var g=e||s.offsetWidth/2,y=t||s.offsetHeight/2,v=n<a?a:o,w=uj(r,v,g,y);w&&Jh(r,w,f,p)}}var qa=function(){return qa=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},qa.apply(this,arguments)};function BD(r,e,t){for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}var ST={previousScale:1,scale:1,positionX:0,positionY:0},gf={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,detached:!1,wheel:{step:.015,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},trackPadPanning:{disabled:!0,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,allowPanning:!0,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},autoAlignment:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivityMouse:1,sensitivityTouch:1.2,maxStrengthMouse:20,maxStrengthTouch:40,inertia:1,animationTime:300,maxAnimationTime:800,animationType:"easeOut"}},DN={wrapperClass:"react-transform-wrapper",contentClass:"react-transform-component"},lU=function(r){var e,t,n,s,i,a,o,l,c,u=Math.max((e=r.minScale)!==null&&e!==void 0?e:gf.minScale,1e-7),f=(t=r.maxScale)!==null&&t!==void 0?t:gf.maxScale,p=(n=r.initialScale)!==null&&n!==void 0?n:ST.scale,m=Math.min(Math.max(p,u),f),x=_1((s=r.initialPositionX)!==null&&s!==void 0?s:ST.positionX,(i=r.minPositionX)!==null&&i!==void 0?i:-1/0,(a=r.maxPositionX)!==null&&a!==void 0?a:1/0,r.minPositionX!=null||r.maxPositionX!=null),g=_1((o=r.initialPositionY)!==null&&o!==void 0?o:ST.positionY,(l=r.minPositionY)!==null&&l!==void 0?l:-1/0,(c=r.maxPositionY)!==null&&c!==void 0?c:1/0,r.minPositionY!=null||r.maxPositionY!=null);return{previousScale:m,scale:m,positionX:x,positionY:g}},UD=function(r){var e=qa({},gf);return Object.keys(r).forEach(function(t){var n=t,s=typeof r[n]<"u",i=typeof gf[n]<"u";if(i&&s){var a=Object.prototype.toString.call(gf[n]),o=a==="[object Object]",l=a==="[object Array]";o?e[n]=qa(qa({},gf[n]),r[n]):l?e[n]=BD(BD([],gf[n],!0),r[n]):e[n]=r[n]}}),e.minScale<=0&&(e.minScale=1e-7),e},cU=function(r,e,t){var n=r.state.scale,s=r.wrapperComponent,i=r.setup,a=i.maxScale,o=i.minScale,l=i.zoomAnimation,c=i.smooth,u=l.size;if(!s)throw new Error("Wrapper is not mounted");var f=c?n*Math.exp(e*t):n+e*t,p=Gb(Ef(f,3),o,a,u,!1);return p};function uU(r,e,t,n,s){var i,a,o=r.wrapperComponent,l=r.state,c=l.scale,u=l.positionX,f=l.positionY,p=r.setup.zoomAnimation;if(!o)return console.error("No WrapperComponent found");var m=p.disabled?0:n,x=o.offsetWidth,g=o.offsetHeight,y=(x/2-u)/c,v=(g/2-f)/c,w=cU(r,e,t),b=uj(r,w,y,v);if(!b)return console.error("Error during zoom event. New transformation state was not calculated.");var _=r.props,T=_.onZoomStart,A=_.onZoom,N=_.onZoomStop,k=new MouseEvent("mousemove",{bubbles:!0}),E=Ct(r);It(E,k,T),It(E,k,A),Jh(r,b,m,s);var P=(a=(i=o.ownerDocument)===null||i===void 0?void 0:i.defaultView)!==null&&a!==void 0?a:typeof window<"u"?window:null;P&&P.setTimeout(function(){r.mounted&&It(Ct(r),k,N)},m)}function dU(r,e,t,n){var s,i,a=r.setup,o=r.wrapperComponent,l=r.contentComponent,c=a.limitToBounds,u=a.centerOnInit,f=lU(r.props),p=r.
482state,m=p.scale,x=p.positionX,g=p.positionY;if(o){var y=f.positionX,v=f.positionY;if(u&&l){var w=hj(f.scale,o,l);y=w.positionX,v=w.positionY}var b=cj(r,f.scale),_=Vb(y,v,b,c,0,0,o),T={scale:f.scale,positionX:_.x,positionY:_.y};if(!(m===f.scale&&x===f.positionX&&g===f.positionY)){n==null||n();var A=r.props,N=A.onZoomStart,k=A.onZoom,E=A.onZoomStop,P=new MouseEvent("mousemove",{bubbles:!0}),O=Ct(r);It(O,P,N),It(O,P,k),Jh(r,T,e,t);var D=(i=(s=o.ownerDocument)===null||s===void 0?void 0:s.defaultView)!==null&&i!==void 0?i:typeof window<"u"?window:null;D&&D.setTimeout(function(){r.mounted&&It(Ct(r),P,E)},e)}}}function Vne(r,e,t,n){var s=r.getBoundingClientRect(),i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=i.x*n.scale,l=i.y*n.scale;return{x:(s.x-a.x+o)/n.scale,y:(s.y-a.y+l)/n.scale}}function Gne(r,e,t,n,s){n===void 0&&(n=0),s===void 0&&(s=0);var i=r.wrapperComponent,a=r.contentComponent,o=r.state,l=r.setup,c=l.limitToBounds,u=l.minScale,f=l.maxScale;if(!i||!a)return o;var p=i.getBoundingClientRect(),m=e.getBoundingClientRect(),x=Vne(e,i,a,o),g=x.x,y=x.y,v=m.width/o.scale,w=m.height/o.scale,b=i.offsetWidth/v,_=i.offsetHeight/w,T=Gb(t||Math.min(b,_),u,f,0,!1),A=(p.width-v*T)/2,N=(p.height-w*T)/2,k=(p.left-g)*T+A+n,E=(p.top-y)*T+N+s,P=cj(r,T),O=Vb(k,E,P,c,0,0,i),D=O.x,H=O.y;return{positionX:D,positionY:H,scale:T}}var Kne=function(r){return function(e,t,n){e===void 0&&(e=.5),t===void 0&&(t=300),n===void 0&&(n="easeOut"),uU(r,1,e,t,n)}},Xne=function(r){return function(e,t,n){e===void 0&&(e=.5),t===void 0&&(t=300),n===void 0&&(n="easeOut"),uU(r,-1,e,t,n)}},Yne=function(r){return function(e,t,n,s,i){s===void 0&&(s=300),i===void 0&&(i="easeOut");var a=r.state,o=a.positionX,l=a.positionY,c=a.scale,u=r.wrapperComponent,f=r.contentComponent,p=r.setup.disabled;if(!(p||!u||!f)){var m={positionX:Number.isNaN(e)?o:e,positionY:Number.isNaN(t)?l:t,scale:Number.isNaN(n)?c:n};Jh(r,m,s,i)}}},qne=function(r){return function(e,t){e===void 0&&(e=200),t===void 0&&(t="easeOut"),dU(r,e,t)}},Zne=function(r){return function(e,t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut");var s=r.state,i=r.wrapperComponent,a=r.contentComponent;if(i&&a){var o=hj(e||s.scale,i,a);Jh(r,o,t,n)}}},Jne=function(r){return function(e,t,n,s,i,a){n===void 0&&(n=600),s===void 0&&(s="easeOut"),i===void 0&&(i=0),a===void 0&&(a=0),Bo(r);var o=r.wrapperComponent,l=typeof e=="string"?document.getElementById(e):e;if(o&&l&&o.contains(l)){var c=Gne(r,l,t,i,a);Jh(r,c,n,s)}}},MN=function(r){return{instance:r,state:r.state,zoomIn:Kne(r),zoomOut:Xne(r),setTransform:Yne(r),resetTransform:qne(r),centerView:Zne(r),zoomToElement:Jne(r)}},Qne=function(r){return{instance:r,state:r.state}},Ct=function(r){var e={};return Object.assign(e,Qne(r)),Object.assign(e,MN(r)),e},ET=!1;function AT(){try{var r={get passive(){return ET=!0,!1}};return r}catch{return ET=!1,ET}}var $_=".".concat(DN.wrapperClass),Kb=function(r,e){return e.some(function(t){return r.matches("".concat($_," ").concat(t,", ").concat($_," .").concat(t,", ").concat($_," ").concat(t," *, ").concat($_," .").concat(t," *"))})},k1=function(r){r&&clearTimeout(r)},ese=function(r){return Number.parseFloat(r.toFixed(8))},hU=function(r,e,t){var n=ese(t);return"translate(".concat(r,"px, ").concat(e,"px) scale(").concat(n,")")},hj=function(r,e,t){var n=t.offsetWidth*r,s=t.offsetHeight*r,i=(e.offsetWidth-n)/2,a=(e.offsetHeight-s)/2;return{scale:r,positionX:i,positionY:a}};function tse(r,e){r!=null&&(typeof r=="function"?r(e):r.current=e)}function rse(r){return function(e){r.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var fU=function(r,e){var t=r.setup.wheel,n=t.disabled,s=t.wheelDisabled,i=t.touchPadDisabled,a=t.excluded,o=r.isInitialized,l=r.isPanning,c=e.target,u=o&&!l&&!n&&c;if(!u||s&&!e.ctrlKey||i&&e.ctrlKey)return!1;var f=Kb(c,a);if(f)return!1;var p=r.isPressingKeys(r.setup.wheel.activationKeys);return!!p},nse=function(r,e){var t=r.setup,n=t.disabled,s=t.trackPadPanning,i=s.activationKeys,a=s.excluded;if(!r.wrapperComponent||!r.contentComponent||n||s.disabled||e.ctrlKey)return!1;var o=fU(r,e);if(o)return!1;var l=e.target,c=Kb(l,a);if(c)return!1;var u=r.isPressingKeys(i);return!!u},sse=function(r){return r?r.deltaY<0?1:-1:0};function ise(r,e){var t=sse(r),n=gne(e,t);return n}function pU(r,e,t){var n=e.getBoundingClientRect(),s=0,i=0;if("clientX"in r)s=(r.clientX-n.left)/t,i=(r.clientY-n.top)/t;else{var a=r.touches[0];s=(a.clientX-n.left)/t,i=(a.clientY-n.top)/t}return(Number.isNaN(s)||Number.isNaN(i))&&console.error("No mouse or touch offset found"),{x:s,y:i}}var ase=function(r,e,t,n,s){var i=r.state.scale,a=r.wrapperComponent,o=r.setup,l=o.maxScale,c=o.minScale,u=o.zoomAnimation,f=o.disablePadding,p=u.size,m=u.disabled;if(!a)throw new Error("Wrapper is not mounted");
482var x=i+e*t,g=n?!1:!m,y=Gb(x,c,l,p,g&&!f);return y},mU=function(r,e){var t=r.previousWheelEvent,n=r.state.scale,s=r.setup,i=s.maxScale,a=s.minScale;return t?n<i||n>a||Math.sign(t.deltaY)!==Math.sign(e.deltaY)||t.deltaY>0&&t.deltaY<e.deltaY||t.deltaY<0&&t.deltaY>e.deltaY||Math.sign(t.deltaY)!==Math.sign(e.deltaY):!1},ose=function(r,e){var t=r.setup.pinch,n=t.disabled,s=t.excluded,i=r.isInitialized,a=e.target,o=i&&!n&&a;if(!o)return!1;var l=Kb(a,s);return!l},lse=function(r){var e=r.setup.pinch.disabled,t=r.isInitialized,n=r.pinchStartDistance,s=t&&!e&&n!==null;return!!s},cse=function(r,e,t){var n=t.getBoundingClientRect(),s=r.touches,i=s[0].clientX-n.left,a=s[0].clientY-n.top,o=s[1].clientX-n.left,l=s[1].clientY-n.top;return{x:(i+o)/2/e,y:(a+l)/2/e}},gU=function(r){return Math.sqrt(Math.pow(r.touches[0].pageX-r.touches[1].pageX,2)+Math.pow(r.touches[0].pageY-r.touches[1].pageY,2))},use=5,dse=function(r,e){var t=r.pinchStartScale,n=r.pinchStartDistance,s=r.setup,i=s.maxScale,a=s.minScale,o=s.zoomAnimation,l=s.disablePadding,c=s.pinch,u=o.size,f=o.disabled,p=c.step;if(!t||n===null)throw new Error("Pinch touches distance was not provided");if(e<0)return r.state.scale;var m=e/n,x=m*t,g=(x-t)*(p/use),y=t+g,v=y===1/0?0:Ef(y,10);return Gb(v,a,i,u,!f&&!l)},xU=160,vU=100,hse=function(r,e){var t=r.props,n=t.onWheelStart,s=t.onZoomStart;r.wheelStopEventTimer||(Bo(r),It(Ct(r),e,n),It(Ct(r),e,s))},fse=function(r,e){var t=r.props,n=t.onWheel,s=t.onZoom,i=r.contentComponent,a=r.setup,o=r.state,l=o.scale,c=a.limitToBounds,u=a.centerZoomedOut,f=a.zoomAnimation,p=a.wheel,m=a.disablePadding,x=a.smooth,g=f.size,y=f.disabled,v=p.step;if(!i)throw new Error("Component not mounted");e.preventDefault(),e.stopPropagation();var w=ise(e,null),b=x?v*Math.abs(e.deltaY):v,_=ase(r,w,b,!e.ctrlKey);if(l!==_){var T=Kx(r,_),A=pU(e,i,l),N=y||g===0||u||m,k=c&&N,E=KE(r,A.x,A.y,_,T,k),P=E.x,O=E.y;r.previousWheelEvent=e,r.setState(_,P,O),It(Ct(r),e,n),It(Ct(r),e,s)}},pse=function(r,e){var t=r.props,n=t.onWheelStop,s=t.onZoomStop;k1(r.wheelAnimationTimer),r.wheelAnimationTimer=setTimeout(function(){r.mounted&&(dj(r,e.x,e.y),r.wheelAnimationTimer=null)},vU);var i=mU(r,e);i&&(k1(r.wheelStopEventTimer),r.wheelStopEventTimer=setTimeout(function(){r.mounted&&(r.wheelStopEventTimer=null,It(Ct(r),e,n),It(Ct(r),e,s))},xU))},mse=function(r,e){var t=r.props,n=t.onWheelStart,s=t.onPanningStart;r.wheelStopEventTimer||(Bo(r),It(Ct(r),e,n),It(Ct(r),e,s))},gse=function(r,e){var t=r.props,n=t.onWheelStop,s=t.onPanningStop;k1(r.wheelAnimationTimer),r.wheelAnimationTimer=setTimeout(function(){r.mounted&&(dj(r,e.x,e.y),r.wheelAnimationTimer=null)},vU);var i=mU(r,e);i&&(k1(r.wheelStopEventTimer),r.wheelStopEventTimer=setTimeout(function(){r.mounted&&(r.wheelStopEventTimer=null,It(Ct(r),e,n),It(Ct(r),e,s))},xU))},yU=function(r){for(var e=0,t=0,n=0;n<2;n+=1)e+=r.touches[n].clientX,t+=r.touches[n].clientY;var s=e/2,i=t/2;return{x:s,y:i}},xse=function(r,e){var t=gU(e);r.pinchStartDistance=t,r.lastDistance=t,r.pinchStartScale=r.state.scale,r.isPanning=!1,r.isPinching=!0,r.pinchPreviousCenter=yU(e),Bo(r)},vse=function(r,e){var t=r.contentComponent,n=r.pinchStartDistance,s=r.wrapperComponent,i=r.pinchPreviousCenter,a=r.state.scale,o=r.setup,l=o.limitToBounds,c=o.centerZoomedOut,u=o.zoomAnimation,f=o.autoAlignment,p=o.pinch,m=o.panning,x=u.disabled,g=u.size,y=p.allowPanning;if(!(n===null||!t)){var v=cse(e,a,t);if(!(!Number.isFinite(v.x)||!Number.isFinite(v.y))){var w=gU(e),b=dse(r,w),_=yU(e),T=a/b,A=(_.x-((i==null?void 0:i.x)||0))*T,N=(_.y-((i==null?void 0:i.y)||0))*T;if(!(b===a&&A===0&&N===0)){r.pinchPreviousCenter=_;var k=Kx(r,b),E=x||g===0||c,P=l&&E,O=KE(r,v.x,v.y,b,k,P),D=O.x,H=O.y;if(r.pinchMidpoint=v,r.lastDistance=w,m.disabled||!y)r.setState(b,D,H);else{var B=f.sizeX,ee=f.sizeY,X=Bh(r,B,b),W=Bh(r,ee,b),Y=D+A,F=H+N,J=Vb(Y,F,k,l,X,W,s),ne=J.x,I=J.y;r.setState(b,ne,I)}}}}},yse=function(r){var e=r.pinchMidpoint;r.velocity=null,r.lastDistance=null,r.pinchMidpoint=null,r.pinchStartScale=null,r.pinchStartDistance=null,r.isPinching=!1,dj(r,e==null?void 0:e.x,e==null?void 0:e.y)},wU=function(r,e){var t=r.props.onZoomStop,n=r.setup.doubleClick.animationTime;k1(r.doubleClickStopEventTimer),r.doubleClickStopEventTimer=setTimeout(function(){r.doubleClickStopEventTimer=null,It(Ct(r),e,t)},n)},wse=function(r,e){var t=r.props,n=t.onZoomStart,s=t.onZoom,i=r.setup.doubleClick,a=i.animationTime,o=i.animationType;It(Ct(r),e,n),dU(r,a,o,function(){return It(Ct(r),e,s)}),wU(r,e)};function bse(r,e){return r==="toggle"?e===1?1:-1:r==="zoomOut"?-1:1}function _se(r,e){var t=r.setup,n=r.doubleClickStopEventTimer,s=r.state,i=r.contentComponent,a=s.scale,o=r.props,l=o.onZoomStart,c=o.onZoom,u=t.doubleClick,f=u.disabled,p=u.mode,m=u.step,x=u.animationTime,g=u.animationType;if(!f&&!n){if(p==="reset")return wse(r,e);if(!i)return console.error("No ContentComponent found");var y=bse(p,r.state.scale),v=cU(r,y,m);if(a!==v){It(Ct(r),e,l);var w=pU(e,i,a),b=uj(r,v,w.x,w.y);if(!b)return console.error("Error during zoom event. New transformation state was not calculated.");It(Ct(r),e,c),Jh(r,b,x,g),wU(r,e)}}}var kse=function(r,e){var t=r.isInitialized,n=r.setup,s=r.wrapperComponent,i=n.doubleClick,a=i.disabled,o=i.excluded,l=e.target,c=s==null?void 0:s.contains(l),u=t&&l&&c&&!a;if(!u)return!1;var f=Kb(l,o);return!f},Sse=function(){function r(e){var t=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.onTransformCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.panStartPosition=null,this.lastTouch=null,this.isPinching=!1,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.pinchPreviousCenter=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.isAnimating=!1,this.animation=null,this.pressedKeys={},this.mount=function(){t.initializeWindowEvents()},this.unmount=function(){t.cleanupWindowEvents()},this.update=function(n){t.props=n,t.wrapperComponent&&t.contentComponent&&Kx(t,t.state.scale),t.setup=UD(n)},this.initializeWindowEvents=function(){var n,s,i,a,o=AT(),l=(n=t.wrapperComponent)===null||n===void 0?void 0:n.ownerDocument,c=l==null?void 0:l.defaultView;(s=t.wrapperComponent)===null||s===void 0||s.addEventListener("wheel",t.onWheelPanning,o),(i=t.wrapperComponent)===null||i===void 0||i.addEventListener("keyup",t.setKeyUnPressed,o),(a=t.wrapperComponent)===null||a===void 0||a.addEventListener("keydown",t.setKeyPressed,o),c==null||c.addEventListener("mousedown",t.onPanningStart,o),c==null||c.addEventListener("mousemove",t.onPanning,o),c==null||c.addEventListener("mouseup",t.onPanningStop,o),l==null||l.addEventListener("mouseleave",t.clearPanning,o),c==null||c.addEventListener("keyup",t.setKeyUnPressed,o),c==null||c.addEventListener("keydown",t.setKeyPressed,o),c==null||c.addEventListener("blur",t.handleWindowBlur)},this.cleanupWindowEvents=function(){var n,s,i,a,o,l=AT(),c=(n=t.wrapperComponent)===null||n===void 0?void 0:n.ownerDocument,u=c==null?void 0:c.defaultView;u==null||u.removeEventListener("mousedown",t.onPanningStart,l),u==null||u.removeEventListener("mousemove",t.onPanning,l),u==null||u.removeEventListener("mouseup",t.onPanningStop,l),c==null||c.removeEventListener("mouseleave",t.clearPanning,l),u==null||u.removeEventListener("keyup",t.setKeyUnPressed,l),u==null||u.removeEventListener("keydown",t.setKeyPressed,l),u==null||u.removeEventListener("blur",t.handleWindowBlur),document.removeEventListener("mouseleave",t.clearPanning,l),(s=t.wrapperComponent)===null||s===void 0||s.removeEventListener("wheel",t.onWheelPanning,l),(i=t.wrapperComponent)===null||i===void 0||i.removeEventListener("keyup",t.setKeyUnPressed,l),(a=t.wrapperComponent)===null||a===void 0||a.removeEventListener("keydown",t.setKeyPressed,l),Bo(t),(o=t.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(n){var s=AT();n.addEventListener("wheel",t.onWheelZoom,s),n.addEventListener("dblclick",t.onDoubleClick,s),n.addEventListener("touchstart",t.onTouchPanningStart,s),n.addEventListener("touchmove",t.onTouchPanning,s),n.addEventListener("touchend",t.onTouchPanningStop,s)},this.handleInitialize=function(n){var s=t.setup.centerOnInit;t.applyTransformation(),t.onInitCallbacks.forEach(function(i){return i(Ct(t))}),s&&(t.setCenter(),t.observer=new ResizeObserver(function(){var i,a=n.offsetWidth,o=n.offsetHeight;(a>0||o>0)&&(t.onInitCallbacks.forEach(function(l){return l(Ct(t))}),t.setCenter(),(i=t.observer)===null||i===void 0||i.disconnect())}),setTimeout(function(){var i;(i=t.observer)===null||i===void 0||i.disconnect()},5e3),t.observer.observe(n))},this.onWheelZoom=function(n){var s=t.setup.disabled;if(!s){t.syncModifierKeys(n);var i=fU(t,n);i&&(hse(t,n),fse(t,n),pse(t,n))}},this.onWheelPanning=function(n){var s=t.props.onPanning,i=t.setup.trackPadPanning,a=i.lockAxisX,o=i.lockAxisY;t.syncModifierKeys(n);var l=nse(t,n);if(l){n.preventDefault(),n.stopPropagation();var c=t.state,u=c.positionX,f=c.positionY,p=u-n.deltaX,m=f-n.deltaY,x=a?u:p,g=o?f:m,y=t.setup.autoAlignment,v=y.sizeX,w=y.sizeY,b=Bh(t,v),_=Bh(t,w);x===u&&g===f||(mse(t,n),aU(t,x,g,b,_),It(Ct(t),n,s),gse(t,n))}},this.onPanningStart=function(n){var s=t.setup.disabled,i=t.props.onPanningStart;if(!s){t.syncModifierKeys(n);var a=FD(t,n);if(a){var o=t.isPressingKeys(t.setup.panning.activationKeys);o&&(n.button===0&&!t.setup.panning.allowLeftClickPan||n.button===1&&!t.setup.panning.allowMiddleClickPan||n.button===2&&!t.setup.panning.allowRightClickPan||(n.preventDefault(),n.stopPropagation(),Bo(t),ID(t,n),It(Ct(t),n,i)))}}},this.onPanning=function(n){var s=t.setup.disabled,i=t.props.onPanning;
482if(!s){if(t.syncModifierKeys(n),t.isPanning&&n.buttons===0){t.clearPanning(n);return}var a=DD(t);if(a){var o=t.isPressingKeys(t.setup.panning.activationKeys);o&&(n.preventDefault(),n.stopPropagation(),LD(t,n.clientX,n.clientY,ph.MOUSE),It(Ct(t),n,i))}}},this.onPanningStop=function(n){var s=t.setup.panning.velocityDisabled,i=t.props.onPanningStop;t.isPanning&&(Wne(t,s),It(Ct(t),n,i))},this.onPinchStart=function(n){var s=t.setup.disabled,i=t.props.onPinchStart;if(!s){var a=ose(t,n);a&&(xse(t,n),Bo(t),It(Ct(t),n,i))}},this.onPinch=function(n){var s=t.setup.disabled,i=t.props.onPinch;if(!s){var a=lse(t);a&&(n.preventDefault(),n.stopPropagation(),vse(t,n),It(Ct(t),n,i))}},this.onPinchStop=function(n){var s=t.props.onPinchStop;t.pinchStartScale&&(yse(t),It(Ct(t),n,s))},this.onTouchPanningStart=function(n){var s=t.setup,i=s.disabled,a=s.doubleClick,o=t.props.onPanningStart;if(!i){var l=!(a!=null&&a.disabled),c=t.lastTouch&&+new Date-t.lastTouch<200;if(l&&c&&n.touches.length===1)t.onDoubleClick(n);else{t.lastTouch=+new Date,Bo(t);var u=n.touches,f=u.length===1,p=u.length===2,m=FD(t,n);if(f){if(!m)return;Bo(t),ID(t,n),It(Ct(t),n,o)}p&&t.onPinchStart(n)}}},this.onTouchPanning=function(n){var s=t.setup.disabled,i=t.props.onPanning;if(t.isPanning&&n.touches.length===1){if(s)return;var a=DD(t);if(!a)return;n.cancelable&&n.preventDefault(),n.stopPropagation();var o=n.touches[0];LD(t,o.clientX,o.clientY,ph.TOUCH),It(Ct(t),n,i)}else n.touches.length>1&&t.onPinch(n)},this.onTouchPanningStop=function(n){t.onPanningStop(n),t.onPinchStop(n)},this.onDoubleClick=function(n){var s=t.setup.disabled;if(!s){var i=kse(t,n);i&&_se(t,n)}},this.clearPanning=function(n){t.isPanning&&t.onPanningStop(n)},this.handleWindowBlur=function(){t.pressedKeys={},t.isPanning&&(t.isPanning=!1,t.startCoords=null)},this.syncModifierKeys=function(n){var s=n.ctrlKey,i=n.metaKey,a=n.shiftKey,o=n.altKey;typeof s=="boolean"&&(t.pressedKeys.Control=s),typeof i=="boolean"&&(t.pressedKeys.Meta=i),typeof a=="boolean"&&(t.pressedKeys.Shift=a),typeof o=="boolean"&&(t.pressedKeys.Alt=o)},this.setKeyPressed=function(n){t.pressedKeys[n.key]=!0},this.setKeyUnPressed=function(n){t.pressedKeys[n.key]=!1},this.isPressingKeys=function(n){return typeof n=="function"?n(Object.entries(t.pressedKeys).filter(function(s){var i=s[1];return i}).map(function(s){var i=s[0];return i})):n.length?!!n.every(function(s){return t.pressedKeys[s]}):!0},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var n=hj(t.state.scale,t.wrapperComponent,t.contentComponent);t.setState(n.scale,n.positionX,n.positionY)}},this.handleTransformStyles=function(n,s,i){return t.props.customTransform?t.props.customTransform(n,s,i):hU(n,s,i)},this.getContext=function(){return Ct(t)},this.applyTransformation=function(){if(!(!t.mounted||!t.contentComponent)){var n=t.state,s=n.scale,i=n.positionX,a=n.positionY,o=t.handleTransformStyles(i,a,s);t.props.detached||(t.contentComponent.style.transform=o),t.onTransformCallbacks.forEach(function(l){return l({scale:s,positionX:i,positionY:a,previousScale:t.state.previousScale,ref:Ct(t)})})}},this.setState=function(n,s,i){var a=t.props.onTransform;if(!Number.isNaN(n)&&!Number.isNaN(s)&&!Number.isNaN(i)){var o=Math.max(n,1e-7);o!==t.state.scale&&(t.state.previousScale=t.state.scale,t.state.scale=o),t.state.positionX=s,t.state.positionY=i,t.applyTransformation();var l=Ct(t);t.onChangeCallbacks.forEach(function(c){return c(l)}),It(l,{scale:t.state.scale,positionX:s,positionY:i},a)}else console.error("Detected NaN set state values")},this.onTransform=function(n){return t.onTransformCallbacks.has(n)||t.onTransformCallbacks.add(n),function(){t.onTransformCallbacks.delete(n)}},this.onChange=function(n){return t.onChangeCallbacks.has(n)||t.onChangeCallbacks.add(n),function(){t.onChangeCallbacks.delete(n)}},this.onInit=function(n){return t.onInitCallbacks.has(n)||t.onInitCallbacks.add(n),function(){t.onInitCallbacks.delete(n)}},this.init=function(n,s){t.cleanupWindowEvents(),t.wrapperComponent=n,t.contentComponent=s,Kx(t,t.state.scale),t.handleInitializeWrapperEvents(n),t.handleInitialize(s),t.initializeWindowEvents(),t.isInitialized=!0;var i=Ct(t);It(i,void 0,t.props.onInit),tse(t.props.ref,i)},this.props=e,this.setup=UD(this.props),this.state=lU(this.props)}return r}(),XE=be.createContext(null),Ese=function(r,e){return typeof r=="function"?r(e):r},YE=be.forwardRef(function(r,e){var t=S.useRef(new Sse(r)).current,n=Ese(r.children,MN(t));return S.useImperativeHandle(e,function(){return MN(t)},[t]),S.useEffect(function(){t.update(r)},[t,r]),d.jsx(XE.Provider,qa({value:t},{children:n}))});be.forwardRef(function(r,e){var t=S.useRef(null),n=S.useContext(XE);return S.useEffect(function(){return n.onChange(function(s){if(t.current){var i=0,a=0;t.current.style.transform=n.handleTransformStyles(i,a,1/s.instance.state.scale)}})},[n]),d.jsx("div",qa({},r,{ref:rse([t,e])}))});function Ase(r,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=r:s.appendChild(document.createTextNode(r))}}var Tse=`.transform-component-module_wrapper__SPB86 { 483 position: relative; 484 width: -moz-fit-content; 485 width: fit-content; 486 height: -moz-fit-content; 487 height: fit-content; 488 overflow: hidden; 489 -webkit-touch-callout: none; /* iOS Safari */ 490 -webkit-user-select: none; /* Safari */ 491 -khtml-user-select: none; /* Konqueror HTML */ 492 -moz-user-select: none; /* Firefox */ 493 -ms-user-select: none; /* Internet Explorer/Edge */ 494 user-select: none; 495 margin: 0; 496 padding: 0; 497 transform: translate3d(0, 0, 0); 498} 499.transform-component-module_content__FBWxo { 500 display: flex; 501 flex-wrap: wrap; 502 width: -moz-fit-content; 503 width: fit-content; 504 height: -moz-fit-content; 505 height: fit-content; 506 margin: 0; 507 padding: 0; 508 transform-origin: 0% 0%; 509} 510.transform-component-module_content__FBWxo img { 511 pointer-events: none; 512} 513.transform-component-module_infiniteGrid__Z-aP3 { 514 position: absolute; 515 inset: 0; 516 pointer-events: none; 517 background-image: radial-gradient( 518 circle, 519 rgba(0, 0, 0, 0.12) 1px, 520 transparent 1px 521 ); 522 background-size: 20px 20px; 523 background-position: 0 0; 524} 525`,TT={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo",infiniteGrid:"transform-component-module_infiniteGrid__Z-aP3"};Ase(Tse);var qE=function(r){var e=r.children,t=r.wrapperClass,n=t===void 0?"":t,s=r.contentClass,i=s===void 0?"":s,a=r.wrapperStyle,o=r.contentStyle,l=r.wrapperProps,c=l===void 0?{}:l,u=r.contentProps,f=u===void 0?{}:u,p=r.infinite,m=p===void 0?!1:p,x=S.useContext(XE),g=x.init,y=x.cleanupWindowEvents,v=S.useRef(null),w=S.useRef(null),b=S.useRef(null);return S.useEffect(function(){var _=v.current,T=w.current;return _!==null&&T!==null&&g&&(g==null||g(_,T)),function(){y==null||y()}},[]),S.useEffect(function(){if(m){var _=b.current;if(_){var T=function(){var A=x.state,N=A.positionX,k=A.positionY;_.style.backgroundPosition="".concat(N,"px ").concat(k,"px")}
525;return T(),x.onChange(T)}}},[m,x]),d.jsxs("div",qa({},c,{ref:v,className:"".concat(DN.wrapperClass," ").concat(TT.wrapper," ").concat(n),style:a},{children:[m&&d.jsx("div",{ref:b,className:TT.infiniteGrid,"aria-hidden":!0}),d.jsx("div",qa({},f,{ref:w,className:"".concat(DN.contentClass," ").concat(TT.content," ").concat(i),style:qa(qa({},o),{transform:hU(x.state.positionX,x.state.positionY,x.state.scale)})},{children:e}))]}))};function Cse(r,e){var t=Math.max(0,Math.min(r.x+r.width,e.x+e.width)-Math.max(r.x,e.x)),n=Math.max(0,Math.min(r.y+r.height,e.y+e.height)-Math.max(r.y,e.y));return t*n}function Nse(r){var e=r.elementX,t=r.elementY,n=r.elementWidth,s=r.elementHeight,i=r.scale,a=r.positionX,o=r.positionY,l=r.viewportWidth,c=r.viewportHeight,u=r.margin,f=u===void 0?0:u,p=r.threshold,m=p===void 0?0:p,x={x:-f,y:-f,width:l+2*f,height:c+2*f},g={x:e*i+a,y:t*i+o,width:n*i,height:s*i};if(m<=0){var y=g.x<x.x+x.width&&g.x+g.width>x.x,v=g.y<x.y+x.height&&g.y+g.height>x.y;return y&&v}var w=g.width*g.height;if(w<=0)return!1;var b=Cse(x,g);return b/w>=m}be.forwardRef(function(r,e){var t=r.x,n=r.y,s=r.width,i=r.height,a=r.margin,o=a===void 0?0:a,l=r.threshold,c=l===void 0?0:l,u=r.placeholder,f=u===void 0?null:u,p=r.onShow,m=r.onHide,x=r.children,g=r.className,y=r.style,v=S.useContext(XE),w=S.useState(!1),b=w[0],_=w[1],T=S.useRef(!1),A=S.useRef(p),N=S.useRef(m);return A.current=p,N.current=m,S.useEffect(function(){var k=function(){var O,D,H=v.wrapperComponent;if(H){var B=Nse({elementX:t,elementY:n,elementWidth:s,elementHeight:i,scale:v.state.scale,positionX:v.state.positionX,positionY:v.state.positionY,viewportWidth:H.offsetWidth,viewportHeight:H.offsetHeight,margin:o,threshold:c});B!==T.current&&(T.current=B,_(B),B?(O=A.current)===null||O===void 0||O.call(A):(D=N.current)===null||D===void 0||D.call(N))}};k();var E=v.onChange(k),P;return v.wrapperComponent||(P=v.onInit(function(){return k()})),function(){E(),P==null||P()}},[v,t,n,s,i,o,c]),b?d.jsx("div",qa({ref:e,className:g,style:y},{children:x})):f?d.jsx(d.Fragment,{children:f}):null});const ra=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),cu=[1/0,1/0,-1/0,-1/0],Af=new Float32Array(cu),IN=[.001,0,0,.001,0,0],CT=1.35,Mi="http://www.w3.org/2000/svg",ea={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},nd={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Nm="pdfjs_internal_id_",S1="pdfjs_internal_editor_",lt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},pt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},Pse={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Sn={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Rk={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},gn={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},cm={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ZE={ERRORS:0,WARNINGS:1,INFOS:5},_c={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}
525,Fv={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},Rse={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let JE=ZE.WARNINGS;function jse(r){Number.isInteger(r)&&(JE=r)}function Ose(){return JE}function QE(r){JE>=ZE.INFOS&&console.info(`Info: ${r}`)}function mt(r){JE>=ZE.WARNINGS&&console.warn(`Warning: ${r}`)}function Ut(r){throw new Error(r)}function Ur(r,e){r||Ut(e)}function Fse(r){switch(r==null?void 0:r.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function bU(r,e=null,t=null){if(!r)return null;if(t&&typeof r=="string"){if(t.addDefaultProtocol&&r.startsWith("www.")){const s=r.match(/\./g);(s==null?void 0:s.length)>=2&&(r=`http://${r}`)}if(t.tryConvertEncoding)try{r=Ise(r)}catch{}}const n=e?URL.parse(r,e):URL.parse(r);return Fse(n)?n:null}function _U(r,e,t=!1){const n=URL.parse(r);return n?(n.hash=e,n.href):t&&bU(r,"http://example.com")?r.split("#",1)[0]+`${e?`#${e}`:""}`:""}function LN(r){return r.substring(r.lastIndexOf("/")+1)}function ct(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}const M0=function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();class $D extends M0{constructor(e,t){super(e,"PasswordException"),this.code=t}}class NT extends M0{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class BN extends M0{constructor(e){super(e,"InvalidPDFException")}}class dS extends M0{constructor(e,t,n){super(e,"ResponseException"),this.status=t,this.missing=n}}class Dse extends M0{constructor(e){super(e,"FormatError")}}class Uh extends M0{constructor(e){super(e,"AbortException")}}function Mse(r){(typeof r!="object"||(r==null?void 0:r.length)===void 0)&&Ut("Invalid argument for bytesToString");const e=r.length,t=8192;if(e<t)return String.fromCharCode.apply(null,r);const n=[];for(let s=0;s<e;s+=t){const i=Math.min(s+t,e),a=r.subarray(s,i);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function eA(r){typeof r!="string"&&Ut("Invalid argument for stringToBytes");const e=r.length,t=new Uint8Array(e);for(let n=0;n<e;++n)t[n]=r.charCodeAt(n)&255;return t}class gr{static get isLittleEndian(){const e=new Uint8Array(4);e[0]=1;const t=new Uint32Array(e.buffer,0,1);return ct(this,"isLittleEndian",t[0]===1)}static get isOffscreenCanvasSupported(){return ct(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return ct(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return ct(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return ct(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return ct(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCanvasFilterSupported(){let e;return this.isOffscreenCanvasSupported?e=new OffscreenCanvas(1,1).getContext("2d"):typeof document<"u"&&(e=document.createElement("canvas").getContext("2d")),ct(this,"isCanvasFilterSupported",(e==null?void 0:e.filter)!==void 0)}static get isAlphaColorInputSupported(){if(typeof document>"u")return ct(this,"isAlphaColorInputSupported",!1);const e=document.createElement("input");return e.type="color",e.setAttribute("alpha",""),e.value="#ff000080",ct(this,"isAlphaColorInputSupported",e.value!=="#ff0000")}}var mu,jk,UN;class ke{static get hexNums(){return ct(this,"hexNums",Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0")))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}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,n=0){const s=e[n],i=e[n+1];e[n]=s*t[0]+i*t[2]+t[4],e[n+1]=s*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){const s=t[0],i=t[1],a=t[2],o=t[3],l=t[4],c=t[5];for(let u=0;u<6;u+=2){const f=e[n+u],p=e[n+u+1];e[n+u]=f*s+p*a+l,e[n+u+1]=f*i+p*o+c}}static applyInverseTransform(e,t){const n=e[0],s=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-s*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+s*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){const s=t[0],i=t[1],a=t[2],o=t[3],l=t[4],c=t[5],u=e[0],f=e[1],p=e[2],m=e[3];let x=s*u+l,g=x,y=s*p+l,v=y,w=o*f+c,b=w,_=o*m+c,T=_;if(i!==0||a!==0){const A=i*u,N=i*p,k=a*f,E=a*m;x+=k,v+=k,y+=E,g+=E,w+=A,T+=A,_+=N,b+=N}n[0]=Math.min(n[0],x,y,g,v),n[1]=Math.min(n[1],w,_,b,T),n[2]=Math.max(n[2],x,y,g,v),n[3]=Math.max(n[3],w,_,b,T)}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 n=e[0],s=e[1],i=e[2],a=e[3],o=n**2+s**2,l=n*i+s*a,c=i**2+a**2,u=(o+c)/2,f=Math.sqrt(u**2-(o*c-l**2));t[0]=Math.sqrt(u+f||1),t[1]=Math.sqrt(u-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 n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),s=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>s)return null;const i=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 i>a?null:[n,i,s,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,s,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,s),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,s)}static bezierBoundingBox(e,t,n,s,i,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),j(this,mu,UN).call(this,e,n,i,o,t,s,a,l,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),j(this,mu,UN).call(this,e,n,i,o,t,s,a,l,3*(-t+3*(s-a)+l),6*(t-2*s+a),3*(s-t),c)}}
525mu=new WeakSet,jk=function(e,t,n,s,i,a,o,l,c,u){if(c<=0||c>=1)return;const f=1-c,p=c*c,m=p*c,x=f*(f*(f*e+3*c*t)+3*p*n)+m*s,g=f*(f*(f*i+3*c*a)+3*p*o)+m*l;u[0]=Math.min(u[0],x),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],x),u[3]=Math.max(u[3],g)},UN=function(e,t,n,s,i,a,o,l,c,u,f,p){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&j(this,mu,jk).call(this,e,t,n,s,i,a,o,l,-f/u,p);return}const m=u**2-4*f*c;if(m<0)return;const x=Math.sqrt(m),g=2*c;j(this,mu,jk).call(this,e,t,n,s,i,a,o,l,(-u+x)/g,p),j(this,mu,jk).call(this,e,t,n,s,i,a,o,l,(-u-x)/g,p)},R(ke,mu);function Ise(r){return decodeURIComponent(escape(r))}let PT=null,zD=null;function Lse(r){return PT||(PT=/([\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,zD=new Map([["ï¬
","ſt"]])),r.replaceAll(PT,(e,t,n)=>t?t.normalize("NFKC"):zD.get(n))}function kU(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const r=new Uint8Array(32);return crypto.getRandomValues(r),Mse(r)}function Bse(r,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[n,s,...i]=t;if(!r(n)&&!Number.isInteger(n)||!e(s))return!1;const a=i.length;let o=!0;switch(s.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 i)if(!(typeof l=="number"||o&&l===null))return!1;return!0}const fj=()=>[],pj=()=>new Map,$N=()=>Object.create(null);function Pr(r,e,t){return Math.min(Math.max(r,e),t)}class Xb{constructor({viewBox:e,userUnit:t,scale:n,rotation:s,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=s,this.offsetX=i,this.offsetY=a,n*=t;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let u,f,p,m;switch(s%=360,s<0&&(s+=360),s){case 180:u=-1,f=0,p=0,m=1;break;case 90:u=0,f=1,p=1,m=0;break;case 270:u=0,f=-1,p=-1,m=0;break;case 0:u=1,f=0,p=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(p=-p,m=-m);let x,g,y,v;u===0?(x=Math.abs(c-e[1])*n+i,g=Math.abs(l-e[0])*n+a,y=(e[3]-e[1])*n,v=(e[2]-e[0])*n):(x=Math.abs(l-e[0])*n+i,g=Math.abs(c-e[1])*n+a,y=(e[2]-e[0])*n,v=(e[3]-e[1])*n),this.transform=[u*n,f*n,p*n,m*n,x-u*n*l-p*n*c,g-f*n*l-m*n*c],this.width=y,this.height=v}get rawDims(){const e=this.viewBox;return ct(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:n=this.offsetX,offsetY:s=this.offsetY,dontFlip:i=!1}={}){return new Xb({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:s,dontFlip:i})}convertToViewportPoint(e,t){const n=[e,t];return ke.applyTransform(n,this.transform),n}convertToViewportRectangle(e){const t=[e[0],e[1]];ke.applyTransform(t,this.transform);const n=[e[2],e[3]];return ke.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){const n=[e,t];return ke.applyInverseTransform(n,this.transform),n}}class E1{static textContent(e){const t=[],n={items:t,styles:Object.create(null)};function s(i){var l;if(!i)return;let a=null;const o=i.name;if(o==="#text")a=i.value;else if(E1.shouldBuildText(o))(l=i==null?void 0:i.attributes)!=null&&l.textContent?a=i.attributes.textContent:i.value&&(
525a=i.value);else return;if(a!==null&&t.push({str:a}),!!i.children)for(const c of i.children)s(c)}return s(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class SU{static setupStorage(e,t,n,s,i){const a=s.getValue(t,{value:null});switch(n.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),i==="print")break;e.addEventListener("input",o=>{s.setValue(t,{value:o.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(a.value===n.attributes.xfaOn?e.setAttribute("checked",!0):a.value===n.attributes.xfaOff&&e.removeAttribute("checked"),i==="print")break;e.addEventListener("change",o=>{s.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),i==="print")break;e.addEventListener("input",o=>{s.setValue(t,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of n.children)o.attributes.value===a.value?o.attributes.selected=!0:Object.hasOwn(o.attributes,"selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;s.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:s,linkService:i}){const{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${s}`);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&&i.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static render(e){var f,p;const t=e.annotationStorage,n=e.linkService,s=e.xfaHtml,i=e.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:i,linkService:n});const o=i!=="richText",l=e.div;if(l.append(a),e.viewport){const m=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=m}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(s.children.length===0){if(s.value){const m=document.createTextNode(s.value);a.append(m),o&&E1.shouldBuildText(s.name)&&c.push(m)}return{textDivs:c}}const u=[[s,-1,a]];for(;u.length>0;){const[m,x,g]=u.at(-1);if(x+1===m.children.length){u.pop();continue}const y=m.children[++u.at(-1)[1]];if(y===null)continue;const{name:v}=y;if(v==="#text"){const b=document.createTextNode(y.value);c.push(b),g.append(b);continue}const w=(f=y==null?void 0:y.attributes)!=null&&f.xmlns?document.createElementNS(y.attributes.xmlns,v):document.createElement(v);if(g.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:t,intent:i,linkService:n}),((p=y.children)==null?void 0:p.length)>0)u.push([y,-1,w]);else if(y.value){const b=document.createTextNode(y.value);o&&E1.shouldBuildText(v)&&c.push(b),w.append(b)}}for(const m of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.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}static getPageViewport(e,{scale:t=1,rotation:n=0}){const{width:s,height:i}=e.attributes.style;return new Xb({viewBox:[0,0,parseInt(s,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}}const vf=class vf{};oe(vf,"CSS",96),oe(vf,"PDF",72),oe(vf,"PDF_TO_CSS_UNITS",vf.CSS/vf.PDF);let $h=vf;async function mj(r,e="text"){if(Ry(r,document.baseURI)){const t=await fetch(r);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,n)=>{const s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType=e==="bytes"?"arraybuffer":e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(e){case"bytes":t(new
525Uint8Array(s.response));return;case"blob":case"json":t(s.response);return}t(s.responseText);return}n(new Error(s.statusText))}},s.send(null)})}class gj extends M0{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function tA(r){const e=r.length;let t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function xj(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function Use(r){return[r]=r.split(/[#?]/,1),LN(r)}function $se(r,e="document.pdf"){if(typeof r!="string")return e;if(tA(r))return mt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const n=(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})(r);if(!n)return e;const s=o=>{try{let l=decodeURIComponent(o);return l.includes("/")&&(l=LN(l),l.length===4&&i.test(l))?o:l}catch{return o}},i=/\.pdf$/i,a=LN(n.pathname);if(i.test(a))return s(a);if(n.searchParams.size>0){const o=c=>[...c].findLast(u=>i.test(u)),l=o(n.searchParams.values())??o(n.searchParams.keys());if(l)return s(l)}if(n.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(l)return s(l[0])}return e}var ud;class HD{constructor(){R(this,ud,new Map);oe(this,"times",[])}time(e){h(this,ud).has(e)&&mt(`Timer is already running for ${e}`),h(this,ud).set(e,Date.now())}timeEnd(e){h(this,ud).has(e)||mt(`Timer has not been started for ${e}`),this.times.push({name:e,start:h(this,ud).get(e),end:Date.now()}),h(this,ud).delete(e)}toString(){const e=Math.max(...this.times.map(t=>t.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms 526`).join("")}}ud=new WeakMap;function Ry(r,e){const t=e?URL.parse(r,e):URL.parse(r);return/https?:/.test((t==null?void 0:t.protocol)??"")}function so(r){r.preventDefault()}function Br(r){r.preventDefault(),r.stopPropagation()}var G1;class hS{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;h(this,G1)||C(this,G1,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?"));const t=h(this,G1).exec(e);if(!t)return null;const n=parseInt(t[1],10);let s=parseInt(t[2],10);s=s>=1&&s<=12?s-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i: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 u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let f=parseInt(t[9],10)||0;return f=f>=0&&f<=59?f:0,c==="-"?(a+=u,o+=f):c==="+"&&(a-=u,o-=f),new Date(Date.UTC(n,s,i,a,o,l))}}G1=new WeakMap,R(hS,G1);function Yb(r){if(r.startsWith("#")){const t=r.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(r.startsWith("rgb(")){const[t,n,s]=r.slice(4,-1).split(",").map(i=>parseInt(i,10));return[t,n,s,1]}if(r.startsWith("rgba(")){const t=r.slice(5,-1).split(",");return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}const e=r.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(parseFloat(e[1])*255),Math.round(parseFloat(e[2])*255),Math.round(parseFloat(e[3])*255),e[4]!==void 0&&e[4]!=="none"?parseFloat(e[4]):1]:null}function qb(r){const e=Yb(r);return e?e.slice(0,3):(mt(`Not a valid color format: "${r}"`),[0,0,0])}function zse(r){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of r.keys()){e.style.color=t;const n=window.getComputedStyle(e).color;r.set(t,qb(n))}e.remove()}function mr(r){const{a:e,b:t,c:n,d:s,e:i,f:a}=r.getTransform();return[e,t,n,s,i,a]}function ll(r){const{a:e,b:t,c:n,d:s,e:i,f:a}=r.getTransform().invertSelf();return[e,t,n,s,i,a]}function _0(r,e,t=!1,n=!0){if(e instanceof Xb){const{pageWidth:s,pageHeight:i}=e.rawDims,{style:a}=r,o=`round(down, var(--total-scale-factor) * ${s}px, var(--scale-round-x))`,l=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!t||e.rotation%180===0?(a.width=o,a.height=l):(a.width=l,a.height=o
526)}n&&r.setAttribute("data-main-rotation",e.rotation)}class rc{constructor(){const{pixelRatio:e}=rc;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,n,s,i=-1){let a=1/0,o=1/0,l=1/0;n=rc.capPixels(n,i),n>0&&(a=Math.sqrt(n/(e*t))),s!==-1&&(o=s/e,l=s/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 n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}}const zN=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Hse{static get isDarkMode(){var e;return ct(this,"isDarkMode",!!((e=window==null?void 0:window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches))}}class Wse{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:n}=window.getComputedStyle(e);return e.remove(),ct(this,"commentForegroundColor",qb(n))}}function Vse(r,e){e=Pr(e??1,0,1);const t=255*(1-e);return r.map(n=>Math.round(n*e+t))}function WD(r,e){const t=r[0]/255,n=r[1]/255,s=r[2]/255,i=Math.max(t,n,s),a=Math.min(t,n,s),o=(i+a)/2;if(i===a)e[0]=e[1]=0;else{const l=i-a;switch(e[1]=o<.5?l/(i+a):l/(2-i-a),i){case t:e[0]=((n-s)/l+(n<s?6:0))*60;break;case n:e[0]=((s-t)/l+2)*60;break;case s:e[0]=((t-n)/l+4)*60;break}}e[2]=o}function HN(r,e){const t=r[0],n=r[1],s=r[2],i=(1-Math.abs(2*s-1))*n,a=i*(1-Math.abs(t/60%2-1)),o=s-i/2;switch(Math.floor(t/60)){case 0:e[0]=i+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=i+o,e[2]=o;break;case 2:e[0]=o,e[1]=i+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=i+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=i+o;break;case 5:case 6:e[0]=i+o,e[1]=o,e[2]=a+o;break}}function VD(r){return r<=.03928?r/12.92:((r+.055)/1.055)**2.4}function GD(r,e,t){HN(r,t),t.map(VD);const n=.2126*t[0]+.7152*t[1]+.0722*t[2];HN(e,t),t.map(VD);const s=.2126*t[0]+.7152*t[1]+.0722*t[2];return n>s?(n+.05)/(s+.05):(s+.05)/(n+.05)}const KD=new Map;function Gse(r,e){const t=r[0]+r[1]*256+r[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let n=KD.get(t);if(n)return n;const s=new Float32Array(9),i=s.subarray(0,3),a=s.subarray(3,6);WD(r,a);const o=s.subarray(6,9);WD(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]),GD(a,o,i)<c){let u,f;l?(u=a[2],f=1):(u=0,f=a[2]);const p=.005;for(;f-u>p;){const m=a[2]=(u+f)/2;l===GD(a,o,i)<c?u=m:f=m}a[2]=l?f:u}return HN(a,i),n=ke.makeHexColor(Math.round(i[0]*255),Math.round(i[1]*255),Math.round(i[2]*255)),KD.set(t,n),n}function EU({html:r,dir:e,className:t},n){const s=document.createDocumentFragment();if(typeof r=="string"){const i=document.createElement("p");i.dir=e||"auto";const a=r.split(/\r\n?|\n/);for(let o=0,l=a.length;o<l;++o){const c=a[o];i.append(document.createTextNode(c)),o<l-1&&i.append(document.createElement("br"))}s.append(i)}else SU.render({xfaHtml:r,div:s,intent:"richText"});s.firstElementChild.classList.add("richText",t),n.append(s)}function AU(r){const e=new Path2D;if(!r)return e;for(let t=0,n=r.length;t<n;)switch(r[t++]){case Fv.moveTo:e.moveTo(r[t++],r[t++]);break;case Fv.lineTo:e.lineTo(r[t++],r[t++]);break;case Fv.curveTo:e.bezierCurveTo(r[t++],r[t++],r[t++],r[t++],r[t++],r[t++]);break;case Fv.quadraticCurveTo:e.quadraticCurveTo(r[t++],r[t++],r[t++],r[t++]);break;case Fv.closePath:e.closePath();break;default:mt(`Unrecognized drawing path operator: ${r[t-1]}`);break}return e}var dd,hd,Ra,ja,K1,fd,rg,ng,X1,LS,TU,ds,CU,NU,um,Gv;const yc=class yc{constructor(e){R(this,ds);R(this,dd,null);R(this,hd,null);R(this,Ra);R(this,ja,null);R(this,K1,null);R(this,fd,null);R(this,rg,null);R(this,ng,null);C(this,Ra,e),h(yc,X1)||C(yc,X1,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=C(this,dd,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=h(this,Ra)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",so,{signal:t}),e.addEventListener("pointerdown",j(yc,LS,TU),{signal:t}));const n=C(this,ja,document.createElement("div"));n.className="buttons",e.append(n);const s=h(this,Ra).toolbarPosition;if(s){const{style:i}=e,a=h(this,Ra)._uiManager.direction==="ltr"?1-s[0]:s[0];i.insetInlineEnd=`${100*a}%`,i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return h(this,dd)}hide(){var e;h(this,dd).classList.add("hidden"),(e=h(this,hd))==null||e.hideDropdown()}show(){var e,t;h(this,dd).classList.remove("hidden"),(e=h(this,K1))==null||e.shown(),(t=h(this,fd))==null||t.shown()}
526addDeleteButton(){const{editorType:e,_uiManager:t}=h(this,Ra),n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",h(yc,X1)[e]),j(this,ds,um).call(this,n)&&n.addEventListener("click",s=>{t.delete()},{signal:t._signal}),h(this,ja).append(n)}async addAltText(e){const t=await e.render();j(this,ds,um).call(this,t),h(this,ja).append(t,h(this,ds,Gv)),C(this,K1,e)}addComment(e,t=null){if(h(this,fd))return;const n=e.renderForToolbar();if(!n)return;j(this,ds,um).call(this,n);const s=C(this,rg,h(this,ds,Gv));t?(h(this,ja).insertBefore(n,t),h(this,ja).insertBefore(s,t)):h(this,ja).append(n,s),C(this,fd,e),e.toolbar=this}addColorPicker(e){if(h(this,hd))return;C(this,hd,e);const t=e.renderButton();j(this,ds,um).call(this,t),h(this,ja).append(t,h(this,ds,Gv))}async addEditSignatureButton(e){const t=C(this,ng,await e.renderEditButton(h(this,Ra)));j(this,ds,um).call(this,t),h(this,ja).append(t,h(this,ds,Gv))}removeButton(e){var t,n;switch(e){case"comment":(t=h(this,fd))==null||t.removeToolbarCommentButton(),C(this,fd,null),(n=h(this,rg))==null||n.remove(),C(this,rg,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,n){if(!t&&e==="comment")return;const s=h(this,ja).querySelector(n);s&&e==="comment"&&this.addComment(t,s)}updateEditSignatureButton(e){h(this,ng)&&(h(this,ng).title=e)}remove(){var e;h(this,dd).remove(),(e=h(this,hd))==null||e.destroy(),C(this,hd,null)}};dd=new WeakMap,hd=new WeakMap,Ra=new WeakMap,ja=new WeakMap,K1=new WeakMap,fd=new WeakMap,rg=new WeakMap,ng=new WeakMap,X1=new WeakMap,LS=new WeakSet,TU=function(e){e.stopPropagation()},ds=new WeakSet,CU=function(e){h(this,Ra)._focusEventsAllowed=!1,Br(e)},NU=function(e){h(this,Ra)._focusEventsAllowed=!0,Br(e)},um=function(e){const t=h(this,Ra)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",j(this,ds,CU).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",j(this,ds,NU).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",so,{signal:t}),!0)},Gv=function(){const e=document.createElement("div");return e.className="divider",e},R(yc,LS),R(yc,X1,null);let WN=yc;var Y1,Ff,Ec,Nu,PU,RU,VN;class Kse{constructor(e){R(this,Nu);R(this,Y1,null);R(this,Ff,null);R(this,Ec);C(this,Ec,e)}show(e,t,n){const[s,i]=j(this,Nu,RU).call(this,t,n),{style:a}=h(this,Ff)||C(this,Ff,j(this,Nu,PU).call(this));e.append(h(this,Ff)),a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){h(this,Ff).remove()}}Y1=new WeakMap,Ff=new WeakMap,Ec=new WeakMap,Nu=new WeakSet,PU=function(){const e=C(this,Ff,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const t=h(this,Ec)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",so,{signal:t});const n=C(this,Y1,document.createElement("div"));return n.className="buttons",e.append(n),h(this,Ec).hasCommentManager()&&j(this,Nu,VN).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{h(this,Ec).commentSelection("floating_button")}),j(this,Nu,VN).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{h(this,Ec).highlightSelection("floating_button")}),e},RU=function(e,t){let n=0,s=0;for(const i of e){const a=i.y+i.height;if(a<n)continue;const o=i.x+(t?i.width:0);if(a>n){s=o,n=a;continue}t?o>s&&(s=o):o<s&&(s=o)}return[t?1-s:s,n]},VN=function(e,t,n,s){const i=document.createElement("button");i.classList.add("basic",e),i.tabIndex=0,i.setAttribute("data-l10n-id",t);const a=document.createElement("span");i.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",n);const o=h(this,Ec)._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener("contextmenu",so,{signal:o}
526),i.addEventListener("click",s,{signal:o})),h(this,Y1).append(i)};const Xse="9556e50a-f4f8-4f57-9831-f9ddff0176eb",Yse=Object.freeze({internal:Xse});function jU(r,e,t){for(const n of t)e.addEventListener(n,r[n].bind(r))}var Df,Mf,sg,If;const rr=class rr{static initializeAndAddPointerId(e){(h(rr,Mf)||C(rr,Mf,new Set)).add(e)}static setPointer(e,t){h(rr,Df)||C(rr,Df,t),h(rr,If)??C(rr,If,e)}static setTimeStamp(e){C(rr,sg,e)}static isSamePointerId(e){return h(rr,Df)===e}static isSamePointerIdOrRemove(e){var t;return h(rr,Df)===e?!0:((t=h(rr,Mf))==null||t.delete(e),!1)}static isSamePointerType(e){return h(rr,If)===e}static isInitializedAndDifferentPointerType(e){return h(rr,If)!==null&&!rr.isSamePointerType(e)}static isSameTimeStamp(e){return h(rr,sg)===e}static isUsingMultiplePointers(){var e;return((e=h(rr,Mf))==null?void 0:e.size)>=1}static clearPointerType(){C(rr,If,null)}static clearPointerIds(){C(rr,Df,NaN),C(rr,Mf,null)}static clearTimeStamp(){C(rr,sg,NaN)}};Df=new WeakMap,Mf=new WeakMap,sg=new WeakMap,If=new WeakMap,R(rr,Df,NaN),R(rr,Mf,null),R(rr,sg,NaN),R(rr,If,null);let ks=rr;var BS;class qse{constructor(){R(this,BS,0)}get id(){return`${S1}${tr(this,BS)._++}`}}BS=new WeakMap;var ig,q1,Es,ag,Ok;const vO=class vO{constructor(){R(this,ag);R(this,ig,kU());R(this,q1,0);R(this,Es,null)}static get _isSVGFittingCanvas(){const e=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${Mi}"><rect width="1" height="1" style="fill:red;"/></svg>`,n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;s.src=e;const i=s.decode().then(()=>(n.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return ct(this,"_isSVGFittingCanvas",i)}async getFromFile(e){const{lastModified:t,name:n,size:s,type:i}=e;return j(this,ag,Ok).call(this,`${t}_${n}_${s}_${i}`,e)}async getFromUrl(e){return j(this,ag,Ok).call(this,e,e)}async getFromBlob(e,t){const n=await t;return j(this,ag,Ok).call(this,e,n)}async getFromId(e){h(this,Es)||C(this,Es,new Map);const t=h(this,Es).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:n}=t;return delete t.blobPromise,this.getFromBlob(t.id,n)}return this.getFromUrl(t.url)}getFromCanvas(e,t){h(this,Es)||C(this,Es,new Map);let n=h(this,Es).get(e);if(n!=null&&n.bitmap)return n.refCounter+=1,n;const s=new OffscreenCanvas(t.width,t.height);return s.getContext("2d").drawImage(t,0,0),n={bitmap:s.transferToImageBitmap(),id:`image_${h(this,ig)}_${tr(this,q1)._++}`,refCounter:1,isSvg:!1},h(this,Es).set(e,n),h(this,Es).set(n.id,n),n}getSvgUrl(e){const t=h(this,Es).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){var s;h(this,Es)||C(this,Es,new Map);const t=h(this,Es).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;const{bitmap:n}=t;if(!t.url&&!t.file){const i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=i.convertToBlob()}(s=n.close)==null||s.call(n),t.bitmap=null}isValidId(e){return e.startsWith(`image_${h(this,ig)}_`)}};ig=new WeakMap,q1=new WeakMap,Es=new WeakMap,ag=new WeakSet,Ok=async function(e,t){h(this,Es)||C(this,Es,new Map);let n=h(this,Es).get(e);if(n===null)return null;if(n!=null&&n.bitmap)return n.refCounter+=1,n;try{n||(n={bitmap:null,id:`image_${h(this,ig)}_${tr(this,q1)._++}`,refCounter:0,isSvg:!1});let s;if(typeof t=="string"?(n.url=t,s=await mj(t,"blob")):t instanceof File?s=n.file=t:t instanceof Blob&&(s=t),s.type==="image/svg+xml"){const i=vO._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,u)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,c()},a.onload=async()=>{const f=n.svgUrl=a.result;o.src=await i?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=u});a.readAsDataURL(s),await l}else n.bitmap=await createImageBitmap(s);n.refCounter=1}catch(s){mt(s),n=null}return h(this,Es).set(e,n),n&&h(this,Es).set(n.id,n),n};let GN=vO;var on,pd,Z1,Mr;class Zse{constructor(e=128){R(this,on,[]);R(this,pd,!1);R(this,Z1);R(this,Mr,-1);C(this,Z1,e)}add({cmd:e,undo:t,post:n,mustExec:s,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(s&&e(),h(this,pd))return;const l={cmd:e,undo:t,post:n,type:i};if(h(this,Mr)===-1){h(this,on).length>0&&(h(this,on).length=0),C(this,Mr,0),h(this,on).push(l);return}if(a&&h(this,on)[h(this,Mr)].type===i){o&&(l.undo=h(this,on)[h(this,Mr)].undo),h(this,on)[h(this,Mr)]=l;return}const c=h(this,Mr)+1;c===h(this,Z1)?h(this,on).splice(0,1):(C(this,Mr,c),c<h(this,on).length&&h(this,on).splice(c)),h(this,on).push(l)}undo(){if(h(this,Mr)===-1)return;C(this,pd,!0);const{undo:e,post:t}=h(this,on)[h(this,Mr)];e(),t==null||t(),C(this,pd,!1),C(this,Mr,h(this,Mr)-1)}redo(){if(h(this,Mr)<h(this,on).length-1){C(this,Mr,h(this,Mr)+1),C(this,pd,!0);const{cmd:e,post:t}=h(this,on)[h(this,Mr)];e(),t==null||t(),C(this,pd,!1)}}hasSomethingToUndo(){return h(this,Mr)!==-1}hasSomethingToRedo(){return h(this,Mr)<h(this,on).length-1}cleanType(e){if(h(this,Mr)!==-1){for(let t=h(this,Mr);t>=0;t--)if(h(this,on)[t].type!==e){h(this,on).splice(t+1,h(this,Mr)-t),C(this,Mr,t);return}h(this,on).length=0,C(this,Mr,-1)}}destroy(){C(this,on,null)}}on=new WeakMap,pd=new WeakMap,Z1=new WeakMap,Mr=new WeakMap;var US,OU;class Zb{constructor(e){R(this,US);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=gr.platform;for(const[n,s,i={}]of e)for(const a of n){const o=a.startsWith("mac+");t&&o?(this.callbacks.set(a.slice(4),{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1))):!t&&!o&&(this.callbacks.set(a,{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(j(this,US,OU).call(this,t));if(!n)return;const{callback:s,options:{bubbles:i=!1,args:a=[],checker:o=null}}=n;o&&!o(e,t)||(s.bind(e,...a,t)(),i||Br(t))}}US=new WeakSet,OU=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 $S=class $S{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return zse(e),ct(this,"_colors",e)}convert(e){const t=qb(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[n,s]of this._colors)if(s.every((i,a)=>i===t[a]))return $S._colorsMapping.get(n);return t}getHexCode(e){const t=this._colors.get(e);return t?ke.makeHexColor(...t):e}};oe($S,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let KN=$S;var og,Ii,lg,Xr,Ir,cg,ug,Ws,dg,Oa,Fn,md,gd,xd,vd,yl,Fa,Lf,J1,Q1,hg,ew,wl,yd,fg,wd,bl,zS,Ac,pg,tw,bd,Bf,mg,_d,rw,xn,Kt,Tc,k
526d,Sd,nw,gg,sw,Ed,_l,Cc,iw,aw,Da,Pe,Fk,XN,FU,DU,MU,Kv,IU,LU,BU,YN,UU,$U,zU,HU,$s,pc,WU,VU,qN,GU,Xv,ZN;const Rm=class Rm{constructor(e,t,n,s,i,a,o,l,c,u,f,p,m,x,g,y){R(this,Pe);R(this,og,new AbortController);R(this,Ii,null);R(this,lg,null);R(this,Xr,new Map);R(this,Ir,new Map);R(this,cg,null);R(this,ug,null);R(this,Ws,null);R(this,dg,null);R(this,Oa,new Zse);R(this,Fn,null);R(this,md,null);R(this,gd,null);R(this,xd,0);R(this,vd,new Set);R(this,yl,null);R(this,Fa,null);R(this,Lf,new Set);oe(this,"_editorUndoBar",null);R(this,J1,!1);R(this,Q1,!1);R(this,hg,!1);R(this,ew,null);R(this,wl,null);R(this,yd,null);R(this,fg,null);R(this,wd,!1);R(this,bl,null);R(this,zS,new qse);R(this,Ac,!1);R(this,pg,!1);R(this,tw,!1);R(this,bd,null);R(this,Bf,null);R(this,mg,null);R(this,_d,null);R(this,rw,null);R(this,xn,lt.NONE);R(this,Kt,new Set);R(this,Tc,null);R(this,kd,null);R(this,Sd,null);R(this,nw,null);R(this,gg,null);R(this,sw,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});R(this,Ed,[0,0]);R(this,_l,null);R(this,Cc,null);R(this,iw,null);R(this,aw,null);R(this,Da,null);const v=this._signal=h(this,og).signal;C(this,Cc,e),C(this,iw,t),C(this,aw,n),C(this,ug,s),C(this,Fn,i),C(this,kd,a),C(this,gg,l),this._eventBus=o;const w={signal:v,...Yse};o.on("editingaction",this.onEditingAction.bind(this),w),o.on("pagechanging",this.onPageChanging.bind(this),w),o.on("scalechanging",this.onScaleChanging.bind(this),w),o.on("rotationchanging",this.onRotationChanging.bind(this),w),o.on("setpreference",this.onSetPreference.bind(this),w),o.on("switchannotationeditorparams",b=>this.updateParams(b.type,b.value),w),window.addEventListener("pointerdown",()=>{C(this,pg,!0)},{capture:!0,signal:v}),window.addEventListener("pointerup",()=>{C(this,pg,!1)},{capture:!0,signal:v}),window.addEventListener("beforeunload",j(this,Pe,FU).bind(this),{capture:!0,signal:v}),j(this,Pe,IU).call(this),j(this,Pe,HU).call(this),j(this,Pe,YN).call(this),C(this,Ws,l.annotationStorage),C(this,ew,l.filterFactory),C(this,Sd,c),C(this,fg,u||null),C(this,J1,f),C(this,Q1,p),C(this,hg,m),C(this,rw,x||null),this.viewParameters={realScale:$h.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=y!==!1,i==null||i.setSidebarUiManager(this)}static get _keyboardManager(){const e=Rm.prototype,t=a=>h(a,Cc).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),n=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},s=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return ct(this,"_keyboardManager",new Zb([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["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:n}
526],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&h(a,Cc).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&h(a,Cc).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}]]))}destroy(){var e,t,n,s,i,a,o,l,c;(e=h(this,Da))==null||e.resolve(),C(this,Da,null),(t=h(this,og))==null||t.abort(),C(this,og,null),this._signal=null;for(const u of h(this,Ir).values())u.destroy();h(this,Ir).clear(),h(this,Xr).clear(),h(this,Lf).clear(),(n=h(this,_d))==null||n.clear(),C(this,Ii,null),h(this,Kt).clear(),h(this,Oa).destroy(),(s=h(this,ug))==null||s.destroy(),(i=h(this,Fn))==null||i.destroy(),(a=h(this,kd))==null||a.destroy(),(o=h(this,bl))==null||o.hide(),C(this,bl,null),(l=h(this,mg))==null||l.destroy(),C(this,mg,null),C(this,lg,null),h(this,wl)&&(clearTimeout(h(this,wl)),C(this,wl,null)),h(this,_l)&&(clearTimeout(h(this,_l)),C(this,_l,null)),(c=this._editorUndoBar)==null||c.destroy(),C(this,gg,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return h(this,rw)}get useNewAltTextFlow(){return h(this,Q1)}get useNewAltTextWhenAddingImage(){return h(this,hg)}get hcmFilter(){return ct(this,"hcmFilter",h(this,Sd)?h(this,ew).addHCMFilter(h(this,Sd).foreground,h(this,Sd).background):"none")}get direction(){return ct(this,"direction",getComputedStyle(h(this,Cc)).direction)}get _highlightColors(){return ct(this,"_highlightColors",h(this,fg)?new Map(h(this,fg).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 ct(this,"highlightColors",null);const t=new Map,n=!!h(this,Sd);for(const[s,i]of e){const a=s.endsWith("_HCM");if(n&&a){t.set(s.replace("_HCM",""),i);continue}!n&&!a&&t.set(s,i)}return ct(this,"highlightColors",t)}get highlightColorNames(){return ct(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),C(this,gd,e)}setMainHighlightColorPicker(e){C(this,mg,e)}editAltText(e,t=!1){var n;(n=h(this,ug))==null||n.editAltText(this,e,t)}hasCommentManager(){return!!h(this,Fn)}editComment(e,t,n,s){var i;(i=h(this,Fn))==null||i.showDialog(this,e,t,n,s)}selectComment(e,t){const n=h(this,Ir).get(e),s=n==null?void 0:n.getEditorByUID(t);s==null||s.toggleComment(!0,!0)}updateComment(e){var t;(t=h(this,Fn))==null||t.updateComment(e.getData())}updatePopupColor(e){var t;(t=h(this,Fn))==null||t.updatePopupColor(e)}removeComment(e){var t;(t=h(this,Fn))==null||t.removeComments([e.uid])}deleteComment(e,t){const n=()=>{e.comment=t},s=()=>{var i;(i=this._editorUndoBar)==null||i.show(n,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:s,undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){var s;(s=h(this,Fn))==null||s.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){var n;return e&&((n=h(this,Fn))==null?void 0:n.makeCommentColor(e,t))||null}getCommentDialogElement(){var e;return((e=h(this,Fn))==null?void 0:e.dialogElement)||null}async waitForEditorsRendered(e){if(h(this,Ir).has(e-1))return;const{resolve:t,promise:n}=Promise.withResolvers(),s=i=>{i.pageNumber===e&&(this._eventBus.off("editorsrendered",s),t())};this._eventBus.on("editorsrendered",s),await n}getSignature(e){var t;(t=h(this,kd))==null||t.getSignature({uiManager:this,editor:e})}get signatureManager(){return h(this,kd)}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":C(this,hg,t);break}}onPageChanging({pageNumber:e}){C(this,xd,e-1)}deletePage(e){for(const t of this.getEditors(e))t.remove();h(this,Ir).delete(e),h(this,xd)===e&&C(this,xd,0)}focusMainContainer(){h(this,Cc).focus()}findParent(e,t){for(const n of h(this,Ir).values()){const{x:s,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=s&&e<=s+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){h(this,iw).classList.toggle("noUserSelect",e)}addShouldRescale(e){h(this,Lf).add(e)}removeShouldRescale(e){h(this,Lf).delete(e)}onScaleChanging({scale:e}){var t;this.commitOrRemove(),this.viewParameters.realScale=e*$h.PDF_TO_CSS_UNITS;for(const n of h(this,Lf))n.onScaleChanging();(t=h(this,gd))==null||t.onScaleChanging()}
526onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",t=!1){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:o}=n,l=n.toString(),u=j(this,Pe,Fk).call(this,n).closest(".textLayer"),f=this.getSelectionBoxes(u);if(!f)return;n.empty();const p=j(this,Pe,XN).call(this,u),m=h(this,xn)===lt.NONE,x=()=>{const g=p==null?void 0:p.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:f,anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:o,text:l});m&&this.showAllEditors("highlight",!0,!0),t&&(g==null||g.editComment())};if(m){this.switchToMode(lt.HIGHLIGHT,x);return}x()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!h(this,Ws))return null;const t=`${S1}${e}`,n=h(this,Ws).getRawValue(t);return n&&h(this,Ws).remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&h(this,Ws)&&!h(this,Ws).has(e.id)&&h(this,Ws).setValue(e.id,e)}a11yAlert(e,t=null){const n=h(this,aw);n&&(n.setAttribute("data-l10n-id",e),t?n.setAttribute("data-l10n-args",JSON.stringify(t)):n.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,h(this,wd)&&(C(this,wd,!1),j(this,Pe,Kv).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of h(this,Kt))if(t.div.contains(e)){C(this,Bf,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!h(this,Bf))return;const[e,t]=h(this,Bf);C(this,Bf,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){j(this,Pe,YN).call(this),this.setEditingState(!0)}removeEditListeners(){j(this,Pe,UU).call(this),this.setEditingState(!1)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const n of h(this,Fa))if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const n of h(this,Fa))if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var n;if(e.preventDefault(),(n=h(this,Ii))==null||n.commitOrRemove(),!this.hasSelection)return;const t=[];for(const s of h(this,Kt)){const i=s.serialize(!0);i&&t.push(i)}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 i of t.items)for(const a of h(this,Fa))if(a.isHandlingMimeForPasting(i.type)){a.paste(i,this.currentLayer);return}let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(i){mt(`paste: "${i.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const s=this.currentLayer;try{const i=[];for(const l of n){const c=await s.deserialize(l);if(!c)return;i.push(c)}const a=()=>{for(const l of i)j(this,Pe,qN).call(this,l);j(this,Pe,ZN).call(this,i)},o=()=>{for(const l of i)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(i){mt(`paste: "${i.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),h(this,xn)!==lt.NONE&&!this.isEditorHandlingKeyboard&&Rm._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,h(this,wd)&&(C(this,wd,!1),j(this,Pe,Kv).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}}updatePageIndex(e,t){for(const s of this.getEditors(e))s.pageIndex=t;const n=h(this,cg).get(e);n&&(n.pageIndex=t,h(this,Ir).set(t,n),h(this,Ac)?n.enable():n.disable())}startUpdatePages(){C(this,cg,new Map(h(this,Ir))),h(this,Ir).clear()}endUpdatePages(){C(this,cg,null)}clonePage(e,t){for(const n of this.getEditors(e)){const s=n.serialize(n.mode!==lt.HIGHLIGHT);s&&(s.pageIndex=t,s.id=this.getId(),s.isClone=!0,delete s.popupRef,h(this,Ws).setValue(s.id,s))}}findClonesForPage(e){const t=[],{pageIndex:n}=e;for(const[s,i]of h(this,Ws))i.pageIndex===n&&i.isClone&&(h(this,Ws).remove(s),t.push(e.deserialize(i).then(a=>{a&&(a.isClone=!0,e.addOrRebuild(a))})));return Promise.all(t)}
526setEditingState(e){e?(j(this,Pe,LU).call(this),j(this,Pe,$U).call(this),j(this,Pe,$s).call(this,{isEditing:h(this,xn)!==lt.NONE,isEmpty:j(this,Pe,Xv).call(this),hasSomethingToUndo:h(this,Oa).hasSomethingToUndo(),hasSomethingToRedo:h(this,Oa).hasSomethingToRedo(),hasSelectedEditor:!1})):(j(this,Pe,BU).call(this),j(this,Pe,zU).call(this),j(this,Pe,$s).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!h(this,Fa)){C(this,Fa,e);for(const t of h(this,Fa))j(this,Pe,pc).call(this,t.defaultPropertiesToUpdate)}}getId(){return h(this,zS).id}get currentLayer(){return h(this,Ir).get(h(this,xd))}getLayer(e){return h(this,Ir).get(e)}get currentPageIndex(){return h(this,xd)}addLayer(e){h(this,Ir).set(e.pageIndex,e),h(this,Ac)?e.enable():e.disable()}removeLayer(e){h(this,Ir).delete(e.pageIndex)}async updateMode(e,t=null,n=!1,s=!1,i=!1,a=!1){var o,l,c,u,f,p;if(h(this,xn)!==e&&!(h(this,Da)&&(await h(this,Da).promise,!h(this,Da)))){if(C(this,Da,Promise.withResolvers()),(o=h(this,gd))==null||o.commitOrRemove(),h(this,xn)===lt.POPUP&&((l=h(this,Fn))==null||l.hideSidebar()),(c=h(this,Fn))==null||c.destroyPopup(),C(this,xn,e),e===lt.NONE){this.setEditingState(!1),j(this,Pe,VU).call(this);for(const m of h(this,Xr).values())m.hideStandaloneCommentButton();(u=this._editorUndoBar)==null||u.hide(),this.toggleComment(null),h(this,Da).resolve();return}for(const m of h(this,Xr).values())m.addStandaloneCommentButton();e===lt.SIGNATURE&&await((f=h(this,kd))==null?void 0:f.loadSignatures()),n&&ks.clearPointerType(),this.setEditingState(!0),await j(this,Pe,WU).call(this),this.unselectAll();for(const m of h(this,Ir).values())m.updateMode(e);if(e===lt.POPUP){h(this,lg)||C(this,lg,await h(this,gg).getAnnotationsByType(new Set(h(this,Fa).map(g=>g._editorType))));const m=new Set,x=[];for(const g of h(this,Xr).values()){const{annotationElementId:y,hasComment:v,deleted:w}=g;y&&m.add(y),v&&!w&&x.push(g.getData())}for(const g of h(this,lg)){const{id:y,popupRef:v,contentsObj:w}=g;v&&(w!=null&&w.str)&&!m.has(y)&&!h(this,vd).has(y)&&x.push(g)}(p=h(this,Fn))==null||p.showSidebar(x)}if(!t){s&&this.addNewEditorFromKeyboard(),h(this,Da).resolve();return}for(const m of h(this,Xr).values())m.uid===t?(this.setSelected(m),a?m.editComment():i?m.enterInEditMode():m.focus()):m.unselect();h(this,Da).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==h(this,xn)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(h(this,Fa)){switch(e){case pt.CREATE:this.currentLayer.addNewEditor(t);return;case pt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(h(this,nw)||C(this,nw,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(const n of h(this,Kt))n.updateParams(e,t);else for(const n of h(this,Fa))n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){var i;for(const a of h(this,Xr).values())a.editorType===e&&a.show(t);(((i=h(this,nw))==null?void 0:i.get(pt.HIGHLIGHT_SHOW_ALL))??!0)!==t&&j(this,Pe,pc).call(this,[[pt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(h(this,tw)!==e){C(this,tw,e);for(const t of h(this,Ir).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(const t of h(this,Xr).values())t.pageIndex===e&&(yield t)}getEditor(e){return h(this,Xr).get(e)}addEditor(e){h(this,Xr).set(e.id,e)}removeEditor(e){var t,n;e.div.contains(document.activeElement)&&(h(this,wl)&&clearTimeout(h(this,wl)),C(this,wl,setTimeout(()=>{this.focusMainContainer(),C(this,wl,null)},0))),h(this,Xr).delete(e.id),e.annotationElementId&&((t=h(this,_d))==null||t.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!h(this,vd).has(e.annotationElementId))&&((n=h(this,Ws))==null||n.remove(e.id))}addDeletedAnnotationElement(e){h(this,vd).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return h(this,vd).has(e)}removeDeletedAnnotationElement(e){h(this,vd).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){h(this,Ii)!==e&&(C(this,Ii,e),e&&j(this,Pe,pc).call(this,e.propertiesToUpdate))}
526updateUI(e){h(this,Pe,GU)===e&&j(this,Pe,pc).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){j(this,Pe,pc).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(h(this,Kt).has(e)){h(this,Kt).delete(e),e.unselect(),j(this,Pe,$s).call(this,{hasSelectedEditor:this.hasSelection});return}h(this,Kt).add(e),e.select(),j(this,Pe,pc).call(this,e.propertiesToUpdate),j(this,Pe,$s).call(this,{hasSelectedEditor:!0})}setSelected(e){var t,n;this.updateToolbar({mode:e.mode,editId:e.uid}),(t=h(this,gd))==null||t.commitOrRemove();for(const s of h(this,Kt))s!==e&&s.unselect();(n=h(this,Fn))==null||n.destroyPopup(),h(this,Kt).clear(),h(this,Kt).add(e),e.select(),j(this,Pe,pc).call(this,e.propertiesToUpdate),j(this,Pe,$s).call(this,{hasSelectedEditor:!0})}isSelected(e){return h(this,Kt).has(e)}get firstSelectedEditor(){return h(this,Kt).values().next().value}unselect(e){e.unselect(),h(this,Kt).delete(e),j(this,Pe,$s).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return h(this,Kt).size!==0}get isEnterHandled(){return h(this,Kt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;h(this,Oa).undo(),j(this,Pe,$s).call(this,{hasSomethingToUndo:h(this,Oa).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:j(this,Pe,Xv).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){h(this,Oa).redo(),j(this,Pe,$s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:h(this,Oa).hasSomethingToRedo(),isEmpty:j(this,Pe,Xv).call(this)})}addCommands(e){h(this,Oa).add(e),j(this,Pe,$s).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:j(this,Pe,Xv).call(this)})}cleanUndoStack(e){h(this,Oa).cleanType(e)}delete(){var i;this.commitOrRemove();const e=(i=this.currentLayer)==null?void 0:i.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...h(this,Kt)],n=()=>{var a;(a=this._editorUndoBar)==null||a.show(s,t.length===1?t[0].editorType:t.length);for(const o of t)o.remove()},s=()=>{for(const a of t)j(this,Pe,qN).call(this,a)};this.addCommands({cmd:n,undo:s,mustExec:!0})}commitOrRemove(){var e;(e=h(this,Ii))==null||e.commitOrRemove()}hasSomethingToControl(){return h(this,Ii)||this.hasSelection}selectAll(){for(const e of h(this,Kt))e.commit();j(this,Pe,ZN).call(this,h(this,Xr).values())}unselectAll(){var e,t;if(!(h(this,Ii)&&(h(this,Ii).commitOrRemove(),h(this,xn)!==lt.NONE))&&!((e=h(this,gd))!=null&&e.commitOrRemove())&&((t=h(this,Fn))==null||t.destroyPopup(),!!this.hasSelection)){for(const n of h(this,Kt))n.unselect();h(this,Kt).clear(),j(this,Pe,$s).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;h(this,Ed)[0]+=e,h(this,Ed)[1]+=t;const[s,i]=h(this,Ed),a=[...h(this,Kt)],o=1e3;h(this,_l)&&clearTimeout(h(this,_l)),C(this,_l,setTimeout(()=>{C(this,_l,null),h(this,Ed)[0]=h(this,Ed)[1]=0,this.addCommands({cmd:()=>{for(const l of a)h(this,Xr).has(l.id)&&(l.translateInPage(s,i),l.translationDone())},undo:()=>{for(const l of a)h(this,Xr).has(l.id)&&(l.translateInPage(-s,-i),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(e,t),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),C(this,yl,new Map);for(const e of h(this,Kt))h(this,yl).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!h(this,yl))return!1;this.disableUserSelect(!1);const e=h(this,yl);C(this,yl,null);let t=!1;for(const[{x:s,y:i,pageIndex:a},o]of e)o.newX=s,o.newY=i,o.newPageIndex=a,t||(t=s!==o.savedX||i!==o.savedY||a!==o.savedPageIndex);if(!t)return!1;const n=(s,i,a,o)=>{if(h(this,Xr).has(s.id)){const l=h(this,Ir).get(o);l?s._setParentAndPosition(l,i,a):(s.pageIndex=o,s.x=i,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:i,newY:a,newPageIndex:o}]of e)n(s,i,a,o)},undo:()=>{for(const[s,{savedX:i,savedY:a,savedPageIndex:o}]of e)n(s,i,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(h(this,yl))for(const n of h(this,yl).keys())n.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())||h(this,Kt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return h(this,Ii)===e}getActive(){return h(this,Ii)}getMode(){return h(this,xn)}isEditingMode(){return h(this,xn)!==lt.NONE}get imageManager(){return ct(this,"imageManager",new GN)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let c=0,u=t.rangeCount;c<u;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:s,width:i,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,u,f,p)=>({x:(u-s)/a,y:1-(c+f-n)/i,width:p/a,height:f/i});break;case"180":o=(c,u,f,p)=>({x:1-(c+f-n)/i,y:1-(u+p-s)/a,width:f/i,height:p/a});break;case"270":o=(c,u,f,p)=>({x:1-(u+p-s)/a,y:(c-n)/i,width:p/a,height:f/i});break;default:o=(c,u,f,p)=>({x:(c-n)/i,y:(u-s)/a,width:f/i,height:p/a});break}const l=[];for(let c=0,u=t.rangeCount;c<u;c++){const f=t.getRangeAt(c);if(!f.collapsed)for(const{x:p,y:m,width:x,height:g}of f.getClientRects())x===0||g===0||l.push(o(p,m,x,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:t}){(h(this,dg)||C(this,dg,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){var t;(t=h(this,dg))==null||t.delete(e)}renderAnnotationElement(e){var s;const t=(s=h(this,dg))==null?void 0:s.get(e.data.id);if(!t)return;const n=h(this,Ws).getRawValue(t);n&&(h(this,xn)===lt.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){var i;const s=(i=h(this,_d))==null?void 0:i.get(e);s&&(s.setCanvas(t,n),h(this,_d).delete(e))}addMissingCanvas(e,t){(h(this,_d)||C(this,_d,new Map)).set(e,t)}};og=new WeakMap,Ii=new WeakMap,lg=new WeakMap,Xr=new WeakMap,Ir=new WeakMap,cg=new WeakMap,ug=new WeakMap,Ws=new WeakMap,dg=new WeakMap,Oa=new WeakMap,Fn=new WeakMap,md=new WeakMap,gd=new WeakMap,xd=new WeakMap,vd=new WeakMap,yl=new WeakMap,Fa=new WeakMap,Lf=new WeakMap,J1=new WeakMap,Q1=new WeakMap,hg=new WeakMap,ew=new WeakMap,wl=new WeakMap,yd=new WeakMap,fg=new WeakMap,wd=new WeakMap,bl=new WeakMap,zS=new WeakMap,Ac=new WeakMap,pg=new WeakMap,tw=new WeakMap,bd=new WeakMap,Bf=new WeakMap,mg=new WeakMap,_d=new WeakMap,rw=new WeakMap,xn=new WeakMap,Kt=ne
526w WeakMap,Tc=new WeakMap,kd=new WeakMap,Sd=new WeakMap,nw=new WeakMap,gg=new WeakMap,sw=new WeakMap,Ed=new WeakMap,_l=new WeakMap,Cc=new WeakMap,iw=new WeakMap,aw=new WeakMap,Da=new WeakMap,Pe=new WeakSet,Fk=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},XN=function(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const n of h(this,Ir).values())if(n.hasTextLayer(e))return n;return null},FU=function(e){var t;this.commitOrRemove(),(t=this.currentLayer)==null||t.endDrawingSession(!1)},DU=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const n=j(this,Pe,Fk).call(this,e).closest(".textLayer"),s=this.getSelectionBoxes(n);s&&(h(this,bl)||C(this,bl,new Kse(this)),h(this,bl).show(n,s,this.direction==="ltr"))},MU=function(){var i,a,o;const e=document.getSelection();if(!e||e.isCollapsed){h(this,Tc)&&((i=h(this,bl))==null||i.hide(),C(this,Tc,null),j(this,Pe,$s).call(this,{hasSelectedText:!1}));return}const{anchorNode:t}=e;if(t===h(this,Tc))return;const s=j(this,Pe,Fk).call(this,e).closest(".textLayer");if(!s){h(this,Tc)&&((a=h(this,bl))==null||a.hide(),C(this,Tc,null),j(this,Pe,$s).call(this,{hasSelectedText:!1}));return}if((o=h(this,bl))==null||o.hide(),C(this,Tc,t),j(this,Pe,$s).call(this,{hasSelectedText:!0}),!(h(this,xn)!==lt.HIGHLIGHT&&h(this,xn)!==lt.NONE)&&(h(this,xn)===lt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),C(this,wd,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=h(this,xn)===lt.HIGHLIGHT?j(this,Pe,XN).call(this,s):null;if(l==null||l.toggleDrawing(),h(this,pg)){const c=new AbortController,u=this.combinedSignal(c),f=p=>{p.type==="pointerup"&&p.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),p.type==="pointerup"&&j(this,Pe,Kv).call(this,"main_toolbar"))};window.addEventListener("pointerup",f,{signal:u}),window.addEventListener("blur",f,{signal:u})}else l==null||l.toggleDrawing(!0),j(this,Pe,Kv).call(this,"main_toolbar")}},Kv=function(e=""){h(this,xn)===lt.HIGHLIGHT?this.highlightSelection(e):h(this,J1)&&j(this,Pe,DU).call(this)},IU=function(){document.addEventListener("selectionchange",j(this,Pe,MU).bind(this),{signal:this._signal})},LU=function(){if(h(this,yd))return;C(this,yd,new AbortController);const e=this.combinedSignal(h(this,yd));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},BU=function(){var e;(e=h(this,yd))==null||e.abort(),C(this,yd,null)},YN=function(){if(h(this,bd))return;C(this,bd,new AbortController);const e=this.combinedSignal(h(this,bd));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},UU=function(){var e;(e=h(this,bd))==null||e.abort(),C(this,bd,null)},$U=function(){if(h(this,md))return;C(this,md,new AbortController);const e=this.combinedSignal(h(this,md));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})},zU=function(){var e;(e=h(this,md))==null||e.abort(),C(this,md,null)},HU=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},$s=function(e){Object.entries(e).some(([n,s])=>h(this,sw)[n]!==s)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(h(this,sw),e)}),h(this,xn)===lt.HIGHLIGHT&&e.hasSelectedEditor===!1&&j(this,Pe,pc).call(this,[[pt.HIGHLIGHT_FREE,!0]]))},pc=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},WU=async function(){if(!h(this,Ac)){C(this,Ac,!0);const e=[];for(const t of h(this,Ir).values())e.push(t.enable());await Promise.all(e);for(const t of h(this,Xr).values())t.enable()}},VU=function(){if(this.unselectAll(),h(this,Ac)){C(this,Ac,!1);for(const e of h(this,Ir).values())e.disable();for(const e of h(this,Xr).values())e.disable()}},qN=function(e){const t=h(this,Ir).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},GU=function(){let e=null;for(e of h(this,Kt));return e},Xv=function(){if(h(this,Xr).size===0)return!0;
526if(h(this,Xr).size===1)for(const e of h(this,Xr).values())return e.isEmpty();return!1},ZN=function(e){for(const t of h(this,Kt))t.unselect();h(this,Kt).clear();for(const t of e)t.isEmpty()||(h(this,Kt).add(t),t.select());j(this,Pe,$s).call(this,{hasSelectedEditor:this.hasSelection})},oe(Rm,"TRANSLATE_SMALL",1),oe(Rm,"TRANSLATE_BIG",10);let k0=Rm;var Dn,kl,ko,xg,Sl,Li,vg,El,di,Nc,Uf,Al,Ad,Ho,Yv,Dk;const zs=class zs{constructor(e){R(this,Ho);R(this,Dn,null);R(this,kl,!1);R(this,ko,null);R(this,xg,null);R(this,Sl,null);R(this,Li,null);R(this,vg,!1);R(this,El,null);R(this,di,null);R(this,Nc,null);R(this,Uf,null);R(this,Al,!1);C(this,di,e),C(this,Al,e._uiManager.useNewAltTextFlow),h(zs,Ad)||C(zs,Ad,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){zs._l10n??(zs._l10n=e)}async render(){const e=C(this,ko,document.createElement("button"));e.className="altText",e.tabIndex="0";const t=C(this,xg,document.createElement("span"));e.append(t),h(this,Al)?(e.classList.add("new"),e.setAttribute("data-l10n-id",h(zs,Ad).missing),t.setAttribute("data-l10n-id",h(zs,Ad)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const n=h(this,di)._uiManager._signal;e.addEventListener("contextmenu",so,{signal:n}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:n});const s=i=>{i.preventDefault(),h(this,di)._uiManager.editAltText(h(this,di)),h(this,Al)&&h(this,di)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:h(this,Ho,Yv)}})};return e.addEventListener("click",s,{capture:!0,signal:n}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(C(this,vg,!0),s(i))},{signal:n}),await j(this,Ho,Dk).call(this),e}finish(){h(this,ko)&&(h(this,ko).focus({focusVisible:h(this,vg)}),C(this,vg,!1))}isEmpty(){return h(this,Al)?h(this,Dn)===null:!h(this,Dn)&&!h(this,kl)}hasData(){return h(this,Al)?h(this,Dn)!==null||!!h(this,Nc):this.isEmpty()}get guessedText(){return h(this,Nc)}async setGuessedText(e){h(this,Dn)===null&&(C(this,Nc,e),C(this,Uf,await zs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),j(this,Ho,Dk).call(this))}toggleAltTextBadge(e=!1){var t;if(!h(this,Al)||h(this,Dn)){(t=h(this,El))==null||t.remove(),C(this,El,null);return}if(!h(this,El)){const n=C(this,El,document.createElement("div"));n.className="noAltTextBadge",h(this,di).div.append(n)}h(this,El).classList.toggle("hidden",!e)}serialize(e){let t=h(this,Dn);return!e&&h(this,Nc)===t&&(t=h(this,Uf)),{altText:t,decorative:h(this,kl),guessedText:h(this,Nc),textWithDisclaimer:h(this,Uf)}}get data(){return{altText:h(this,Dn),decorative:h(this,kl)}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:s,cancel:i=!1}){n&&(C(this,Nc,n),C(this,Uf,s)),!(h(this,Dn)===e&&h(this,kl)===t)&&(i||(C(this,Dn,e),C(this,kl,t)),j(this,Ho,Dk).call(this))}toggle(e=!1){h(this,ko)&&(!e&&h(this,Li)&&(clearTimeout(h(this,Li)),C(this,Li,null)),h(this,ko).disabled=!e)}shown(){h(this,di)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:h(this,Ho,Yv)}})}destroy(){var e,t;(e=h(this,ko))==null||e.remove(),C(this,ko,null),C(this,xg,null),C(this,Sl,null),(t=h(this,El))==null||t.remove(),C(this,El,null)}};Dn=new WeakMap,kl=new WeakMap,ko=new WeakMap,xg=new WeakMap,Sl=new WeakMap,Li=new WeakMap,vg=new WeakMap,El=new WeakMap,di=new WeakMap,Nc=new WeakMap,Uf=new WeakMap,Al=new WeakMap,Ad=new WeakMap,Ho=new WeakSet,Yv=function(){return h(this,Dn)&&"added"||h(this,Dn)===null&&this.guessedText&&"review"||"missing"},Dk=async function(){var s,i,a;const e=h(this,ko);if(!e)return;if(h(this,Al)){if(e.classList.toggle("done",!!h(this,Dn)),e.setAttribute("data-l10n-id",h(zs,Ad)[h(this,Ho,Yv)]),(s=h(this,xg))==null||s.setAttribute("data-l10n-id",h(zs,Ad)[`${h(this,Ho,Yv)}-label`]),!h(this,Dn)){(i=h(this,Sl))==null||i.remove();return}}else{if(!h(this,Dn)&&!h(this,kl)){e.classList.remove("done"),(a=h(this,Sl))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=h(this,Sl);if(!t){C(this,Sl,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${h(this,di).id}`;const o=100,l=h(this,di)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(h(this,Li)),C(this,Li,null)},{once:!0}),e.addEventListener("mouseenter",()=>{C(this,Li,setTimeout(()=>{C(this,Li,null),h(this,Sl).classList.add("show"),h(this,di)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var c;h(this,Li)&&(clearTimeout(h(this,Li)),C(this,Li,null)),(c=h(this,Sl))==null||c.classList.remove("show")},{signal:l})}h(this,kl)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=h(this,Dn)),t.parentNode||e.append(t);const n=h(this,di).getElementForAltText();n==null||n.setAttribute("aria-describedby",t.id)},R(zs,Ad,null),oe(zs,"_l10n",null);let fS=zs;var es,Ma,$f,pr,ow,Td,Ia,Cd,Nd,zf,lw,JN;class z_{constructor(e){R(this,lw);R(this,es,null);R(this,Ma,null);R(this,$f,!1);R(this,pr,null);R(this,ow,null);R(this,Td,null);R(this,Ia,null);R(this,Cd,null);R(this,Nd,!1);R(this,zf,null);C(this,pr,e)}renderForToolbar(){const e=C(this,Ma,document.createElement("button"));
526return e.className="comment",j(this,lw,JN).call(this,e,!1)}renderForStandalone(){const e=C(this,es,document.createElement("button"));e.className="annotationCommentButton";const t=h(this,pr).commentButtonPosition;if(t){const{style:n}=e;n.insetInlineEnd=`calc(${100*(h(this,pr)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const s=h(this,pr).commentButtonColor;s&&(n.backgroundColor=s)}return j(this,lw,JN).call(this,e,!0)}focusButton(){setTimeout(()=>{var e;(e=h(this,es)??h(this,Ma))==null||e.focus()},0)}onUpdatedColor(){if(!h(this,es))return;const e=h(this,pr).commentButtonColor;e&&(h(this,es).style.backgroundColor=e),h(this,pr)._uiManager.updatePopupColor(h(this,pr))}get commentButtonWidth(){var e;return(((e=h(this,es))==null?void 0:e.getBoundingClientRect().width)??0)/h(this,pr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(h(this,zf))return h(this,zf);if(!h(this,es))return null;const{x:e,y:t,height:n}=h(this,es).getBoundingClientRect(),{x:s,y:i,width:a,height:o}=h(this,pr).parent.boundingClientRect;return[(e-s)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){C(this,zf,e)}hasDefaultPopupPosition(){return h(this,zf)===null}removeStandaloneCommentButton(){var e;(e=h(this,es))==null||e.remove(),C(this,es,null)}removeToolbarCommentButton(){var e;(e=h(this,Ma))==null||e.remove(),C(this,Ma,null)}setCommentButtonStates({selected:e,hasPopup:t}){h(this,es)&&(h(this,es).classList.toggle("selected",e),h(this,es).ariaExpanded=t)}edit(e){const t=this.commentPopupPositionInLayer;let n,s;if(t)[n,s]=t;else{[n,s]=h(this,pr).commentButtonPosition;const{width:u,height:f,x:p,y:m}=h(this,pr);n=p+n*u,s=m+s*f}const i=h(this,pr).parent.boundingClientRect,{x:a,y:o,width:l,height:c}=i;h(this,pr)._uiManager.editComment(h(this,pr),a+n*l,o+s*c,{...e,parentDimensions:i})}finish(){h(this,Ma)&&(h(this,Ma).focus({focusVisible:h(this,$f)}),C(this,$f,!1))}isDeleted(){return h(this,Nd)||h(this,Ia)===""}isEmpty(){return h(this,Ia)===null}hasBeenEdited(){return this.isDeleted()||h(this,Ia)!==h(this,ow)}serialize(){return this.data}get data(){return{text:h(this,Ia),richText:h(this,Td),date:h(this,Cd),deleted:this.isDeleted()}}set data(e){if(e!==h(this,Ia)&&C(this,Td,null),e===null){C(this,Ia,""),C(this,Nd,!0);return}C(this,Ia,e),C(this,Cd,new Date),C(this,Nd,!1)}restoreData({text:e,richText:t,date:n}){C(this,Ia,e),C(this,Td,t),C(this,Cd,n),C(this,Nd,!1)}setInitialText(e,t=null){C(this,ow,e),this.data=e,C(this,Cd,null),C(this,Td,t)}shown(){}destroy(){var e,t;(e=h(this,Ma))==null||e.remove(),C(this,Ma,null),(t=h(this,es))==null||t.remove(),C(this,es,null),C(this,Ia,""),C(this,Td,null),C(this,Cd,null),C(this,pr,null),C(this,$f,!1),C(this,Nd,!1)}}es=new WeakMap,Ma=new WeakMap,$f=new WeakMap,pr=new WeakMap,ow=new WeakMap,Td=new WeakMap,Ia=new WeakMap,Cd=new WeakMap,Nd=new WeakMap,zf=new WeakMap,lw=new WeakSet,JN=function(e,t){if(!h(this,pr)._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=[h(this,pr)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const n=h(this,pr)._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",so,{signal:n}),t&&(e.addEventListener("focusin",i=>{h(this,pr)._focusEventsAllowed=!1,Br(i)},{capture:!0,signal:n}),e.addEventListener("focusout",i=>{h(this,pr)._focusEventsAllowed=!0,Br(i)},{capture:!0,signal:n})),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:n});const s=i=>{i.preventDefault(),e===h(this,Ma)?this.edit():h(this,pr).toggleComment(!0)};return e.addEventListener("click",s,{capture:!0,signal:n}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(C(this,$f,!0),s(i))},{signal:n}),e.addEventListener("pointerenter",()=>{h(this,pr).toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{h(this,pr).toggleComment(!1,!1)},{signal:n}),e};var yg,Hf,cw,uw,dw,hw,fw,Pc,Wf,Rc,Vf,jc,Gh,KU,XU,YU;const yO=class yO{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:s=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){R(this,Gh);R(this,yg);R(this,Hf,!1);R(this,cw,null);R(this,uw);R(this,dw);R(this,hw);R(this,fw);R(this,Pc,null);R(this,Wf);R(this,Rc,null);R(this,Vf);R(this,jc,null);C(this,yg,e),C(this,cw,n),C(this,uw,t),C(this,dw,s),C(this,hw,i),C(this,fw,a),C(this,Vf,new AbortController),C(this,Wf,AbortSignal.any([o,h(this,Vf).signal])),e.addEventListener("touchstart",j(this,Gh,KU).bind(this),{passive:!1,signal:h(this,Wf)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/rc.pixelRatio}destroy(){var e,t;(e=h(this,Vf))==null||e.abort(),C(this,Vf,null),(t=h(this,Pc))==null||t.abort(),C(this,Pc,null)}};yg=new WeakMap,Hf=new WeakMap,cw=new WeakMap,uw=new WeakMap,dw=new WeakMap,hw=new WeakMap,fw=new WeakMap,Pc=new WeakMap,Wf=new WeakMap,Rc=new WeakMap,Vf=new WeakMap,jc=new WeakMap,Gh=new WeakSet,KU=function(e){var s,i,a;if((s=h(this,uw))!=null&&s.call(this))return;if(e.touches.length===1){if(h(this,Pc))return;const o=C(this,Pc,new AbortController),l=AbortSignal.any([h(this,Wf),o.signal]),c=h(this,yg),u={capture:!0,signal:l,passive:!1},f=p=>{var m;p.pointerType==="touch"&&((m=h(this,Pc))==null||m.abort(),C(this,Pc,null))};c.addEventListener("pointerdown",p=>{p.pointerType==="touch"&&(Br(p),f(p))},u),c.addEventListener("pointerup",f,u),c.addEventListener("pointercancel",f,u);return}if(!h(this,jc)){C(this,jc,new AbortController);const o=AbortSignal.any([h(this,Wf),h(this,jc).signal]),l=h(this,yg),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",j(this,Gh,XU).bind(this),c);const u=j(this,Gh,YU).bind(this);l.addEventListener("touchend",u,c),l.addEventListener("touchcancel",u,c),c.capture=!0,l.addEventListener("pointerdown",Br,c),l.addEventListener("pointermove",Br,c),l.addEventListener("pointercancel",Br,c),l.addEventListener("pointerup",Br,c),(i=h(this,dw))==null||i.call(this)}if(Br(e),e.touches.length!==2||(a=h(this,cw))!=null&&a.call(this)){C(this,Rc,null);return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),C(this,Rc,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY})},XU=function(e){var _;if(!h(this,Rc)||e.touches.length!==2)return;Br(e);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);const{screenX:s,screenY:i}=t,{screenX:a,screenY:o}=n,l=h(this,Rc),{touch0X:c,touch0Y:u,touch1X:f,touch1Y:p}=l,m=f-c,x=p-u,g=a-s,y=o-i,v=Math.hypot(g,y)||1,w=Math.hypot(m,x)||1;if(!h(this,Hf)&&Math.abs(w-v)<=yO.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=i,l.touch1X=a,l.touch1Y=o,!h(this,Hf)){C(this,Hf,!0);return}const b=[(s+a)/2,(i+o)/2];(_=h(this,hw))==null||_.call(this,b,w,v)},YU=function(e){var t;e.touches.length>=2||(h(this,jc)&&(h(this,jc).abort(),C(this,jc,null),(t=h(this,fw))==null||t.call(this)),h(this,Rc)&&(Br(e),C(this,Rc,null),C(this,Hf,!1)))};let pS=yO;var Gf,So,Cr,Xt,Oc,wg,Pd,pw,ts,Kf,Fc,La,Rd,mw,Xf,Bi,gw,Yf,Dc,Tl,bg,_g,Ba,qf,xw,HS,qe,QN,vw,eP,Mk,qU,ZU,tP,Ik,rP,JU,QU,e$,nP,t$,sP,r$,n$,s$,iP,qv;const st=class st{constructor(e){R(this,qe);R(this,Gf,null);R(this,So,null);R(this,Cr,null);R(this,Xt,null);R(this,Oc,null);R(this,wg,!1);R(this,Pd,null);R(this,pw,"");R(this,ts,null);R(this,Kf,null);R(this,Fc,null);R(this,La,null);R(this,Rd,null);R(this,mw,"");R(this,Xf,!1);R(this,Bi,null);R(this,gw,!1);R(this,Yf,!1);R(this,Dc,!1);R(this,Tl,null);R(this,bg,0);R(this,_g,0);R(this,Ba,null);R(this,qf,null);oe(this,"isSelected",!1);oe(this,"_isCopy",!1);oe(this,"_editToolbar",null);oe(this,"_initialOptions",Object.create(null));oe(this,"_initialData",null);oe(this,"_isVisible",!0);oe(this,"_uiManager",null);oe(this,"_focusEventsAllowed",!0);R(this,xw,!1);R(this,HS,st._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:n,pageHeight:s,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,s],this.pageTranslation=[i,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=st.prototype._resizeWithKeyboard,t=k0.TRANSLATE_SMALL,n=k0.TRANSLATE_BIG;return ct(this,"_resizerKeyboardManager",new Zb([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],st.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 ct(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}
526static deleteAnnotationElement(e){const t=new Jse({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(st._l10n??(st._l10n=e),st._l10nAlert??(st._l10nAlert=Object.freeze({highlight:"pdfjs-editor-highlight-added-alert",freetext:"pdfjs-editor-freetext-added-alert",ink:"pdfjs-editor-ink-added-alert",stamp:"pdfjs-editor-stamp-added-alert",signature:"pdfjs-editor-signature-added-alert"})),st._l10nResizer??(st._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"})),st._borderLineWidth!==-1)return;const n=getComputedStyle(document.documentElement);st._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Ut("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return h(this,xw)}set _isDraggable(e){var t;C(this,xw,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=h(this,HS)}setParent(e){var t;e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(j(this,qe,qv).call(this),(t=h(this,La))==null||t.remove(),C(this,La,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(h(this,Xf)?C(this,Xf,!1):this.parent.setSelected(this))}focusout(e){var n;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(n=this.parent)!=null&&n.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,s){const[i,a]=this.parentDimensions;[n,s]=this.screenToPageTranslation(n,s),this.x=(e+n)/i,this.y=(t+s)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}const[n,s]=this.parentDimensions;this.setAt(e*n,t*s,this.width*n,this.height*s),this._onTranslated()}translate(e,t){j(this,qe,QN).call(this,this.parentDimensions,e,t)}translateInPage(e,t){h(this,Bi)||C(this,Bi,[this.x,this.y,this.width,this.height]),j(this,qe,QN).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){h(this,Bi)||C(this,Bi,[this.x,this.y,this.width,this.height]);const{div:n,parentDimensions:[s,i]}=this;if(this.x+=e/s,this.y+=t/i,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:u}=n;u.left=`${(100*a).toFixed(2)}%`,u.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!h(this,Bi)&&(h(this,Bi)[0]!==this.x||h(this,Bi)[1]!==this.y)}get _hasBeenResized(){return!!h(this,Bi)&&(h(this,Bi)[2]!==this.width||h(this,Bi)[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=st,s=n/e,i=n/t;switch(this.rotation){case 90:return[-s,i];case 180:return[s,i];case 270:return[s,-i];default:return[-s,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[n,s]}=this;let{x:i,y:a,width:o,height:l}=this;if(o*=n,l*=s,i*=n,a*=s,this._mustFixPosition)switch(e){case 0:i=Pr(i,0,n-o),a=Pr(a,0,s-l);break;case 90:i=Pr(i,0,n-l),a=Pr(a,o,s);break;case 180:i=Pr(i,o,n),a=Pr(a,l,s);break;case 270:i=Pr(i,l,n),a=Pr(a,0,s-o);break}this.x=i/=n,this.y=a/=s;const[c,u]=this.getBaseTranslation();i+=c,a+=u,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var n;return j(n=st,vw,eP).call(n,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var n;return j(n=st,vw,eP).call(n,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,n]}=this;return[t*e,n*e]}setDims(){const{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=h(this,Cr))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||h(this,Yf))return this._editToolbar;
526this._editToolbar=new WN(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[t,n]of e)await this._editToolbar.addButton(t,n);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=h(this,Cr))==null||t.destroy()}addContainer(e){var n;const t=(n=this._editToolbar)==null?void 0:n.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return h(this,Cr)||(fS.initialize(st._l10n),C(this,Cr,new fS(this)),h(this,Gf)&&(h(this,Cr).data=h(this,Gf),C(this,Gf,null))),h(this,Cr)}get altTextData(){var e;return(e=h(this,Cr))==null?void 0:e.data}set altTextData(e){h(this,Cr)&&(h(this,Cr).data=e)}get guessedAltText(){var e;return(e=h(this,Cr))==null?void 0:e.guessedText}async setGuessedAltText(e){var t;await((t=h(this,Cr))==null?void 0:t.setGuessedText(e))}serializeAltText(e){var t;return(t=h(this,Cr))==null?void 0:t.serialize(e)}hasAltText(){return!!h(this,Cr)&&!h(this,Cr).isEmpty()}hasAltTextData(){var e;return((e=h(this,Cr))==null?void 0:e.hasData())??!1}focusCommentButton(){var e;(e=h(this,Xt))==null||e.focusButton()}addCommentButton(){return this.canAddComment?h(this,Xt)||C(this,Xt,new z_(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(h(this,Oc)){this._uiManager.isEditingMode()&&h(this,Oc).classList.remove("hidden");return}this.hasComment&&(C(this,Oc,h(this,Xt).renderForStandalone()),this.div.append(h(this,Oc)))}}removeStandaloneCommentButton(){h(this,Xt).removeStandaloneCommentButton(),C(this,Oc,null)}hideStandaloneCommentButton(){var e;(e=h(this,Oc))==null||e.classList.add("hidden")}get comment(){if(!h(this,Xt))return null;const{data:{richText:e,text:t,date:n,deleted:s}}=h(this,Xt);return{text:t,richText:e,date:n,deleted:s,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){h(this,Xt)||C(this,Xt,new z_(this)),typeof e=="object"&&e!==null?h(this,Xt).restoreData(e):h(this,Xt).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:n}){if(!t||(h(this,Xt)||C(this,Xt,new z_(this)),h(this,Xt).setInitialText(e,n),!this.annotationElementId))return;const s=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);s&&this.updateFromAnnotationLayer(s)}get hasEditedComment(){var e;return(e=h(this,Xt))==null?void 0:e.hasBeenEdited()}get hasDeletedComment(){var e;return(e=h(this,Xt))==null?void 0:e.isDeleted()}get hasComment(){return!!h(this,Xt)&&!h(this,Xt).isEmpty()&&!h(this,Xt).isDeleted()}async editComment(e){h(this,Xt)||C(this,Xt,new z_(this)),h(this,Xt).edit(e)}
526toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){h(this,Xt).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,s]=e.rect,[i]=this.pageDimensions,[a]=this.pageTranslation,o=a+i+1,l=s-100,c=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,s]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){h(this,Xt).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=h(this,wg)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),j(this,qe,sP).call(this);const[t,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);const[s,i]=this.getInitialTranslation();return this.translate(s,i),jU(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(h(this,qf)||C(this,qf,new pS({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:j(this,qe,JU).bind(this),onPinching:j(this,qe,QU).bind(this),onPinchEnd:j(this,qe,e$).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),e}pointerdown(e){const{isMac:t}=gr.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(C(this,Xf,!0),this._isDraggable){j(this,qe,t$).call(this,e);return}j(this,qe,nP).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){h(this,Tl)&&clearTimeout(h(this,Tl)),C(this,Tl,setTimeout(()=>{var e;C(this,Tl,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){const s=this.parentScale,[i,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/s,u=t/s,f=this.x*i,p=this.y*a,m=this.width*i,x=this.height*a;switch(n){case 0:return[f+c+o,a-p-u-x+l,f+c+m+o,a-p-u+l];case 90:return[f+u+o,a-p+c+l,f+u+x+o,a-p+c+m+l];case 180:return[f-c-m+o,a-p+u+l,f-c+o,a-p+u+x+l];case 270:return[f-u-x+o,a-p-c-m+l,f-u+o,a-p-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,s,i,a]=e,o=i-n,l=a-s;switch(this.rotation){case 0:return[n,t-a,o,l];case 90:return[n,t-s,l,o];case 180:return[i,t-s,o,l];case 270:return[i,t-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&st._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var e;(e=h(this,Xt))==null||e.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:n,opacity:s,deleted:i,richText:a},uid:o,pageIndex:l,creationDate:c,modificationDate:u}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||u,popupRef:!i,color:t,opacity:s}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),C(this,Yf,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),C(this,Yf,!1),!0):!1}isInEditMode(){return h(this,Yf)}shouldGetKeyboardEvents(){return h(this,Dc)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:n,right:s}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&s>0&&e<i&&n>0}rebuild(){j(this,qe,sP).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 n;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((n=this._initialData)==null?void 0:n.popupRef)||""}}static async deserialize(e,t,n){const s=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});s.rotation=e.rotation,C(s,Gf,e.accessibilityData),s._isCopy=e.isCopy||!1;const[i,a]=s.pageDimensions,[o,l,c,u]=s.getRectInCurrentCoords(e.rect,a);return s.x=o/i,s.y=l/a,s.width=c/i,s.height=u/a,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,t,n;if((e=h(this,Rd))==null||e.abort(),C(this,Rd,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),h(this,Tl)&&(clearTimeout(h(this,Tl)),C(this,Tl,null)),j(this,qe,qv).call(this),this.removeEditToolbar(),h(this,Ba)){for(const s of h(this,Ba).values())clearTimeout(s);C(this,Ba,null)}this.parent=null,(t=h(this,qf))==null||t.destroy(),C(this,qf,null),(n=h(this,La))==null||n.remove(),C(this,La,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(j(this,qe,qU).call(this),h(this,ts).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,[n,s,i,a]=this.getPDFRect();return[st._round(n+(i-n)*e),st._round(s+(a-s)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return h(this,Xt).commentPopupPositionInLayer}set commentPopupPosition(e){h(this,Xt).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return h(this,Xt).hasDefaultPopupPosition()}get commentButtonWidth(){return h(this,Xt).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){var t;(t=h(this,Xt))==null||t.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),C(this,Fc,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=h(this,ts).children;if(!h(this,So)){C(this,So,Array.from(t));const a=j(this,qe,r$).bind(this),o=j(this,qe,n$).bind(this),l=this._uiManager._signal;for(const c of h(this,So)){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",j(this,qe,s$).bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",st._l10nResizer[u])}}const n=h(this,So)[0];let s=0;for(const a of t){if(a===n)break;s++}
526const i=(360-this.rotation+this.parentRotation)%360/90*(h(this,So).length/4);if(i!==s){if(i<s)for(let o=0;o<s-i;o++)h(this,ts).append(h(this,ts).firstElementChild);else if(i>s)for(let o=0;o<i-s;o++)h(this,ts).firstElementChild.before(h(this,ts).lastElementChild);let a=0;for(const o of t){const c=h(this,So)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",st._l10nResizer[c])}}j(this,qe,iP).call(this,0),C(this,Dc,!0),h(this,ts).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){h(this,Dc)&&j(this,qe,rP).call(this,h(this,mw),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){j(this,qe,qv).call(this),this.div.focus()}select(){var e,t,n;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 s,i;(s=this.div)!=null&&s.classList.contains("selectedEditor")&&((i=this._editToolbar)==null||i.show())});return}(t=this._editToolbar)==null||t.show(),(n=h(this,Cr))==null||n.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,n,s,i;this.isSelected&&(this.isSelected=!1,(e=h(this,ts))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(n=this.div)!=null&&n.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(s=this._editToolbar)==null||s.hide(),(i=h(this,Cr))==null||i.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 h(this,gw)}set isEditing(e){C(this,gw,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){h(this,Ba)||C(this,Ba,new Map);const{action:n}=e;let s=h(this,Ba).get(n);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(e),h(this,Ba).delete(n),h(this,Ba).size===0&&C(this,Ba,null)},st._telemetryTimeout),h(this,Ba).set(n,s);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),C(this,wg,!1)}disable(){this.div&&(this.div.tabIndex=-1),C(this,wg,!0)}updateFakeAnnotationElement(e){if(!h(this,La)&&!this.deleted){C(this,La,e.addFakeAnnotation(this));return}if(this.deleted){h(this,La).remove(),C(this,La,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&h(this,La).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 n=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),n.before(t)}return t}resetAnnotationElement(e){const{firstElementChild:t}=e.container;(t==null?void 0:t.nodeName)==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};Gf=new WeakMap,So=new WeakMap,Cr=new WeakMap,Xt=new WeakMap,Oc=new WeakMap,wg=new WeakMap,Pd=new WeakMap,pw=new WeakMap,ts=new WeakMap,Kf=new WeakMap,Fc=new WeakMap,La=new WeakMap,Rd=new WeakMap,mw=new WeakMap,Xf=ne
vendor: 4,527 bytes, line 526
526w WeakMap,Bi=new WeakMap,gw=new WeakMap,Yf=new WeakMap,Dc=new WeakMap,Tl=new WeakMap,bg=new WeakMap,_g=new WeakMap,Ba=new WeakMap,qf=new WeakMap,xw=new WeakMap,HS=new WeakMap,qe=new WeakSet,QN=function([e,t],n,s){[n,s]=this.screenToPageTranslation(n,s),this.x+=n/e,this.y+=s/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},vw=new WeakSet,eP=function(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},Mk=function(e){switch(e){case 90:{const[t,n]=this.pageDimensions;return[0,-t/n,n/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,n]=this.pageDimensions;return[0,t/n,-n/t,0]}default:return[1,0,0,1]}},qU=function(){if(h(this,ts))return;C(this,ts,document.createElement("div")),h(this,ts).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 n of e){const s=document.createElement("div");h(this,ts).append(s),s.classList.add("resizer",n),s.setAttribute("data-resizer-name",n),s.addEventListener("pointerdown",j(this,qe,ZU).bind(this,n),{signal:t}),s.addEventListener("contextmenu",so,{signal:t}),s.tabIndex=-1}this.div.prepend(h(this,ts))},ZU=function(e,t){var u;t.preventDefault();const{isMac:n}=gr.platform;if(t.button!==0||t.ctrlKey&&n)return;(u=h(this,Cr))==null||u.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,C(this,Kf,[t.screenX,t.screenY]);const i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",j(this,qe,rP).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",Br,{passive:!1,signal:a}),window.addEventListener("contextmenu",so,{signal:a}),C(this,Fc,{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;i.abort(),this.parent.togglePointerEvents(!0),(f=h(this,Cr))==null||f.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,j(this,qe,Ik).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},tP=function(e,t,n,s){this.width=n,this.height=s,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},Ik=function(){if(!h(this,Fc))return;const{savedX:e,savedY:t,savedWidth:n,savedHeight:s}=h(this,Fc);C(this,Fc,null);const i=this.x,a=this.y,o=this.width,l=this.height;i===e&&a===t&&o===n&&l===s||this.addCommands({cmd:j(this,qe,tP).bind(this,i,a,o,l),undo:j(this,qe,tP).bind(this,e,t,n,s),mustExec:!0})},rP=function(e,t){const[n,s]=this.parentDimensions,i=this.x,a=this.y,o=this.width,l=this.height,c=st.MIN_SIZE/n,u=st.MIN_SIZE/s,f=j(this,qe,Mk).call(this,this.rotation),p=(X,W)=>[f[0]*X+f[2]*W,f[1]*X+f[3]*W],m=j(this,qe,Mk).call(this,360-this.rotation),x=(X,W)=>[m[0]*X+m[2]*W,m[1]*X+m[3]*W];let g,y,v=!1,w=!1;switch(e){case"topLeft":v=!0,g=(X,W)=>[0,0],y=(X,W)=>[X,W];break;case"topMiddle":g=(X,W)=>[X/2,0],y=(X,W)=>[X/2,W];break;case"topRight":v=!0,g=(X,W)=>[X,0],y=(X,W)=>[0,W];break;case"middleRight":w=!0,g=(X,W)=>[X,W/2],y=(X,W)=>[0,W/2];break;case"bottomRight":v=!0,g=(X,W)=>[X,W],y=(X,W)=>[0,0];break;case"bottomMiddle":g=(X,W)=>[X/2,W],y=(X,W)=>[X/2,0];break;case"bottomLeft":v=!0,g=(X,W)=>[0,W],y=(X,W)=>[X,0];break;case"middleLeft":w=!0,g=(X,W)=>[0,W/2],y=(X,W)=>[X,W/2];break}const b=g(o,l),_=y(o,l);let T=p(..._);const A=st._round(i+T[0]),N=st._round(a+T[1]);let k=1,E=1,P,O;if(t.fromKeyboard)({deltaX:P,deltaY:O}=t);else{const{screenX:X,screenY:W}=t,[Y,F]=h(this,Kf);[P,O]=this.screenToPageTranslation(X-Y,W-F),h(this,Kf)[0]=X,h(this,Kf)[1]=W}if([P,O]=x(P/n,O/s),v){const X=Math.hypot(o,l);k=E=Math.max(Math.min(Math.hypot(_[0]-b[0]-P,_[1]-b[1]-O)/X,1/o,1/l),c/o,u/l)}else w?k=Pr(Math.abs(_[0]-b[0]-P),c,1)/o:E=Pr(Math.abs(_[1]-b[1]-O),u,1)/l;const D=st._round(o*k),H=st._round(l*E);T=p(...y(D,H));const B=A-T[0],ee=N-T[1];h(this,Bi)||C(this,Bi,[this.x,this.y,this.width,this.height]),this.width=D,this.height=H,this.x=B,this.y=ee,this.setDims(),this.fixAndSetPosition(),this._onResizing()},JU=function(){var e;C(this,Fc,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=h(this,Cr))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},QU=function(e,t,n){let i=.7*(n/t)+1-.7;
526if(i===1)return;const a=j(this,qe,Mk).call(this,this.rotation),o=(A,N)=>[a[0]*A+a[2]*N,a[1]*A+a[3]*N],[l,c]=this.parentDimensions,u=this.x,f=this.y,p=this.width,m=this.height,x=st.MIN_SIZE/l,g=st.MIN_SIZE/c;i=Math.max(Math.min(i,1/p,1/m),x/p,g/m);const y=st._round(p*i),v=st._round(m*i);if(y===p&&v===m)return;h(this,Bi)||C(this,Bi,[u,f,p,m]);const w=o(p/2,m/2),b=st._round(u+w[0]),_=st._round(f+w[1]),T=o(y/2,v/2);this.x=b-T[0],this.y=_-T[1],this.width=y,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()},e$=function(){var e;(e=h(this,Cr))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),j(this,qe,Ik).call(this)},nP=function(e){const{isMac:t}=gr.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},t$=function(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1;const s=new AbortController,i=this._uiManager.combinedSignal(s),a={capture:!0,passive:!1,signal:i},o=c=>{s.abort(),C(this,Pd,null),C(this,Xf,!1),this._uiManager.endDragSession()||j(this,qe,nP).call(this,c),n&&this._onStopDragging()};t&&(C(this,bg,e.clientX),C(this,_g,e.clientY),C(this,Pd,e.pointerId),C(this,pw,e.pointerType),window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:u,clientY:f,pointerId:p}=c;if(p!==h(this,Pd)){Br(c);return}const[m,x]=this.screenToPageTranslation(u-h(this,bg),f-h(this,_g));C(this,bg,u),C(this,_g,f),this._uiManager.dragSelectedEditors(m,x)},a),window.addEventListener("touchmove",Br,a),window.addEventListener("pointerdown",c=>{c.pointerType===h(this,pw)&&(h(this,qf)||c.isPrimary)&&o(c),Br(c)},a));const l=c=>{if(!h(this,Pd)||h(this,Pd)===c.pointerId){o(c);return}Br(c)};window.addEventListener("pointerup",l,{signal:i}),window.addEventListener("blur",l,{signal:i})},sP=function(){if(h(this,Rd)||!this.div)return;C(this,Rd,new AbortController);const e=this._uiManager.combinedSignal(h(this,Rd));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},r$=function(e){st._resizerKeyboardManager.exec(this,e)},n$=function(e){var t;h(this,Dc)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==h(this,ts)&&j(this,qe,qv).call(this)},s$=function(e){C(this,mw,h(this,Dc)?e:"")},iP=function(e){if(h(this,So))for(const t of h(this,So))t.tabIndex=e},qv=function(){C(this,Dc,!1),j(this,qe,iP).call(this,-1),j(this,qe,Ik).call(this)},R(st,vw),oe(st,"_l10n",null),oe(st,"_l10nAlert",null),oe(st,"_l10nResizer",null),oe(st,"_borderLineWidth",-1),oe(st,"_colorManager",new KN),oe(st,"_zIndex",1),oe(st,"_telemetryTimeout",1e3);let Wt=st;class Jse extends Wt{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const XD=3285377520,_a=4294901760,cl=65535;class aP{constructor(e){this.h1=e?e&4294967295:XD,this.h2=e?e&4294967295:XD}update(e){let t,n;if(typeof e=="string"){t=new Uint8Array(e.length*2),n=0;for(let g=0,y=e.length;g<y;g++){const v=e.charCodeAt(g);v<=255?t[n++]=v:(t[n++]=v>>>8,t[n++]=v&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const s=n>>2,i=n-s*4,a=new Uint32Array(t.buffer,0,s);let o=0,l=0,c=this.h1,u=this.h2;const f=3432918353,p=461845907,m=f&cl,x=p&cl;for(let g=0;g<s;g++)g&1?(o=a[g],o=o*f&_a|o*m&cl,o=o<<15|o>>>17,o=o*p&_a|o*x&cl,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[g],l=l*f&_a|l*m&cl,l=l<<15|l>>>17,l=l*p&_a|l*x&cl,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(o=0,i){case 3:o^=t[s*4+2]<<16;case 2:o^=t[s*4+1]<<8;case 1:o^=t[s*4],o=o*f&_a|o*m&cl,o=o<<15|o>>>17,o=o*p&_a|o*x&cl,s&1?c^=o:u^=o}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&_a|e*36045&cl,t=t*4283543511&_a|((t<<16|e>>>16)*2950163797&_a)>>>16,e^=t>>>1,e=e*444984403&_a|e*60499&cl,t=t*3301882366&_a|((t<<16|e>>>16)*3120437893&_a)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const A1=Object.freeze({map:null,hash:"",transfer:void 0});var Zf,Jf,Mc,rs,WS,i$;class vj{constructor(){R(this,WS);R(this,Zf,!1);R(this,Jf,null);R(this,Mc,null);R(this,rs,new Map);oe(this,"onSetModified",null);oe(this,"onResetModified",null);oe(this,"onAnnotationEditor",null)}getValue(e,t){const n=h(this,rs).get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return h(this,rs).get(e)}remove(e){var n;const t=h(this,rs).get(e);t!==void 0&&(t instanceof Wt&&h(this,Mc).delete(t.annotationElementId),h(this,rs).delete(e),h(this,rs).size===0&&this.resetModified(),!h(this,rs).values().some(s=>s instanceof Wt)&&((n=this.onAnnotationEditor)==null||n.call(this,null)))}setValue(e,t){var i;const n=h(this,rs).get(e);let s=!1;
526if(n!==void 0)for(const[a,o]of Object.entries(t))n[a]!==o&&(s=!0,n[a]=o);else s=!0,h(this,rs).set(e,t);s&&j(this,WS,i$).call(this),t instanceof Wt&&((h(this,Mc)||C(this,Mc,new Map)).set(t.annotationElementId,t),(i=this.onAnnotationEditor)==null||i.call(this,t.constructor._type))}has(e){return h(this,rs).has(e)}get size(){return h(this,rs).size}resetModified(){var e;h(this,Zf)&&(C(this,Zf,!1),(e=this.onResetModified)==null||e.call(this))}get print(){return new a$(this)}get serializable(){if(h(this,rs).size===0)return A1;const e=new Map,t=new aP,n=[],s=Object.create(null);let i=!1;for(const[a,o]of h(this,rs)){const l=o instanceof Wt?o.serialize(!1,s):o;o.page&&(o.pageIndex=o.page._pageIndex,delete o.page),l&&(e.set(a,l),t.update(`${a}:${JSON.stringify(l)}`),i||(i=!!l.bitmap))}if(i)for(const a of e.values())a.bitmap&&n.push(a.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:A1}get editorStats(){let e=null;const t=new Map;let n=0,s=0;for(const i of h(this,rs).values()){if(!(i instanceof Wt)){i.popup&&(i.popup.deleted?s+=1:n+=1);continue}i.isCommentDeleted?s+=1:i.hasEditedComment&&(n+=1);const a=i.telemetryFinalData;if(!a)continue;const{type:o}=a;t.has(o)||t.set(o,Object.getPrototypeOf(i).constructor),e||(e=Object.create(null));const l=e[o]||(e[o]=new Map);for(const[c,u]of Object.entries(a)){if(c==="type")continue;const f=l.getOrInsertComputed(c,pj);f.set(u,(f.get(u)??0)+1)}}if((s>0||n>0)&&(e||(e=Object.create(null)),e.comments={deleted:s,edited:n}),!e)return null;for(const[i,a]of t)e[i]=a.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){C(this,Jf,null)}updateEditor(e,t){var s;const n=(s=h(this,Mc))==null?void 0:s.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){var t;return((t=h(this,Mc))==null?void 0:t.get(e))||null}get modifiedIds(){if(h(this,Jf))return h(this,Jf);const e=[];if(h(this,Mc))for(const n of h(this,Mc).values())n.serialize()&&e.push(n.annotationElementId);let t="";if(e.length){const n=new aP;n.update(e.join(",")),t=n.hexdigest()}return C(this,Jf,{ids:new Set(e),hash:t})}
526[Symbol.iterator](){return h(this,rs).entries()}}Zf=new WeakMap,Jf=new WeakMap,Mc=new WeakMap,rs=new WeakMap,WS=new WeakSet,i$=function(){var e;h(this,Zf)||(C(this,Zf,!0),(e=this.onSetModified)==null||e.call(this))};var yw;class a$ extends vj{constructor(t){super();R(this,yw,A1);const{serializable:n}=t;if(n===A1)return;const{map:s,hash:i,transfer:a}=n,o=structuredClone(s,a?{transfer:a}:null);C(this,yw,{map:o,hash:i,transfer:[]})}get print(){Ut("Should not call PrintAnnotationStorage.print")}get serializable(){return h(this,yw)}get modifiedIds(){return ct(this,"modifiedIds",{ids:new Set,hash:""})}}yw=new WeakMap;const Z0="__forcedDependency",{floor:YD,ceil:qD}=Math;function ZD(r,e,t,n,s,i){r[e*4+0]=Math.min(r[e*4+0],t),r[e*4+1]=Math.min(r[e*4+1],n),r[e*4+2]=Math.max(r[e*4+2],s),r[e*4+3]=Math.max(r[e*4+3],i)}function Qse(r,e,t,n,s){let i;r?(r<0&&(i=s[0],s[0]=s[2],s[2]=i),s[0]*=r,s[2]*=r,e<0&&(i=s[1],s[1]=s[3],s[3]=i),s[1]*=e,s[3]*=e):s.fill(0),s[0]+=t,s[1]+=n,s[2]+=t,s[3]+=n}const oP=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var kg,jd;class eie{constructor(e,t){R(this,kg);R(this,jd);C(this,kg,e),C(this,jd,t)}get length(){return h(this,kg).length}isEmpty(e){return h(this,kg)[e]===oP}minX(e){return h(this,jd)[e*4+0]/256}minY(e){return h(this,jd)[e*4+1]/256}maxX(e){return(h(this,jd)[e*4+2]+1)/256}maxY(e){return(h(this,jd)[e*4+3]+1)/256}}kg=new WeakMap,jd=new WeakMap;const JD=(r,e)=>r==null?void 0:r.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));var Ic,Ht,br,Qf,ep,tp,As,ww,lP;class tie{constructor(e,t){R(this,ww);R(this,Ic,[[1,0,0,1,0,0]]);R(this,Ht,[-1/0,-1/0,1/0,1/0]);R(this,br,new Float64Array(cu));oe(this,"_pendingBBoxIdx",-1);R(this,Qf);R(this,ep);R(this,tp);R(this,As);oe(this,"_savesStack",[]);oe(this,"_markedContentStack",[]);C(this,Qf,e.width),C(this,ep,e.height),j(this,ww,lP).call(this,t)}growOperationsCount(e){e>=h(this,As).length&&j(this,ww,lP).call(this,e,h(this,As))}get clipBox(){return h(this,Ht)}save(e){return C(this,Ht,{__proto__:h(this,Ht)}),this._savesStack.push(e),this}restore(e,t){const n=Object.getPrototypeOf(h(this,Ht));if(n===null)return this;C(this,Ht,n);const s=this._savesStack.pop();return s!==void 0&&(t==null||t(s,e),h(this,As)[e]=h(this,As)[s]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){const n=this._savesStack.pop();return n!==void 0&&(t==null||t(n,e),h(this,As)[e]=h(this,As)[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){const n=this._markedContentStack.pop();return n!==void 0&&(t==null||t(n,e),h(this,As)[e]=h(this,As)[n]),this}pushBaseTransform(e){return h(this,Ic).push(ke.multiplyByDOMMatrix(h(this,Ic).at(-1),e.getTransform())),this}popBaseTransform(){return h(this,Ic).length>1&&h(this,Ic).pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,h(this,br).set(cu,0)),this}recordClipBox(e,t,n,s,i,a){const o=ke.multiplyByDOMMatrix(h(this,Ic).at(-1),t.getTransform()),l=cu.slice();ke.axialAlignedBoundingBox([n,i,s,a],o,l);const c=ke.intersect(h(this,Ht),l);return c?(h(this,Ht)[0]=c[0],h(this,Ht)[1]=c[1],h(this,Ht)[2]=c[2],h(this,Ht)[3]=c[3]):(h(this,Ht)[0]=h(this,Ht)[1]=1/0,h(this,Ht)[2]=h(this,Ht)[3]=-1/0),this}recordBBox(e,t,n,s,i,a){const o=h(this,Ht);if(o[0]===1/0)return this;const l=ke.multiplyByDOMMatrix(h(this,Ic).at(-1),t.getTransform());if(o[0]===-1/0)return ke.axialAlignedBoundingBox([n,i,s,a],l,h(this,br)),this;const c=cu.slice();return ke.axialAlignedBoundingBox([n,i,s,a],l,c),h(this,br)[0]=Pr(c[0],o[0],h(this,br)[0]),h(this,br)[1]=Pr(c[1],o[1],h(this,br)[1]),h(this,br)[2]=Pr(c[2],h(this,br)[2],o[2]),h(this,br)[3]=Pr(c[3],h(this,br)[3],o[3]),this}recordFullPageBBox(e){return h(this,br)[0]=Math.max(0,h(this,Ht)[0]),h(this,br)[1]=Math.max(0,h(this,Ht)[1]),h(this,br)[2]=Math.min(h(this,Qf),h(this,Ht)[2]),h(this,br)[3]=Math.min(h(this,ep),h(this,Ht)[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;const s=YD(h(this,br)[0]*256/h(this,Qf)),i=YD(h(this,br)[1]*256/h(this,ep)),a=qD(h(this,br)[2]*256/h(this,Qf)),o=qD(h(this,br)[3]*256/h(this,ep));if(ZD(h(this,tp),e,s,i,a,o),n)for(const l of n)for(const c of l)c!==e&&ZD(h(this,tp),c,s,i,a,o);
526return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,h(this,Ht)[0]=Math.max(h(this,Ht)[0],h(this,br)[0]),h(this,Ht)[1]=Math.max(h(this,Ht)[1],h(this,br)[1]),h(this,Ht)[2]=Math.min(h(this,Ht)[2],h(this,br)[2]),h(this,Ht)[3]=Math.min(h(this,Ht)[3],h(this,br)[3])),this}take(){return new eie(h(this,As),h(this,tp))}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,s=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}}Ic=new WeakMap,Ht=new WeakMap,br=new WeakMap,Qf=new WeakMap,ep=new WeakMap,tp=new WeakMap,As=new WeakMap,ww=new WeakSet,lP=function(e,t){const n=new ArrayBuffer(e*4);C(this,tp,new Uint8ClampedArray(n)),C(this,As,new Uint32Array(n)),t&&t.length>0?(h(this,As).set(t),h(this,As).fill(oP,t.length)):h(this,As).fill(oP)};var hi,fi,rp,Eo,Sg,Od,Fd,nr;
526class rie{constructor(e,t=!1){R(this,hi,{__proto__:null});R(this,fi,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Z0]:[]});R(this,rp,new Map);R(this,Eo,new Set);R(this,Sg,new Map);R(this,Od);R(this,Fd);R(this,nr);C(this,nr,e),t&&(C(this,Od,new Map),C(this,Fd,(n,s)=>{JD(h(this,Od),s).dependencies.add(n)}))}get clipBox(){return h(this,nr).clipBox}growOperationsCount(e){h(this,nr).growOperationsCount(e)}save(e){return C(this,hi,{__proto__:h(this,hi)}),C(this,fi,{__proto__:h(this,fi),transform:{__proto__:h(this,fi).transform},moveText:{__proto__:h(this,fi).moveText},sameLineText:{__proto__:h(this,fi).sameLineText},[Z0]:{__proto__:h(this,fi)[Z0]}}),h(this,nr).save(e),this}restore(e){h(this,nr).restore(e,h(this,Fd));const t=Object.getPrototypeOf(h(this,hi));return t===null?this:(C(this,hi,t),C(this,fi,Object.getPrototypeOf(h(this,fi))),this)}recordOpenMarker(e){return h(this,nr).recordOpenMarker(e,h(this,Fd)),this}getOpenMarker(){return h(this,nr).getOpenMarker()}recordCloseMarker(e){return h(this,nr).recordCloseMarker(e,h(this,Fd)),this}beginMarkedContent(e){return h(this,nr).beginMarkedContent(e),this}endMarkedContent(e){return h(this,nr).endMarkedContent(e,h(this,Fd)),this}pushBaseTransform(e){return h(this,nr).pushBaseTransform(e),this}popBaseTransform(){return h(this,nr).popBaseTransform(),this}recordSimpleData(e,t){return h(this,hi)[e]=t,this}recordIncrementalData(e,t){return h(this,fi)[e].push(t),this}resetIncrementalData(e,t){return h(this,fi)[e].length=0,this}recordNamedData(e,t){return h(this,rp).set(e,t),this}recordSimpleDataFromNamed(e,t,n){h(this,hi)[e]=h(this,rp).get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Z0,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const t of e)t in h(this,hi)&&this.recordFutureForcedDependency(t,h(this,hi)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of h(this,Eo))this.recordFutureForcedDependency(Z0,e);return this}resetBBox(e){return h(this,nr).resetBBox(e),this}recordClipBox(e,t,n,s,i,a){return h(this,nr).recordClipBox(e,t,n,s,i,a),this}recordBBox(e,t,n,s,i,a){return h(this,nr).recordBBox(e,t,n,s,i,a),this}recordCharacterBBox(e,t,n,s=1,i=0,a=0,o){const l=n.bbox;let c,u;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&h(this,Sg).get(n),c!==!1&&(u=[0,0,0,0],ke.axialAlignedBoundingBox(l,n.fontMatrix,u),(s!==1||i!==0||a!==0)&&Qse(s,-s,i,a,u),c)))return this.recordBBox(e,t,u[0],u[2],u[1],u[3]);if(!o)return this.recordFullPageBBox(e);const f=o();return l&&u&&c===void 0&&(c=u[0]<=i-f.actualBoundingBoxLeft&&u[2]>=i+f.actualBoundingBoxRight&&u[1]<=a-f.actualBoundingBoxAscent&&u[3]>=a+f.actualBoundingBoxDescent,h(this,Sg).set(n,c),c)?this.recordBBox(e,t,u[0],u[2],u[1],u[3]):this.recordBBox(e,t,i-f.actualBoundingBoxLeft,i+f.actualBoundingBoxRight,a-f.actualBoundingBoxAscent,a+f.actualBoundingBoxDescent)}recordFullPageBBox(e){return h(this,nr).recordFullPageBBox(e),this}getSimpleIndex(e){return h(this,hi)[e]}recordDependencies(e,t){const n=h(this,Eo),s=h(this,hi),i=h(this,fi);for(const a of t)a in h(this,hi)?n.add(s[a]):a in i&&i[a].forEach(n.add,n);return this}recordNamedDependency(e,t){return h(this,rp).has(t)&&h(this,Eo).add(h(this,rp).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Z0]),h(this,Od)){const s=JD(h(this,Od),e),{dependencies:i}=s;h(this,Eo).forEach(i.add,i),h(this,nr)._savesStack.forEach(i.add,i),h(this,nr)._markedContentStack.forEach(i.add,i),i.delete(e),s.isRenderingOperation=!0}const n=!t&&e===h(this,nr)._pendingBBoxIdx;return h(this,nr).recordOperation(e,t,[h(this,Eo),h(this,nr)._savesStack,h(this,nr)._markedContentStack]),n&&h(this,Eo).clear(),this}recordShowTextOperation(e,t=!1){const n=Array.from(h(this,Eo));this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(const s of n)this.recordIncrementalData("sameLineText",s);return this}bboxToClipBoxDropOperation(e,t=!1){const n=!t&&e===h(this,nr)._pendingBBoxIdx;return h(this,nr).bboxToClipBoxDropOperation(e),n&&h(this,Eo).clear(),this}take(){return h(this,Sg).clear(),h(this,nr).take()}takeDebugMetadata(){return h(this,Od)}}hi=new WeakMap,fi=new WeakMap,rp=new WeakMap,Eo=new WeakMap,Sg=new WeakMap,Od=new WeakMap,Fd=new WeakMap,nr=new WeakMap;var sr,Yr,Ao,Eg,Ag;const wO=class wO{constructor(e,t,n){R(this,sr);R(this,Yr);R(this,Ao);R(this,Eg,0);R(this,Ag,0);if(e instanceof wO&&h(e,Ao)===!!n)return e;C(this,sr,e),C(this,Yr,t),C(this,Ao,!!n)}get clipBox(){return h(this,sr).clipBox}growOperationsCount(){throw new Error("Unreachable")}save(e){return tr(this,Ag)._++,h(this,sr).save(h(this,Yr)),this}restore(e){return h(this,Ag)>0&&(h(this,sr).restore(h(this,Yr)),tr(this,Ag)._--),this}recordOpenMarker(e){return tr(this,Eg)._++,this}getOpenMarker(){return h(this,Eg)>0?h(this,Yr):h(this,sr).getOpenMarker()}recordCloseMarker(e){return tr(this,Eg)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return h(this,sr).pushBaseTransform(e),this}popBaseTransform(){return h(this,sr).popBaseTransform(),this}recordSimpleData(e,t){return h(this,sr).recordSimpleData(e,h(this,Yr)),this}recordIncrementalData(e,t){return h(this,sr).recordIncrementalData(e,h(this,Yr)),this}resetIncrementalData(e,t){return h(this,sr).resetIncrementalData(e,h(this,Yr)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return h(this,sr).recordSimpleDataFromNamed(e,t,h(this,Yr)),this}recordFutureForcedDependency(e,t){return h(this,sr).recordFutureForcedDependency(e,h(this,Yr)),this}inheritSimpleDataAsFutureForcedDependencies(e){return h(this,sr).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return h(this,sr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return h(this,Ao)||h(this,sr).resetBBox(h(this,Yr)),this}recordClipBox(e,t,n,s,i,a){return h(this,Ao)||h(this,sr).recordClipBox(h(this,Yr),t,n,s,i,a),this}recordBBox(e,t,n,s,i,a){return h(this,Ao)||h(this,sr).recordBBox(h(this,Yr),t,n,s,i,a),this}recordCharacterBBox(e,t,n,s,i,a,o){return h(this,Ao)||h(this,sr).recordCharacterBBox(h(this,Yr),t,n,s,i,a,o),this}recordFullPageBBox(e){return h(this,Ao)||h(this,sr).recordFullPageBBox(h(this,Yr)),this}getSimpleIndex(e){return h(this,sr).getSimpleIndex(e)}recordDependencies(e,t){return h(this,sr).recordDependencies(h(this,Yr),t),this}recordNamedDependency(e,t){return h(this,sr).recordNamedDependency(h(this,Yr),t),this}recordOperation(e){return h(this,sr).recordOperation(h(this,Yr),!0),this}recordShowTextOperation(e){return h(this,sr).recordShowTextOperation(h(this,Yr),!0),this}bboxToClipBoxDropOperation(e){return h(this,Ao)||h(this,sr).bboxToClipBoxDropOperation(h(this,Yr),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};sr=new WeakMap,Yr=new WeakMap,Ao=new WeakMap,Eg=new WeakMap,Ag=new WeakMap;let T1=wO;
526const ka={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"]};var np,sp,ip,ap,op,bw;const $y=class $y{constructor(e){R(this,np);R(this,sp);R(this,ip,4);R(this,ap,0);R(this,op,new(h($y,bw))(h(this,ip)*6));C(this,np,e.width),C(this,sp,e.height)}record(e,t,n,s){if(h(this,ap)===h(this,ip)){C(this,ip,h(this,ip)*2);const o=new(h($y,bw))(h(this,ip)*6);o.set(h(this,op)),C(this,op,o)}const i=mr(e);let a;if(s[0]!==1/0){const o=cu.slice();ke.axialAlignedBoundingBox([0,-n,t,0],i,o);const l=ke.intersect(s,o);if(!l)return;const[c,u,f,p]=l;if(c!==o[0]||u!==o[1]||f!==o[2]||p!==o[3]){const m=Math.atan2(i[1],i[0]),x=Math.abs(Math.sin(m)),g=Math.abs(Math.cos(m));if(x<1e-6||g<1e-6||Math.abs(x-g)<1e-6)a=[c,u,c,p,f,u];else{const y=f-c,v=p-u,w=x*x,b=g*g,_=g*x,T=b-w,A=(v*b-y*_)/T,N=(v*_-y*w)/T;a=[c+N,u,c,u+A,f,p-A]}}}
526a||(a=[0,-n,0,0,t,-n],ke.applyTransform(a,i,0),ke.applyTransform(a,i,2),ke.applyTransform(a,i,4)),a[0]/=h(this,np),a[1]/=h(this,sp),a[2]/=h(this,np),a[3]/=h(this,sp),a[4]/=h(this,np),a[5]/=h(this,sp),h(this,op).set(a,h(this,ap)*6),tr(this,ap)._++}take(){return h(this,op).subarray(0,h(this,ap)*6)}};np=new WeakMap,sp=new WeakMap,ip=new WeakMap,ap=new WeakMap,op=new WeakMap,bw=new WeakMap,R($y,bw,gr.isFloat16ArraySupported?Float16Array:Float32Array);let cP=$y;var Tg;class nie{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){R(this,Tg,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(),h(this,Tg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||h(this,Tg).has(e.loadedName))){if(Ur(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:s,src:i,style:a}=e,o=new FontFace(s,i,a);this.addNativeFontFace(o);try{await o.load(),h(this,Tg).add(s),n==null||n(e)}catch{mt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Ut("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 n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(s){throw mt(`Failed to load font '${n.family}': '${s}'.`),e.disableFontFace=!0,s}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{const s=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,s)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return ct(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return ct(this,"isSyncFontLoadingSupported",ra||gr.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Ur(!s.done,"completeRequest() cannot be called twice."),s.done=!0;n.length>0&&n[0].done;){const i=n.shift();setTimeout(i.callback,0)}}const{loadingRequests:n}=this,s={done:!1,complete:t,callback:e};return n.push(s),s}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return ct(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(T,A){return T.charCodeAt(A)<<24|T.charCodeAt(A+1)<<16|T.charCodeAt(A+2)<<8|T.charCodeAt(A+3)&255}function s(T){return String.fromCharCode(T>>24&255,T>>16&255,T>>8&255,T&255)}function i(T,A,N,k){const E=T.substring(0,A),P=T.substring(A+N);return E+k+P}let a,o;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let u=0;function f(T,A){if(++u>30){mt("Load test font never loaded."),A();return}if(c.font="30px "+T,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(f.bind(null,T,A))}const p=`lt${Date.now()}${this.loadTestFontId++}`;let m=this._loadTestFont;m=i(m,976,p.length,p);const g=16,y=1482184792;let v=n(m,g);for(a=0,o=p.length-3;a<o;a+=4)v=v-y+n(p,a)|0;a<p.length&&(v=v-y+n(p+"XXX",a)|0),m=i(m,g,4,s(v));const w=`url(data:font/opentype;base64,${btoa(m)});`,b=`@font-face {font-family:"${p}";src:${w}}`;this.insertRule(b);const _=this._document.createElement("div");_.style.visibility="hidden",_.style.width=_.style.height="10px",_.style.position="absolute",_.style.top=_.style.left="0px";for(const T of[e.loadedName,p]){const A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=T,_.append(A)}this._document.body.append(_),f(p,()=>{_.remove(),t.complete()})}}Tg=new WeakMap;var ir;class sie{constructor(e,t=null,n,s){oe(this,"compiledGlyphs",Object.create(null));R(this,ir);
526C(this,ir,e),this._inspectFont=t,n&&(this.charProcOperatorList=n),s&&Object.assign(this,s)}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,n)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var n;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 s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${e}}`}return(n=this._inspectFont)==null||n.call(this,this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];const n=this.loadedName+"_path_"+t;let s;try{s=e.get(n)}catch(a){mt(`getPathGenerator - ignoring character: "${a}".`)}const i=AU(s==null?void 0:s.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return h(this,ir).black}get bold(){return h(this,ir).bold}get disableFontFace(){return h(this,ir).disableFontFace}set disableFontFace(e){ct(this,"disableFontFace",!!e)}get fontExtraProperties(){return h(this,ir).fontExtraProperties}get isInvalidPDFjsFont(){return h(this,ir).isInvalidPDFjsFont}get isType3Font(){return h(this,ir).isType3Font}get italic(){return h(this,ir).italic}get missingFile(){return h(this,ir).missingFile}get remeasure(){return h(this,ir).remeasure}get vertical(){return h(this,ir).vertical}get ascent(){return h(this,ir).ascent}get defaultWidth(){return h(this,ir).defaultWidth}get descent(){return h(this,ir).descent}get bbox(){return h(this,ir).bbox}get fontMatrix(){return h(this,ir).fontMatrix}get fallbackName(){return h(this,ir).fallbackName}get loadedName(){return h(this,ir).loadedName}get mimetype(){return h(this,ir).mimetype}get name(){return h(this,ir).name}get data(){return h(this,ir).data}clearData(){h(this,ir).clearData()}get cssFontInfo(){return h(this,ir).cssFontInfo}get systemFontInfo(){return h(this,ir).systemFontInfo}get defaultVMetrics(){return h(this,ir).defaultVMetrics}}ir=new WeakMap;class o${}oe(o$,"strings",["fontFamily","fontWeight","italicAngle"]);class l${}oe(l$,"strings",["css","loadedName","baseFontName","src"]);const _s=class _s{};oe(_s,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),oe(_s,"numbers",["ascent","defaultWidth","descent"]),oe(_s,"strings",["fallbackName","loadedName","mimetype","name"]),oe(_s,"OFFSET_NUMBERS",Math.ceil(_s.bools.length*2/8)),oe(_s,"OFFSET_BBOX",_s.OFFSET_NUMBERS+_s.numbers.length*8),oe(_s,"OFFSET_FONT_MATRIX",_s.OFFSET_BBOX+1+2*4),oe(_s,"OFFSET_DEFAULT_VMETRICS",_s.OFFSET_FONT_MATRIX+1+8*6),oe(_s,"OFFSET_STRINGS",_s.OFFSET_DEFAULT_VMETRICS+1+2*3);let Fi=_s;class Zs{}oe(Zs,"KIND",0),oe(Zs,"HAS_BBOX",1),oe(Zs,"HAS_BACKGROUND",2),oe(Zs,"SHADING_TYPE",3),oe(Zs,"N_COORD",4),oe(Zs,"N_COLOR",8),oe(Zs,"N_STOP",12),oe(Zs,"N_FIGURES",16);var _w,VS,Cg,Ng,Lk;class iie{constructor(e){R(this,Ng);R(this,_w);R(this,VS,new TextDecoder);R(this,Cg);C(this,_w,e),C(this,Cg,new DataView(e))}get fontFamily(){return j(this,Ng,Lk).call(this,0)}get fontWeight(){return j(this,Ng,Lk).call(this,1)}get italicAngle(){return j(this,Ng,Lk).call(this,2)}}_w=new WeakMap,VS=new WeakMap,Cg=new WeakMap,Ng=new WeakSet,Lk=function(e){Ur(e<o$.strings.length,"Invalid string index");let t=0;for(let s=0;s<e;s++)t+=h(this,Cg).getUint32(t)+4;const n=h(this,Cg).getUint32(t);return h(this,VS).decode(new Uint8Array(h(this,_w),t+4,n))};var lp,Pg,Cl,cp,Zv;class aie{constructor(e){R(this,cp);R(this,lp);R(this,Pg,new TextDecoder);R(this,Cl);C(this,lp,e),C(this,Cl,new DataView(e))}get guessFallback(){return h(this,Cl).getUint8(0)!==0}get css(){return j(this,cp,Zv).call(this,0)}get loadedName(){return j(this,cp,Zv).call(this,1)}get baseFontName(){return j(this,cp,Zv).call(this,2)}get src(){return j(this,cp,Zv).call(this,3)}get style(){let e=1;e+=4+h(this,Cl).getUint32(e);const t=h(this,Cl).getUint32(e),n=h(this,Pg).decode(new Uint8Array(h(this,lp),e+4,t));e+=4+t;const s=h(this,Cl).getUint32(e),i=h(this,Pg).decode(new Uint8Array(h(this,lp),e+4,s));return{style:n,weight:i}}}lp=new WeakMap,Pg=new WeakMap,Cl=new WeakMap,cp=new WeakSet,Zv=function(e){Ur(e<l$.strings.length,"Invalid string index");let t=5;for(let s=0;s<e;s++)t+=h(this,Cl).getUint32(t)+4;const n=h(this,Cl).getUint32(t);return h(this,Pg).decode(new Uint8Array(h(this,lp),t+4,n))};var To,GS,ln,Zt,mo,Bk,Uk,Jv,uP;class oie{constructor({buffer:e,extra:t}){R(this,Zt);R(this,To);R(this,GS,new TextDecoder);R(this,ln);C(this,To,e),C(this,ln,new DataView(e)),t&&Object.assign(this,t)}get black(){return j(this,Zt,mo).call(this,0)}get bold(){return j(this,Zt,mo).call(this,1)}get disableFontFace(){return j(this,Zt,mo).call(this,2)}get fontExtraProperties(){return j(this,Zt,mo).call(this,3)}get isInvalidPDFjsFont(){return j(this,Zt,mo).call(this,4)}get isType3Font(){return j(this,Zt,mo).call(this,5)}get italic(){return j(this,Zt,mo).call(this,6)}get missingFile(){return j(this,Zt,mo).call(this,7)}get remeasure(){return j(this,Zt,mo).call(this,8)}get vertical(){return j(this,Zt,mo).call(this,9)}get ascent(){return j(this,Zt,Bk).call(this,0)}get defaultWidth(){return j(this,Zt,Bk).call(this,1)}get descent(){return j(this,Zt,Bk).call(this,2)}get bbox(){return j(this,Zt,Uk).call(this,Fi.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return j(this,Zt,Uk).call(this,Fi.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return j(this,Zt,Uk).call(this,Fi.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}get fallbackName(){return j(this,Zt,Jv).call(this,0)}get loadedName(){return j(this,Zt,Jv).call(this,1)}get mimetype(){return j(this,Zt,Jv).call(this,2)}get name(){return j(this,Zt,Jv).call(this,3)}get data(){const{offset:e,length:t}
526=j(this,Zt,uP).call(this);return t===0?void 0:new Uint8Array(h(this,To),e+4,t)}clearData(){const{offset:e,length:t}=j(this,Zt,uP).call(this);t!==0&&(h(this,ln).setUint32(e,0),C(this,To,new Uint8Array(h(this,To),0,e+4).slice().buffer),C(this,ln,new DataView(h(this,To))))}get cssFontInfo(){let e=Fi.OFFSET_STRINGS;const t=h(this,ln).getUint32(e);e+=4+t;const n=h(this,ln).getUint32(e);e+=4+n;const s=h(this,ln).getUint32(e);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(h(this,To),e+4,s)),new iie(i.buffer)}get systemFontInfo(){let e=Fi.OFFSET_STRINGS;const t=h(this,ln).getUint32(e);e+=4+t;const n=h(this,ln).getUint32(e);if(n===0)return null;const s=new Uint8Array(n);return s.set(new Uint8Array(h(this,To),e+4,n)),new aie(s.buffer)}}To=new WeakMap,GS=new WeakMap,ln=new WeakMap,Zt=new WeakSet,mo=function(e){Ur(e<Fi.bools.length,"Invalid boolean index");const t=Math.floor(e/4),n=e*2%8,s=h(this,ln).getUint8(t)>>n&3;return s===0?void 0:s===2},Bk=function(e){return Ur(e<Fi.numbers.length,"Invalid number index"),h(this,ln).getFloat64(Fi.OFFSET_NUMBERS+e*8)},Uk=function(e,t,n,s){const i=h(this,ln).getUint8(e);if(i===0)return;Ur(i===t,"Invalid array length."),e+=1;const a=new Array(i);for(let o=0;o<i;o++)a[o]=h(this,ln)[n](e,!0),e+=s;return a},Jv=function(e){Ur(e<Fi.strings.length,"Invalid string index");let t=Fi.OFFSET_STRINGS+4;for(let s=0;s<e;s++)t+=h(this,ln).getUint32(t)+4;const n=h(this,ln).getUint32(t);return h(this,GS).decode(new Uint8Array(h(this,To),t+4,n))},uP=function(){let e=Fi.OFFSET_STRINGS;const t=h(this,ln).getUint32(e);e+=4+t;const n=h(this,ln).getUint32(e);e+=4+n;const s=h(this,ln).getUint32(e);e+=4+s;const i=h(this,ln).getUint32(e);return{offset:e,length:i}};class lie{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){const e=this.view,t=this.data[Zs.KIND],n=!!this.data[Zs.HAS_BBOX],s=!!this.data[Zs.HAS_BACKGROUND],i=e.getUint32(Zs.N_COORD,!0),a=e.getUint32(Zs.N_COLOR,!0),o=e.getUint32(Zs.N_STOP,!0);let l=20;const c=new Float32Array(this.buffer,l,i*2);l+=i*8;const u=new Uint8Array(this.buffer,l,a*4);l+=a*4;const f=[];for(let x=0;x<o;++x){const g=e.getFloat32(l,!0);l+=4;const y=e.getUint32(l,!0);l+=4,f.push([g,`#${y.toString(16).padStart(6,"0")}`])}let p=null;if(n){p=[];for(let x=0;x<4;++x)p.push(e.getFloat32(l,!0)),l+=4}let m=null;if(s&&(m=new Uint8Array(this.buffer,l,3),l+=3),t===1)return["RadialAxial","axial",p,f,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",p,f,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(t===3){const x=this.data[Zs.SHADING_TYPE];let g=null;if(c.length>0){g=cu.slice();for(let y=0,v=c.length;y<v;y+=2)ke.pointBoundingBox(c[y],c[y+1],g)}return["Mesh",x,c,u,i,g,p,m]}throw new Error(`Unsupported pattern kind: ${t}`)}}var Rg;class cie{constructor(e){R(this,Rg);C(this,Rg,e)}get path(){return gr.isFloat16ArraySupported?new Float16Array(h(this,Rg)):new Float32Array(h(this,Rg))}}Rg=new WeakMap;function uie(r){if(r instanceof URL)return r;if(typeof r=="string"){if(ra){if(/^[a-z][a-z0-9\-+.]+:/i.test(r))return new URL(r);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(r))}const e=URL.parse(r,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 die(r){if(ra&&typeof Buffer<"u"&&r instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength)return r;if(typeof r=="string")return eA(r);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof r=="object"&&!isNaN(r==null?void 0:r.length))return new Uint8Array(r);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function H_(r){if(typeof r!="string")return null;if(r.endsWith("/"))return r;throw new Error(`Invalid factory url: "${r}" must include trailing slash.`)}const dP=r=>typeof r=="object"&&Number.isInteger(r==null?void 0:r.num)&&r.num>=0&&Number.isInteger(r==null?void 0:r.gen)&&r.gen>=0,hie=r=>
526typeof r=="object"&&typeof(r==null?void 0:r.name)=="string",fie=Bse.bind(null,dP,hie);var Lc,KS;class pie{constructor(){R(this,Lc,new Map);R(this,KS,Promise.resolve())}postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};h(this,KS).then(()=>{for(const[s]of h(this,Lc))s.call(this,n)})}addEventListener(e,t,n=null){let s=null;if((n==null?void 0:n.signal)instanceof AbortSignal){const{signal:i}=n;if(i.aborted){mt("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,t);s=()=>i.removeEventListener("abort",a),i.addEventListener("abort",a)}h(this,Lc).set(t,s)}removeEventListener(e,t){const n=h(this,Lc).get(t);n==null||n(),h(this,Lc).delete(t)}terminate(){for(const[,e]of h(this,Lc))e==null||e();h(this,Lc).clear()}}Lc=new WeakMap,KS=new WeakMap;const W_={DATA:1,ERROR:2},pn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function QD(){}function ci(r){if(r instanceof Uh||r instanceof BN||r instanceof $D||r instanceof dS||r instanceof NT)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||Ut('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new Uh(r.message);case"InvalidPDFException":return new BN(r.message);case"PasswordException":return new $D(r.message,r.code);case"ResponseException":return new dS(r.message,r.status,r.missing);case"UnknownErrorException":return new NT(r.message,r.details)}return new NT(r.message,r.toString())}var jg,Qa,c$,u$,d$,$k;class Qv{constructor(e,t,n){R(this,Qa);R(this,jg,new AbortController);this.sourceName=e,this.targetName=t,this.comObj=n,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),n.addEventListener("message",j(this,Qa,c$).bind(this),{signal:h(this,jg).signal})}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const s=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[s]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:s,data:t},n)}catch(a){i.reject(a)}return i.promise}sendWithStream(e,t,n,s){const i=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[i]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:c.desiredSize},s),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[i].pullCall=u,l.postMessage({sourceName:a,targetName:o,stream:pn.PULL,streamId:i,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Ur(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[i].cancelCall=u,this.streamControllers[i].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:pn.CANCEL,streamId:i,reason:ci(c)}),u.promise}},n)}destroy(){var e;(e=h(this,jg))==null||e.abort(),C(this,jg,null)}}jg=new WeakMap,Qa=new WeakSet,c$=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){j(this,Qa,d$).call(this,e);return}if(e.callback){const n=e.callbackId,s=this.callbackCapabilities[n];if(!s)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===W_.DATA)s.resolve(e.data);else if(e.callback===W_.ERROR)s.reject(ci(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 n=this.sourceName,s=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(a){i.postMessage({sourceName:n,targetName:s,callback:W_.DATA,callbackId:e.callbackId,data:a})},function(a){i.postMessage({sourceName:n,targetName:s,callback:W_.ERROR,callbackId:e.callbackId,reason:ci(a)})});return}if(e.streamId){j(this,Qa,u$).call(this,e);return}t(e.data)},u$=function(e){const t=e.streamId,n=this.sourceName,s=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(c,u=1,f){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=u,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:s,stream:pn.ENQUEUE,streamId:t,chunk:c},f)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:s,stream:pn.CLOSE,streamId:t}),delete a.streamSinks[t])},error(c){Ur(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:s,stream:pn.ERROR,streamId:t,reason:ci(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(){i.postMessage({sourceName:n,targetName:s,stream:pn.START_COMPLETE,streamId:t,success:!0})},function(c){i.postMessage({sourceName:n,targetName:s,stream:pn.START_COMPLETE,streamId:t,reason:ci(c)})})},d$=function(e){const t=e.streamId,n=this.sourceName,s=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case pn.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(ci(e.reason));break;case pn.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(ci(e.reason));break;case pn.PULL:if(!o){i.postMessage({sourceName:n,targetName:s,stream:pn.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||QD).then(function(){i.postMessage({sourceName:n,targetName:s,stream:pn.PULL_COMPLETE,streamId:t,success:!0})},function(c){i.postMessage({sourceName:n,targetName:s,stream:pn.PULL_COMPLETE,streamId:t,reason:ci(c)})});break;case pn.ENQUEUE:if(Ur(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case pn.CLOSE:if(Ur(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),j(this,Qa,$k).call(this,a,t);break;case pn.ERROR:Ur(a,"error should have stream controller"),a.controller.error(ci(e.reason)),j(this,Qa,$k).call(this,a,t);break;case pn.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(ci(e.reason)),j(this,Qa,$k).call(this,a,t);break;case pn.CANCEL:if(!o)break;const l=ci(e.reason);Promise.try(o.onCancel||QD,l).then(function(){i.postMessage({sourceName:n,targetName:s,stream:pn.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){i.postMessage({sourceName:n,targetName:s,stream:pn.CANCEL_COMPLETE,streamId:t,reason:ci(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},$k=async function(e,t){var n,s,i;await Promise.allSettled([(n=e.startCall)==null?void 0:n.promise,(s=e.pullCall)==null?void 0:s.promise,(i=e.cancelCall)==null?void 0:i.promise]),delete this.streamControllers[t]};var XS;class h${constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){R(this,XS,Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"}));this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:Ut(`Not implemented: ${e}`)}const n=this[e];if(!n)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const s=`${n}${t}`;
526return this._fetch(s,e).catch(i=>{throw new Error(`Unable to load ${h(this,XS)[e]} data at: ${s}`)})}async _fetch(e,t){Ut("Abstract method `_fetch` called.")}}XS=new WeakMap;class eM extends h${async _fetch(e,t){const n=t==="cMapUrl"&&!e.endsWith(".bcmap")?"text":"bytes",s=await mj(e,n);return s instanceof Uint8Array?s:eA(s)}}var kw;class f${constructor({enableHWA:e=!1}){R(this,kw,!1);C(this,kw,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!h(this,kw)})}}reset({canvas:e},t,n){if(!e)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.width=t,e.height=n}destroy(e){const{canvas:t}=e;if(!t)throw new Error("Canvas is not specified");t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Ut("Abstract method `_createCanvas` called.")}}kw=new WeakMap;class mie extends f${constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}class p${addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addKnockoutFilter(e=0){return"none"}addHighlightHCMFilter(e,t,n,s,i){return"none"}addSelectionHCMFilter(e,t){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(e=null){return null}destroy(e=!1){}}var up,Og,Bc,Nl,Mn,dp,Dd,Ne,On,ey,Ku,zk,df,m$,hP,hf,ty,ry,fP,ny,g$,x$;class gie extends p${constructor({docId:t,ownerDocument:n=globalThis.document}){super();R(this,Ne);R(this,up);R(this,Og);R(this,Bc);R(this,Nl);R(this,Mn);R(this,dp);R(this,Dd,0);C(this,Nl,t),C(this,Mn,n)}addFilter(t){if(!t)return"none";let n=h(this,Ne,On).get(t);if(n)return n;const[s,i,a]=j(this,Ne,zk).call(this,t),o=t.length===1?s:`${s}${i}${a}`;if(n=h(this,Ne,On).get(o),n)return h(this,Ne,On).set(t,n),n;const l=`g_${h(this,Nl)}_transfer_map_${tr(this,Dd)._++}`,c=j(this,Ne,df).call(this,l);h(this,Ne,On).set(t,c),h(this,Ne,On).set(o,c);const u=j(this,Ne,hf).call(this,l);return j(this,Ne,ry).call(this,s,i,a,u),c}addHCMFilter(t,n){var x;const s=`${t}-${n}`,i="base";let a=h(this,Ne,ey).get(i);if((a==null?void 0:a.key)===s||(a?((x=a.filter)==null||x.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},h(this,Ne,ey).set(i,a)),!t||!n))return a.url;const o=j(this,Ne,ny).call(this,t);t=ke.makeHexColor(...o);const l=j(this,Ne,ny).call(this,n);if(n=ke.makeHexColor(...l),h(this,Ne,Ku).style.color="",t==="#000000"&&n==="#ffffff"||t===n)return a.url;const c=new Array(256);for(let g=0;g<=255;g++){const y=g/255;c[g]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const u=c.join(","),f=`g_${h(this,Nl)}_hcm_filter`,p=a.filter=j(this,Ne,hf).call(this,f);j(this,Ne,ry).call(this,u,u,u,p),j(this,Ne,hP).call(this,p);const m=(g,y)=>{const v=o[g]/255,w=l[g]/255,b=new Array(y+1);for(let _=0;_<=y;_++)b[_]=v+_/y*(w-v);return b.join(",")};return j(this,Ne,ry).call(this,m(0,5),m(1,5),m(2,5),p),a.url=j(this,Ne,df).call(this,f),a.url}addSelectionHCMFilter(t,n){return this.addHighlightHCMFilter("selection",t,n,"HighlightText","Highlight")}addSelectionFilter(){return this.addHighlightHCMFilter("selection_default","black","white","HighlightText","Highlight")}createSelectionStyle(t=null){const n=t?this.addSelectionHCMFilter(t.foreground,t.background):this.addSelectionFilter();return n==="none"||!gr.platform.isFirefox?null:{"backdrop-filter":n,"background-color":"transparent"}}addAlphaFilter(t){let n=h(this,Ne,On).get(t);if(n)return n;const[s]=j(this,Ne,zk).call(this,[t]),i=`alpha_${s}`;if(n=h(this,Ne,On).get(i),n)return h(this,Ne,On).set(t,n),n;const a=`g_${h(this,Nl)}_alpha_map_${tr(this,Dd)._++}`,o=j(this,Ne,df).call(this,a);h(this,Ne,On).set(t,o),h(this,Ne,On).set(i,o);const l=j(this,Ne,hf).call(this,a);return j(this,Ne,fP).call(this,s,l),o}addLuminosityFilter(t){let n=h(this,Ne,On).get(t||"luminosity");if(n)return n;let s,i;if(t?([s]=j(this,Ne,zk).call(this,[t]),i=`luminosity_${s}`):i="luminosity",n=h(this,Ne,On).get(i),n)return h(this,Ne,On).set(t,n),n;const a=`g_${h(this,Nl)}_luminosity_map_${tr(this,Dd)._++}`,o=j(this,Ne,df).call(this,a);h(this,Ne,On).set(t,o),h(this,Ne,On).set(i,o);const l=j(this,Ne,hf).call(this,a);
526return j(this,Ne,m$).call(this,l),t&&j(this,Ne,fP).call(this,s,l),o}addKnockoutFilter(t=0){const n=t>0?Math.min(1/t,1e6):1e6,s=`knockout_${n}`,i=h(this,Ne,On).get(s);if(i)return i;const a=`g_${h(this,Nl)}_knockout_filter_${tr(this,Dd)._++}`,o=j(this,Ne,df).call(this,a);h(this,Ne,On).set(s,o);const l=j(this,Ne,hf).call(this,a),c=h(this,Mn).createElementNS(Mi,"feComponentTransfer");l.append(c);const u=h(this,Mn).createElementNS(Mi,"feFuncA");return u.setAttribute("type","linear"),u.setAttribute("slope",`${n}`),u.setAttribute("intercept","0"),c.append(u),o}addHighlightHCMFilter(t,n,s,i,a){var w;const o=`${n}-${s}-${i}-${a}`;let l=h(this,Ne,ey).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},h(this,Ne,ey).set(t,l)),!n||!s))return l.url;const[c,u]=[n,s].map(j(this,Ne,ny).bind(this));let f=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[m,x]=[i,a].map(j(this,Ne,x$).bind(this));p<f&&([f,p,m,x]=[p,f,x,m]),h(this,Ne,Ku).style.color="";const g=(b,_,T)=>{const A=new Array(256),N=(p-f)/T,k=b/255,E=(_-b)/(255*T);let P=0;for(let O=0;O<=T;O++){const D=Math.round(f+O*N),H=k+O*E;for(let B=P;B<=D;B++)A[B]=H;P=D+1}for(let O=P;O<256;O++)A[O]=A[P-1];return A.join(",")},y=`g_${h(this,Nl)}_hcm_${t}_filter`,v=l.filter=j(this,Ne,hf).call(this,y);return j(this,Ne,hP).call(this,v),j(this,Ne,ry).call(this,g(m[0],x[0],5),g(m[1],x[1],5),g(m[2],x[2],5),v),l.url=j(this,Ne,df).call(this,y),l.url}destroy(t=!1){var n,s,i,a;t&&((n=h(this,dp))!=null&&n.size)||((s=h(this,Bc))==null||s.parentNode.parentNode.remove(),C(this,Bc,null),(i=h(this,Og))==null||i.clear(),C(this,Og,null),(a=h(this,dp))==null||a.clear(),C(this,dp,null),C(this,Dd,0))}}up=new WeakMap,Og=new WeakMap,Bc=new WeakMap,Nl=new WeakMap,Mn=new WeakMap,dp=new WeakMap,Dd=new WeakMap,Ne=new WeakSet,On=function(){return h(this,Og)||C(this,Og,new Map)},ey=function(){return h(this,dp)||C(this,dp,new Map)},Ku=function(){if(!h(this,Bc)){const t=h(this,Mn).createElement("div"),{style:n}=t;n.colorScheme="only light",n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;const s=h(this,Mn).createElementNS(Mi,"svg");s.setAttribute("width",0),s.setAttribute("height",0),C(this,Bc,h(this,Mn).createElementNS(Mi,"defs")),t.append(s),s.append(h(this,Bc)),h(this,Mn).body.append(t)}return h(this,Bc)},zk=function(t){if(t.length===1){const c=t[0],u=new Array(256);for(let p=0;p<256;p++)u[p]=c[p]/255;const f=u.join(",");return[f,f,f]}const[n,s,i]=t,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=n[c]/255,o[c]=s[c]/255,l[c]=i[c]/255;return[a.join(","),o.join(","),l.join(",")]},df=function(t){if(h(this,up)===void 0){C(this,up,"");const n=h(this,Mn).URL;n!==h(this,Mn).baseURI&&(tA(n)?mt('#createUrl: ignore "data:"-URL for performance reasons.'):C(this,up,_U(n,"")))}return`url(${h(this,up)}#${t})`},m$=function(t){const n=h(this,Mn).createElementNS(Mi,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(n)},hP=function(t){const n=h(this,Mn).createElementNS(Mi,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(n)},hf=function(t){const n=h(this,Mn).createElementNS(Mi,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",t),h(this,Ne,Ku).append(n),n},ty=function(t,n,s){const i=h(this,Mn).createElementNS(Mi,n);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),t.append(i)},ry=function(t,n,s,i){const a=h(this,Mn).createElementNS(Mi,"feComponentTransfer");i.append(a),j(this,Ne,ty).call(this,a,"feFuncR",t),j(this,Ne,ty).call(this,a,"feFuncG",n),j(this,Ne,ty).call(this,a,"feFuncB",s)},fP=function(t,n){const s=h(this,Mn).createElementNS(Mi,"feComponentTransfer");n.append(s),j(this,Ne,ty).call(this,s,"feFuncA",t)},ny=function(t){return h(this,Ne,Ku).style.color=t,qb(getComputedStyle(h(this,Ne,Ku)).getPropertyValue("color"))},g$=function(t){return h(this,Ne,Ku).style.color=t,Yb(getComputedStyle(h(this,Ne,Ku)).getPropertyValue("color"))},x$=function(t){const[n,s,i,a]=j(this,Ne,g$).call(this,t);if(a===1)return[n,s,i];const[o,l,c]=j(this,Ne,ny).call(this,"Canvas");return[RT(n,o,a),RT(s,l,a),RT(i,c,a)]};function RT(r,e,t){return Math.round(t*r+(1-t)*e)}ra&&mt("Please use the `legacy` build in Node.js environments.");async function xie(r){const t=await process.getBuiltinModule("fs/promises").readFile(r);return new Uint8Array(t)}class vie extends p${}class yie extends f${_createCanvas(e,t){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,t)}}class wie extends h${async _fetch(e,t){return xie(e)}}const bie=` 527struct Uniforms { 528 offsetX : f32, 529 offsetY : f32, 530 scaleX : f32, 531 scaleY : f32, 532 paddedWidth : f32, 533 paddedHeight : f32, 534 borderSize : f32, 535 _pad : f32, 536}; 537 538@group(0) @binding(0) var<uniform> u : Uniforms; 539 540struct VertexInput { 541 @location(0) position : vec2<f32>, 542 @location(1) color : vec4<f32>, 543}; 544 545struct VertexOutput { 546 @builtin(position) position : vec4<f32>, 547 @location(0) color : vec3<f32>, 548}; 549 550@vertex
551fn vs_main(in : VertexInput) -> VertexOutput { 552 var out : VertexOutput; 553 let cx = (in.position.x + u.offsetX) * u.scaleX; 554 let cy = (in.position.y + u.offsetY) * u.scaleY; 555 out.position = vec4<f32>( 556 ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0, 557 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0, 558 0.0, 559 1.0 560 ); 561 out.color = in.color.rgb; 562 return out; 563} 564 565@fragment 566fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> { 567 return vec4<f32>(in.color, 1.0); 568} 569`;var YS,Uc,hp,Fg,qS,v$;class _ie{constructor(){R(this,qS);R(this,YS,null);R(this,Uc,null);R(this,hp,null);R(this,Fg,null)}init(){return h(this,YS)||C(this,YS,j(this,qS,v$).call(this))}get isReady(){return h(this,Uc)!==null}loadMeshShader(){if(!h(this,Uc)||h(this,hp))return;const e=h(this,Uc).createShaderModule({code:bie});C(this,hp,h(this,Uc).createRenderPipeline({layout:"auto",vertex:{module:e,entryPoint:"vs_main",buffers:[{arrayStride:2*4,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:e,entryPoint:"fs_main",targets:[{format:h(this,Fg)}]},primitive:{topology:"triangle-list"}}))}draw(e,t,n,s,i,a,o,l){this.loadMeshShader();const c=h(this,Uc),{offsetX:u,offsetY:f,scaleX:p,scaleY:m}=s,x=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(x,0,e);const g=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(g,0,t);const y=c.createBuffer({size:8*4,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(y,0,new Float32Array([u,f,p,m,a,o,l,0]));const v=c.createBindGroup({layout:h(this,hp).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:y}}]}),w=new OffscreenCanvas(a,o),b=w.getContext("webgpu");b.configure({device:c,format:h(this,Fg),alphaMode:i?"opaque":"premultiplied"});const _=i?{r:i[0]/255,g:i[1]/255,b:i[2]/255,a:1}:{r:0,g:0,b:0,a:0},T=c.createCommandEncoder(),A=T.beginRenderPass({colorAttachments:[{view:b.getCurrentTexture().createView(),clearValue:_,loadOp:"clear",storeOp:"store"}]});return n>0&&(A.setPipeline(h(this,hp)),A.setBindGroup(0,v),A.setVertexBuffer(0,x),A.setVertexBuffer(1,g),A.draw(n)),A.end(),c.queue.submit([T.finish()]),x.destroy(),g.destroy(),y.destroy(),w.transferToImageBitmap()}}YS=new WeakMap,Uc=new WeakMap,hp=new WeakMap,Fg=new WeakMap,qS=new WeakSet,v$=async function(){var e;if(!((e=globalThis.navigator)!=null&&e.gpu))return!1;try{const t=await navigator.gpu.requestAdapter();return t?(C(this,Fg,navigator.gpu.getPreferredCanvasFormat()),C(this,Uc,await t.requestDevice()),!0):!1}catch{return!1}};const rA=new _ie;function kie(){return rA.init()}function Sie(){return rA.isReady}function Eie(){rA.loadMeshShader()}function Aie(r,e,t,n,s,i,a,o){return rA.draw(r,e,t,n,s,i,a,o)}const os={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Hk(r,e){if(!e)return;const t=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],t,n),r.clip(s)}class yj{isModifyingCurrentTransform(){return!1}getPattern(){Ut("Abstract method `getPattern` called.")}}class Tie extends yj{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"}areConic(){if(!this.isRadial())return!1;const e=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return e+this._r1>this._r0&&e+this._r0>this._r1}_createGradient(e,t=null){let n,s=this._p0,i=this._p1;if(t&&(s=s.slice(),i=i.slice(),ke.applyTransform(s,t),ke.applyTransform(i,t)),this._type==="axial")n=e.createLinearGradient(s[0],s[1],i[0],i[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(t){const l=new Float32Array(2);ke.singularValueDecompose2dScale(t,l),a*=l[0],o*=l[0]}n=e.createRadialGradient(s[0],s[1],a,i[0],i[1],o)}for(const a of this._colorStops)n.addColorStop(a[0],a[1]);return n}_createReversedGradient(e,t=null){let n=this._p1,s=this._p0;t&&(n=n.slice(),s=s.slice(),ke.applyTransform(n,t),ke.applyTransform(s,t));let i=this._r1,a=this._r0;if(t){const c=new Float32Array(2);ke.singularValueDecompose2dScale(t,c),i*=c[0],a*=c[0]}const o=e.createRadialGradient(n[0],n[1],i,s[0],s[1],a),l=this._colorStops.map(([c,u])=>[1-c,u]).reverse();for(const[c,u]of l)o.addColorStop(c,u);return o}getPattern(e,t,n,s){let i;if(s===os.STROKE||s===os.FILL){if(this.isOriginBased()){let p=ke.transform(n,t.baseTransform);
569this.matrix&&(p=ke.transform(p,this.matrix));const m=.001,x=Math.hypot(p[0],p[1]),g=Math.hypot(p[2],p[3]),y=(p[0]*p[2]+p[1]*p[3])/(x*g);if(Math.abs(y)<m)if(this.isRadial()){if(Math.abs(x-g)<m)return this._createGradient(e,p)}else return this._createGradient(e,p)}const a=t.current.getClippedPathBoundingBox(s,mr(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=t.canvasFactory.create(o,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),n=ke.transform(n,[1,0,0,1,a[0],a[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),Hk(u,this._bbox),this.areConic()&&(u.fillStyle=this._createReversedGradient(u),u.fill()),u.fillStyle=this._createGradient(u),u.fill(),i=e.createPattern(c.canvas,"no-repeat"),t.canvasFactory.destroy(c);const f=new DOMMatrix(n);i.setTransform(f)}else this.areConic()&&(e.save(),Hk(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),Hk(e,this._bbox),i=this._createGradient(e);return i}}function Cie(r,e,t,n,s,i,a,o){const l=e.coords,c=e.colors,u=r.data,f=r.width*4;let p;l[t*2+1]>l[n*2+1]&&(p=t,t=n,n=p,p=i,i=a,a=p),l[n*2+1]>l[s*2+1]&&(p=n,n=s,s=p,p=a,a=o,o=p),l[t*2+1]>l[n*2+1]&&(p=t,t=n,n=p,p=i,i=a,a=p);const m=(l[t*2]+e.offsetX)*e.scaleX,x=(l[t*2+1]+e.offsetY)*e.scaleY,g=(l[n*2]+e.offsetX)*e.scaleX,y=(l[n*2+1]+e.offsetY)*e.scaleY,v=(l[s*2]+e.offsetX)*e.scaleX,w=(l[s*2+1]+e.offsetY)*e.scaleY;if(x>=w)return;const b=c[i*4],_=c[i*4+1],T=c[i*4+2],A=c[a*4],N=c[a*4+1],k=c[a*4+2],E=c[o*4],P=c[o*4+1],O=c[o*4+2],D=Math.round(x),H=Math.round(w);let B,ee,X,W,Y,F,J,ne;for(let I=D;I<=H;I++){if(I<y){const re=I<x?0:(x-I)/(x-y);B=m-(m-g)*re,ee=b-(b-A)*re,X=_-(_-N)*re,W=T-(T-k)*re}else{let re;I>w?re=1:y===w?re=0:re=(y-I)/(y-w),B=g-(g-v)*re,ee=A-(A-E)*re,X=N-(N-P)*re,W=k-(k-O)*re}let z;I<x?z=0:I>w?z=1:z=(x-I)/(x-w),Y=m-(m-v)*z,F=b-(b-E)*z,J=_-(_-P)*z,ne=T-(T-O)*z;const M=Math.round(Math.min(B,Y)),U=Math.round(Math.max(B,Y));let te=f*I+M*4;for(let re=M;re<=U;re++)z=(B-re)/(B-Y),z<0?z=0:z>1&&(z=1),u[te++]=ee-(ee-F)*z|0,u[te++]=X-(X-J)*z|0,u[te++]=W-(W-ne)*z|0,u[te++]=255}}class Nie extends yj{constructor(e){super(),this._posData=e[2],this._colData=e[3],this._vertexCount=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null,Eie()}_createMeshCanvas(e,t,n){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,u=Math.ceil(this._bounds[3])-l,f=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3)||1,p=Math.min(Math.ceil(Math.abs(u*e[1]*1.1)),3e3)||1,m=c?c/f:1,x=u?u/p:1,g={coords:this._posData,colors:this._colData,offsetX:-o,offsetY:-l,scaleX:1/m,scaleY:1/x},y=f+2*2,v=p+2*2,w=n.create(y,v);if(Sie()&&this._vertexCount>48)w.context.drawImage(Aie(this._posData,this._colData,this._vertexCount,g,t,y,v,2),0,0);else{const b=w.context.createImageData(f,p);if(t){const _=b.data;for(let T=0,A=_.length;T<A;T+=4)_[T]=t[0],_[T+1]=t[1],_[T+2]=t[2],_[T+3]=255}for(let _=0,T=this._vertexCount;_<T;_+=3)Cie(b,g,_,_+1,_+2,_,_+1,_+2);w.context.putImageData(b,2,2)}return{canvas:w.canvas,offsetX:o-2*m,offsetY:l-2*x,scaleX:m,scaleY:x}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,s){Hk(e,this._bbox);const i=new Float32Array(2);if(s===os.SHADING)ke.singularValueDecompose2dScale(mr(e),i);else if(this.matrix){ke.singularValueDecompose2dScale(this.matrix,i);const[l,c]=i;ke.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=l,i[1]*=c}else ke.singularValueDecompose2dScale(t.baseTransform,i);const a=this._createMeshCanvas(i,s===os.SHADING?null:this._background,t.canvasFactory);s!==os.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY);const o=e.createPattern(a.canvas,"no-repeat");return t.canvasFactory.destroy(a),o}}class Pie extends yj{getPattern(){return"hotpink"}}function Rie(r){switch(r[0]){case"RadialAxial":return new Tie(r);case"Mesh":return new Nie(r);case"Dummy":return new Pie}throw new Error(`Unknown IR type: ${r[0]}`)}const tM={COLORED:1,UNCOLORED:2},ZS=class ZS{constructor(e,t,n,s){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.needsIsolation=e[9]??!0,this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=s,this.patternBaseMatrix=this.matrix?ke.transform(s,this.matrix
vendor: 4,533 bytes, line 569
569):s}canSkipPatternCanvas([e,t,n,s]){const[i,a,o,l]=this.bbox,c=Math.abs(this.xstep),u=Math.abs(this.ystep);if(e>c+1e-6||t>u+1e-6)return null;const f=Math.floor((n-o)/c)+1,p=Math.ceil((n+e-i)/c)-1,m=Math.floor((s-l)/u)+1,x=Math.ceil((s+t-a)/u)-1;return p<=f&&x<=m?[f,m]:null}updatePatternDims(e,t){const n=ke.inverseTransform(this.patternBaseMatrix),s=[e[0],e[1]],i=[e[2],e[3]];ke.applyTransform(s,n),ke.applyTransform(i,n),t[0]=Math.abs(i[0]-s[0]),t[1]=Math.abs(i[1]-s[1]),t[2]=Math.min(s[0],i[0]),t[3]=Math.min(s[1],i[1])}_renderTileCanvas(e,t,n,s){var p,m;const[i,a,o,l]=this.bbox,c=e.canvasFactory.create(n.size,s.size),u=c.context,f=this.canvasGraphicsFactory.createCanvasGraphics(u,t);return f.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(f,this.paintType,this.color),u.translate(-n.scale*i,-s.scale*a),f.transform(0,n.scale,0,0,s.scale,0,0),u.save(),(p=f.dependencyTracker)==null||p.save(),this.clipBbox(f,i,a,o,l),f.baseTransform=mr(f.ctx),f.executeOperatorList(this.operatorList),f.endDrawing(),(m=f.dependencyTracker)==null||m.restore(),u.restore(),c}_getCombinedScales(){const e=new Float32Array(2);ke.singularValueDecompose2dScale(this.matrix,e);const[t,n]=e;return ke.singularValueDecompose2dScale(this.baseTransform,e),[t*e[0],n*e[1]]}drawPattern(e,t,n=!1,[s,i],a){const[o,l,c,u]=this.bbox,f=e.dependencyTracker;if(f&&(e.dependencyTracker=new T1(f,a)),e.save(),n?e.ctx.clip(t,"evenodd"):e.ctx.clip(t),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(s*this.xstep,i*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!=="source-over"||e.inSMaskMode){const p=c-o,m=u-l,[x,g]=this._getCombinedScales(),y=this.getSizeAndScale(p,this.ctx.canvas.width,x),v=this.getSizeAndScale(m,this.ctx.canvas.height,g),w=this._renderTileCanvas(e,a,y,v);e.ctx.drawImage(w.canvas,o,l,p,m),e.canvasFactory.destroy(w)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,l,c,u),e.baseTransformStack.push(e.baseTransform),e.baseTransform=mr(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),f&&(e.dependencyTracker=f)}createPatternCanvas(e,t){const[n,s,i,a]=this.bbox,o=i-n,l=a-s;let{xstep:c,ystep:u}=this;c=Math.abs(c),u=Math.abs(u),QE("TilingType: "+this.tilingType);const[f,p]=this._getCombinedScales();let m=o,x=l,g=!1,y=!1;Math.ceil(c*f)>=Math.ceil(o*f)?m=c:g=!0,Math.ceil(u*p)>=Math.ceil(l*p)?x=u:y=!0;const v=this.getSizeAndScale(m,this.ctx.canvas.width,f),w=this.getSizeAndScale(x,this.ctx.canvas.height,p),b=this._renderTileCanvas(e,t,v,w);if(g||y){const _=b.canvas;g&&(m=c),y&&(x=u);const T=this.getSizeAndScale(m,this.ctx.canvas.width,f),A=this.getSizeAndScale(x,this.ctx.canvas.height,p),N=T.size,k=A.size,E=e.canvasFactory.create(N,k),P=E.context,O=g?Math.floor(o/c):0,D=y?Math.floor(l/u):0;for(let H=0;H<=O;H++)for(let B=0;B<=D;B++)P.drawImage(_,N*H,k*B,N,k,0,0,N,k);return e.canvasFactory.destroy(b),{canvas:E.canvas,canvasEntry:E,scaleX:T.scale,scaleY:A.scale,offsetX:n,offsetY:s}}return{canvas:b.canvas,canvasEntry:b,scaleX:v.scale,scaleY:w.scale,offsetX:n,offsetY:s}}getSizeAndScale(e,t,n){const s=Math.max(ZS.MAX_PATTERN_SIZE,t);let i=Math.ceil(e*n);return i>=s?i=s:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,s,i){const a=s-t,o=i-n,l=new Path2D;l.rect(t,n,a,o),ke.axialAlignedBoundingBox([t,n,s,i],mr(e.ctx),e.current.minMax),e.ctx.clip(l),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,t,n){const s=e.ctx,i=e.current;switch(i.patternFill=i.patternStroke=!1,t){case tM.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;s.fillStyle=i.fillColor=a,s.strokeStyle=i.strokeColor=o;break;case tM.UNCOLORED:s.fillStyle=s.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new Dse(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,s,i){const a=s!==os.SHADING?ke.transform(n,this.patternBaseMatrix):n,o=this.createPatternCanvas(t,i);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 t.canvasFactory.destroy(o.canvasEntry),c.setTransform(l),c}};oe(ZS,"MAX_PATTERN_SIZE",3e3);let jy=ZS;function jie({src:r,srcPos:e=0,dest:t,width:n,height:s,nonBlackColor:i=4294967295,inverseDecode:a=!1}){const o=gr.isLittleEndian?4278190080:255,[l,c]=a?[i,o]:[o,i],u=n>>3,f=n&7,p=l^c,m=r.length;t=new Uint32Array(t.buffer);let x=0;for(let g=0;g<s;++g){for(const v=e+u;e<v;++e,x+=8){const w=r[e];t[x]=l^-(w>>7&1)&p,t[x+1]=l^-(w>>6&1)&p,t[x+2]=l^-(w>
569>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 y=e<m?r[e++]:255;for(let v=0;v<f;++v,++x)t[x]=l^-(y>>7-v&1)&p}return{srcPos:e,destPos:x}}const rM=16,nM=100,Oie=15,sM=10,yi=16,jT=new DOMMatrix,na=new Float32Array(2);function iM(r,e){if(r._removeMirroring)throw new Error("Context is already forwarding operations.");const t=new Map;for(const n of["save","restore","rotate","scale","translate","transform","setTransform","resetTransform","clip","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","arc","arcTo","ellipse","rect","roundRect","closePath","beginPath"]){const s=r[n];typeof s!="function"||typeof e[n]!="function"||(t.set(n,s),r[n]=function(...i){return e[n](...i),s.apply(this,i)})}r._removeMirroring=()=>{for(const[n,s]of t)r[n]=s;delete r._removeMirroring}}function V_(r,e,t,n,s,i,a,o,l,c){const[u,f,p,m,x,g]=mr(r);if(f===0&&p===0){const w=a*u+x,b=Math.round(w),_=o*m+g,T=Math.round(_),A=(a+l)*u+x,N=Math.abs(Math.round(A)-b)||1,k=(o+c)*m+g,E=Math.abs(Math.round(k)-T)||1;return r.setTransform(Math.sign(u),0,0,Math.sign(m),b,T),r.drawImage(e,t,n,s,i,0,0,N,E),r.setTransform(u,f,p,m,x,g),[N,E]}if(u===0&&m===0){const w=o*p+x,b=Math.round(w),_=a*f+g,T=Math.round(_),A=(o+c)*p+x,N=Math.abs(Math.round(A)-b)||1,k=(a+l)*f+g,E=Math.abs(Math.round(k)-T)||1;return r.setTransform(0,Math.sign(f),Math.sign(p),0,b,T),r.drawImage(e,t,n,s,i,0,0,E,N),r.setTransform(u,f,p,m,x,g),[E,N]}r.drawImage(e,t,n,s,i,a,o,l,c);const y=Math.hypot(u,f),v=Math.hypot(p,m);return[y*l,v*c]}class aM{constructor(e,t){oe(this,"alphaIsShape",!1);oe(this,"fontSize",0);oe(this,"fontSizeScale",1);oe(this,"textMatrix",null);oe(this,"textMatrixScale",1);oe(this,"fontMatrix",IN);oe(this,"leading",0);oe(this,"x",0);oe(this,"y",0);oe(this,"lineX",0);oe(this,"lineY",0);oe(this,"charSpacing",0);oe(this,"wordSpacing",0);oe(this,"textHScale",1);oe(this,"textRenderingMode",Sn.FILL);oe(this,"textRise",0);oe(this,"fillColor","#000000");oe(this,"strokeColor","#000000");oe(this,"tilingPatternDims",null);oe(this,"patternFill",!1);oe(this,"patternStroke",!1);oe(this,"fillAlpha",1);oe(this,"strokeAlpha",1);oe(this,"lineWidth",1);oe(this,"activeSMask",null);oe(this,"transferMaps","none");oe(this,"minMax",Af.slice());this.clipBox=new Float32Array([0,0,e,t])}clone(){var t;const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=(t=this.tilingPatternDims)==null?void 0:t.slice(),e}getPathBoundingBox(e=os.FILL,t=null){const n=this.minMax.slice();if(e===os.STROKE){t||Ut("Stroke bounding box must include transform."),ke.singularValueDecompose2dScale(t,na);const s=na[0]*this.lineWidth/2,i=na[1]*this.lineWidth/2;n[0]-=s,n[1]-=i,n[2]+=s,n[3]+=i}return n}updateClipFromPath(){const e=ke.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(Af,0)}getClippedPathBoundingBox(e=os.FILL,t=null){return ke.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function oM(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}const t=e.height,n=e.width,s=t%yi,i=(t-s)/yi,a=s===0?i:i+1,o=r.createImageData(n,yi);let l=0,c;const u=e.data,f=o.data;let p,m,x,g;if(e.kind===Rk.GRAYSCALE_1BPP){const y=u.byteLength,v=new Uint32Array(f.buffer,0,f.byteLength>>2),w=v.length,b=n+7>>3,_=4294967295,T=gr.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(x=p<i?yi:s,c=0,m=0;m<x;m++){const A=y-l;let N=0;const k=A>b?n:A*8-7,E=k&-8;let P=0,O=0;for(;N<E;N+=8)O=u[l++],v[c++]=O&128?_:T,v[c++]=O&64?_:T,v[c++]=O&32?_:T,v[c++]=O&16?_:T,v[c++]=O&8?_:T,v[c++]=O&4?_:T,v[c++]=O&2?_:T,v[c++]=O&1?_:T;for(;N<k;N++)P===0&&(O=u[l++],P=128),v[c++]=O&P?_:T,P>>=1}for(;c<w;)v[c++]=0;r.putImageData(o,0,p*yi)}}else if(e.kind===Rk.RGBA_32BPP){for(m=0,g=n*yi*4,p=0;p<i;p++)f.set(u.subarray(l,l+g)),l+=g,r.putImageData(o,0,m),m+=yi;p<a&&(g=n*s*4,f.set(u.subarray(l,l+g)),r.putImageData(o,0,m))}else if(e.kind===Rk.RGB_24BPP)for(x=yi,g=n*x,p=0;p<a;p++){for(p>=i&&(x=s,g=n*x),c=0,m=g;m--;)f[c++]=u[l++],f[c++]=u[l++],f[c++]=u[l++],f[c++]=255;r.putImageData(o,0,p*yi)}else throw new Error(`bad image kind: ${e.kind}`)}function lM(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}const t=e.height,n=e.width,s=t%yi,i=(t-s)/yi,a=s===0?i:i+1,o=r.createImageData(n,yi);let l=0;const c=e.data,u=o.data;for(let f=0;f<a;f++){const p=f<i?yi:s;({srcPos:l}=jie({src:c,srcPos:l,dest:u,width:n,height:p,nonBlackColor:0})),r.putImageData(o,0,f*yi)}}function af(r,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of t)r[n]!==void 0&&(e[n]=r[n]);r.setLineDash!==void 0&&(e.setLineDash(r.getLineDash()),e.lineDashOffset=r.lineDashOffset)}function G_(r){r.strokeStyle=r.fillStyle="#000000",r.fillRule="nonzero",r.globalAlpha=1,r.lineWidth=1,r.lineCap="butt",r.lineJoin="miter",r.miterLimit=10,r.globalCompositeOperation="source-over",r.font="10px sans-serif",r.setLineDash!==void 0&&(r.setLineDash([]),r.lineDashOffset=0);const{filter:e}=r;e!=="none"&&e!==""&&(r.filter="none")}function cM(r,e){if(e)return!0;ke.singularValueDecompose2dScale(r,na);const t=Math.fround(rc.pixelRatio*$h.PDF_TO_CSS_UNITS);return na[0]<=t&&na[1]<=t}const Fie=["butt","round","square"],Die=["miter","round","bevel"],Mie={},uM={};var Ui,Md,fp,pp,mp,gp,xp,Id,vp,Pl,Ye,pP,mP,gP,xP,vP,li,bs,yP,Wk;const bO=class bO{constructor(e,t,n,s,i,{optionalContentConfig:a,markedContentStack:o=null},l,c,u,f){R(this,Ye);R(this,Ui,0);R(this,Md,0);R(this,fp,null);R(this,pp,null);R(this,mp,null);R(this,gp,null);R(this,xp,1);R(this,Id);R(this,vp,null);R(this,Pl,[]);
569this.ctx=e,this.current=new aM(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=s,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,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=u??null,this.imagesTracker=f??null}getObject(e,t,n=null){var s;return typeof t=="string"?((s=this.dependencyTracker)==null||s.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:s=null}){const i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){const l=this.transparentCanvasEntry=this.canvasFactory.create(i,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=l,this.ctx.save(),this.ctx.transform(...mr(this.compositeCtx))}this.ctx.save(),G_(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=mr(this.ctx)}executeOperatorList(e,t,n,s,i){var v;const a=e.argsArray,o=e.fnArray;let l=t||0;const c=a.length;if(c===l)return l;const u=c-l>sM&&typeof n=="function",f=u?Date.now()+Oie:0;let p=0;const m=this.commonObjs,x=this.objs;let g,y;for(;;){if(s!==void 0){if(l===s.nextBreakPoint)return s.breakIt(l,n),l;if(s.shouldSkip(l)){if(++l===c)return l;continue}}if(!i||i(l))if(g=o[l],y=a[l]??null,g!==_c.dependency)y===null?this[g](l):this[g](l,...y);else for(const w of y){(v=this.dependencyTracker)==null||v.recordNamedData(w,l);const b=w.startsWith("g_")?m:x;if(!b.has(w))return b.get(w,n),l}if(l++,l===c)return l;if(u&&++p>sM){if(Date.now()>f)return n(),l;p=0}}}endDrawing(){j(this,Ye,pP).call(this);for(const e of this.smaskGroupCanvases)this.canvasFactory.destroy(e);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0;for(const e of h(this,Pl))j(this,Ye,Wk).call(this,e);h(this,Pl).length=0,C(this,fp,null),C(this,pp,null),C(this,mp,null),C(this,gp,null),C(this,xp,1),C(this,vp,null),C(this,Md,0),C(this,Ui,0),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(),j(this,Ye,mP).call(this)}_scaleImage(e,t){const n=e.width??e.displayWidth,s=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=[];let l=i,c=a,u=n,f=s;for(;l>2&&u>1||c>2&&f>1;){let v=u,w=f;l>2&&u>1&&(v=Math.ceil(u/2),l/=u/v),c>2&&f>1&&(w=Math.ceil(f/2),c/=f/w),o.push({newWidth:v,newHeight:w}),u=v,f=w}if(o.length===0)return{img:e,paintWidth:n,paintHeight:s,tmpCanvas:null};if(o.length===1){const{newWidth:v,newHeight:w}=o[0],b=this.canvasFactory.create(v,w);return b.context.drawImage(e,0,0,n,s,0,0,v,w),{img:b.canvas,paintWidth:v,paintHeight:w,tmpCanvas:b}}let p=this.canvasFactory.create(1,1),m=this.canvasFactory.create(1,1),x=n,g=s,y=e;for(const{newWidth:v,newHeight:w}of o)this.canvasFactory.reset(m,v,w),m.context.drawImage(y,0,0,x,g,0,0,v,w),[p,m]=[m,p],y=p.canvas,x=v,g=w;return this.canvasFactory.destroy(m),{img:p.canvas,paintWidth:x,paintHeight:g,tmpCanvas:p}}_createMaskCanvas(e,t){var O,D;const n=this.ctx,{width:s,height:i}=t,a=this.current.fillColor,o=this.current.patternFill,l=mr(n);let c,u,f,p;if((t.bitmap||t.data)&&t.count>1){const H=t.bitmap||t.data.buffer;u=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.getOrInsertComputed(H,pj);const B=c.get(u);if(B&&!o){const ee=Math.round(Math.min(l[0],l[2])+l[4]),X=Math.round(Math.min(l[1],l[3])+l[5]);return(O=this.dependencyTracker)==null||O.recordDependencies(e,ka.transformAndFill),{canvas:B,offsetX:ee,offsetY:X}}f=B}f||(p=this.canvasFactory.create(s,i),lM(p.context,t));let m=ke.transform(l,[1/s,0,0,-1/i,0,0]);m=ke.transform(m,[1,0,0,1,0,-i]);const x=Af.slice();ke.axialAlignedBoundingBox([0,0,s,i],m,x);const[g,y,v,w]=x,b=Math.round(v-g)||1,_=Math.round(w-y)||1,T=this.canvasFactory.create(b,_),A=T.context,N=g,k=y;A.translate(-N,-k),A.transform(...m);let E=null;if(!f){const H=this._scaleImage(p.canvas,ll(A));f=H.img,E=H.tmpCanvas,f!==p.canvas&&(this.canvasFactory.destroy(p),p=null),c&&o&&(c.set(u,f),E=null,p=null)}A.imageSmoothingEnabled=cM(mr(A),t.interpolate),V_(A,f,0,0,f.width,f.height,0,0,s,i),E&&this.canvasFactory.destroy(E),p&&this.canvasFactory.destroy(p),A.globalCompositeOperation="source-in";const P=ke.transform(ll(A),[1,0,0,1,-N,-k]);return A.fillStyle=o?a.getPattern(n,this,P,os.FILL,e):a,A.fillRect(0,0,s,i),c&&!o&&c.set(u,T.canvas),(D=this.dependencyTracker)==null||D.recordDependencies(e,ka.transformAndFill),{canvas:T.canvas,canvasEntry:c&&!o?null:T,offsetX:Math.round(N),offsetY:Math.round(k)}}setLineWidth(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("lineCap",e),this.ctx.lineCap=Fie[t]}setLineJoin(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("lineJoin",e),this.ctx.lineJoin=Die[t]}setMiterLimit(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,n){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("dash",e);const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(t),s.lineDashOffset=n)}
569setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){var n,s,i,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":(n=this.dependencyTracker)==null||n.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=c;break;case"ca":(s=this.dependencyTracker)==null||s.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=c;break;case"BM":(i=this.dependencyTracker)==null||i.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.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(e);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}_clearPreparedSMask(){this.smaskPreparedEntry&&(this.canvasFactory.destroy(this.smaskPreparedEntry),this.smaskPreparedEntry=null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(e){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e))}checkSMaskState(e){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode(e):!this.current.activeSMask&&t?this.endSMaskMode():this.current.activeSMask&&t&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(e){const{canvas:t,subtype:n,backdrop:s,transferMap:i}=e,a=n==="Luminosity"||n==="Alpha"&&i;if(!a&&!(n==="Luminosity"&&s)){this.smaskPreparedFor=e;return}let o;if(n==="Luminosity"&&s){const[w,b,_]=Yb(s),T=Math.round(.3*w+.59*b+.11*_);o=(i==null?void 0:i[T])??T}else o=(i==null?void 0:i[0])??0;const l=4,{width:c,height:u}=this.ctx.canvas,f=t.width*t.height,p=c*u<l*f,m=a?{url:n==="Alpha"?this.filterFactory.addAlphaFilter(i):this.filterFactory.addLuminosityFilter(i),subtype:n,transferMap:i}:null,x=n==="Luminosity"?s:null;let g,y,v;p?(g=this._bakeSMaskCanvas(t,e.offsetX,e.offsetY,c,u,x,m),y=0,v=0):(g=this._bakeSMaskCanvas(t,0,0,t.width,t.height,x,m),y=e.offsetX,v=e.offsetY),this.smaskPreparedEntry=g,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=y,this.smaskPreparedOffsetY=v,this.smaskPreparedOOBAlpha=!p&&o!==0?o:null}_bakeSMaskCanvas(e,t,n,s,i,a,o){!a&&!o&&Ut("_bakeSMaskCanvas with neither backdrop nor filter");const l=this.canvasFactory.create(s,i),c=l.context;if(c.drawImage(e,t,n),a&&(c.globalCompositeOperation="destination-atop",c.fillStyle=a,c.fillRect(0,0,s,i)),!o)return l;const u=this.canvasFactory.create(s,i),f=u.context;f.filter=o.url;const p=gr.isCanvasFilterSupported&&f.filter!=="none"&&f.filter!=="";if(f.drawImage(l.canvas,0,0),gr.isCanvasFilterSupported&&(f.filter="none"),!p){const m=f.getImageData(0,0,s,i),{data:x}=m,{transferMap:g}=o;if(o.subtype==="Luminosity")for(let y=0,v=x.length;y<v;y+=4){const w=.3*x[y]+.59*x[y+1]+.11*x[y+2]+.5|0;x[y]=x[y+1]=x[y+2]=0,x[y+3]=(g==null?void 0:g[w])??w}else for(let y=3,v=x.length;y<v;y+=4)x[y]=g[x[y]];f.putImageData(m,0,0)}return this.canvasFactory.destroy(l),u}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const{width:t,height:n}=this.ctx.canvas,s=this.canvasFactory.create(t,n);this.smaskScratchCanvas=s,this.suspendedCtx=this.ctx;const i=this.ctx=s.context;i.setTransform(this.suspendedCtx.getTransform()),af(this.suspendedCtx,i),iM(i,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),af(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}compose(e){if(!this.current.activeSMask)return;e=e?[Math.floor(e[0]),Math.floor(e[1]),Math.ceil(e[2]),Math.ceil(e[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,n=this.suspendedCtx,s=h(this,Md)>0&&n===this.ctx;this.composeSMask(s?null:n,t,this.ctx,e),!s&&(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(
569))}composeSMask(e,t,n,s){const i=s[0],a=s[1],o=s[2]-i,l=s[3]-a;if(o===0||l===0)return;const c=this.smaskPreparedEntry;if(c){let u=i,f=a,p=o,m=l;const x=this.smaskPreparedOOBAlpha,g=x!==null;if(g){u=Math.max(i,t.offsetX),f=Math.max(a,t.offsetY);const y=Math.min(i+o,t.offsetX+t.canvas.width),v=Math.min(a+l,t.offsetY+t.canvas.height);p=y-u,m=v-f}if(p>0&&m>0){const y=u-this.smaskPreparedOffsetX,v=f-this.smaskPreparedOffsetY;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);const w=new Path2D;w.rect(u,f,p,m),n.clip(w),n.globalCompositeOperation="destination-in",n.drawImage(c.canvas,y,v,p,m,u,f,p,m),n.restore()}g&&x<255&&this._applySMaskOOBAlpha(n,i,a,o,l,u,f,u+p,f+m,x)}else this.genericComposeSMask(t,n,o,l,i,a);e&&(e.save(),e.globalAlpha=1,e.globalCompositeOperation=t.blendMode||"source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,i,a,o,l,i,a,o,l),e.restore())}_applySMaskOOBAlpha(e,t,n,s,i,a,o,l,c,u){const f=a<l&&o<c;if(f&&a===t&&o===n&&l===t+s&&c===n+i)return;const p=new Path2D;p.rect(t,n,s,i),f&&p.rect(a,o,l-a,c-o),e.save(),e.globalAlpha=u/255,e.setTransform(1,0,0,1,0,0),e.clip(p,"evenodd"),e.globalCompositeOperation="destination-in",e.fillStyle="#000000",e.fillRect(t,n,s,i),e.restore()}genericComposeSMask(e,t,n,s,i,a){const{context:o,offsetX:l,offsetY:c}=e;t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const u=new Path2D;u.rect(i,a,n,s),t.clip(u),t.globalCompositeOperation="destination-in",t.drawImage(o.canvas,i-l,a-c,n,s,i,a,n,s),t.restore()}save(e){var n;this.inSMaskMode&&af(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone(),(n=this.dependencyTracker)==null||n.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&&(af(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(e),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,s,i,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",e),this.ctx.transform(t,n,s,i,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,s){let[i]=n;if(!s){i||(i=n[0]=new Path2D),t!==_c.stroke&&t!==_c.closeStroke&&(this.current.tilingPatternDims=null),this[t](e,i);return}if(this.dependencyTracker!==null){const o=t===_c.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,s[0]-o,s[2]+o,s[1]-o,s[3]+o).recordDependencies(e,["transform"])}i instanceof Path2D||(i=n[0]=AU(i)),ke.axialAlignedBoundingBox(s,mr(this.ctx),this.current.minMax);const a=this.current.tilingPatternDims;if(a&&t!==_c.stroke&&t!==_c.closeStroke&&this.current.fillColor instanceof jy){const o=ke.intersect(this.current.clipBox,this.current.minMax);o?this.current.fillColor.updatePatternDims(o,a):this.current.tilingPatternDims=null}this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){var o;const s=n&&j(this,Ye,li).call(this,this.current.strokeAlpha),i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a=="object"&&(a!=null&&a.getPattern)){const l=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,ll(i),os.STROKE,e),l){const c=new Path2D;c.addPath(t,i.getTransform().invertSelf().multiplySelf(l)),t=c}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);(o=this.dependencyTracker)==null||o.recordDependencies(e,ka.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(os.STROKE,mr(this.ctx))),i.globalAlpha=this.current.fillAlpha,j(this,Ye,bs).call(this,s)}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){var u,f,p;const s=n&&j(this,Ye,li).call(this,this.current.fillAlpha),i=this.ctx,a=this.current.fillColor,o=this.current.patternFill;let l=!1;const c=this.current.getClippedPathBoundingBox();if((u=this.dependencyTracker)==null||u.recordDependencies(e,ka.fill),o){const m=this.current.tilingPatternDims,x=m&&a.canSkipPatternCanvas(m);if(x){a.drawPattern(this,t,this.pendingEOFill,x,e),this.pendingEOFill=!1,n&&this.consumePath(e,t,c),this.current.tilingPatternDims=null,j(this,Ye,bs).call(this,s);return}const g=a.isModifyingCurrentTransform()?i.getTransform():null;if((f=this.dependencyTracker)==null||f.save(e),i.save(),i.fillStyle=a.getPattern(i,this,ll(i),os.FILL,e),g){const y=new Path2D;y.addPath(t,i.getTransform().invertSelf().multiplySelf(g)),t=y}l=!0}this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),l&&(i.restore(
569),(p=this.dependencyTracker)==null||p.restore(e)),n&&this.consumePath(e,t,c),j(this,Ye,bs).call(this,s)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){const n=j(this,Ye,li).call(this,Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t),j(this,Ye,bs).call(this,n)}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 s;const n=j(this,Ye,li).call(this,this.current.fillAlpha);this.ctx.fill(t),(s=this.dependencyTracker)==null||s.recordDependencies(e,ka.rawFillPath).recordOperation(e),j(this,Ye,bs).call(this,n)}clip(e){var t;(t=this.dependencyTracker)==null||t.recordFutureForcedDependency("clipMode",e),this.pendingClip=Mie}eoClip(e){var t;(t=this.dependencyTracker)==null||t.recordFutureForcedDependency("clipMode",e),this.pendingClip=uM}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,n=this.ctx;if(this.dependencyTracker){const{dependencyTracker:s}=this;t!==void 0&&s.recordFutureForcedDependency("textClip",s.getOpenMarker()).recordFutureForcedDependency("textClip",e),s.recordCloseMarker(e)}if(t!==void 0){const s=new Path2D,i=n.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:c,path:u}of t)u&&s.addPath(u,new DOMMatrix(a).preMultiplySelf(i).translate(o,l).scale(c,-c));n.clip(s)}delete this.pendingTextPaths}setCharSpacing(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,n){var f,p;(f=this.dependencyTracker)==null||f.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);const s=this.commonObjs.get(t),i=this.current;if(!s)throw new Error(`Can't find font for ${t}`);if(i.fontMatrix=s.fontMatrix||IN,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&mt("Invalid font matrix for font "+t),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=s,this.current.fontSize=n,s.isType3Font)return;const a=s.loadedName||"sans-serif",o=((p=s.systemFontInfo)==null?void 0:p.css)||`"${a}", ${s.fallbackName}`;let l="normal";s.black?l="900":s.bold&&(l="bold");const c=s.italic?"italic":"normal";let u=n;n<rM?u=rM:n>nM&&(u=nM),this.current.fontSizeScale=n/u,this.ctx.font=`${c} ${l} ${u}px ${o}`}setTextRenderingMode(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,n){var s;(s=this.dependencyTracker)==null||s.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){var s;(s=this.dependencyTracker)==null||s.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.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,n,s,i,a){var v,w,b,_;const o=this.ctx,l=this.current,c=l.font,u=l.textRenderingMode,f=l.fontSize/l.fontSizeScale,p=u&Sn.FILL_STROKE_MASK,m=!!(u&Sn.ADD_TO_PATH_FLAG),x=l.patternFill&&!c.missingFile,g=l.patternStroke&&!c.missingFile;let y;if((c.disableFontFace||m||x||g)&&!c.missingFile&&(y=c.getPathGenerator(this.commonObjs,t)),y&&(c.disableFontFace||x||g)){o.save(),o.translate(n,s),o.scale(f,-f),(v=this.dependencyTracker)==null||v.recordCharacterBBox(e,o,c);let T;if(p===Sn.FILL||p===Sn.FILL_STROKE)if(i){T=o.getTransform(),o.setTransform(...i);const A=j(this,Ye,yP).call(this,y,T,i);o.fill(A)}else o.fill(y);if(p===Sn.STROKE||p===Sn.FILL_STROKE)if(a){T||(T=o.getTransform()),o.setTransform(...a);const{a:A,b:N,c:k,d:E}=T,P=ke.inverseTransform(a),O=ke.transform([A,N,k,E,0,0],P);ke.singularValueDecompose2dScale(O,na),o.lineWidth*=Math.max(na[0],na[1])/f,o.stroke(j(this,Ye,yP).call(this,y,T,a))}else o.lineWidth/=f,o.stroke(y);
569o.restore()}else(p===Sn.FILL||p===Sn.FILL_STROKE)&&(o.fillText(t,n,s),(w=this.dependencyTracker)==null||w.recordCharacterBBox(e,o,c,f,n,s,()=>o.measureText(t))),(p===Sn.STROKE||p===Sn.FILL_STROKE)&&(this.dependencyTracker&&((b=this.dependencyTracker)==null||b.recordCharacterBBox(e,o,c,f,n,s,()=>o.measureText(t)).recordDependencies(e,ka.stroke)),o.strokeText(t,n,s));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:mr(o),x:n,y:s,fontSize:f,path:y}),(_=this.dependencyTracker)==null||_.recordCharacterBBox(e,o,c,f,n,s))}get isFontSubpixelAAEnabled(){const e=this.canvasFactory.create(10,10),t=e.context;t.scale(1.5,1),t.fillText("I",0,10);const n=t.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let s=!1;for(let i=3;i<n.length;i+=4)if(n[i]>0&&n[i]<255){s=!0;break}return ct(this,"isFontSubpixelAAEnabled",s)}showText(e,t){var D,H,B,ee;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,ka.showText).resetBBox(e),this.current.textRenderingMode&Sn.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const n=this.current,s=n.font;if(s.isType3Font){const X=j(this,Ye,li).call(this,n.fillAlpha);this.showType3Text(e,t),(D=this.dependencyTracker)==null||D.recordShowTextOperation(e),j(this,Ye,bs).call(this,X);return}const i=n.fontSize;if(i===0){(H=this.dependencyTracker)==null||H.recordOperation(e);return}const a=j(this,Ye,li).call(this,n.fillAlpha),o=this.ctx,l=n.fontSizeScale,c=n.charSpacing,u=n.wordSpacing,f=n.fontDirection,p=n.textHScale*f,m=t.length,x=s.vertical,g=x?1:-1,y=s.defaultVMetrics,v=i*n.fontMatrix[0],w=n.textRenderingMode===Sn.FILL&&!s.disableFontFace&&!n.patternFill;o.save(),n.textMatrix&&o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),f>0?o.scale(p,-1):o.scale(p,1);let b,_;const T=n.textRenderingMode&Sn.FILL_STROKE_MASK,A=T===Sn.FILL||T===Sn.FILL_STROKE,N=T===Sn.STROKE||T===Sn.FILL_STROKE;let k=n.lineWidth;const E=n.textMatrixScale;if(E===0||k===0?N&&(k=this.getSinglePixelWidth()):k/=E,l!==1&&(o.scale(l,l),k/=l),o.lineWidth=k,A&&n.patternFill){o.save();const X=n.fillColor.getPattern(o,this,ll(o),os.FILL,e);b=mr(o),o.restore(),o.fillStyle=X}if(N&&n.patternStroke){o.save();const X=n.strokeColor.getPattern(o,this,ll(o),os.STROKE,e);_=mr(o),o.restore(),o.strokeStyle=X}if(s.isInvalidPDFjsFont){const X=[];let W=0;for(const F of t)X.push(F.unicode),W+=F.width;const Y=X.join("");if(o.fillText(Y,0,0),this.dependencyTracker!==null){const F=o.measureText(Y);this.dependencyTracker.recordBBox(e,this.ctx,-F.actualBoundingBoxLeft,F.actualBoundingBoxRight,-F.actualBoundingBoxAscent,F.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=W*v*p,o.restore(),this.compose(),j(this,Ye,bs).call(this,a);return}let P=0,O;for(O=0;O<m;++O){const X=t[O];if(typeof X=="number"){P+=g*X*i/1e3;continue}let W=!1;const Y=(X.isSpace?u:0)+c,F=X.fontChar,J=X.accent;let ne,I,z=X.width;if(x){const te=X.vmetric||y,re=-(X.vmetric?te[1]:z*.5)*v,se=te[2]*v;z=te?-te[0]:z,ne=re/l,I=(P+se)/l}else ne=P/l,I=0;let M;if(s.remeasure&&z>0){M=o.measureText(F);const te=M.width*1e3/i*l;if(z<te&&this.isFontSubpixelAAEnabled){const re=z/te;W=!0,o.save(),o.scale(re,1),ne/=re}else z!==te&&(ne+=(z-te)/2e3*i/l)}if(this.contentVisible&&(X.isInFont||s.missingFile)){if(w&&!J)o.fillText(F,ne,I),(B=this.dependencyTracker)==null||B.recordCharacterBBox(e,o,M?{bbox:null}:s,i/l,ne,I,()=>M??o.measureText(F));else if(this.paintChar(e,F,ne,I,b,_),J){const te=ne+i*J.offset.x/l,re=I-i*J.offset.y/l;this.paintChar(e,J.fontChar,te,re,b,_)}}const U=x?z*v-Y*f:z*v+Y*f;P+=U,W&&o.restore()}x?n.y-=P:n.x+=P*p,o.restore(),this.compose(),(ee=this.dependencyTracker)==null||ee.recordShowTextOperation(e),j(this,Ye,bs).call(this,a)}showType3Text(e,t){const n=this.ctx,s=this.current,i=s.font,a=s.fontSize,o=s.fontDirection,l=i.vertical?1:-1,c=s.charSpacing,u=s.wordSpacing,f=s.textHScale*o,p=s.fontMatrix||IN,m=t.length,x=s.textRenderingMode===Sn.INVISIBLE;let g,y,v,w;if(x||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),s.textMatrix&&n.transform(...s.textMatrix),n.translate(s.x,s.y+s.textRise),n.scale(f,o);const b=this.dependencyTracker;for(this.dependencyTracker=b?new T1(b,e):null,g=0;g<m;++g){if(y=t[g],typeof y=="number"){w=l*y*a/1e3,this.ctx.translate(w,0),s.x+=w*f;continue}const _=(y.isSpace?u:0)+c,T=i.charProcOperatorList[y.operatorListId];T?this.contentVisible&&(this.save(),n.scale(a,a),n.transform(...p),this.executeOperatorList(T),this.restore(
569)):mt(`Type3 character "${y.operatorListId}" is not available.`);const A=[y.width,0];ke.applyTransform(A,p),v=A[0]*a+_,n.translate(v,0),s.x+=v*f}n.restore(),b&&(this.dependencyTracker=b)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,s,i,a,o){var c;const l=new Path2D;l.rect(s,i,a-s,o-i),this.ctx.clip(l),(c=this.dependencyTracker)==null||c.recordBBox(e,this.ctx,s,a,i,o).recordClipBox(e,this.ctx,s,a,i,o),this.endPath(e)}getColorN_Pattern(e,t){let n;if(t[0]==="TilingPattern"){const s=this.baseTransform||mr(this.ctx),i={createCanvasGraphics:(a,o)=>new bO(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new T1(this.dependencyTracker,o,!0):null)};n=new jy(t,this.ctx,i,s)}else n=this._getPattern(e,t[1],t[2]);return n}setStrokeColorN(e,...t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("fillColor",e);const n=this.current.fillColor=this.getColorN_Pattern(e,t);this.current.patternFill=!0,this.current.tilingPatternDims=n instanceof jy?[0,0,0,0]:null}setStrokeRGBColor(e,t){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}
569setStrokeTransparent(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 n;(n=this.dependencyTracker)==null||n.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){var t;(t=this.dependencyTracker)==null||t.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,t,n=null){let s;return this.cachedPatterns.has(t)?s=this.cachedPatterns.get(t):(s=Rie(this.getObject(e,t)),this.cachedPatterns.set(t,s)),n&&(s.matrix=n),s}shadingFill(e,t){var o;if(!this.contentVisible)return;const n=j(this,Ye,li).call(this,this.current.fillAlpha),s=this.ctx;this.save(e);const i=this._getPattern(e,t);s.fillStyle=i.getPattern(s,this,ll(s),os.SHADING,e);const a=ll(s);if(a){const{width:l,height:c}=s.canvas,u=Af.slice();ke.axialAlignedBoundingBox([0,0,l,c],a,u);const[f,p,m,x]=u;this.ctx.fillRect(f,p,m-f,x-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(o=this.dependencyTracker)==null||o.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,ka.transform).recordDependencies(e,ka.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e),j(this,Ye,bs).call(this,n)}beginInlineImage(){Ut("Should not call beginInlineImage")}beginImageData(){Ut("Should not call beginImageData")}paintFormXObjectBegin(e,t,n){var s;if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=mr(this.ctx),n)){ke.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);const[i,a,o,l]=n,c=new Path2D;c.rect(i,a,o-i,l-a),this.ctx.clip(c),(s=this.dependencyTracker)==null||s.recordClipBox(e,this.ctx,i,o,a,l),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){var w;if(!this.contentVisible)return;this.save(e);const{inSMaskMode:n}=this;n&&(this.endSMaskMode(),this.current.activeSMask=null);const s=this.ctx;if(!t.isolated&&!t.knockout&&h(this,Ui)===0&&QE("TODO: Fully support non-isolated non-knockout groups."),!t.needsIsolation&&!t.knockout&&h(this,Ui)===0&&s.globalAlpha===1&&s.globalCompositeOperation==="source-over"&&!n){if(t.bbox){let b=new Path2D;const[_,T,A,N]=t.bbox;if(b.rect(_,T,A-_,N-T),t.matrix){const k=new Path2D;k.addPath(b,new DOMMatrix(t.matrix)),b=k}s.clip(b)}this.groupStack.push(null),h(this,Pl).push(null),this.groupLevel++;return}const i=mr(s);t.matrix&&s.transform(...t.matrix);const a=[0,0,s.canvas.width,s.canvas.height];let o;t.bbox?(o=Af.slice(),ke.axialAlignedBoundingBox(t.bbox,mr(s),o),o=ke.intersect(o,a)||[0,0,0,0]):o=a;const l=Math.floor(o[0]),c=Math.floor(o[1]),u=Math.max(Math.ceil(o[2])-l,1),f=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,u,f]);const p=this.canvasFactory.create(u,f);t.smask&&this.smaskGroupCanvases.push(p);const m=p.context,x=t.knockout&&!t.isolated?s:null,g=!t.isolated&&!t.knockout&&!t.smask&&t.needsIsolation&&h(this,Ui)>0,y=t.knockout?this.canvasFactory.create(u,f):null,v=h(this,Ui);if(t.knockout?tr(this,Ui)._++:C(this,Ui,0),m.translate(-l,-c),m.transform(...i),!t.isolated&&!t.smask&&n&&t.needsIsolation&&(m.save(),m.setTransform(1,0,0,1,0,0),m.drawImage(s.canvas,-l,-c),m.restore()),t.bbox){let b=new Path2D;const[_,T,A,N]=t.bbox;if(b.rect(_,T,A-_,N-T),t.matrix){const k=new Path2D;k.addPath(b,new DOMMatrix(t.matrix)),b=k}m.clip(b)}t.smask&&this.smaskStack.push({canvas:p.canvas,context:m,offsetX:l,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null}),(!t.smask||this.dependencyTracker)&&(s.setTransform(1,0,0,1,0,0),s.translate(l,c),s.save()),af(s,m),this.ctx=m,(w=this.dependencyTracker)==null||w.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(s),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(s),h(this,Pl).push({backdropCtx:x,savedKnockoutLevel:v,offsetX:l,offsetY:c,hasInnerBackdrop:g,knockoutMaskEntry:y,knockoutTempEntry:null,knockoutBackdropEntry:null}),this.groupLevel++}endGroup(e,t){var a;if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,s=this.groupStack.pop(),i=h(this,Pl).pop();if(i&&C(this,Ui,i.savedKnockoutLevel),s===null){this.restore(e);return}if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,(a=this.dependencyTracker)==null||a.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(
569),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())),j(this,Ye,Wk).call(this,i);else{this.ctx.restore();const o=mr(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...o);const l=Af.slice();ke.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],o,l);const c=h(this,Pl).at(-1);if(h(this,Ui)>0)if(i.hasInnerBackdrop){const{width:u,height:f}=n.canvas,p=this.canvasFactory.create(u,f),m=p.context;m.drawImage(s.canvas,i.offsetX,i.offsetY,u,f,0,0,u,f),m.globalCompositeOperation="source-over",m.drawImage(n.canvas,0,0);const x=j(this,Ye,gP).call(this,n.canvas);m.globalCompositeOperation="destination-in",m.drawImage(x.canvas,0,0);const g=this.ctx.globalCompositeOperation,y=this.ctx.globalAlpha,v=this.ctx.filter;this.ctx.save(),this.ctx.setTransform(...o),this.ctx.globalAlpha=1,gr.isCanvasFilterSupported&&(this.ctx.filter="none"),this.ctx.globalCompositeOperation="destination-out",this.ctx.drawImage(x.canvas,0,0),this.ctx.globalCompositeOperation=g,this.ctx.globalAlpha=y,gr.isCanvasFilterSupported&&(this.ctx.filter=v??"none"),this.ctx.drawImage(p.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(x),this.canvasFactory.destroy(p)}else{const u=(c==null?void 0:c.backdropCtx)??null;j(this,Ye,vP).call(this,this.ctx,n.canvas,{backdropCanvas:(u==null?void 0:u.canvas)??null,destTransform:o,backdropOffset:u?[c.offsetX+i.offsetX,c.offsetY+i.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else this.ctx.drawImage(n.canvas,0,0);this.ctx.restore(),this.canvasFactory.destroy({canvas:n.canvas,context:n}),j(this,Ye,Wk).call(this,i),this.compose(l)}}beginAnnotation(e,t,n,s,i,a){if(j(this,Ye,pP).call(this),G_(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){const o=n[2]-n[0],l=n[3]-n[1];if(a&&this.annotationCanvasMap){s=s.slice(),s[4]-=n[0],s[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=o,n[3]=l,ke.singularValueDecompose2dScale(mr(this.ctx),na);const{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),f=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,f);const{canvas:p,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(t,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(na[0],0,0,-na[1],0,l*na[1]),G_(this.ctx)}else{G_(this.ctx),this.endPath(e);const c=new Path2D;c.rect(n[0],n[1],o,l),this.ctx.clip(c)}}this.current=new aM(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...s),this.transform(e,...i),this.baseTransform=mr(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),j(this,Ye,mP).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,t){var l;if(!this.contentVisible)return;const n=t.count;t=this.getObject(e,t.data,t),t.count=n;const s=j(this,Ye,li).call(this,this.current.fillAlpha),i=this.ctx,a=this._createMaskCanvas(e,t),o=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,a.offsetX,a.offsetY),(l=this.dependencyTracker)==null||l.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+o.width,a.offsetY,a.offsetY+o.height).recordOperation(e),i.restore(),a.canvasEntry&&this.canvasFactory.destroy(a.canvasEntry),this.compose(),j(this,Ye,bs).call(this,s)}paintImageMaskXObjectRepeat(e,t,n,s=0,i=0,a,o){var p,m,x;if(!this.contentVisible)return;t=this.getObject(e,t.data,t);const l=j(this,Ye,li).call(this,this.current.fillAlpha),c=this.ctx;c.save();const u=mr(c);c.transform(n,s,i,a,0,0);const f=this._createMaskCanvas(e,t);c.setTransform(1,0,0,1,f.offsetX-u[4],f.offsetY-u[5]),(p=this.dependencyTracker)==null||p.resetBBox(e);for(let g=0,y=o.length;g<y;g+=2){const v=ke.transform(u,[n,s,i,a,o[g],o[g+1]]);c.drawImage(f.canvas,v[4],v[5]),(m=this.dependencyTracker)==null||m.recordBBox(e,this.ctx,v[4],v[4]+f.canvas.width,v[5],v[5]+f.canvas.height)}c.restore(),f.canvasEntry&&this.canvasFactory.destroy(f.canvasEntry),this.compose(),(x=this.dependencyTracker)==null||x.recordOperation(e),j(this,Ye,bs).call(this,l)}paintImageMaskXObjectGroup(e,t){var o,l,c;if(!this.contentVisible)return;const n=j(this,Ye,li).call(this,this.current.fillAlpha),s=this.ctx,i=this.current.fillColor,a=this.current.patternFill;(o=this.dependencyTracker)==null||o.resetBBox(e).recordDependencies(e,ka.transformAndFill);for(const u of t){const{data:f,width:p,height:m,transform:x}=u,g=this.canvasFactory.create(p,m),y=g.context;y.save();const v=this.getObject(e,f,u);lM(y,v),y.globalCompositeOperation="source-in",y.fillStyle=a?i.getPattern(y,this,ll(s),os.FILL,e):i,y.fillRect(0,0,p,m),y.restore(
569),s.save(),s.transform(...x),s.scale(1,-1),V_(s,g.canvas,0,0,p,m,0,-1,1,1),this.canvasFactory.destroy(g),(l=this.dependencyTracker)==null||l.recordBBox(e,s,0,p,0,m),s.restore()}this.compose(),(c=this.dependencyTracker)==null||c.recordOperation(e),j(this,Ye,bs).call(this,n)}paintImageXObject(e,t){if(!this.contentVisible)return;const n=this.getObject(e,t);if(!n){mt("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,t,n,s,i){if(!this.contentVisible)return;const a=this.getObject(e,t);if(!a){mt("Dependent image isn't ready yet");return}const o=a.width,l=a.height,c=[];for(let u=0,f=i.length;u<f;u+=2)c.push({transform:[n,0,0,s,i[u],i[u+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{img:e.bitmap,canvasEntry:null};const{bitmap:t,width:n,height:s}=e,i=this.canvasFactory.create(n,s),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",{img:i.canvas,canvasEntry:i}}paintInlineImageXObject(e,t){var f;if(!this.contentVisible)return;const n=t.width,s=t.height,i=j(this,Ye,li).call(this,this.current.fillAlpha),a=this.ctx;this.save(e);const{filter:o}=a;o!=="none"&&o!==""&&(a.filter="none"),a.scale(1/n,-1/s);let l,c=null;if(t.bitmap){const p=this.applyTransferMapsToBitmap(t);l=p.img,c=p.canvasEntry}else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)l=t;else{const p=this.canvasFactory.create(n,s);oM(p.context,t),l=this.applyTransferMapsToCanvas(p.context),c=p}const u=this._scaleImage(l,ll(a));a.imageSmoothingEnabled=cM(mr(a),t.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,a,0,n,-s,0).recordDependencies(e,ka.imageXObject).recordOperation(e),(f=this.imagesTracker)==null||f.record(a,n,s,this.dependencyTracker.clipBox)),V_(a,u.img,0,0,u.paintWidth,u.paintHeight,0,-s,n,s),u.tmpCanvas&&this.canvasFactory.destroy(u.tmpCanvas),c&&this.canvasFactory.destroy(c),this.compose(),this.restore(e),j(this,Ye,bs).call(this,i)}paintInlineImageXObjectGroup(e,t,n){var l,c,u;if(!this.contentVisible)return;const s=j(this,Ye,li).call(this,this.current.fillAlpha),i=this.ctx;let a,o=null;if(t.bitmap)a=t.bitmap;else{const f=t.width,p=t.height,m=this.canvasFactory.create(f,p);oM(m.context,t),a=this.applyTransferMapsToCanvas(m.context),o=m}(l=this.dependencyTracker)==null||l.resetBBox(e);for(const f of n)i.save(),i.transform(...f.transform),i.scale(1,-1),V_(i,a,f.x,f.y,f.w,f.h,0,-1,1,1),(c=this.dependencyTracker)==null||c.recordBBox(e,i,0,1,-1,0),i.restore();o&&this.canvasFactory.destroy(o),(u=this.dependencyTracker)==null||u.recordOperation(e),this.compose(),j(this,Ye,bs).call(this,s)}paintSolidColorImageMask(e){var n;if(!this.contentVisible)return;const t=j(this,Ye,li).call(this,this.current.fillAlpha);(n=this.dependencyTracker)==null||n.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,ka.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose(),j(this,Ye,bs).call(this,t)}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){var n;(n=this.dependencyTracker)==null||n.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){var s;(s=this.dependencyTracker)==null||s.beginMarkedContent(e),t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):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,n){var a,o;const s=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);const i=this.ctx;this.pendingClip?(s||(this.pendingClip===uM?i.clip(t,"evenodd"):i.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=mr(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]),n=Math.hypot(e[0],e[2]),s=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,s)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:t,b:n,c:s,d:i}=this.ctx.getTransform();let a,o;
569if(n===0&&s===0){const l=Math.abs(t),c=Math.abs(i);if(l===c)if(e===0)a=o=1/l;else{const u=l*e;a=o=u<1?1/u:1}else if(e===0)a=1/l,o=1/c;else{const u=l*e,f=c*e;a=u<1?1/u:1,o=f<1?1/f:1}}else{const l=Math.abs(t*i-n*s),c=Math.hypot(t,n),u=Math.hypot(s,i);if(e===0)a=u/l,o=c/l;else{const f=e*l;a=u>f?u/f:1,o=c>f?c/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:n,current:{lineWidth:s}}=this,[i,a]=this.getScaleForStroking();if(i===a){n.lineWidth=(s||1)*i,n.stroke(e);return}const o=n.getLineDash();t&&n.save(),n.scale(i,a),jT.a=1/i,jT.d=1/a;const l=new Path2D;if(l.addPath(e,jT),o.length>0){const c=Math.max(i,a);n.setLineDash(o.map(u=>u/c)),n.lineDashOffset/=c}n.lineWidth=s||1,n.stroke(l),t&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};Ui=new WeakMap,Md=new WeakMap,fp=new WeakMap,pp=new WeakMap,mp=new WeakMap,gp=new WeakMap,xp=new WeakMap,Id=new WeakMap,vp=new WeakMap,Pl=new WeakMap,Ye=new WeakSet,pP=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.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)},mP=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}}},gP=function(e,t=null,n=1){const{width:s,height:i}=e,a=t??this.canvasFactory.create(s,i),o=a.context;n=Math.round(n*255)/255;const l=n<1;l&&h(this,Id)===void 0&&C(this,Id,gr.isCanvasFilterSupported?new Map:"none");let c="none";if(l&&h(this,Id)instanceof Map&&(c=h(this,Id).get(n),c||(c=this.filterFactory.addKnockoutFilter(n),h(this,Id).set(n,c))),!l||c!=="none")return t&&(o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,s,i),o.restore()),o.filter=c,o.drawImage(e,0,0),o.filter="none",a;const u=e.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,s,i),f=o.createImageData(s,i),p=u.data,m=f.data,x=n>0?1/n:1e6;for(let g=3,y=p.length;g<y;g+=4)m[g]=Math.min(Math.round(p[g]*x),255);return o.putImageData(f,0,0),a},xP=function(e,t,n,s){let i=(e==null?void 0:e[t])??null;if(i&&(i.canvas.width!==n||i.canvas.height!==s)&&(this.canvasFactory.destroy(i),i=null),!i)return i=this.canvasFactory.create(n,s),e&&(e[t]=i),i;const a=i.context;return a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,n,s),a.restore(),i},vP=function(e,t,n={}){const{backdropCanvas:s=null,destTransform:i=[1,0,0,1,0,0],backdropOffset:a=[0,0],reuseMaskEntry:o=null,poolMeta:l=null,sourceAlpha:c=1,sourceFilter:u="none",knockoutAlpha:f=1}=n,{width:p,height:m}=t,x=j(this,Ye,gP).call(this,t,o,f),g=e.globalCompositeOperation;if(e.save(),e.setTransform(...i),e.globalAlpha=1,gr.isCanvasFilterSupported&&(e.filter="none"),e.globalCompositeOperation="destination-out",e.drawImage(x.canvas,0,0),s){const[y,v]=a,w=j(this,Ye,xP).call(this,l,"knockoutBackdropEntry",p,m),b=w.context;b.drawImage(s,y,v,p,m,0,0,p,m),b.globalCompositeOperation="destination-in",b.drawImage(x.canvas,0,0),b.globalCompositeOperation="source-over",e.globalCompositeOperation="destination-over",e.drawImage(w.canvas,0,0),l||this.canvasFactory.destroy(w)}e.globalCompositeOperation=g,e.globalAlpha=c,gr.isCanvasFilterSupported&&(e.filter=u??"none"),e.drawImage(t,0,0),e.restore(),o||this.canvasFactory.destroy(x)},li=function(e=1){if(h(this,Ui)===0||h(this,Md)>0||!this.contentVisible)return!1;tr(this,Md)._++,C(this,xp,e);const t=h(this,Pl).at(-1),{canvas:n}=this.ctx,s=j(this,Ye,xP).call(this,t,"knockoutTempEntry",n.width,n.height);C(this,fp,s);const i=s.context;return i.save(),i.setTransform(this.ctx.getTransform()),af(this.ctx,i),C(this,gp,i.globalCompositeOperation),i.globalCompositeOperation="source-over",iM(i,this.ctx),C(this,vp,t),C(this,pp,this.ctx),C(this,mp,this.suspendedCtx),this.ctx=i,this.inSMaskMode&&(this.suspendedCtx=i),!0},bs=function(e){var l;if(!e)return;const t=h(this,fp),n=h(this,pp),s=h(this,mp),i=t.context;C(this,fp,null),C(this,pp,null),C(this,mp,null),this.inSMaskMode&&this.suspendedCtx===i&&this.ctx!==i&&this.endSMaskMode(),this.inSMaskMode&&(this.suspendedCtx=s),this.ctx._removeMirroring(),this.ctx.globalCompositeOperation=h(this,gp),C(this,gp,null),af(this.ctx,n),this.ctx=n;const a=h(this,vp);C(this,vp,null);const o=h(this,xp);C(this,xp,1);try{j(this,Ye,vP).call(this,s??n,t.canvas,{backdropCanvas:((l=a==null?void 0:a.backdropCtx)==null?void 0:l.canvas)??null,backdropOffset:a!=null&&a.backdropCtx?[a.offsetX,a.offsetY]:[0,0],reuseMaskEntry:(a==null?void 0:a.knockoutMaskEntry)??null,poolMeta:a,
569knockoutAlpha:o})}finally{i.restore(),tr(this,Md)._--,a||this.canvasFactory.destroy(t)}},yP=function(e,t,n){const s=new Path2D;return s.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),s},Wk=function(e){e&&(e.knockoutMaskEntry&&(this.canvasFactory.destroy(e.knockoutMaskEntry),e.knockoutMaskEntry=null),e.knockoutTempEntry&&(this.canvasFactory.destroy(e.knockoutTempEntry),e.knockoutTempEntry=null),e.knockoutBackdropEntry&&(this.canvasFactory.destroy(e.knockoutBackdropEntry),e.knockoutBackdropEntry=null))};let zm=bO;for(const r in _c)zm.prototype[r]!==void 0&&(zm.prototype[_c[r]]=zm.prototype[r]);var Sw,Ew;class nA{constructor(e,t,n){R(this,Sw,null);R(this,Ew,null);oe(this,"_fullReader",null);oe(this,"_rangeReaders",new Set);oe(this,"_source",null);this._source=e,C(this,Sw,t),C(this,Ew,n)}get _progressiveDataLength(){var e;return((e=this._fullReader)==null?void 0:e._loaded)??0}getFullReader(){return Ur(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(h(this,Sw))(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new(h(this,Ew))(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){var t;(t=this._fullReader)==null||t.cancel(e);for(const n of new Set(this._rangeReaders))n.cancel(e)}}Sw=new WeakMap,Ew=new WeakMap;class sA{constructor(e){oe(this,"onProgress",null);oe(this,"_contentLength",0);oe(this,"_filename",null);oe(this,"_headersCapability",Promise.withResolvers());oe(this,"_isRangeSupported",!1);oe(this,"_isStreamingSupported",!1);oe(this,"_loaded",0);oe(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(){Ut("Abstract method `read` called")}cancel(e){Ut("Abstract method `cancel` called")}}class iA{constructor(e,t,n){oe(this,"_stream",null);this._stream=e}async read(){Ut("Abstract method `read` called")}cancel(e){Ut("Abstract method `cancel` called")}}function Iie(r){let e=!0,t=n("filename\\*","i").exec(r);if(t){t=t[1];let u=o(t);return u=unescape(u),u=l(u),u=c(u),i(u)}if(t=a(r),t){const u=c(t);return i(u)}if(t=n("filename","i").exec(r),t){t=t[1];let u=o(t);return u=c(u),i(u)}function n(u,f){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function s(u,f){if(u){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const p=new TextDecoder(u,{fatal:!0}),m=eA(f);f=p.decode(m),e=!1}catch{}}return f}function i(u){return e&&/[\x80-\xff]/.test(u)&&(u=s("utf-8",u),e&&(u=s("iso-8859-1",u))),u}function a(u){const f=[];let p;const m=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=m.exec(u))!==null;){let[,g,y,v]=p;if(g=parseInt(g,10),g in f){if(g===0)break;continue}f[g]=[y,v]}const x=[];for(let g=0;g<f.length&&g in f;++g){let[y,v]=f[g];v=o(v),y&&(v=unescape(v),g===0&&(v=l(v))),x.push(v)}return x.join("")}function o(u){if(u.startsWith('"')){const f=u.slice(1).split('\\"');for(let p=0;p<f.length;++p){const m=f[p].indexOf('"');m!==-1&&(f[p]=f[p].slice(0,m),f.length=p+1),f[p]=f[p].replaceAll(/\\(.)/g,"$1")}u=f.join('"')}return u}function l(u){const f=u.indexOf("'");if(f===-1)return u;const p=u.slice(0,f),x=u.slice(f+1).replace(/^[^']*'/,"");return s(p,x)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi,function(f,p,m,x){if(m==="q"||m==="Q")return x=x.replaceAll("_"," "),x=x.replaceAll(/=([0-9a-f]{2})/gi,function(g,y){return String.fromCharCode(parseInt(y,16))}),s(p,x);try{x=atob(x)}catch{}return s(p,x)})}return""}function y$(r,e){const t=new Headers;if(!r||!e||typeof e!="object")return t;for(const n in e){const s=e[n];s!==void 0&&t.append(n,s)}return t}function aA(r){var e;return((e=URL.parse(r))==null?void 0:e.origin)??null}function w$({responseHeaders:r,isHttp:e,rangeChunkSize:t,disableRange:n}){const s={contentLength:0,isRangeSupported:!1},i=parseInt(r.get("Content-Length"),10);return!Number.isInteger(i)||(s.contentLength=i,i<=2*t)||n||!e||r.get("Accept-Ranges")!=="bytes"||(r.get("Content-Encoding")||"identity")==="identity"&&(s.isRangeSupported=!0),s}function b$(r){const e=r.get("Content-Disposition");if(e){let t=Iie(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(xj(t))return t}return null}
569function oA(r,e){return new dS(`Unexpected server response (${r}) while retrieving PDF "${e.href}".`,r,r===404||r===0&&e.protocol==="file:")}function _$(r,e){if(r!==e)throw new Error(`Expected range response-origin "${r}" to match "${e}".`)}function k$(r,e,t,n){return fetch(r,{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"})}function S$(r,e){if(r!==200&&r!==206)throw oA(r,e)}function lA(r){if(r instanceof Uint8Array)return r.buffer;if(r instanceof ArrayBuffer)return r;throw new Error(`getArrayBuffer - unexpected data: ${r}`)}class Lie extends nA{constructor(t){super(t,Bie,Uie);oe(this,"_responseOrigin",null);const{httpHeaders:n,url:s}=t;Ur(/https?:/.test(s.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=y$(!0,n)}}class Bie extends sA{constructor(t){super(t);oe(this,"_abortController",new AbortController);oe(this,"_reader",null);const{disableRange:n,disableStream:s,rangeChunkSize:i,url:a,withCredentials:o}=t._source;this._isStreamingSupported=!s;const l=new Headers(t.headers);k$(a,l,o,this._abortController).then(c=>{t._responseOrigin=aA(c.url),S$(c.status,a),this._reader=c.body.getReader();const u=c.headers,{contentLength:f,isRangeSupported:p}=w$({responseHeaders:u,isHttp:!0,rangeChunkSize:i,disableRange:n});this._contentLength=f,this._isRangeSupported=p,this._filename=b$(u),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Uh("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:lA(t),done:!1})}cancel(t){var n;(n=this._reader)==null||n.cancel(t),this._abortController.abort()}}class Uie extends iA{constructor(t,n,s){super(t,n,s);oe(this,"_abortController",new AbortController);oe(this,"_readCapability",Promise.withResolvers());oe(this,"_reader",null);const{url:i,withCredentials:a}=t._source,o=new Headers(t.headers);o.append("Range",`bytes=${n}-${s-1}`),k$(i,o,a,this._abortController).then(l=>{const c=aA(l.url);_$(c,t._responseOrigin),S$(l.status,i),this._reader=l.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:lA(t),done:!1}}cancel(t){var n;(n=this._reader)==null||n.cancel(t),this._abortController.abort()}}function dM(r){return r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer}function cA(){for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}var JS,E$;class $ie extends nA{constructor(t){super(t,zie,Hie);R(this,JS);oe(this,"_progressiveDone",!1);oe(this,"_queuedChunks",[]);const{pdfDataRangeTransport:n}=t,{initialData:s,progressiveDone:i}=n;if((s==null?void 0:s.length)>0){const o=dM(s);this._queuedChunks.push(o)}this._progressiveDone=i;const a=o=>{var l;switch(o.type){case"range":case"progressiveRead":j(this,JS,E$).call(this,o.begin,o.chunk);break;case"progressiveDone":(l=this._fullReader)==null||l.progressiveDone(),this._progressiveDone=!0;break}};n.transportReady(a)}getFullReader(){const t=super.getFullReader();return this._queuedChunks=null,t}getRangeReader(t,n){const s=super.getRangeReader(t,n);return s&&(s.onDone=()=>this._rangeReaders.delete(s),this._source.pdfDataRangeTransport.requestDataRange(t,n)),s}cancelAllRequests(t){super.cancelAllRequests(t),this._source.pdfDataRangeTransport.abort()}}JS=new WeakSet,E$=function(t,n){const s=dM(n);if(t===void 0)this._fullReader?this._fullReader._enqueue(s):this._queuedChunks.push(s);else{const i=this._rangeReaders.keys().find(a=>a._begin===t);Ur(i,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),i._enqueue(s)}};var Aw;class zie extends sA{constructor(t){super(t);R(this,Aw,cA.bind(this));oe(this,"_done",!1);oe(this,"_queuedChunks",null);oe(this,"_requests",[]);const{pdfDataRangeTransport:n,disableRange:s,disableStream:i}=t._source,{length:a,contentDispositionFilename:o}=n;this._queuedChunks=t._queuedChunks||[];for(const c of this._queuedChunks)this._loaded+=c.byteLength;this._done=t._progressiveDone,this._contentLength=a,this._isStreamingSupported=!i,this._isRangeSupported=!s,xj(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,h(this,Aw).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&h(this,Aw).call(this)}}Aw=new WeakMap;var Tw;class Hie extends iA{constructor(t,n,s){super(t,n,s);R(this,Tw,cA.bind(this));oe(this,"onDone",null);oe(this,"_begin",-1);oe(this,"_done",!1);oe(this,"_queuedChunk",null);oe(this,"_requests",[]);this._begin=n}_enqueue(t){var n;this._done||(this._requests.length===0?this._queuedChunk=t:(this._requests.shift().resolve({value:t,done:!1}),h(this,Tw).call(this)),this._done=!0,(n=this.onDone)==null||n.call(this))}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){var n;this._done=!0,h(this,Tw).call(this),(n=this.onDone)==null||n.call(this)}}Tw=new WeakMap;const OT=200,hM=206;function Wie(r){return typeof r!="string"?r:eA(r).buffer}var Rl,Zx,A$,T$;
569class Vie extends nA{constructor(t){super(t,Gie,Kie);R(this,Zx);R(this,Rl,new WeakMap);oe(this,"_responseOrigin",null);const{httpHeaders:n,url:s}=t;this.url=s,this.isHttp=/https?:/.test(s.protocol),this.headers=y$(this.isHttp,n)}_request(t){const n=new XMLHttpRequest,s={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};h(this,Rl).set(n,s),n.open("GET",this.url),n.withCredentials=this._source.withCredentials;for(const[i,a]of this.headers)n.setRequestHeader(i,a);return this.isHttp&&"begin"in t&&"end"in t?(n.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.validateStatus=i=>i===hM||i===OT):s.validateStatus=i=>i===OT,n.responseType="arraybuffer",Ur(t.onError,"Expected `onError` callback to be provided."),n.onerror=()=>t.onError(n.status),n.onreadystatechange=j(this,Zx,T$).bind(this,n),n.onprogress=j(this,Zx,A$).bind(this,n),n.send(null),n}_abortRequest(t){h(this,Rl).has(t)&&(h(this,Rl).delete(t),t.abort())}getRangeReader(t,n){const s=super.getRangeReader(t,n);return s&&(s.onClosed=()=>this._rangeReaders.delete(s)),s}}Rl=new WeakMap,Zx=new WeakSet,A$=function(t,n){var i;const s=h(this,Rl).get(t);(i=s==null?void 0:s.onProgress)==null||i.call(s,n)},T$=function(t,n){const s=h(this,Rl).get(t);if(!s||(t.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),t.readyState!==4)||!h(this,Rl).has(t))return;if(h(this,Rl).delete(t),t.status===0&&this.isHttp){s.onError(t.status);return}const i=t.status||OT;if(!s.validateStatus(i)){s.onError(t.status);return}const a=Wie(t.response);if(i===hM){const o=t.getResponseHeader("Content-Range");/bytes \d+-\d+\/\d+/.test(o)?s.onDone(a):(mt('Missing or invalid "Content-Range" header.'),s.onError(0))}else a?s.onDone(a):s.onError(t.status)};var Cw,nc,C$,N$,P$,R$;class Gie extends sA{constructor(t){super(t);R(this,nc);R(this,Cw,cA.bind(this));oe(this,"_cachedChunks",[]);oe(this,"_done",!1);oe(this,"_requests",[]);oe(this,"_storedError",null);this._fullRequestXhr=t._request({onHeadersReceived:j(this,nc,C$).bind(this),onDone:j(this,nc,N$).bind(this),onError:j(this,nc,P$).bind(this),onProgress:j(this,nc,R$).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),h(this,Cw).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}}Cw=new WeakMap,nc=new WeakSet,C$=function(){const t=this._stream,{disableRange:n,rangeChunkSize:s}=t._source,i=this._fullRequestXhr;t._responseOrigin=aA(i.responseURL);const a=i.getAllResponseHeaders(),o=new Headers(a?a.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(u=>{const[f,...p]=u.split(": ");return[f,p.join(": ")]}):[]),{contentLength:l,isRangeSupported:c}=w$({responseHeaders:o,isHttp:t.isHttp,rangeChunkSize:s,disableRange:n});this._contentLength=l,this._isRangeSupported=c,this._filename=b$(o),this._isRangeSupported&&t._abortRequest(i),this._headersCapability.resolve()},N$=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&&h(this,Cw).call(this)},P$=function(t){this._storedError=oA(t,this._stream.url),this._headersCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0},R$=function(t){var n;(n=this.onProgress)==null||n.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})};var Nw,Pu,j$,O$,wP;class Kie extends iA{constructor(t,n,s){super(t,n,s);R(this,Pu);R(this,Nw,cA.bind(this));oe(this,"onClosed",null);oe(this,"_done",!1);oe(this,"_queuedChunk",null);oe(this,"_requests",[]);oe(this,"_storedError",null);this._requestXhr=t._request({begin:n,end:s,onHeadersReceived:j(this,Pu,j$).bind(this),onDone:j(this,Pu,O$).bind(this),onError:j(this,Pu,wP).bind(this),onProgress:null})}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){var n;
569this._done=!0,h(this,Nw).call(this),this._stream._abortRequest(this._requestXhr),(n=this.onClosed)==null||n.call(this)}}Nw=new WeakMap,Pu=new WeakSet,j$=function(){var n;const t=aA((n=this._requestXhr)==null?void 0:n.responseURL);try{_$(t,this._stream._responseOrigin)}catch(s){this._storedError=s,j(this,Pu,wP).call(this,0)}},O$=function(t){var n;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,h(this,Nw).call(this),(n=this.onClosed)==null||n.call(this)},wP=function(t){this._storedError??(this._storedError=oA(t,this._stream.url));for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null};function F$(r,e=null){const t=process.getBuiltinModule("fs"),{Readable:n}=process.getBuiltinModule("stream"),s=t.createReadStream(r,e);return n.toWeb(s)}class Xie extends nA{constructor(e){super(e,Yie,qie);const{url:t}=e;Ur(t.protocol==="file:","PDFNodeStream only supports file:// URLs.")}}class Yie extends sA{constructor(t){super(t);oe(this,"_reader",null);const{disableRange:n,disableStream:s,rangeChunkSize:i,url:a}=t._source;this._isStreamingSupported=!s,process.getBuiltinModule("fs/promises").lstat(a).then(l=>{const c=F$(a);this._reader=c.getReader();const{size:u}=l;this._contentLength=u,this._isRangeSupported=!n&&u>2*i,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Uh("Streaming is disabled.")),this._headersCapability.resolve()}).catch(l=>{l.code==="ENOENT"&&(l=oA(0,a)),this._headersCapability.reject(l)})}async read(){await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:lA(t),done:!1})}cancel(t){var n;(n=this._reader)==null||n.cancel(t)}}class qie extends iA{constructor(t,n,s){super(t,n,s);oe(this,"_readCapability",Promise.withResolvers());oe(this,"_reader",null);const{url:i}=t._source;try{const a=F$(i,{start:n,end:s-1});this._reader=a.getReader(),this._readCapability.resolve()}catch(a){this._readCapability.reject(a)}}async read(){await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:lA(t),done:!1}}cancel(t){var n;(n=this._reader)==null||n.cancel(t)}}function Zie(r){return Ry(r)?Lie:ra?Xie:Vie}var Pw,Rw;class Vl{static get workerPort(){return h(this,Pw)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");C(this,Pw,e)}static get workerSrc(){return h(this,Rw)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");C(this,Rw,e)}}Pw=new WeakMap,Rw=new WeakMap,R(Vl,Pw,null),R(Vl,Rw,"");var Dg,jw;class Jie{constructor({parsedData:e,rawData:t}){R(this,Dg);R(this,jw);C(this,Dg,e),C(this,jw,t)}getRaw(){return h(this,jw)}get(e){return h(this,Dg).get(e)??null}[Symbol.iterator](){return h(this,Dg).entries()}}Dg=new WeakMap,jw=new WeakMap;const dm=Symbol("INTERNAL");var Ow,Fw,Dw,Mg;class Qie{constructor(e,{name:t,intent:n,usage:s,rbGroups:i}){R(this,Ow,!1);R(this,Fw,!1);R(this,Dw,!1);R(this,Mg,!0);C(this,Ow,!!(e&ea.DISPLAY)),C(this,Fw,!!(e&ea.PRINT)),this.name=t,this.intent=n,this.usage=s,this.rbGroups=i}get visible(){if(h(this,Dw))return h(this,Mg);if(!h(this,Mg))return!1;const{print:e,view:t}=this.usage;return h(this,Ow)?(t==null?void 0:t.viewState)!=="OFF":h(this,Fw)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,t,n=!1){e!==dm&&Ut("Internal method `_setVisible` called."),C(this,Dw,n),C(this,Mg,t)}}Ow=new WeakMap,Fw=new WeakMap,Dw=new WeakMap,Mg=new WeakMap;var Ld,ar,Ig,Lg,Mw,bP;class eae{constructor(e,t=ea.DISPLAY){R(this,Mw);R(this,Ld,null);R(this,ar,new Map);R(this,Ig,null);R(this,Lg,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,C(this,Lg,e.order);for(const n of e.groups)h(this,ar).set(n.id,new Qie(t,n));if(e.baseState==="OFF")for(const n of h(this,ar).values())n._setVisible(dm,!1);for(const n of e.on)h(this,ar).get(n)._setVisible(dm,!0);for(const n of e.off)h(this,ar).get(n)._setVisible(dm,!1);C(this,Ig,this.getHash())}}isVisible(e){if(h(this,ar).size===0)return!0;
569if(!e)return QE("Optional content group not defined."),!0;if(e.type==="OCG")return h(this,ar).has(e.id)?h(this,ar).get(e.id).visible:(mt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return j(this,Mw,bP).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!h(this,ar).has(t))return mt(`Optional content group not found: ${t}`),!0;if(h(this,ar).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!h(this,ar).has(t))return mt(`Optional content group not found: ${t}`),!0;if(!h(this,ar).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!h(this,ar).has(t))return mt(`Optional content group not found: ${t}`),!0;if(!h(this,ar).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!h(this,ar).has(t))return mt(`Optional content group not found: ${t}`),!0;if(h(this,ar).get(t).visible)return!1}return!0}return mt(`Unknown optional content policy ${e.policy}.`),!0}return mt(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){var i;const s=h(this,ar).get(e);if(!s){mt(`Optional content group not found: ${e}`);return}if(n&&t&&s.rbGroups.length)for(const a of s.rbGroups)for(const o of a)o!==e&&((i=h(this,ar).get(o))==null||i._setVisible(dm,!1,!0));s._setVisible(dm,!!t,!0),C(this,Ld,null)}setOCGState({state:e,preserveRB:t}){let n;for(const s of e){switch(s){case"ON":case"OFF":case"Toggle":n=s;continue}const i=h(this,ar).get(s);if(i)switch(n){case"ON":this.setVisibility(s,!0,t);break;case"OFF":this.setVisibility(s,!1,t);break;case"Toggle":this.setVisibility(s,!i.visible,t);break}}C(this,Ld,null)}get hasInitialVisibility(){return h(this,Ig)===null||this.getHash()===h(this,Ig)}getOrder(){return h(this,ar).size?h(this,Lg)?h(this,Lg).slice():[...h(this,ar).keys()]:null}getGroup(e){return h(this,ar).get(e)||null}getHash(){if(h(this,Ld)!==null)return h(this,Ld);const e=new aP;for(const[t,n]of h(this,ar))e.update(`${t}:${n.visible}`);return C(this,Ld,e.hexdigest())}[Symbol.iterator](){return h(this,ar).entries()}}Ld=new WeakMap,ar=new WeakMap,Ig=new WeakMap,Lg=new WeakMap,Mw=new WeakSet,bP=function(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let s=1;s<t;s++){const i=e[s];let a;if(Array.isArray(i))a=j(this,Mw,bP).call(this,i);else if(h(this,ar).has(i))a=h(this,ar).get(i).visible;else return mt(`Optional content group not found: ${i}`),!0;switch(n){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return n==="And"};var cn,Co,ns,yp,jl,Os,sy,iy,Vk;class tae{constructor(){R(this,Os);R(this,cn,null);R(this,Co,null);R(this,ns,0);R(this,yp,null);R(this,jl,null)}get pagesNumber(){return h(this,ns)}set pagesNumber(e){h(this,ns)!==e&&(C(this,ns,e),C(this,cn,null),C(this,Co,null))}movePages(e,t,n){j(this,Os,sy).call(this);const s=h(this,cn),i=j(this,Os,iy).call(this),a=t.length,o=new Uint32Array(a);let l=0;for(let p=0;p<a;p++){const m=t[p]-1;o[p]=s[m],m<n&&l++}const c=h(this,ns),u=c-a,f=Pr(n-l,0,u);for(let p=0,m=0;p<c;p++)e.has(p+1)||(s[m++]=s[p]);s.copyWithin(f+a,f,u),s.set(o,f),j(this,Os,Vk).call(this,i),s.every((p,m)=>p===m+1)&&C(this,cn,null)}deletePages(e){j(this,Os,sy).call(this);const t=h(this,cn),n=j(this,Os,iy).call(this);C(this,jl,{pageNumberToId:t.slice(),pagesNumber:h(this,ns),prevPageNumbers:h(this,Co).slice()});const s=h(this,ns)-e.length;C(this,ns,s);const i=C(this,cn,new Uint32Array(s));C(this,Co,new Int32Array(s));let a=0,o=0;for(const l of e){const c=l-1;c!==a&&(i.set(t.subarray(a,c),o),o+=c-a),a=c+1}a<t.length&&i.set(t.subarray(a),o),j(this,Os,Vk).call(this,n,new Set(e))}cancelDelete(){h(this,jl)&&(C(this,cn,h(this,jl).pageNumberToId),C(this,ns,h(this,jl).pagesNumber),C(this,Co,h(this,jl).prevPageNumbers),C(this,jl,null))}cleanSavedData(){C(this,jl,null)}copyPages(e){j(this,Os,sy).call(this),C(this,yp,{pageNumbers:e,pageIds:e.map(t=>h(this,cn)[t-1])})}cancelCopy(){C(this,yp,null)}pastePages(e){j(this,Os,sy).call(this);const t=h(this,cn),n=j(this,Os,iy).call(this),{pageNumbers:s,pageIds:i}=h(this,yp),a=h(this,ns)+s.length;C(this,ns,a);const o=C(this,cn,new Uint32Array(a));
569C(this,Co,new Int32Array(a)),o.set(t.subarray(0,e),0),o.set(i,e),o.set(t.subarray(e),e+s.length),j(this,Os,Vk).call(this,n,null,e,s),C(this,yp,null)}hasBeenAltered(){return h(this,cn)!==null}getPageMappingForSaving(e=null){e??(e=j(this,Os,iy).call(this));let t=0;for(const s of e.values())t=Math.max(t,s.length);const n=new Array(t);for(let s=0;s<t;s++)n[s]={document:null,pageIndices:[],includePages:[]};for(const[s,i]of e)for(let a=0,o=i.length;a<o;a++)n[a].includePages.push([s-1,i[a]-1]);for(const{includePages:s,pageIndices:i}of n){s.sort((a,o)=>a[0]-o[0]);for(let a=0,o=s.length;a<o;a++)i.push(s[a][1]),s[a]=s[a][0]}return n}extractPages(e){e=Array.from(e).sort((n,s)=>n-s);const t=new Map;for(let n=0,s=e.length;n<s;n++){const i=this.getPageId(e[n]);t.getOrInsertComputed(i,fj).push(n+1)}return this.getPageMappingForSaving(t)}getPrevPageNumber(e){var t;return((t=h(this,Co))==null?void 0:t[e-1])??0}getPageNumber(e){if(!h(this,cn))return e;const t=h(this,cn);for(let n=0,s=h(this,ns);n<s;n++)if(t[n]===e)return n+1;return 0}getPageId(e){var t;return((t=h(this,cn))==null?void 0:t[e-1])??e}getMapping(){var e;return(e=h(this,cn))==null?void 0:e.subarray(0,this.pagesNumber)}}cn=new WeakMap,Co=new WeakMap,ns=new WeakMap,yp=new WeakMap,jl=new WeakMap,Os=new WeakSet,sy=function(){if(h(this,cn))return;const e=h(this,ns),t=C(this,cn,new Uint32Array(e));for(let n=0;n<e;n++)t[n]=n+1;C(this,Co,new Int32Array(t))},iy=function(){const e=new Map,t=h(this,cn);for(let n=0,s=h(this,ns);n<s;n++){const i=t[n],a=e.get(i);a?a.push(n+1):e.set(i,[n+1])}return e},Vk=function(e,t=null,n=-1,s=null){const i=h(this,Co),a=h(this,cn),o=n+((s==null?void 0:s.length)??0),l=new Map;for(let c=0,u=h(this,ns);c<u;c++){if(c>=n&&c<o){i[c]=-s[c-n];continue}const f=a[c],p=e.get(f);let m=l.get(f)||0;if(t&&p)for(;m<p.length&&t.has(p[m]);)m++;i[c]=p==null?void 0:p[m],l.set(f,m+1)}};const hm=Symbol("INITIAL_DATA"),fM=()=>({...Promise.withResolvers(),data:hm});var Ua;class D${constructor(){R(this,Ua,new Map)}get(e,t=null){if(t){const s=h(this,Ua).getOrInsertComputed(e,fM);return s.promise.then(()=>t(s.data)),null}const n=h(this,Ua).get(e);if(!n||n.data===hm)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=h(this,Ua).get(e);return!!t&&t.data!==hm}delete(e){const t=h(this,Ua).get(e);return!t||t.data===hm?!1:(h(this,Ua).delete(e),!0)}resolve(e,t=null){const n=h(this,Ua).getOrInsertComputed(e,fM);if(n.data!==hm)throw new Error(`Object already resolved ${e}.`);n.data=t,n.resolve()}clear(){var e;for(const{data:t}of h(this,Ua).values())(e=t==null?void 0:t.bitmap)==null||e.close();h(this,Ua).clear()}*[Symbol.iterator](){for(const[e,{data:t}]of h(this,Ua))t!==hm&&(yield[e,t])}}Ua=new WeakMap;const rae=1e5,pM=30;var cL,Bd,Vs,Iw,Lw,Bg,wp,$c,Bw,Uw,bp,$w,Ug,Ud,$g,zw,zg,_p,Hw,Ww,Hg,kp,Vw,Wg,Vg,Ru,M$,I$,_P,pa,Gk,kP,L$,B$;const Qn=class Qn{constructor({textContentSource:e,images:t,container:n,viewport:s}){R(this,Ru);R(this,Bd,Promise.withResolvers());R(this,Vs,null);R(this,Iw,!1);R(this,Lw,!!((cL=globalThis.FontInspector)!=null&&cL.enabled));R(this,Bg,null);R(this,wp,null);R(this,$c,null);R(this,Bw,0);R(this,Uw,0);R(this,bp,null);R(this,$w,null);R(this,Ug,0);R(this,Ud,0);R(this,$g,Object.create(null));R(this,zw,[]);R(this,zg,null);R(this,_p,[]);R(this,Hw,new WeakMap);R(this,Ww,null);var c;if(e instanceof ReadableStream)C(this,zg,e);else if(typeof e=="object")C(this,zg,new ReadableStream({start(u){u.enqueue(e),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');C(this,Vs,C(this,$w,n)),C(this,Bg,t),C(this,Ud,s.scale*rc.pixelRatio),C(this,Ug,s.rotation),C(this,$c,{div:null,properties:null,ctx:null});const{pageWidth:i,pageHeight:a,pageX:o,pageY:l}=s.rawDims;C(this,Ww,[1,0,0,-1,-o,l+a]),C(this,Uw,i),C(this,Bw,a),j(c=Qn,pa,L$).call(c),n.style.setProperty("--min-font-size",h(Qn,Wg)),_0(n,s),h(this,Bd).promise.finally(()=>{h(Qn,Vg).delete(this),C(this,$c,null),C(this,$g,null)}
569).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=gr.platform;return ct(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){h(this,Bg)&&h(this,Vs).append(h(this,Bg).render());const e=()=>{h(this,bp).read().then(({value:t,done:n})=>{if(n){h(this,Bd).resolve();return}h(this,wp)??C(this,wp,t.lang),Object.assign(h(this,$g),t.styles),j(this,Ru,M$).call(this,t.items),e()},h(this,Bd).reject)};return C(this,bp,h(this,zg).getReader()),h(Qn,Vg).add(this),e(),h(this,Bd).promise}update({viewport:e,onBefore:t=null}){var i;const n=e.scale*rc.pixelRatio,s=e.rotation;if(s!==h(this,Ug)&&(t==null||t(),C(this,Ug,s),_0(h(this,$w),{rotation:s})),n!==h(this,Ud)){t==null||t(),C(this,Ud,n);const a={div:null,properties:null,ctx:j(i=Qn,pa,Gk).call(i,h(this,wp))};for(const o of h(this,_p))a.properties=h(this,Hw).get(o),a.div=o,j(this,Ru,_P).call(this,a)}}cancel(){var t;const e=new Uh("TextLayer task cancelled.");(t=h(this,bp))==null||t.cancel(e).catch(()=>{}),C(this,bp,null),h(this,Bd).reject(e)}get textDivs(){return h(this,_p)}get textContentItemsStr(){return h(this,zw)}static cleanup(){if(!(h(this,Vg).size>0)){h(this,Hg).clear();for(const{canvas:e}of h(this,kp).values())e.remove();h(this,kp).clear()}}};Bd=new WeakMap,Vs=new WeakMap,Iw=new WeakMap,Lw=new WeakMap,Bg=new WeakMap,wp=new WeakMap,$c=new WeakMap,Bw=new WeakMap,Uw=new WeakMap,bp=new WeakMap,$w=new WeakMap,Ug=new WeakMap,Ud=new WeakMap,$g=new WeakMap,zw=new WeakMap,zg=new WeakMap,_p=new WeakMap,Hw=new WeakMap,Ww=new WeakMap,Hg=new WeakMap,kp=new WeakMap,Vw=new WeakMap,Wg=new WeakMap,Vg=new WeakMap,Ru=new WeakSet,M$=function(e){var s,i;if(h(this,Iw))return;(i=h(this,$c)).ctx??(i.ctx=j(s=Qn,pa,Gk).call(s,h(this,wp)));const t=h(this,_p),n=h(this,zw);for(const a of e){if(t.length>rae){mt("Ignoring additional textDivs for performance reasons."),C(this,Iw,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=h(this,Vs);C(this,Vs,document.createElement("span")),h(this,Vs).classList.add("markedContent"),a.id&&h(this,Vs).setAttribute("id",`${a.id}`),a.tag==="Artifact"&&(h(this,Vs).ariaHidden=!0),o.append(h(this,Vs))}else a.type==="endMarkedContent"&&C(this,Vs,h(this,Vs).parentNode);continue}n.push(a.str),j(this,Ru,I$).call(this,a)}},I$=function(e){var x;const t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};h(this,_p).push(t);const s=ke.transform(h(this,Ww),e.transform);let i=Math.atan2(s[1],s[0]);const a=h(this,$g)[e.fontName];a.vertical&&(i+=Math.PI/2);let o=h(this,Lw)&&a.fontSubstitution||a.fontFamily;o=Qn.fontFamilyMap.get(o)||o;const l=Math.hypot(s[2],s[3]),c=l*j(x=Qn,pa,B$).call(x,o,a,h(this,wp));let u,f;i===0?(u=s[4],f=s[5]-c):(u=s[4]+c*Math.sin(i),f=s[5]-c*Math.cos(i));const p=t.style;p.left=`${(100*u/h(this,Uw)).toFixed(2)}%`,p.top=`${(100*f/h(this,Bw)).toFixed(2)}%`,p.setProperty("--font-height",`${l.toFixed(2)}px`),p.fontFamily=o,n.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,h(this,Lw)&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),i!==0&&(n.angle=i*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const g=Math.abs(e.transform[0]),y=Math.abs(e.transform[3]);g!==y&&Math.max(g,y)/Math.min(g,y)>1.5&&(m=!0)}if(m&&(n.canvasWidth=a.vertical?e.height:e.width),h(this,Hw).set(t,n),h(this,$c).div=t,h(this,$c).properties=n,j(this,Ru,_P).call(this,h(this,$c)),n.hasText&&h(this,Vs).append(t),n.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),h(this,Vs).append(g)}},_P=function(e){var a;const{div:t,properties:n,ctx:s}=e,{style:i}=t;if(n.canvasWidth!==0&&n.hasText){const{fontFamily:o}=i,{canvasWidth:l,fontSize:c}=n;j(a=Qn,pa,kP).call(a,s,c*h(this,Ud),o);const{width:u}=s.measureText(t.textContent);u>0&&i.setProperty("--scale-x",l*h(this,Ud)/u)}n.angle!==0&&i.setProperty("--rotate",`${n.angle}deg`)},pa=new WeakSet,Gk=function(e=null){let t=h(this,kp).get(e||(e=""));if(!t){const n=document.createElement("canvas");n.style.cssText="position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),h(this,kp).set(e,t),h(this,Vw).set(t,{size:0,family:""})}return t},kP=function(e,t,n){const s=h(this,Vw).get(e);t===s.size&&n===s.family||(e.font=`${t}px ${n}`,s.size=t,s.family=n)},L$=function(){if(h(this,Wg)!==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),C(this,Wg,e.getBoundingClientRect().height),e.remove()},B$=function(e,t,n){const s=h(this,Hg).get(e);if(s)return s;const i=j(this,pa,Gk).call(this,n);i.canvas.width=i.canvas.height=pM,j(this,pa,kP).call(this,i,pM,e);const a=i.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let c=.8;return o?c=o/(o+l):(gr.platform.isFirefox&&mt("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)),h(this,Hg).set(e,c),c},R(Qn,pa),R(Qn,Hg,new Map),R(Qn,kp,new Map),R(Qn,Vw,new WeakMap),R(Qn,Wg,null),R(Qn,Vg,new Set);let C1=Qn;const nae=100;function U$(r={}){const e=new SP,{docId:t}=e,n=r.url?uie(r.url):null,s=r.data?die(r.data):null,i=r.httpHeaders||null,a=r.withCredentials===!0,o=r.password??null,l=r.range instanceof $$?r.range:null,c=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:2**16;let u=r.worker instanceof N1?r.worker:null;const f=r.verbosity,p=typeof r.docBaseUrl=="string"&&!tA(r.docBaseUrl)?r.docBaseUrl:null,m=H_(r.cMapUrl),x=r.cMapPacked!==!1,g=H_(r.iccUrl),y=H_(r.standardFontDataUrl),v=H_(r.wasmUrl),w=r.stopAtErrors!==!0,b=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,_=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!ra,T=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!ra,A=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,N=typeof r.disableFontFace=="boolean"?r.disableFontFace:ra,k=r.fontExtraProperties===!0,E=r.enableXfa===!0,P=r.ownerDocument||globalThis.document,O=r.disableRange===!0,D=r.disableStream===!0,H=r.disableAutoFetch===!0,B=r.pdfBug
569===!0,ee=r.CanvasFactory||(ra?yie:mie),X=r.FilterFactory||(ra?vie:gie),W=r.BinaryDataFactory||(ra?wie:eM),Y=r.enableHWA===!0,J=r.enableWebGPU===!0?kie():Promise.resolve(!1),ne=r.useWasm!==!1,I=r.pagesMapper||new tae,z=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!ra&&!N,M=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:!!(W===eM&&m&&x&&y&&v&&Ry(m,document.baseURI)&&Ry(y,document.baseURI)&&Ry(v,document.baseURI)),U=null;jse(f);const te={canvasFactory:new ee({ownerDocument:P,enableHWA:Y}),filterFactory:new X({docId:t,ownerDocument:P}),binaryDataFactory:M?null:new W({cMapUrl:m,standardFontDataUrl:y,wasmUrl:v})};u||(u=N1.create({verbosity:f,port:Vl.workerPort}),e._worker=u);const re={docId:t,apiVersion:"6.0.227",data:s,password:o,disableAutoFetch:H,rangeChunkSize:c,docBaseUrl:p,enableXfa:E,evaluatorOptions:{maxImageSize:b,disableFontFace:N,ignoreErrors:w,isOffscreenCanvasSupported:_,isImageDecoderSupported:T,canvasMaxAreaInBytes:A,fontExtraProperties:k,useSystemFonts:z,useWasm:ne,useWorkerFetch:M,cMapUrl:m,cMapPacked:x,iccUrl:g,standardFontDataUrl:y,wasmUrl:v,hasGPU:!1}},se={ownerDocument:P,pdfBug:B,styleElement:U,enableHWA:Y,loadingParams:{disableAutoFetch:H,enableXfa:E}};return Promise.all([u.promise,J]).then(function([,ie]){if(u.destroyed)throw new Error("Worker was destroyed");re.evaluatorOptions.hasGPU=ie;const ae=u.messageHandler.sendWithPromise("GetDocRequest",re,s?[s.buffer]:null);let ge;if(!s)if(l)ge=new $ie({pdfDataRangeTransport:l,disableRange:O,disableStream:D});else if(n){const G=Zie(n);ge=new G({url:n,httpHeaders:i,withCredentials:a,rangeChunkSize:c,disableRange:O,disableStream:D})}else throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");return ae.then(G=>{if(u.destroyed)throw new Error("Worker was destroyed");const Ue=new Qv(t,G,u.port),Re=new iae(Ue,e,ge,se,te,I);if(e._transport=Re,e.destroyed)throw new Error("Loading aborted");Ue.send("Ready",null)})}).catch(e._capability.reject).finally(e._setupCapability.resolve),e}var QS;const eE=class eE{constructor(){oe(this,"_capability",Promise.withResolvers());oe(this,"_setupCapability",Promise.withResolvers());oe(this,"_transport",null);oe(this,"_worker",null);oe(this,"docId",`d${tr(eE,QS)._++}`);oe(this,"destroyed",!1);oe(this,"onPassword",null);oe(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,t,n,s;this.destroyed=!0,this._capability.promise.catch(()=>{});try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await this._setupCapability.promise,await((t=this._transport)==null?void 0:t.destroy())}catch(i){throw(n=this._worker)!=null&&n.port&&delete this._worker._pendingDestroy,i}this._transport=null,(s=this._worker)==null||s.destroy(),this._worker=null}async getData(){return this._transport.getData()}};QS=new WeakMap,R(eE,QS,0);let SP=eE;var Gg,Sp;class $${constructor(e,t,n=!1,s=null){R(this,Gg,Promise.withResolvers());R(this,Sp,null);this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=s}onDataRange(e,t){h(this,Sp).call(this,{type:"range",begin:e,chunk:t})}onDataProgressiveRead(e){h(this,Gg).promise.then(()=>{h(this,Sp).call(this,{type:"progressiveRead",chunk:e})})}onDataProgressiveDone(){h(this,Gg).promise.then(()=>{h(this,Sp).call(this,{type:"progressiveDone"})})}transportReady(e){C(this,Sp,e),h(this,Gg).resolve()}requestDataRange(e,t){Ut("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}Gg=new WeakMap,Sp=new WeakMap;class sae{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 ct(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)}
569getDestinations(){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}getRawData(e){return this._transport.getRawData(e)}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}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 zc,Ep,Ap,ay;const _O=class _O{constructor(e,t,n,s,i=!1){R(this,Ap);R(this,zc,!1);R(this,Ep,null);this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new HD:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new D$,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,C(this,Ep,s),this.imageCoordinates=null}clone(e){const t=new _O(e,this._pageInfo,this._transport,h(this,Ep),this._pdfBug);return t.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(t),t}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1,this._transport.updatePage(this)}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:n=0,offsetY:s=0,dontFlip:i=!1}={}){return new Xb({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:s,dontFlip:i})}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 ct(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:n,intent:s="display",annotationMode:i=nd.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:u=null,printAnnotationStorage:f=null,isEditing:p=!1,recordImages:m=!1,recordOperations:x=!1,operationsFilter:g=null}){var H,B,ee;(H=this._stats)==null||H.time("Overall");const y=this._transport.getRenderingIntent(s,i,f,p),{renderingIntent:v,cacheKey:w}=y;C(this,zc,!1),l||(l=this._transport.getOptionalContentConfig(v));const b=this._intentStates.getOrInsertComputed(w,$N);b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const _=!!(v&ea.PRINT);b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(B=this._stats)==null||B.time("Page Request"),this._pumpOperatorList(y));const T=!!(this._pdfBug&&((ee=globalThis.StepperManager)!=null&&ee.enabled)),A=!!t&&!this.recordedBBoxes&&(x||T),N=!!t&&!this.imageCoordinates&&m,k=X=>{var W,Y,F,J;if(b.renderTasks.delete(O),A){const ne=(W=O.gfx)==null?void 0:W.dependencyTracker.take();ne&&((Y=O.stepper)==null||Y.setOperatorBBoxes(ne,O.gfx.dependencyTracker.takeDebugMetadata()),x&&(this.recordedBBoxes=ne))}N&&!X&&(this.imageCoordinates=(F=O.gfx)==null?void 0:F.imagesTracker.take()),_&&C(this,zc,!0),j(this,Ap,ay).call(this),X?(O.capability.reject(X),this._abortOperatorList({intentState:b,reason:X instanceof Error?X:new Error(X)})):O.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(J=globalThis.Stats)!=null&&J.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)
569)};let E=null,P=null;(A||N)&&(P=new tie(t,b.operatorList.length)),A&&(E=new rie(P,T));const O=new AP({callback:k,params:{canvas:t,canvasContext:e,dependencyTracker:E??P,imagesTracker:N?new cP(t):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!_,pdfBug:this._pdfBug,pageColors:u,enableHWA:this._transport.enableHWA,operationsFilter:g});(b.renderTasks||(b.renderTasks=new Set)).add(O);const D=O.task;return Promise.all([b.displayReadyCapability.promise,l]).then(([X,W])=>{var Y;if(this.destroyed){k();return}if((Y=this._stats)==null||Y.time("Rendering"),!(W.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");O.initializeGraphics({transparency:X,optionalContentConfig:W}),O.operatorListChanged()}).catch(k),D}getOperatorList({intent:e="display",annotationMode:t=nd.ENABLE,printAnnotationStorage:n=null,isEditing:s=!1}={}){var c;function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,t,n,s,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,$N);let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=i,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:h(this,Ep).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(s){return s.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>E1.textContent(s));const t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(const s of t)n.lang??(n.lang=s.lang),Object.assign(n.styles,s.styles),n.items.push(...s.items);return n}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 n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),C(this,zc,!1),Promise.all(e)}cleanup(e=!1){C(this,zc,!0);const t=j(this,Ap,ay).call(this);return e&&t&&this._stats&&(this._stats=new HD),t}_startRenderPage(e,t){var s,i;const n=this._intentStates.get(t);n&&((s=this._stats)==null||s.timeEnd("Page Request"),(i=n.displayReadyCapability)==null||i.resolve(e))}_renderPageChunk(e,t){for(let n=0,s=e.length;n<s;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const n of t.renderTasks)n.operatorListChanged();e.lastChunk&&j(this,Ap,ay).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:s}){const{map:i,transfer:a}=n,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:h(this,Ep).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:s},void 0,a).getReader(),c=this._intentStates.get(t);c.streamReader=l;const u=()=>{l.read().then(({value:f,done:p})=>{if(p){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,c),u())},f=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const p of c.renderTasks)p.operatorListChanged();j(this,Ap,ay).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(f);else if(c.opListReadCapability)c.opListReadCapability.reject(f);else throw f}})};u()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof gj){let s=nae;t.extraDelay>0&&t.extraDelay<1e3&&(s+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},s);return}}
569if(e.streamReader.cancel(new Uh(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[s,i]of this._intentStates)if(i===e){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}};zc=new WeakMap,Ep=new WeakMap,Ap=new WeakSet,ay=function(){if(!h(this,zc)||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(),C(this,zc,!1),!0};let EP=_O;var $d,No,Hc,Tp,tE,Cp,Np,ti,Kk,z$,H$,oy,Kg,Xk;const Gr=class Gr{constructor({name:e=null,port:t=null,verbosity:n=Ose()}={}){R(this,ti);R(this,$d,Promise.withResolvers());R(this,No,null);R(this,Hc,null);R(this,Tp,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,t){if(h(Gr,Np).has(t))throw new Error("Cannot use more than one PDFWorker per port.");h(Gr,Np).set(t,this),j(this,ti,z$).call(this,t)}else j(this,ti,H$).call(this)}get promise(){return h(this,$d).promise}get port(){return h(this,Hc)}get messageHandler(){return h(this,No)}destroy(){var e,t;this.destroyed=!0,(e=h(this,Tp))==null||e.terminate(),C(this,Tp,null),h(Gr,Np).delete(h(this,Hc)),C(this,Hc,null),(t=h(this,No))==null||t.destroy(),C(this,No,null)}static create(e){const t=h(this,Np).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 Gr(e)}static get workerSrc(){if(Vl.workerSrc)return Vl.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return ct(this,"_setupFakeWorkerGlobal",(async()=>h(this,Kg,Xk)?h(this,Kg,Xk):(await import(this.workerSrc)).WorkerMessageHandler)())}};$d=new WeakMap,No=new WeakMap,Hc=new WeakMap,Tp=new WeakMap,tE=new WeakMap,Cp=new WeakMap,Np=new WeakMap,ti=new WeakSet,Kk=function(){h(this,$d).resolve(),h(this,No).send("configure",{verbosity:this.verbosity})},z$=function(e){C(this,Hc,e),C(this,No,new Qv("main","worker",e)),h(this,No).on("ready",()=>{}),j(this,ti,Kk).call(this)},H$=function(){if(h(Gr,Cp)||h(Gr,Kg,Xk)){j(this,ti,oy).call(this);return}let{workerSrc:e}=Gr;try{Gr._isSameOrigin(window.location,e)||(e=Gr._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),n=new Qv("main","worker",t),s=()=>{i.abort(),n.destroy(),t.terminate(),this.destroyed?h(this,$d).reject(new Error("Worker was destroyed")):j(this,ti,oy).call(this)},i=new AbortController;t.addEventListener("error",()=>{h(this,Tp)||s()},{signal:i.signal}),n.on("test",o=>{if(i.abort(),this.destroyed||!o){s();return}C(this,No,n),C(this,Hc,t),C(this,Tp,t),j(this,ti,Kk).call(this)}),n.on("ready",o=>{if(i.abort(),this.destroyed){s();return}try{a()}catch{j(this,ti,oy).call(this)}});const a=()=>{const o=new Uint8Array;n.send("test",o,[o.buffer])};a();return}catch{QE("The worker has been disabled.")}j(this,ti,oy).call(this)},oy=function(){h(Gr,Cp)||(mt("Setting up fake worker."),C(Gr,Cp,!0)),Gr._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){h(this,$d).reject(new Error("Worker was destroyed"));return}const t=new pie;C(this,Hc,t);const n=`fake${tr(Gr,tE)._++}`,s=new Qv(n+"_worker",n,t);e.setup(s,t),C(this,No,new Qv(n,n+"_worker",t)),j(this,ti,Kk).call(this)}).catch(e=>{h(this,$d).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Kg=new WeakSet,Xk=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},R(Gr,Kg),R(Gr,tE,0),R(Gr,Cp,!1),R(Gr,Np,new WeakMap),ra&&(C(Gr,Cp,!0),Vl.workerSrc||(Vl.workerSrc="./pdf.worker.mjs")),Gr._isSameOrigin=(e,t)=>{const n=URL.parse(e);if(!(n!=null&&n.origin)||n.origin==="null")return!1;const s=new URL(t,n);return n.origin===s.origin},Gr._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};let N1=Gr;var $i,Pp,Wc,Po,Rp,Xg,Vc,Wo,ly,Yk;class iae{constructor(e,t,n,s,i,a){R(this,Wo);oe(this,"downloadInfoCapability",Promise.withResolvers());R(this,$i,null);R(this,Pp,new Map);R(this,Wc,null);R(this,Po,new Map);R(this,Rp,new Map);R(this,Xg,new Map);R(this,Vc,null);this.messageHandler=e,this.loadingTask=t,C(this,Wc,n),this.commonObjs=new D$,this.fontLoader=new nie({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.enableHWA=s.enableHWA,this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=i.
569canvasFactory,this.filterFactory=i.filterFactory,this.binaryDataFactory=i.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){const{_pageIndex:t}=e;h(this,Po).set(t,e),h(this,Rp).set(t,Promise.resolve(e))}get annotationStorage(){return ct(this,"annotationStorage",new vj)}getRenderingIntent(e,t=nd.ENABLE,n=null,s=!1,i=!1){let a=ea.DISPLAY,o=A1;switch(e){case"any":a=ea.ANY;break;case"display":break;case"print":a=ea.PRINT;break;default:mt(`getRenderingIntent - invalid intent: ${e}`)}const l=a&ea.PRINT&&n instanceof a$?n:this.annotationStorage;switch(t){case nd.DISABLE:a+=ea.ANNOTATIONS_DISABLE;break;case nd.ENABLE:break;case nd.ENABLE_FORMS:a+=ea.ANNOTATIONS_FORMS;break;case nd.ENABLE_STORAGE:a+=ea.ANNOTATIONS_STORAGE,o=l.serializable;break;default:mt(`getRenderingIntent - invalid annotationMode: ${t}`)}s&&(a+=ea.IS_EDITING),i&&(a+=ea.OPLIST);const{ids:c,hash:u}=l.modifiedIds,f=[a,o.hash,u];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var n;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(n=h(this,Vc))==null||n.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of h(this,Po).values())e.push(s._destroy());h(this,Po).clear(),h(this,Rp).clear(),h(this,Xg).clear(),Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{var s,i;this.commonObjs.clear(),this.fontLoader.clear(),h(this,Pp).clear(),this.filterFactory.destroy(),C1.cleanup(),(s=h(this,Wc))==null||s.cancelAllRequests(new Uh("Worker was terminated.")),(i=this.messageHandler)==null||i.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(n,s)=>{Ur(h(this,Wc),"GetReader - no `BasePDFStream` instance available."),C(this,$i,h(this,Wc).getFullReader()),h(this,$i).onProgress=i=>j(this,Wo,Yk).call(this,i),s.onPull=()=>{h(this,$i).read().then(function({value:i,done:a}){if(a){s.close();return}Ur(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(i),1,[i])}).catch(i=>{s.error(i)})},s.onCancel=i=>{h(this,$i).cancel(i),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async n=>{await h(this,$i).headersReady;const{isStreamingSupported:s,isRangeSupported:i,contentLength:a}=h(this,$i);return s&&i&&(h(this,$i).onProgress=null),{isStreamingSupported:s,isRangeSupported:i,contentLength:a}}),e.on("GetRangeReader",(n,s)=>{Ur(h(this,Wc),"GetRangeReader - no `BasePDFStream` instance available.");const i=h(this,Wc).getRangeReader(n.begin,n.end);if(!i){s.close();return}s.onPull=()=>{i.read().then(function({value:a,done:o}){if(o){s.close();return}Ur(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{s.error(a)})},s.onCancel=a=>{i.cancel(a),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:n})=>{this.pagesMapper.pagesNumber=n.numPages,this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new sae(n,this))}),e.on("DocException",n=>{t._capability.reject(ci(n))}),e.on("PasswordRequest",n=>{C(this,Vc,Promise.withResolvers());try{if(!t.onPassword)throw ci(n);const s=i=>{i instanceof Error?h(this,Vc).reject(i):h(this,Vc).resolve({password:i})};t.onPassword(s,n.code)}catch(s){h(this,Vc).reject(s)}return h(this,Vc).promise}),e.on("DataLoaded",n=>{j(this,Wo,Yk).call(this,{loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;h(this,Po).get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,s,i])=>{var a;if(this.destroyed||this.commonObjs.has(n))return null;switch(s){case"Font":if("error"in i){const p=i.error;mt(`Error during font loading: ${p}`),this.commonObjs.resolve(n,p);break}const o=new oie(i),l=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(p,m)=>globalThis.FontInspector.fontAdded(p,m):null,c=new sie(o,l,i.charProcOperatorList,i.extra);this.fontLoader.bind(c).catch(()=>
569e.sendWithPromise("FontFallback",{id:n})).finally(()=>{c.fontExtraProperties||c.clearData(),this.commonObjs.resolve(n,c)});break;case"CopyLocalImage":const{imageRef:u}=i;Ur(u,"The imageRef must be defined.");for(const p of h(this,Po).values())for(const[,m]of p.objs){if((m==null?void 0:m.ref)!==u)continue;if(!m.dataLen)return null;const x=structuredClone(m);return this.commonObjs.resolve(n,x),m.dataLen}break;case"FontPath":this.commonObjs.resolve(n,new cie(i));break;case"Image":this.commonObjs.resolve(n,i);break;case"Pattern":const f=new lie(i);this.commonObjs.resolve(n,f.getIR());break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),e.on("obj",([n,s,i,a])=>{var l;if(this.destroyed)return;const o=h(this,Po).get(s);if(!o.objs.has(n)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(i){case"Image":case"Pattern":o.objs.resolve(n,a);break;default:throw new Error(`Got unknown object type ${i}`)}}}),e.on("DocProgress",n=>{this.destroyed||j(this,Wo,Yk).call(this,n)}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.binaryDataFactory)throw new Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var n;this.annotationStorage.size<=0&&mt("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:((n=h(this,$i))==null?void 0:n.filename)??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){var i;const t={pageInfos:e};let n;const s=globalThis.ImageBitmap;if(typeof s=="function"){const a=Array.isArray(e)?e:[e];for(const o of a)(o==null?void 0:o.image)instanceof s&&(n||(n=[])).push(o.image)}if(this.annotationStorage.size>0){const a=this.annotationStorage.serializable;let{map:o}=a;(i=a.transfer)!=null&&i.length&&(n?n.push(...a.transfer):n=a.transfer);const l=this.pagesMapper.getMapping();if(l){const c=new Map;for(const[u,f]of o){if((f==null?void 0:f.pageIndex)!==void 0&&f.pageIndex>=0&&f.pageIndex<l.length){const p=l[f.pageIndex]-1;if(p!==f.pageIndex){c.set(u,{...f,pageIndex:p});continue}}c.set(u,f)}o=c}t.annotationStorage=o}return this.messageHandler.sendWithPromise("ExtractPages",t,n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.pagesMapper.getPageId(e)-1,s=h(this,Rp).get(t);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&h(this,Xg).set(a.refStr,n);const o=new EP(t,a,this,this.pagesMapper,this._params.pdfBug);return h(this,Po).set(t,o),o});return h(this,Rp).set(t,i),i}async getPageIndex(e){if(!dP(e))throw new Error("Invalid pageIndex request.");const t=await this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw new Error("GetPageIndex: page has been removed.");return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return j(this,Wo,ly).call(this,"GetFieldObjects")}hasJSActions(){return j(this,Wo,ly).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)}
569getPageLayout(){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 j(this,Wo,ly).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 j(this,Wo,ly).call(this,"GetOptionalContentConfig").then(t=>new eae(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata";return h(this,Pp).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(t=>{var n,s;return{info:t[0],metadata:t[1]?new Jie(t[1]):null,contentDispositionFilename:((n=h(this,$i))==null?void 0:n.filename)??null,contentLength:((s=h(this,$i))==null?void 0:s.contentLength)??null,hasStructTree:t[2]}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}getRawData(e){return this.messageHandler.sendWithPromise("GetRawData",e)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of h(this,Po).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),h(this,Pp).clear(),this.filterFactory.destroy(!0),C1.cleanup()}}cachedPageNumber(e){if(!dP(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=h(this,Xg).get(t);if(n>=0){const s=this.pagesMapper.getPageNumber(n+1);if(s!==0)return s}return null}}$i=new WeakMap,Pp=new WeakMap,Wc=new WeakMap,Po=new WeakMap,Rp=new WeakMap,Xg=new WeakMap,Vc=new WeakMap,Wo=new WeakSet,ly=function(e,t=null){return h(this,Pp).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))},Yk=function({loaded:e,total:t}){var n,s;(s=(n=this.loadingTask).onProgress)==null||s.call(n,{loaded:e,total:t,percent:t?Pr(Math.round(e/t*100),0,100):NaN})};class aae{constructor(e){oe(this,"_internalRenderTask",null);oe(this,"onContinue",null);oe(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}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}}var zd,jp;const yf=class yf{constructor({callback:e,params:t,objs:n,commonObjs:s,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:f=!1,pageColors:p=null,enableHWA:m=!1,operationsFilter:x=null}){R(this,zd,null);this.callback=e,this.params=t,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=i,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=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new aae(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=m,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=x}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){var c,u;if(this.cancelled)return;
569if(this._canvas){if(h(yf,jp).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.");h(yf,jp).add(this._canvas)}this._pdfBug&&((c=globalThis.StepperManager)!=null&&c.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:n,transform:s,background:i,dependencyTracker:a,imagesTracker:o}=this.params,l=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new zm(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,a,o),this.gfx.beginDrawing({transform:s,viewport:n,transparency:e,background:i}),this.operatorListIdx=0,this.graphicsReady=!0,(u=this.graphicsReadyCallback)==null||u.call(this)}cancel(e=null,t=0){var n,s,i;this.running=!1,this.cancelled=!0,(n=this.gfx)==null||n.endDrawing(),h(this,zd)&&(window.cancelAnimationFrame(h(this,zd)),C(this,zd,null)),h(yf,jp).delete(this._canvas),e||(e=new gj(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(e),(i=(s=this.task).onError)==null||i.call(s,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?C(this,zd,window.requestAnimationFrame(()=>{C(this,zd,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(),h(yf,jp).delete(this._canvas),this.callback())))}};zd=new WeakMap,jp=new WeakMap,R(yf,jp,new WeakSet);let AP=yf;const oae="6.0.227",lae="241dbabbf";var zi,Op,Yg,En,Gw,qg,Gc,Kw,Hd,Ro,Xw,or,TP,CP,NP,ff,W$,Xu;const ui=class ui{constructor({editor:e=null,uiManager:t=null}){R(this,or);R(this,zi,null);R(this,Op,null);R(this,Yg);R(this,En,null);R(this,Gw,!1);R(this,qg,!1);R(this,Gc,null);R(this,Kw);R(this,Hd,null);R(this,Ro,null);var n,s;e?(C(this,qg,!1),C(this,Gc,e)):C(this,qg,!0),C(this,Ro,(e==null?void 0:e._uiManager)||t),C(this,Kw,h(this,Ro)._eventBus),C(this,Yg,((n=e==null?void 0:e.color)==null?void 0:n.toUpperCase())||((s=h(this,Ro))==null?void 0:s.highlightColors.values().next().value)||"#FFFF98"),h(ui,Xw)||C(ui,Xw,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 ct(this,"_keyboardManager",new Zb([[["Escape","mac+Escape"],ui.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ui.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ui.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ui.prototype._moveToPrevious],[["Home","mac+Home"],ui.prototype._moveToBeginning],[["End","mac+End"],ui.prototype._moveToEnd]]))}renderButton(){const e=C(this,zi,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",h(this,Gc)&&(e.ariaControls=`${h(this,Gc).id}_colorpicker_dropdown`);const t=h(this,Ro)._signal;e.addEventListener("click",j(this,or,ff).bind(this),{signal:t}),e.addEventListener("keydown",j(this,or,NP).bind(this),{signal:t});const n=C(this,Op,document.createElement("span"));return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=h(this,Yg),e.append(n),e}renderMainDropdown(){const e=C(this,En,j(this,or,TP).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===h(this,zi)){j(this,or,ff).call(this,e);return}const t=e.target.getAttribute("data-color");t&&j(this,or,CP).call(this,t,e)}_moveToNext(e){var t,n;if(!h(this,or,Xu)){j(this,or,ff).call(this,e);return}if(e.target===h(this,zi)){(t=h(this,En).firstElementChild)==null||t.focus();return}(n=e.target.nextSibling)==null||n.focus()}_moveToPrevious(e){var t,n;if(e.target===((t=h(this,En))==null?void 0:t.firstElementChild)||e.target===h(this,zi)){h(this,or,Xu)&&this._hideDropdownFromKeyboard();return}h(this,or,Xu)||j(this,or,ff).call(this,e),(n=e.target.previousSibling)==null||n.focus()}_moveToBeginning(e){var t;if(!h(this,or,Xu)){j(this,or,ff).call(this,e);return}(t=h(this,En).firstElementChild)==null||t.focus()}_moveToEnd(e){var t;if(!h(this,or,Xu)){j(this,or,ff).call(this,e);return}(t=h(this,En).lastElementChild)==null||t.focus()}hideDropdown(){var e,t;(e=h(this,En))==null||e.classList.add("hidden"),h(this,zi).ariaExpanded="false",(t=h(this,Hd))==null||t.abort(),C(this,Hd,null)}_hideDropdownFromKeyboard(){var e;
569if(!h(this,qg)){if(!h(this,or,Xu)){(e=h(this,Gc))==null||e.unselect();return}this.hideDropdown(),h(this,zi).focus({preventScroll:!0,focusVisible:h(this,Gw)})}}updateColor(e){if(h(this,Op)&&(h(this,Op).style.backgroundColor=e),!h(this,En))return;const t=h(this,Ro).highlightColors.values();for(const n of h(this,En).children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){var e,t;(e=h(this,zi))==null||e.remove(),C(this,zi,null),C(this,Op,null),(t=h(this,En))==null||t.remove(),C(this,En,null)}};zi=new WeakMap,Op=new WeakMap,Yg=new WeakMap,En=new WeakMap,Gw=new WeakMap,qg=new WeakMap,Gc=new WeakMap,Kw=new WeakMap,Hd=new WeakMap,Ro=new WeakMap,Xw=new WeakMap,or=new WeakSet,TP=function(){const e=document.createElement("div"),t=h(this,Ro)._signal;e.addEventListener("contextmenu",so,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),h(this,Gc)&&(e.id=`${h(this,Gc).id}_colorpicker_dropdown`);for(const[n,s]of h(this,Ro).highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",s),i.title=n,i.setAttribute("data-l10n-id",h(ui,Xw)[n]);const a=document.createElement("span");i.append(a),a.className="swatch",a.style.backgroundColor=s,i.ariaSelected=s===h(this,Yg),i.addEventListener("click",j(this,or,CP).bind(this,s),{signal:t}),e.append(i)}return e.addEventListener("keydown",j(this,or,NP).bind(this),{signal:t}),e},CP=function(e,t){t.stopPropagation(),h(this,Kw).dispatch("switchannotationeditorparams",{source:this,type:pt.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},NP=function(e){ui._keyboardManager.exec(this,e)},ff=function(e){if(h(this,or,Xu)){this.hideDropdown();return}if(C(this,Gw,e.detail===0),h(this,Hd)||(C(this,Hd,new AbortController),window.addEventListener("pointerdown",j(this,or,W$).bind(this),{signal:h(this,Ro).combinedSignal(h(this,Hd))})),h(this,zi).ariaExpanded="true",h(this,En)){h(this,En).classList.remove("hidden");return}const t=C(this,En,j(this,or,TP).call(this));h(this,zi).append(t)},W$=function(e){var t;(t=h(this,En))!=null&&t.contains(e.target)||this.hideDropdown()},Xu=function(){return h(this,En)&&!h(this,En).classList.contains("hidden")},R(ui,Xw,null);let mS=ui;var Hi,Zg,Fp,Kc,Yw;const wf=class wf{constructor(e){R(this,Hi,null);R(this,Zg,!1);R(this,Fp,null);R(this,Kc,null);C(this,Fp,e),C(this,Kc,e._uiManager),h(wf,Yw)||C(wf,Yw,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(h(this,Hi))return h(this,Hi);const{editorType:e,colorType:t,colorAndOpacityType:n,opacityType:s,color:i,opacity:a}=h(this,Fp),o=C(this,Zg,gr.isAlphaColorInputSupported&&s!==void 0),l=C(this,Hi,document.createElement("input"));if(l.type="color",o){l.setAttribute("alpha","");const c=ke.hexNums[Math.round((a??1)*255)];l.value=(i||"#000000")+c}else l.value=i||"#000000";return l.className="basicColorPicker",l.tabIndex=0,l.setAttribute("data-l10n-id",h(wf,Yw)[e]),l.addEventListener("input",()=>{if(o){const c=Yb(l.value);if(!c)return;const[u,f,p,m]=c,x=ke.makeHexColor(u,f,p);n!==void 0?h(this,Kc).updateParams(n,{color:x,opacity:m}):(h(this,Kc).updateParams(t,x),h(this,Kc).updateParams(s,m))}else h(this,Kc).updateParams(t,l.value)},{signal:h(this,Kc)._signal}),l}update(e){if(h(this,Hi))if(h(this,Zg)){const t=ke.hexNums[Math.round(h(this,Fp).opacity*255)];h(this,Hi).value=e+t}else h(this,Hi).value=e}updateOpacity(e){if(!h(this,Hi)||!h(this,Zg))return;const t=ke.hexNums[Math.round(e*255)];h(this,Hi).value=h(this,Fp).color+t}destroy(){var e;(e=h(this,Hi))==null||e.remove(),C(this,Hi,null)}hideDropdown(){}};Hi=new WeakMap,Zg=new WeakMap,Fp=new WeakMap,Kc=new WeakMap,Yw=new WeakMap,R(wf,Yw,null);let gS=wf;function mM(r){return Math.floor(Pr(r,0,1)*255).toString(16).padStart(2,"0")}function Dv(r){return Pr(r,0,1)*255}class gM{static CMYK_G([e,t,n,s]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+s)]}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=Dv(e),[e,e,e]}static G_HTML([e]){const t=mM(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(Dv)}static RGB_HTML(e){return`#${e.map(mM).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,s]){return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,t+s)]}static CMYK_rgb([e,t,n,s]){return[Dv(1-Math.min(1,e+s)),Dv(1-Math.min(1,n+s)),Dv(1-Math.min(1,t+s))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const s=1-e,i=1-t,a=1-n,o=Math.min(s,i,a);return["CMYK",s,i,a,o]}}class cae{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),n||(s.setAttribute("width",`${e}px`),s.setAttribute("height",`${t}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${e} ${t}`),s}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Ut("Abstract method `_createSVG` called.")}}class xS extends cae{_createSVG(e){return document.createElementNS(Mi,e)}}const uae=9,S0=new WeakSet,dae=new Date().getTimezoneOffset()*60*1e3;class FT{static create(e){switch(e.data.annotationType){case gn.LINK:return new wj(e);case gn.TEXT:return new fae(e);case gn.WIDGET:switch(e.data.fieldType){case"Tx":return new pae(e);case"Btn":return e.data.radioButton?new K$(e):e.data.checkBox?new gae(e):new xae(e);case"Ch":return new vae(e);case"Sig":return new mae(e)}return new I0(e);case gn.POPUP:return new RP(e);case gn.FREETEXT:return new J$(e);case gn.LINE:return new wae(e);case gn.SQUARE:return new bae(e);case gn.CIRCLE:return new _ae(e);case gn.POLYLINE:return new Q$(e);case gn.CARET:return new Sae(e);case gn.INK:return new bj(e);case gn.POLYGON:return new kae(e);case gn.HIGHLIGHT:return new e9(e);case gn.UNDERLINE:return new Eae(e);case gn.SQUIGGLY:return new Aae(e);case gn.STRIKEOUT:return new Tae(e);case gn.STAMP:return new t9(e);case gn.FILEATTACHMENT:return new Cae(e);default:return new Wr(e)}}}var Dp,Jg,$a,qw,PP;const kO=class kO{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:s=!1}={}){R(this,qw);R(this,Dp,null);R(this,Jg,!1);R(this,$a,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(n)),s&&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 kO._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var n;const{data:e}=this,t=(n=this.annotationStorage)==null?void 0:n.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}
569get 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:n,rect:s}=this.data;let i=-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],i=t[l+2]):t[l+1]===a&&(i=Math.max(i,t[l+2]));return[i,a]}if((n==null?void 0:n.length)>=1){for(const l of n)for(let c=0,u=l.length;c<u;c+=2)l[c+1]>a?(a=l[c+1],i=l[c]):l[c+1]===a&&(i=Math.max(i,l[c]));if(i!==1/0)return[i,a]}return s?[s[2],s[3]]:null}_normalizePoint(e){const{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:s,pageX:i,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/n,e[1]=100*(e[1]-a)/s,e}get commentText(){var t,n,s;const{data:e}=this;return((n=(t=this.annotationStorage.getRawValue(`${S1}${e.id}`))==null?void 0:t.popup)==null?void 0:n.contents)||((s=e.contentsObj)==null?void 0:s.str)||""}set commentText(e){const{data:t}=this,n={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${S1}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){var e,t;(t=((e=h(this,$a))==null?void 0:e.popup)||this.popup)==null||t.remove(),C(this,$a,this.popup=null)}updateEdited(e){var i;if(!this.container)return;e.rect&&(h(this,Dp)||C(this,Dp,{rect:this.data.rect.slice(0)}));const{rect:t,popup:n}=e;t&&j(this,qw,PP).call(this,t);let s=((i=h(this,$a))==null?void 0:i.popup)||this.popup;!s&&(n!=null&&n.text)&&(this._createPopup(n),s=h(this,$a).popup),s&&(s.updateEdited(e),n!=null&&n.deleted&&(s.remove(),C(this,$a,null),this.popup=null))}resetEdited(){var e;h(this,Dp)&&(j(this,qw,PP).call(this,h(this,Dp).rect),(e=h(this,$a))==null||e.popup.resetEdited(),C(this,Dp,null))}_createContainer(e){const{data:t,parent:{page:n,viewport:s}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),!(this instanceof I0)&&!(this instanceof wj)&&(i.tabIndex=0);const{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add("norotate"),!t.rect||this instanceof RP){const{rotation:g}=t;return!t.hasOwnCanvas&&g!==0&&this.setRotation(g,i),i}const{width:o,height:l}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;const g=t.borderStyle.horizontalCornerRadius,y=t.borderStyle.verticalCornerRadius;if(g>0||y>0){const w=`calc(${g}px * var(--total-scale-factor)) / calc(${y}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof K$){const w=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=w}switch(t.borderStyle.style){case cm.SOLID:a.borderStyle="solid";break;case cm.DASHED:a.borderStyle="dashed";break;case cm.BEVELED:mt("Unimplemented border style: beveled");break;case cm.INSET:mt("Unimplemented border style: inset");break;case cm.UNDERLINE:a.borderBottomStyle="solid";break}const v=t.borderColor||null;v?(C(this,Jg,!0),a.borderColor=ke.makeHexColor(...v)):a.borderWidth=0}const c=ke.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:u,pageHeight:f,pageX:p,pageY:m}=s.rawDims;a.left=`${100*(c[0]-p)/u}%`,a.top=`${100*(c[1]-m)/f}%`;const{rotation:x}=t;return t.hasOwnCanvas||x===0?(a.width=`${100*o/u}%`,a.height=`${100*l/f}%`):this.setRotation(x,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:s}=this.parent.viewport.rawDims;let{width:i,height:a}=this;e%180!==0&&([i,a]=[a,i]),t.style.width=`${100*i/n}%`,t.style.height=`${100*a/s}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,n,s)=>{const i=s.detail[t],a=i[0],o=i.slice(1);s.target.style[n]=gM[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[n]:gM[`${a}_rgb`](o)})};return ct(this,"_commonActions",{display:t=>{const{display:n}=t.detail,s=n%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:n===1||n===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:n}=t.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},focus:t=>{setTimeout(()=>
569t.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 n=t.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const s of Object.keys(t.detail)){const i=e[s]||n[s];i==null||i(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[s,i]of Object.entries(t)){const a=n[s];if(a){const o={detail:{[s]:i},target:e};a(o),delete t[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,s,i]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,y,v,w]=e.subarray(2,6);if(s===g&&i===y&&t===v&&n===w)return}const{style:a}=this.container;let o;if(h(this,Jg)){const{borderColor:g,borderWidth:y}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",`<svg xmlns="${Mi}" preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${g}" stroke-width="${y}">`],this.container.classList.add("hasBorder")}const l=s-t,c=i-n,{svgFactory:u}=this,f=u.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0),f.role="none";const p=u.createElement("defs");f.append(p);const m=u.createElement("clipPath"),x=`clippath_${this.data.id}`;m.setAttribute("id",x),m.setAttribute("clipPathUnits","objectBoundingBox"),p.append(m);for(let g=2,y=e.length;g<y;g+=8){const v=e[g],w=e[g+1],b=e[g+2],_=e[g+3],T=u.createElement("rect"),A=(b-t)/l,N=(i-w)/c,k=(v-b)/l,E=(w-_)/c;T.setAttribute("x",A),T.setAttribute("y",N),T.setAttribute("width",k),T.setAttribute("height",E),m.append(T),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${N}" width="${k}" height="${E}"/>`)}h(this,Jg)&&(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 n,s;e?(n={str:e.text},s=e.date):(n=t.contentsObj,s=t.modificationDate),C(this,$a,new RP({data:{color:t.color,titleObj:t.titleObj,modificationDate:s,contentsObj:n,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!!(h(this,$a)||this.popup||this.data.popupRef)}get extraPopupElement(){return h(this,$a)}render(){Ut("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const s=this._fieldObjects[e];if(s)for(const{page:i,id:a,exportValues:o}of s){if(i===-1||a===t)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!S0.has(c)){mt(`_getElementsByName - element not allowed: ${a}`);continue}n.push({id:a,exportValue:l,domElement:c})}return n}for(const s of document.getElementsByName(e)){const{exportValue:i}=s,a=s.getAttribute("data-element-id");a!==t&&S0.has(s)&&n.push({id:a,exportValue:i,domElement:s})}return n}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 n;(n=this.linkService.eventBus)==null||n.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}updateOC(e){if(!this.data.oc||!e)return;e.isVisible(this.data.oc)?this.show():this.hide()}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};Dp=new WeakMap,Jg=new WeakMap,$a=new WeakMap,qw=new WeakSet,PP=function(e){const{container:{style:t},data:{rect:n,rotation:s},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:l}}}}=this;n==null||n.splice(0,4,...e),t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+l)/a}%`,s===0?(t.width=`${100*(e[2]-e[0])/i}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(s)};let Wr=kO;class hae extends Wr{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}
569get 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 oa,pf,V$,G$;class wj extends Wr{constructor(t,n=null){super(t,{isRenderable:!0,ignoreBorder:!!(n!=null&&n.ignoreBorder),createQuadrilaterals:!0});R(this,oa);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:n}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let i=!1;return t.url?(n.addLinkAttributes(s,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(s,t.action,t.overlaidText),i=!0):t.attachment?(j(this,oa,V$).call(this,s,t.attachment,t.overlaidText,t.attachmentDest),i=!0):t.setOCGState?(j(this,oa,G$).call(this,s,t.setOCGState,t.overlaidText),i=!0):t.dest?(this._bindLink(s,t.dest,t.overlaidText),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,t),i=!0),t.resetForm?(this._bindResetFormAction(s,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(this.contentElement=s,this.container.append(s)),this.container}_bindLink(t,n,s=""){t.href=this.linkService.getDestinationHash(n),t.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&j(this,oa,pf).call(this),s&&(t.title=s)}_bindNamedAction(t,n,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(n),!1),s&&(t.title=s),j(this,oa,pf).call(this)}_bindJSAction(t,n){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(n.actions)){const a=s.get(i);a&&(t[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:i}}),!1})}n.overlaidText&&(t.title=n.overlaidText),t.onclick||(t.onclick=()=>!1),j(this,oa,pf).call(this)}_bindResetFormAction(t,n){const s=t.onclick;if(s||(t.href=this.linkService.getAnchorUrl("")),j(this,oa,pf).call(this),!this._fieldObjects){mt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(t.onclick=()=>!1);return}t.onclick=()=>{var f;s==null||s();const{fields:i,refs:a,include:o}=n,l=[];if(i.length!==0||a.length!==0){const p=new Set(a);for(const m of i){const x=this._fieldObjects[m]||[];for(const{id:g}of x)p.add(g)}for(const m of Object.values(this._fieldObjects))for(const x of m)p.has(x.id)===o&&l.push(x)}else for(const p of Object.values(this._fieldObjects))l.push(...p);const c=this.annotationStorage,u=[];for(const p of l){const{id:m}=p;switch(u.push(m),p.type){case"text":{const g=p.defaultValue||"";c.setValue(m,{value:g});break}case"checkbox":case"radiobutton":{const g=p.defaultValue===p.exportValues;c.setValue(m,{value:g});break}case"combobox":case"listbox":{const g=p.defaultValue||"";c.setValue(m,{value:g});break}default:continue}const x=document.querySelector(`[data-element-id="${m}"]`);if(x){if(!S0.has(x)){mt(`_bindResetFormAction - element not allowed: ${m}`);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:u,name:"ResetForm"}})),!1}}}oa=new WeakSet,pf=function(){this.container.setAttribute("data-internal-link","")},V$=function(t,n,s="",i=null){t.href=this.linkService.getAnchorUrl(""),n.description?t.title=n.description:s&&(t.title=s),t.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(n.content,n.filename,i),!1},j(this,oa,pf).call(this)},G$=function(t,n,s=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(n),!1),s&&(t.title=s),j(this,oa,pf).call(this)};class fae extends Wr{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}}
569class I0 extends Wr{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 gr.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,s,i){n.includes("mouse")?e.addEventListener(n,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(n,a=>{var o;if(n==="blur"){if(!t.focused||!a.relatedTarget)return;t.focused=!1}else if(n==="focus"){if(t.focused)return;t.focused=!0}i&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(a)}}))})}_setEventListeners(e,t,n,s){var i,a,o;for(const[l,c]of n)(c==="Action"||(i=this.data.actions)!=null&&i[c])&&((c==="Focus"||c==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,l,c,s),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":ke.makeHexColor(...t)}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||uae,i=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),u=Math.round(c/(CT*s))||1,f=c/u;a=Math.min(s,l(f/CT))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(s,l(c/CT))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=ke.makeHexColor(...n),this.data.textAlignment!==null&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class pae extends I0{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,s){const i=this.annotationStorage;
569for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[s]:n})}render(){var s,i;const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=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||((s=this.data.textContent)==null?void 0:s.join(` 570`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const u={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=c??o,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",c??o),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),S0.add(n),this.contentElement=n,n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;const{datetimeFormat:f,datetimeType:p,timeStep:m}=this.data,x=!!p&&this.enableScripting;f&&(n.title=f),this._setRequired(n,this.data.required),l&&(n.maxLength=l),n.addEventListener("input",y=>{e.setValue(t,{value:y.target.value}),this.setPropertyOnSiblings(n,"value",y.target.value,"value"),u.formattedValue=null}),n.addEventListener("resetform",y=>{const v=this.data.defaultFieldValue??"";n.value=u.userValue=v,u.formattedValue=null});let g=y=>{const{formattedValue:v}=u;v!=null&&(y.target.value=v),y.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",v=>{var b;if(u.focused)return;const{target:w}=v;if(x&&(w.type=p,m&&(w.step=m)),u.userValue){const _=u.userValue;if(x)if(p==="time"){const T=new Date(_),A=[T.getHours(),T.getMinutes(),T.getSeconds()];w.value=A.map(N=>N.toString().padStart(2,"0")).join(":")}else w.value=new Date(_-dae).toISOString().split(p==="date"?"T":".",1)[0];else w.value=_}u.lastCommittedValue=w.value,u.commitKey=1,(b=this.data.actions)!=null&&b.Focus||(u.focused=!0)}),n.addEventListener("updatefromsandbox",v=>{this.showElementAndHideCanvas(v.target);const w={value(b){u.userValue=b.detail.value??"",x||e.setValue(t,{value:u.userValue.toString()}),b.target.value=u.userValue},formattedValue(b){const{formattedValue:_}=b.detail;u.formattedValue=_,_!=null&&b.target!==document.activeElement&&(b.target.value=_);const T={formattedValue:_};x&&(T.value=_),e.setValue(t,T)},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{var N;const{charLimit:_}=b.detail,{target:T}=b;if(_===0){T.removeAttribute("maxLength");return}T.setAttribute("maxLength",_);let A=u.userValue;!A||A.length<=_||(A=A.slice(0,_),T.value=u.userValue=A,e.setValue(t,{value:A}),(N=this.linkService.eventBus)==null||N.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:A,willCommit:!0,commitKey:1,selStart:T.selectionStart,selEnd:T.selectionEnd}}))}};this._dispatchEventFromSandbox(w,v)}),n.addEventListener("keydown",v=>{var _;u.commitKey=1;let w=-1;
570if(v.key==="Escape"?w=0:v.key==="Enter"&&!this.data.multiLine?w=2:v.key==="Tab"&&(u.commitKey=3),w===-1)return;const{value:b}=v.target;u.lastCommittedValue!==b&&(u.lastCommittedValue=b,u.userValue=b,(_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:w,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}))});const y=g;g=null,n.addEventListener("blur",v=>{var _,T;if(!u.focused||!v.relatedTarget)return;(_=this.data.actions)!=null&&_.Blur||(u.focused=!1);const{target:w}=v;let{value:b}=w;if(x){if(b&&p==="time"){const A=b.split(":").map(N=>parseInt(N,10));b=new Date(2e3,0,1,A[0],A[1],A[2]||0).valueOf(),w.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();w.type="text"}u.userValue=b,u.lastCommittedValue!==b&&((T=this.linkService.eventBus)==null||T.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:u.commitKey,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}})),y(v)}),(i=this.data.actions)!=null&&i.Keystroke&&n.addEventListener("beforeinput",v=>{var E;u.lastCommittedValue=null;const{data:w,target:b}=v,{value:_,selectionStart:T,selectionEnd:A}=b;let N=T,k=A;switch(v.inputType){case"deleteWordBackward":{const P=_.substring(0,T).match(/\w*\W*$/);P&&(N-=P[0].length);break}
vendor: 4,159 bytes, line 570
570case"deleteWordForward":{const P=_.substring(T).match(/^\W*\w*/);P&&(k+=P[0].length);break}case"deleteContentBackward":T===A&&(N-=1);break;case"deleteContentForward":T===A&&(k+=1);break}v.preventDefault(),(E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,change:w||"",willCommit:!1,selStart:N,selEnd:k}})}),this._setEventListeners(n,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],v=>v.target.value)}if(g&&n.addEventListener("blur",g),this.data.comb){const v=(this.data.rect[2]-this.data.rect[0])/l;n.classList.add("comb"),n.style.letterSpacing=`calc(${v}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class mae extends I0{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class gae extends I0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let s=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",e.setValue(n,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return S0.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,s&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=0,i.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,n)){const u=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(n,{value:l})}),i.addEventListener("resetform",a=>{const o=t.defaultFieldValue||"Off";a.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(n,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(i,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(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class K$ extends I0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let s=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof s=="string"&&(s=s!==t.buttonValue,e.setValue(n,{value:s})),s)for(const a of this._getElementsByName(t.fieldName,n))e.setValue(a.id,{value:!1});const i=document.createElement("input");if(S0.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,s&&i.setAttribute("checked",!0),i.tabIndex=0,i.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,n))e.setValue(c.id,{value:!1});e.setValue(n,{value:l})}),i.addEventListener("resetform",a=>{const o=t.defaultFieldValue;a.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;i.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const u=a===c.detail.value;for(const f of this._getElementsByName(c.target.name)){const p=u&&f.id===n;f.domElement&&(f.domElement.checked=p),e.setValue(f.id,{value:p})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(i,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)}
vendor: 2,276 bytes, line 570
570return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class xae extends wj{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",n=>{this._dispatchEventFromSandbox({},n)})),e}}class vae extends I0{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),s=document.createElement("select");S0.add(s),s.setAttribute("data-element-id",t),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",f=>{const p=this.data.defaultFieldValue;for(const m of s.options)m.selected=m.value===p});const a=(f,p)=>{const m=p.replaceAll(" ","Â ");f.textContent=m,m!==p&&f.setAttribute("display-value",p)};for(const f of this.data.options){const p=document.createElement("option");a(p,f.displayValue),p.value=f.exportValue,n.value.includes(f.exportValue)&&(p.setAttribute("selected",!0),i=!1),s.append(p)}let o=null;if(i){const f=document.createElement("option");f.value=" ",f.setAttribute("hidden",!0),f.setAttribute("selected",!0),s.prepend(f),o=()=>{f.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}const l=f=>{const p=f?"value":"textContent",{options:m,multiple:x}=s;return x?Array.prototype.filter.call(m,g=>g.selected).map(g=>g[p]):m.selectedIndex===-1?null:m[m.selectedIndex][p]};let c=l(!1);const u=f=>{const p=f.target.options;return Array.prototype.map.call(p,m=>({displayValue:m.getAttribute("display-value")||m.textContent,exportValue:m.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",f=>{const p={value(m){o==null||o();const x=m.detail.value,g=new Set(Array.isArray(x)?x:[x]);for(const y of s.options)y.selected=g.has(y.value);
570e.setValue(t,{value:l(!0)}),c=l(!1)},multipleSelection(m){s.multiple=!0},remove(m){const x=s.options,g=m.detail.remove;x[g].selected=!1,s.remove(g),x.length>0&&Array.prototype.findIndex.call(x,v=>v.selected)===-1&&(x[0].selected=!0),e.setValue(t,{value:l(!0),items:u(m)}),c=l(!1)},clear(m){for(;s.length!==0;)s.remove(0);e.setValue(t,{value:null,items:[]}),c=l(!1)},insert(m){const{index:x,displayValue:g,exportValue:y}=m.detail.insert,v=s.children[x],w=document.createElement("option");a(w,g),w.value=y,v?v.before(w):s.append(w),e.setValue(t,{value:l(!0),items:u(m)}),c=l(!1)},items(m){const{items:x}=m.detail;for(;s.length!==0;)s.remove(0);for(const g of x){const{displayValue:y,exportValue:v}=g,w=document.createElement("option");a(w,y),w.value=v,s.append(w)}s.options.length>0&&(s.options[0].selected=!0),e.setValue(t,{value:l(!0),items:u(m)}),c=l(!1)},indices(m){const x=new Set(m.detail.indices);for(const g of m.target.options)g.selected=x.has(g.index);e.setValue(t,{value:l(!0)}),c=l(!1)},editable(m){m.target.disabled=!m.detail.editable}};this._dispatchEventFromSandbox(p,f)}),s.addEventListener("input",f=>{var x;const p=l(!0),m=l(!1);e.setValue(t,{value:p}),f.preventDefault(),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:c,change:m,changeEx:p,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],f=>f.target.value)):s.addEventListener("input",function(f){e.setValue(t,{value:l(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}var Zw,jP;class RP extends Wr{constructor(t){const{data:n,elements:s,parent:i}=t,a=!!i._commentManager;super(t,{isRenderable:!a&&Wr._hasPopupData(n)});R(this,Zw);if(this.elements=s,a&&Wr._hasPopupData(n)){const o=this.popup=j(this,Zw,jP).call(this);for(const l of s)l.popup=o}else this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const n=this.popup=j(this,Zw,jP).call(this),s=[];for(const i of this.elements)i.popup=n,i.container.ariaHasPopup="dialog",s.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(i=>`${Nm}${i}`).join(",")),this.container}}Zw=new WeakSet,jP=function(){return new yae({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 Wi,Wd,rE,nE,Qg,ex,qr,Ol,Vd,Mp,tx,rx,Fl,Vi,Xc,Yc,Zr,qc,Gd,Jw,Zc,nx,Ip,Kd,In,Xd,wt,qk,OP,FP,DP,Zk,MP,X$,Y$,q$,Z$,Jk,Qk,IP;class yae{constructor({container:e,color:t,elements:n,titleObj:s,modificationDate:i,contentsObj:a,richText:o,parent:l,rect:c,parentRect:u,open:f,commentManager:p=null}){R(this,wt);R(this,Wi,null);R(this,Wd,j(this,wt,q$).bind(this));R(this,rE,j(this,wt,IP).bind(this));R(this,nE,j(this,wt,Qk).bind(this));R(this,Qg,j(this,wt,Jk).bind(this));R(this,ex,null);R(this,qr,null);R(this,Ol,null);R(this,Vd,null);R(this,Mp,null);R(this,tx,null);R(this,rx,null);R(this,Fl,!1);R(this,Vi,null);R(this,Xc,null);R(this,Yc,null);R(this,Zr,null);R(this,qc,null);R(this,Gd,null);R(this,Jw,null);R(this,Zc,null);R(this,nx,null);R(this,Ip,null);R(this,Kd,!1);R(this,In,null);R(this,Xd,null);C(this,qr,e),C(this,nx,s),C(this,Ol,a),C(this,Zc,o),C(this,tx,l),C(this,ex,t),C(this,Jw,c),C(this,rx,u),C(this,Mp,n),C(this,Wi,p),C(this,In,n[0]),C(this,Vd,hS.toDateObject(i)),this.trigger=n.flatMap(m=>m.getElementsToTriggerPopup()),p||(j(this,wt,qk).call(this),h(this,qr).hidden=!0,f&&j(this,wt,Jk).call(this))}renderCommentButton(){if(h(this,Zr)){h(this,Zr).parentNode||h(this,In).container.after(h(this,Zr));return}if(h(this,qc)||j(this,wt,OP).call(this),!h(this,qc))return;const{signal:e}=C(this,Xc,new AbortController),t=h(this,In).hasOwnCommentButton,n=()=>{h(this,Wi).toggleCommentPopup(this,!0,void 0,!t)},s=()=>
570{h(this,Wi).toggleCommentPopup(this,!1,!0,!t)},i=()=>{h(this,Wi).toggleCommentPopup(this,!1,!1)};if(t){C(this,Zr,h(this,In).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",h(this,Wd),{signal:e}),a.addEventListener("click",n,{signal:e}),a.addEventListener("pointerenter",s,{signal:e}),a.addEventListener("pointerleave",i,{signal:e}),a.classList.add("popupTriggerArea")}else{const a=C(this,Zr,document.createElement("button"));a.className="annotationCommentButton";const o=h(this,In).container;a.style.zIndex=parseInt(o.style.zIndex,10)+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),j(this,wt,DP).call(this),j(this,wt,FP).call(this),a.addEventListener("keydown",h(this,Wd),{signal:e}),a.addEventListener("click",n,{signal:e}),a.addEventListener("pointerenter",s,{signal:e}),a.addEventListener("pointerleave",i,{signal:e}),o.after(a)}}get commentButtonColor(){const{color:e,opacity:t}=h(this,In).commentData;return e?h(this,tx)._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{var e;(e=h(this,Zr))==null||e.focus()},0)}
570getData(){const{richText:e,color:t,opacity:n,creationDate:s,modificationDate:i}=h(this,In).commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:s,modificationDate:i}}get elementBeforePopup(){return h(this,Zr)}get comment(){return h(this,Xd)||C(this,Xd,h(this,In).commentText),h(this,Xd)}set comment(e){e!==this.comment&&(h(this,In).commentText=C(this,Xd,e))}focus(){var e;(e=h(this,In).container)==null||e.focus()}get parentBoundingClientRect(){return h(this,In).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){h(this,Zr)&&(h(this,Zr).classList.toggle("selected",e),h(this,Zr).ariaExpanded=t)}setSelectedCommentButton(e){h(this,Zr).classList.toggle("selected",e)}get commentPopupPosition(){if(h(this,Gd))return h(this,Gd);const{x:e,y:t,height:n}=h(this,Zr).getBoundingClientRect(),{x:s,y:i,width:a,height:o}=h(this,In).layer.getBoundingClientRect();return[(e-s)/a,(t+n-i)/o]}set commentPopupPosition(e){C(this,Gd,e)}hasDefaultPopupPosition(){return h(this,Gd)===null}get commentButtonPosition(){return h(this,qc)}get commentButtonWidth(){return h(this,Zr).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[t,n]=h(this,Gd)||this.commentButtonPosition.map(c=>c/100),s=this.parentBoundingClientRect,{x:i,y:a,width:o,height:l}=s;h(this,Wi).showDialog(null,this,i+t*o,a+n*l,{...e,parentDimensions:s})}render(){var n,s;if(h(this,Vi))return;const e=C(this,Vi,document.createElement("div"));if(e.className="popup",h(this,ex)){const i=e.style.outlineColor=ke.makeHexColor(...h(this,ex));e.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const t=document.createElement("span");if(t.className="header",(n=h(this,nx))!=null&&n.str){const i=document.createElement("span");i.className="title",t.append(i),{dir:i.dir,str:i.textContent}=h(this,nx)}if(e.append(t),h(this,Vd)){const i=document.createElement("time");i.className="popupDate",i.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),i.setAttribute("data-l10n-args",JSON.stringify({dateObj:h(this,Vd).valueOf()})),i.dateTime=h(this,Vd).toISOString(),t.append(i)}EU({html:h(this,wt,Zk)||h(this,Ol).str,dir:(s=h(this,Ol))==null?void 0:s.dir,className:"popupContent"},e),h(this,qr).append(e)}updateEdited({rect:e,popup:t,deleted:n}){var s;if(h(this,Wi)){n?(this.remove(),C(this,Xd,null)):t&&(t.deleted?this.remove():(j(this,wt,DP).call(this),C(this,Xd,t.text))),e&&(C(this,qc,null),j(this,wt,OP).call(this),j(this,wt,FP).call(this));return}if(n||t!=null&&t.deleted){this.remove();return}j(this,wt,qk).call(this),h(this,Ip)||C(this,Ip,{contentsObj:h(this,Ol),richText:h(this,Zc)}),e&&C(this,Yc,null),t&&t.text&&(C(this,Zc,j(this,wt,Y$).call(this,t.text)),C(this,Vd,hS.toDateObject(t.date)),C(this,Ol,null)),(s=h(this,Vi))==null||s.remove(),C(this,Vi,null)}resetEdited(){var e;h(this,Ip)&&({contentsObj:tr(this,Ol)._,richText:tr(this,Zc)._}=h(this,Ip),C(this,Ip,null),(e=h(this,Vi))==null||e.remove(),C(this,Vi,null),C(this,Yc,null))}remove(){var e,t,n;if((e=h(this,Xc))==null||e.abort(),C(this,Xc,null),(t=h(this,Vi))==null||t.remove(),C(this,Vi,null),C(this,Kd,!1),C(this,Fl,!1),(n=h(this,Zr))==null||n.remove(),C(this,Zr,null),this.trigger)for(const s of this.trigger)s.classList.remove("popupTriggerArea")}forceHide(){C(this,Kd,this.isVisible),h(this,Kd)&&(h(this,qr).hidden=!0)}maybeShow(){h(this,Wi)||(j(this,wt,qk).call(this),h(this,Kd)&&(h(this,Vi)||j(this,wt,Qk).call(this),C(this,Kd,!1),h(this,qr).hidden=!1))}get isVisible(){return h(this,Wi)?!1:h(this,qr).hidden===!1}}Wi=new WeakMap,Wd=new WeakMap,rE=new WeakMap,nE=new WeakMap,Qg=new WeakMap,ex=new WeakMap,qr=new WeakMap,Ol=new WeakMap,Vd=new WeakMap,Mp=new WeakMap,tx=new WeakMap,rx=new WeakMap,Fl=new WeakMap,Vi=new WeakMap,Xc=new WeakMap,Yc=new WeakMap,Zr=new WeakMap,qc=new WeakMap,Gd=new WeakMap,Jw=new WeakMap,Zc=new WeakMap,nx=new WeakMap,Ip=new WeakMap,Kd=new WeakMap,In=new WeakMap,Xd=new WeakMap,wt=new WeakSet,qk=function(){var t;if(h(this,Xc))return;C(this,Xc,new AbortController);const{signal:e}=h(this,Xc);for(const n of this.trigger)n.addEventListener("click",h(this,Qg),{signal:e}),n.addEventListener("pointerenter",h(this,nE),{signal:e}),n.addEventListener("pointerleave",h(this,rE),{signal:e}),n.classList.add("popupTriggerArea");for(const n of h(this,Mp))(t=n.container)==null||t.addEventListener("keydown",h(this,Wd),{signal:e})},OP=function(){const e=h(this,Mp).find(t=>t.hasCommentButton);e&&C(this,qc,e._normalizePoint(e.commentButtonPosition))},FP=function(){if(h(this,In).extraPopupElement&&!h(this,In).editor)return;h(this,Zr)||this.renderCommentButton();const[e,t]=h(this,qc),{style:n}=h(this,Zr);n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`},DP=function(){h(this,In).extraPopupElement||(h(this,Zr)||this.renderCommentButton(),h(this,Zr).style.backgroundColor=this.commentButtonColor||"")},Zk=function(){const e=h(this,Zc),t=h(this,Ol);return e!=null&&e.str&&(!(t!=null&&t.str)||t.str===e.str)&&h(this,Zc).html||null},MP=function(){var e,t,n;return((n=(t=(e=h(this,wt,Zk))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:n.fontSize)||0},X$=function(){var e,t,n;return((n=(t=(e=h(this,wt,Zk))==null?void 0:e.attributes)==null?void 0:t.style)==null?void 0:n.color)||null},Y$=function(e){const t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},s={style:{color:h(this,wt,X$),fontSize:h(this,wt,MP)?`calc(${h(this,wt,MP)}px * var(--total-scale-factor))`:""}};for(const i of e.split(` 571`))t.push({name:"span",value:i,attributes:s});return n},q$=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&h(this,Fl))&&j(this,wt,Jk).call(this)},Z$=function(){if(h(this,Yc)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:s,pageY:i}}}=h(this,tx);let a=!!h(this,rx),o=a?h(this,rx):h(this,Jw);for(const x of h(this,Mp))if(!o||ke.intersect(x.data.rect,o)!==null){o=x.data.rect,a=!0;break}const l=ke.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),u=a?o[2]-o[0]+5:0,f=l[0]+u,p=l[1];C(this,Yc,[100*(f-s)/t,100*(p-i)/n]);const{style:m}=h(this,qr);m.left=`${h(this,Yc)[0]}%`,m.top=`${h(this,Yc)[1]}%`},Jk=function(){if(h(this,Wi)){h(this,Wi).toggleCommentPopup(this,!1);return}C(this,Fl,!h(this,Fl)),h(this,Fl)?(j(this,wt,Qk).call(this),h(this,qr).addEventListener("click",h(this,Qg)),h(this,qr).addEventListener("keydown",h(this,Wd))):(j(this,wt,IP).call(this),h(this,qr).removeEventListener("click",h(this,Qg)),h(this,qr).removeEventListener("keydown",h(this,Wd)))},Qk=function(){h(this,Vi)||this.render(),this.isVisible?h(this,Fl)&&h(this,qr).classList.add("focused"):(j(this,wt,Z$).call(this),h(this,qr).hidden=!1,h(this,qr).style.zIndex=parseInt(h(this,qr).style.zIndex,10)+1e3)},IP=function(){h(this,qr).classList.remove("focused"),!(h(this,Fl)||!this.isVisible)&&(h(this,qr).hidden=!0,h(this,qr).style.zIndex=parseInt(h(this,qr).style.zIndex,10)-1e3)};class J$ extends Wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=lt.FREETEXT}
571render(){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 n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var Qw;class wae extends Wr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});R(this,Qw,null)}render(){this.container.classList.add("lineAnnotation");const{data:t,width:n,height:s}=this,i=this.svgFactory.create(n,s,!0),a=C(this,Qw,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"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return h(this,Qw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qw=new WeakMap;var eb;class bae extends Wr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});R(this,eb,null)}render(){this.container.classList.add("squareAnnotation");const{data:t,width:n,height:s}=this,i=this.svgFactory.create(n,s,!0),a=t.borderStyle.width,o=C(this,eb,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",n-a),o.setAttribute("height",s-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return h(this,eb)}addHighlightArea(){this.container.classList.add("highlightArea")}}eb=new WeakMap;var tb;class _ae extends Wr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});R(this,tb,null)}render(){this.container.classList.add("circleAnnotation");const{data:t,width:n,height:s}=this,i=this.svgFactory.create(n,s,!0),a=t.borderStyle.width,o=C(this,tb,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",n/2),o.setAttribute("cy",s/2),o.setAttribute("rx",n/2-a/2),o.setAttribute("ry",s/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return h(this,tb)}addHighlightArea(){this.container.classList.add("highlightArea")}}tb=new WeakMap;var rb;class Q$ extends Wr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});R(this,rb,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:n,borderStyle:s,popupRef:i},width:a,height:o}=this;if(!n)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let f=0,p=n.length;f<p;f+=2){const m=n[f]-t[0],x=t[3]-n[f+1];c.push(`${m},${x}`)}c=c.join(" ");const u=C(this,rb,this.svgFactory.createElement(this.svgElementName));return u.setAttribute("points",c),u.setAttribute("stroke-width",s.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),l.append(u),this.container.append(l),!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return h(this,rb)}addHighlightArea(){this.container.classList.add("highlightArea")}}rb=new WeakMap;class kae extends Q${constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Sae extends Wr{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}}
571var nb,Lp,sb,LP;class bj extends Wr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});R(this,sb);R(this,nb,null);R(this,Lp,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?lt.HIGHLIGHT:lt.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:n,inkLists:s,borderStyle:i,popupRef:a}}=this,{transform:o,width:l,height:c}=j(this,sb,LP).call(this,n,t),u=this.svgFactory.create(l,c,!0),f=C(this,nb,this.svgFactory.createElement("svg:g"));u.append(f),f.setAttribute("stroke-width",i.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,m=s.length;p<m;p++){const x=this.svgFactory.createElement(this.svgElementName);h(this,Lp).push(x),x.setAttribute("points",s[p].join(",")),f.append(x)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(u),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:n,points:s,rect:i}=t,a=h(this,nb);if(n>=0&&a.setAttribute("stroke-width",n||1),s)for(let o=0,l=h(this,Lp).length;o<l;o++)h(this,Lp)[o].setAttribute("points",s[o].join(","));if(i){const{transform:o,width:l,height:c}=j(this,sb,LP).call(this,this.data.rotation,i);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${c}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return h(this,Lp)}addHighlightArea(){this.container.classList.add("highlightArea")}}nb=new WeakMap,Lp=new WeakMap,sb=new WeakSet,LP=function(t,n){switch(t){case 90:return{transform:`rotate(90) translate(${-n[0]},${n[1]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};case 180:return{transform:`rotate(180) translate(${-n[2]},${n[1]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]};case 270:return{transform:`rotate(270) translate(${-n[2]},${n[3]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};default:return{transform:`translate(${-n[0]},${n[3]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]}}};class e9 extends Wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=lt.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 n=document.createElement("mark");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class Eae extends Wr{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 n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class Aae extends Wr{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 n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class Tae extends Wr{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 n=document.createElement("s");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}}class t9 extends Wr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=lt.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}}
571var ib,ab,BP;class Cae extends Wr{constructor(t){var s;super(t,{isRenderable:!0});R(this,ab);R(this,ib,null);const{file:n}=this.data;this.filename=n.filename,this.content=n.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...n})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:n}=this;let s;n.hasAppearance||n.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name)?"paperclip":"pushpin"}.svg`,n.fillAlpha&&n.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(n.fillAlpha*100)}%);`)),s.addEventListener("dblclick",j(this,ab,BP).bind(this)),C(this,ib,s);const{isMac:i}=gr.platform;return t.addEventListener("keydown",a=>{a.key==="Enter"&&(i?a.metaKey:a.ctrlKey)&&j(this,ab,BP).call(this)}),!n.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):s.classList.add("popupTriggerArea"),t.append(s),t}getElementsToTriggerPopup(){return h(this,ib)}addHighlightArea(){this.container.classList.add("highlightArea")}}ib=new WeakMap,ab=new WeakSet,BP=function(){var t;(t=this.downloadManager)==null||t.openOrDownloadData(this.content,this.filename)};var Bp,Up,sx,Yd,ob,$p,pi,lb,gu,e2,$P;const SO=class SO{constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:s,page:i,viewport:a,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:u}){R(this,gu);R(this,Bp,null);R(this,Up,null);R(this,sx,null);R(this,Yd,new Map);R(this,ob,null);R(this,$p,null);R(this,pi,[]);R(this,lb,!1);oe(this,"zIndex",0);this.div=e,C(this,Bp,t),C(this,Up,n),C(this,ob,o||null),C(this,$p,c||null),C(this,sx,u||new vj),this.page=i,this.viewport=a,this._annotationEditorUIManager=s,this._commentManager=l||null}hasEditableAnnotations(){return h(this,Yd).size>0}async render(e){var l;const{annotations:t,optionalContentConfig:n}=e,s=this.div;_0(s,this.viewport);const i=new Map,a=[],o={data:null,layer:s,linkService:h(this,$p),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new xS,annotationStorage:h(this,sx),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const c of t){if(c.noHTML)continue;const u=c.annotationType===gn.POPUP;if(u){const m=i.get(c.id);if(!m)continue;if(!this._commentManager){a.push(c);continue}o.elements=m}else if(c.rect[2]===c.rect[0]||c.rect[3]===c.rect[1])continue;o.data=c;const f=FT.create(o);if(!f.isRenderable)continue;u||(h(this,pi).push(f),c.popupRef&&i.getOrInsertComputed(c.popupRef,fj).push(f));const p=f.render();c.hidden&&(p.style.visibility="hidden"),f.updateOC(n),f._isEditable&&(h(this,Yd).set(f.data.id,f),(l=this._annotationEditorUIManager)==null||l.renderAnnotationElement(f))}await j(this,gu,e2).call(this);for(const c of a){const u=o.elements=i.get(c.id);o.data=c;const f=FT.create(o);if(!f.isRenderable)continue;const p=f.render();f.contentElement.id=`${Nm}${c.id}`,c.hidden&&(p.style.visibility="hidden"),u.at(-1).container.after(p)}j(this,gu,$P).call(this)}async addLinkAnnotations(e){const t={data:null,layer:this.div,linkService:h(this,$p),svgFactory:new xS,parent:this};for(const n of e){n.borderStyle||(n.borderStyle=SO._defaultBorderStyle),t.data=n;const s=FT.create(t);s.isRenderable&&(s.render(),s.contentElement.id=`${Nm}${n.id}`,h(this,pi).push(s))}await j(this,gu,e2).call(this)}update({viewport:e,optionalContentConfig:t}){const n=this.div;this.viewport=e,_0(n,{rotation:e.rotation});for(const s of h(this,pi))s.updateOC(t);j(this,gu,$P).call(this),n.hidden=!1}getEditableAnnotations(){return h(this,Yd).values()}getEditableAnnotation(e){return h(this,Yd).get(e)}addFakeAnnotation(e){const{div:t}=this,{id:n,rotation:s}=e,i=new hae({data:{id:n,rect:e.getPDFRect(),rotation:s},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:h(this,$p),annotationStorage:h(this,sx)});return i.render(),i.contentElement.id=`${Nm}${n}`,i.createOrUpdatePopup(),h(this,pi).push(i),i}removeAnnotation(e){var s;const t=h(this,pi).findIndex(i=>i.data.id===e);if(t<0)return;const[n]=h(this,pi).splice(t,1);(s=h(this,Bp))==null||s.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(const t of e)t.updateFakeAnnotationElement(this);j(this,gu,e2).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return ct(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:cm.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};Bp=new WeakMap,Up=new WeakMap,sx=new WeakMap,Yd=new WeakMap,ob=new WeakMap,$p=new WeakMap,pi=new WeakMap,lb=new WeakMap,gu=new WeakSet,e2=async function(){var n,s,i;if(h(this,pi).length===0)return;this.div.replaceChildren();const e=[];
571if(!h(this,lb)){C(this,lb,!0);for(const{contentElement:a,data:{id:o}}of h(this,pi)){const l=a.id=`${Nm}${o}`;e.push((n=h(this,ob))==null?void 0:n.getAriaAttributes(l).then(c=>{if(c)for(const[u,f]of c)a.setAttribute(u,f)}))}}h(this,pi).sort(({data:{rect:[a,o,l,c]}},{data:{rect:[u,f,p,m]}})=>{if(a===l&&o===c)return 1;if(u===p&&f===m)return-1;const x=c,g=o,y=(o+c)/2,v=m,w=f,b=(f+m)/2;if(y>=v&&b<=g)return-1;if(b>=x&&y<=w)return 1;const _=(a+l)/2,T=(u+p)/2;return _-T});const t=document.createDocumentFragment();for(const a of h(this,pi))t.append(a.container),this._commentManager?(i=((s=a.extraPopupElement)==null?void 0:s.popup)||a.popup)==null||i.renderCommentButton():a.extraPopupElement&&t.append(a.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),h(this,Bp))for(const a of h(this,pi))h(this,Bp).addPointerInTextLayer(a.contentElement,!1)},$P=function(){var t;if(!h(this,Up))return;const e=this.div;for(const[n,s]of h(this,Up)){const i=e.querySelector(`[data-annotation-id="${n}"]`);if(!i)continue;s.className="annotationContent";const{firstChild:a}=i;a?a.nodeName==="CANVAS"?a.replaceWith(s):a.classList.contains("annotationContent")?a.after(s):a.before(s):i.append(s);const o=h(this,Yd).get(n);o&&(o._hasNoCanvas?((t=this._annotationEditorUIManager)==null||t.setMissingCanvas(n,i.id,s),o._hasNoCanvas=!1):o.canvas=s)}h(this,Up).clear()};let UP=SO;const K_=/\r\n?|\n/g;var Gi,cb,zp,Ki,_n,r9,n9,s9,t2,xu,r2,n2,i9,HP,a9;const wr=class wr extends Wt{constructor(t){super({...t,name:"freeTextEditor"});R(this,_n);R(this,Gi,"");R(this,cb,`${this.id}-editor`);R(this,zp,null);R(this,Ki);oe(this,"_colorPicker",null);this.color=t.color||wr._defaultColor||Wt._defaultLineColor,C(this,Ki,t.fontSize||wr._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert(Wt._l10nAlert.freetext),this.canAddComment=!1}static get _keyboardManager(){const t=wr.prototype,n=a=>a.isEmpty(),s=k0.TRANSLATE_SMALL,i=k0.TRANSLATE_BIG;return ct(this,"_keyboardManager",new Zb([[["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:[-s,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[s,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,s],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:n}]]))}static initialize(t,n){Wt.initialize(t,n);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,n){switch(t){case pt.FREETEXT_SIZE:wr._defaultFontSize=n;break;case pt.FREETEXT_COLOR:wr._defaultColor=n;break}}updateParams(t,n){switch(t){case pt.FREETEXT_SIZE:j(this,_n,r9).call(this,n);break;case pt.FREETEXT_COLOR:j(this,_n,n9).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[pt.FREETEXT_SIZE,wr._defaultFontSize],[pt.FREETEXT_COLOR,wr._defaultColor||Wt._defaultLineColor]]}get propertiesToUpdate(){return[[pt.FREETEXT_SIZE,h(this,Ki)],[pt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new gS(this)),[["colorPicker",this._colorPicker]]}get colorType(){return pt.FREETEXT_COLOR}onUpdatedColor(){var t;this.editorDiv.style.color=this.color,(t=this._colorPicker)==null||t.update(this.color),super.onUpdatedColor()}_translateEmpty(t,n){this._uiManager.translateSelectedEditors(t,n,!0)}getInitialTranslation(){const t=this.parentScale;return[-wr._internalPadding*t,-(wr._internalPadding+h(this,Ki))*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"),C(this,zp,new AbortController);const t=this._uiManager.combinedSignal(h(this,zp));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",h(this,cb)),this._isDraggable=!0,(t=h(this,zp))==null||t.abort(),C(this,zp,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 n;this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),(n=this._initialOptions)!=null&&n.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=h(this,Gi),n=C(this,Gi,j(this,_n,s9).call(this).trimEnd());if(t===n)return;const s=i=>{if(C(this,Gi,i),!i){this.remove();return}j(this,_n,n2).call(this),this._uiManager.rebuild(this),j(this,_n,t2).call(this)};this.addCommands({cmd:()=>{s(n)},undo:()=>{s(t)},mustExec:!1}),j(this,_n,t2).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){wr._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}
571render(){if(this.div)return this.div;let t,n;(this._isCopy||this.annotationElementId)&&(t=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",h(this,cb)),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:s}=this.editorDiv;if(s.fontSize=`calc(${h(this,Ki)}px * var(--total-scale-factor))`,s.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[i,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[u,f]=this.pageDimensions,[p,m]=this.pageTranslation;let x,g;switch(this.rotation){case 0:x=t+(o[0]-p)/u,g=n+this.height-(o[1]-m)/f;break;case 90:x=t+(o[0]-p)/u,g=n-(o[1]-m)/f,[l,c]=[c,-l];break;case 180:x=t-this.width+(o[0]-p)/u,g=n-(o[1]-m)/f,[l,c]=[-l,-c];break;case 270:x=t+(o[0]-p-this.height*f)/u,g=n+(o[1]-m-this.width*u)/f,[l,c]=[-c,l];break}this.setAt(x*i,g*a,l,c)}else this._moveAfterPaste(t,n);j(this,_n,n2).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var x,g,y;const n=t.clipboardData||window.clipboardData,{types:s}=n;if(s.length===1&&s[0]==="text/plain")return;t.preventDefault();const i=j(x=wr,xu,HP).call(x,n.getData("text")||"").replaceAll(K_,` 572`);if(!i)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!i.includes(` 573`)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,u=[],f=[];if(l.nodeType===Node.TEXT_NODE){const v=l.parentElement;if(f.push(l.nodeValue.slice(c).replaceAll(K_,"")),v!==this.editorDiv){let w=u;for(const b of this.editorDiv.childNodes){if(b===v){w=f;continue}w.push(j(g=wr,xu,r2).call(g,b))}}u.push(l.nodeValue.slice(0,c).replaceAll(K_,""))}else if(l===this.editorDiv){let v=u,w=0;for(const b of this.editorDiv.childNodes)w++===c&&(v=f),v.push(j(y=wr,xu,r2).call(y,b))}C(this,Gi,`${u.join(` 574`)}${i}${f.join(` 575`)}`),j(this,_n,n2).call(this);const p=new Range;let m=Math.sumPrecise(u.map(v=>v.length));for(const{firstChild:v}of this.editorDiv.childNodes)if(v.nodeType===Node.TEXT_NODE){const w=v.nodeValue.length;if(m<=w){p.setStart(v,m),p.setEnd(v,m);break}m-=w}a.removeAllRanges(),a.addRange(p)}get contentDiv(){return this.editorDiv}getPDFRect(){const t=wr._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,s){var o;let i=null;if(t instanceof J$){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:u,rotation:f,id:p,popupRef:m,richText:x,contentsObj:g,creationDate:y,modificationDate:v},textContent:w,textPosition:b,parent:{page:{pageNumber:_}}}=t;if(!w||w.length===0)return null;i=t={annotationType:lt.FREETEXT,color:Array.from(c),fontSize:l,value:w.join(` 576`),position:b,pageIndex:_-1,rect:u.slice(0),rotation:f,annotationElementId:p,id:p,deleted:!1,popupRef:m,comment:(g==null?void 0:g.str)||null,richText:x,creationDate:y,modificationDate:v}}const a=await super.deserialize(t,n,s);return C(a,Ki,t.fontSize),a.color=ke.makeHexColor(...t.color),C(a,Gi,j(o=wr,xu,HP).call(o,t.value)),a._initialData=i,t.comment&&a.setCommentData(t),a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n=Wt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(t),{color:n,fontSize:h(this,Ki),value:j(this,_n,i9).call(this)});return this.addComment(s),t?(s.isCopy=!0,s):this.annotationElementId&&!j(this,_n,a9).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const n=super.renderAnnotationElement(t);if(!n)return null;const{style:s}=n;s.fontSize=`calc(${h(this,Ki)}px * var(--total-scale-factor))`,s.color=this.color,n.replaceChildren();for(const i of h(this,Gi).split(` 577`)){const a=document.createElement("div");a.append(i?document.createTextNode(i):document.createElement("br")),n.append(a)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:h(this,Gi)}}),n}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};
vendor: 6,335 bytes, lines 577-579
577Gi=new WeakMap,cb=new WeakMap,zp=new WeakMap,Ki=new WeakMap,_n=new WeakSet,r9=function(t){const n=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-h(this,Ki))*this.parentScale),C(this,Ki,i),j(this,_n,t2).call(this)},s=h(this,Ki);this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},n9=function(t){const n=i=>{this.color=i,this.onUpdatedColor()},s=this.color;this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},s9=function(){var s;const t=[];this.editorDiv.normalize();let n=null;for(const i of this.editorDiv.childNodes)(n==null?void 0:n.nodeType)===Node.TEXT_NODE&&i.nodeName==="BR"||(t.push(j(s=wr,xu,r2).call(s,i)),n=i);return t.join(` 578`)},t2=function(){const[t,n]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=s.width/t,this.height=s.height/n):(this.width=s.height/t,this.height=s.width/n),this.fixAndSetPosition()},xu=new WeakSet,r2=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(K_,"")},n2=function(){if(this.editorDiv.replaceChildren(),!!h(this,Gi))for(const t of h(this,Gi).split(` 579`)){const n=document.createElement("div");n.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(n)}},i9=function(){return h(this,Gi).replaceAll("Â "," ")},HP=function(t){return t.replaceAll(" ","Â ")},a9=function(t){const{value:n,fontSize:s,color:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==n||t.fontSize!==s||t.color.some((o,l)=>o!==i[l])||t.pageIndex!==a},R(wr,xu),oe(wr,"_freeTextDefaultContent",""),oe(wr,"_internalPadding",0),oe(wr,"_defaultColor",null),oe(wr,"_defaultFontSize",10),oe(wr,"_type","freetext"),oe(wr,"_editorType",lt.FREETEXT);let zP=wr;class Be{toSVGPath(){Ut("Abstract method `toSVGPath` must be implemented.")}get box(){Ut("Abstract getter `box` must be implemented.")}serialize(e,t){Ut("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,s,i,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o]*s,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,s,i,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=t+e[o+1]*s,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,s){s||(s=new Float32Array(e.length));for(let i=0,a=e.length;i<a;i+=2)s[i]=t+e[i],s[i+1]=n+e[i+1];return s}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,s,i){switch(i){case 90:return[1-t/n,e/s];case 180:return[1-e/n,1-t/s];case 270:return[t/n,1-e/s];default:return[e/n,t/s]}}static createBezierPoints(e,t,n,s,i,a){return[(e+5*n)/6,(t+5*s)/6,(5*n+i)/6,(5*s+a)/6,(n+i)/2,(s+a)/2]}}oe(Be,"PRECISION",1e-4);var Xi,jo,ix,ax,Dl,_t,Hp,Wp,ub,db,ox,lx,qd,hb,sE,iE,Nn,cy,o9,l9,c9,u9,d9,h9;const wc=class wc{constructor({x:e,y:t},n,s,i,a,o=0){R(this,Nn);R(this,Xi);R(this,jo,[]);R(this,ix);R(this,ax);R(this,Dl,[]);R(this,_t,new Float32Array(18));R(this,Hp);R(this,Wp);R(this,ub);R(this,db);R(this,ox);R(this,lx);R(this,qd,[]);C(this,Xi,n),C(this,lx,i*s),C(this,ax,a),h(this,_t).set([NaN,NaN,NaN,NaN,e,t],6),C(this,ix,o),C(this,db,h(wc,hb)*s),C(this,ub,h(wc,iE)*s),C(this,ox,s),h(this,qd).push(e,t)}isEmpty(){return isNaN(h(this,_t)[8])}add({x:e,y:t}){var E;C(this,Hp,e),C(this,Wp,t);const[n,s,i,a]=h(this,Xi);let[o,l,c,u]=h(this,_t).subarray(8,12);const f=e-c,p=t-u,m=Math.hypot(f,p);if(m<h(this,ub))return!1;const x=m-h(this,db),g=x/m,y=g*f,v=g*p;let w=o,b=l;o=c,l=u,c+=y,u+=v,(E=h(this,qd))==null||E.push(e,t);const _=-v/x,T=y/x,A=_*h(this,lx),N=T*h(this,lx);return h(this,_t).set(h(this,_t).subarray(2,8),0),h(this,_t).set([c+A,u+N],4),h(this,_t).set(h(this,_t).subarray(14,18),12),h(this,_t).set([c-A,u-N],16),isNaN(h(this,_t)[6])?(h(this,Dl).length===0&&(h(this,_t).set([o+A,l+N],2),h(this,Dl).push(NaN,NaN,NaN,NaN,(o+A-n)/i,(l+N-s)/a),h(this,_t).set([o-A,l-N],14),h(this,jo).push(NaN,NaN,NaN,NaN,(o-A-n)/i,(l-N-s)/a)),h(this,_t).set([w,b,o,l,c,u],6),!this.isEmpty()):(h(this,_t).set([w,b,o,l,c,u],6),Math.abs(Math.atan2(b-l,w-o)-Math.atan2(v,y))<Math.PI/2?([o,l,c,u]=h(this,_t).subarray(2,6),h(this,Dl).push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((l+u)/2-s)/a),[o,l,w,b]=h(this,_t).subarray(14,18),h(this,jo).push(NaN,NaN,NaN,NaN,((w+o)/2-n)/i,((b+l)/2-s)/a),!0):([w,b,o,l,c,u]=h(this,_t).subarray(0,6),h(this,Dl).push(((w+5*o)/6-n)/i,((b+5*l)/6-s)/a,((5*o+c)/6-n)/i,((5*l+u)/6-s)/a,((o+c)/2-n)/i,((l+u)/2-s)/a),[c,u,o,l,w,b]=h(this,_t).subarray(12,18),h(this,jo).push(((w+5*o)/6-n)/i,((b+5*l)/6-s)/a,((5*o+c)/6-n)/i,((5*l+u)/6-s)/a,((o+c)/2-n)/i,((l+u)/2-s)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=h(this,Dl),t=h(this,jo);if(isNaN(h(this,_t)[6])&&!this.isEmpty())return j(this,Nn,o9).call(this);const n=[];n.push(`M${e[4]} ${e[5]}`);for(let s=6;s<e.length;s+=6)isNaN(e[s])?n.push(`L${e[s+4]} ${e[s+5]}`):n.push(`C${e[s]} ${e[s+1]} ${e[s+2]} ${e[s+3]} ${e[s+4]} ${e[s+5]}`);j(this,Nn,c9).call(this,n);for(let s=t.length-6;s>=6;s-=6)isNaN(t[s])?n.push(`L${t[s+4]} ${t[s+5]}`):n.push(`C${t[s]} ${t[s+1]} ${t[s+2]} ${t[s+3]} ${t[s+4]} ${t[s+5]}`);return j(this,Nn,l9).call(this,n),n.join(" ")}newFreeDrawOutline(e,t,n,s,i,a){return new f9(e,t,n,s,i,a)}getOutlines(){var f;const e=h(this,Dl),t=h(this,jo),n=h(this,_t),[s,i,a,o]=h(this,Xi),l=new Float32Array((((f=h(this,qd))==null?void 0:f.length)??0)+2);for(let p=0,m=l.length-2;p<m;p+=2)l[p]=(h(this,qd)[p]-s)/a,l[p+1]=(h(this,qd)[p+1]-i)/o;if(l[l.length-2]=(h(this,Hp)-s)/a,l[l.length-1]=(h(this,Wp)-i)/o,isNaN(n[6])&&!this.isEmpty())return j(this,Nn,u9).call(this,l);const c=new Float32Array(h(this,Dl).length+24+h(this,jo).length);let u=e.length;for(let p=0;p<u;p+=2){if(isNaN(e[p])){c[p]=c[p+1]=NaN;continue}c[p]=e[p],c[p+1]=e[p+1]}u=j(this,Nn,h9).call(this,c,u);for(let p=t.length-6;p>=6;p-=6)for(let m=0;m<6;
579m+=2){if(isNaN(t[p+m])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[p+m],c[u+1]=t[p+m+1],u+=2}return j(this,Nn,d9).call(this,c,u),this.newFreeDrawOutline(c,l,h(this,Xi),h(this,ox),h(this,ix),h(this,ax))}};Xi=new WeakMap,jo=new WeakMap,ix=new WeakMap,ax=new WeakMap,Dl=new WeakMap,_t=new WeakMap,Hp=new WeakMap,Wp=new WeakMap,ub=new WeakMap,db=new WeakMap,ox=new WeakMap,lx=new WeakMap,qd=new WeakMap,hb=new WeakMap,sE=new WeakMap,iE=new WeakMap,Nn=new WeakSet,cy=function(){const e=h(this,_t).subarray(4,6),t=h(this,_t).subarray(16,18),[n,s,i,a]=h(this,Xi);return[(h(this,Hp)+(e[0]-t[0])/2-n)/i,(h(this,Wp)+(e[1]-t[1])/2-s)/a,(h(this,Hp)+(t[0]-e[0])/2-n)/i,(h(this,Wp)+(t[1]-e[1])/2-s)/a]},o9=function(){const[e,t,n,s]=h(this,Xi),[i,a,o,l]=j(this,Nn,cy).call(this);return`M${(h(this,_t)[2]-e)/n} ${(h(this,_t)[3]-t)/s} L${(h(this,_t)[4]-e)/n} ${(h(this,_t)[5]-t)/s} L${i} ${a} L${o} ${l} L${(h(this,_t)[16]-e)/n} ${(h(this,_t)[17]-t)/s} L${(h(this,_t)[14]-e)/n} ${(h(this,_t)[15]-t)/s} Z`},l9=function(e){const t=h(this,jo);e.push(`L${t[4]} ${t[5]} Z`)},c9=function(e){const[t,n,s,i]=h(this,Xi),a=h(this,_t).subarray(4,6),o=h(this,_t).subarray(16,18),[l,c,u,f]=j(this,Nn,cy).call(this);e.push(`L${(a[0]-t)/s} ${(a[1]-n)/i} L${l} ${c} L${u} ${f} L${(o[0]-t)/s} ${(o[1]-n)/i}`)},u9=function(e){const t=h(this,_t),[n,s,i,a]=h(this,Xi),[o,l,c,u]=j(this,Nn,cy).call(this),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-s)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-s)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-s)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-s)/a],0),this.newFreeDrawOutline(f,e,h(this,Xi),h(this,ox),h(this,ix),h(this,ax))},d9=function(e,t){const n=h(this,jo);return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6},h9=function(e,t){const n=h(this,_t).subarray(4,6),s=h(this,_t).subarray(16,18),[i,a,o,l]=h(this,Xi),[c,u,f,p]=j(this,Nn,cy).call(this);return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,f,p,NaN,NaN,NaN,NaN,(s[0]-i)/o,(s[1]-a)/l],t),t+=24},R(wc,hb,8),R(wc,sE,2),R(wc,iE,h(wc,hb)+h(wc,sE));let vS=wc;var cx,Vp,Jc,fb,Yi,pb,un,aE,p9;class f9 extends Be{constructor(t,n,s,i,a,o){super();R(this,aE);R(this,cx);R(this,Vp,new Float32Array(4));R(this,Jc);R(this,fb);R(this,Yi);R(this,pb);R(this,un);C(this,un,t),C(this,Yi,n),C(this,cx,s),C(this,pb,i),C(this,Jc,a),C(this,fb,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],j(this,aE,p9).call(this,o);const[l,c,u,f]=h(this,Vp);for(let p=0,m=t.length;p<m;p+=2)t[p]=(t[p]-l)/u,t[p+1]=(t[p+1]-c)/f;for(let p=0,m=n.length;p<m;p+=2)n[p]=(n[p]-l)/u,n[p+1]=(n[p+1]-c)/f}toSVGPath(){const t=[`M${h(this,un)[4]} ${h(this,un)[5]}`];for(let n=6,s=h(this,un).length;n<s;n+=6){if(isNaN(h(this,un)[n])){t.push(`L${h(this,un)[n+4]} ${h(this,un)[n+5]}`);continue}t.push(`C${h(this,un)[n]} ${h(this,un)[n+1]} ${h(this,un)[n+2]} ${h(this,un)[n+3]} ${h(this,un)[n+4]} ${h(this,un)[n+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,n,s,i],a){const o=s-t,l=i-n;let c,u;switch(a){case 0:c=Be._rescale(h(this,un),t,i,o,-l),u=Be._rescale(h(this,Yi),t,i,o,-l);break;case 90:c=Be._rescaleAndSwap(h(this,un),t,n,o,l),u=Be._rescaleAndSwap(h(this,Yi),t,n,o,l);break;case 180:c=Be._rescale(h(this,un),s,n,-o,l),u=Be._rescale(h(this,Yi),s,n,-o,l);break;case 270:c=Be._rescaleAndSwap(h(this,un),s,i,-o,-l),u=Be._rescaleAndSwap(h(this,Yi),s,i,-o,-l);break}return{outline:Array.from(c),points:[Array.from(u)]}}get box(){return h(this,Vp)}newOutliner(t,n,s,i,a,o=0){return new vS(t,n,s,i,a,o)}getNewOutline(t,n){const[s,i,a,o]=h(this,Vp),[l,c,u,f]=h(this,cx),p=a*u,m=o*f,x=s*u+l,g=i*f+c,y=this.newOutliner({x:h(this,Yi)[0]*p+x,y:h(this,Yi)[1]*m+g},h(this,cx),h(this,pb),t,h(this,fb),n??h(this,Jc));for(let v=2;v<h(this,Yi).length;v+=2)y.add({x:h(this,Yi)[v]*p+x,y:h(this,Yi)[v+1]*m+g});return y.getOutlines()}}cx=new WeakMap,Vp=new WeakMap,Jc=new WeakMap,fb=new WeakMap,Yi=new WeakMap,pb=new WeakMap,un=new WeakMap,aE=new WeakSet,p9=function(t){const n=h(this,un);let s=n[4],i=n[5];const a=[s,i,s,i];let o=s,l=i,c=s,u=i;const f=t?Math.max:Math.min,p=new Float32Array(4);for(let x=6,g=n.length;x<g;x+=6){const y=n[x+4],v=n[x+5];isNaN(n[x])?(ke.pointBoundingBox(y,v,a),l>v?(o=y,l=v):l===v&&(o=f(o,y)),u<v?(c=y,u=v):u===v&&(c=f(c,y))):(p.set(cu,0),ke.bezierBoundingBox(s,i,...n.slice(
579x,x+6),p),ke.rectBoundingBox(...p,a),l>p[1]?(o=p[0],l=p[1]):l===p[1]&&(o=f(o,p[0])),u<p[3]?(c=p[2],u=p[3]):u===p[3]&&(c=f(c,p[2]))),s=y,i=v}const m=h(this,Vp);m[0]=a[0]-h(this,Jc),m[1]=a[1]-h(this,Jc),m[2]=a[2]-a[0]+2*h(this,Jc),m[3]=a[3]-a[1]+2*h(this,Jc),this.firstPoint=[o,l],this.lastPoint=[c,u]};var mb,gb,xb,Zd,Oo,si,m9,s2,g9,x9,VP;class WP{constructor(e,t=0,n=0,s=!0){R(this,si);R(this,mb);R(this,gb);R(this,xb);R(this,Zd,[]);R(this,Oo,[]);const i=cu.slice(),o=10**-4;for(const{x:y,y:v,width:w,height:b}of e){const _=Math.floor((y-t)/o)*o,T=Math.ceil((y+w+t)/o)*o,A=Math.floor((v-t)/o)*o,N=Math.ceil((v+b+t)/o)*o,k=[_,A,N,!0],E=[T,A,N,!1];h(this,Zd).push(k,E),ke.rectBoundingBox(_,A,T,N,i)}const l=i[2]-i[0]+2*n,c=i[3]-i[1]+2*n,u=i[0]-n,f=i[1]-n;let p=s?-1/0:1/0,m=1/0;const x=h(this,Zd).at(s?-1:-2),g=[x[0],x[2]];for(const y of h(this,Zd)){const[v,w,b,_]=y;!_&&s?w<m?(m=w,p=v):w===m&&(p=Math.max(p,v)):_&&!s&&(w<m?(m=w,p=v):w===m&&(p=Math.min(p,v))),y[0]=(v-u)/l,y[1]=(w-f)/c,y[2]=(b-f)/c}C(this,mb,new Float32Array([u,f,l,c])),C(this,gb,[p,m]),C(this,xb,g)}getOutlines(){h(this,Zd).sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);const e=[];for(const t of h(this,Zd))t[3]?(e.push(...j(this,si,VP).call(this,t)),j(this,si,g9).call(this,t)):(j(this,si,x9).call(this,t),e.push(...j(this,si,VP).call(this,t)));return j(this,si,m9).call(this,e)}}mb=new WeakMap,gb=new WeakMap,xb=new WeakMap,Zd=new WeakMap,Oo=new WeakMap,si=new WeakSet,m9=function(e){const t=[],n=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),n.add(l),n.add(c)}const s=[];let i;for(;n.size>0;){const a=n.values().next().value;let[o,l,c,u,f]=a;n.delete(a);let p=o,m=l;for(i=[o,c],s.push(i);;){let x;if(n.has(u))x=u;else if(n.has(f))x=f;else break;n.delete(x),[o,l,c,u,f]=x,p!==o&&(i.push(p,m,o,m===l?l:c),p=o),m=m===l?c:l}i.push(p,m)}return new Nae(s,h(this,mb),h(this,gb),h(this,xb))},s2=function(e){const t=h(this,Oo);let n=0,s=t.length-1;for(;n<=s;){const i=n+s>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:s=i-1}return s+1},g9=function([,e,t]){const n=j(this,si,s2).call(this,e);h(this,Oo).splice(n,0,[e,t])},x9=function([,e,t]){const n=j(this,si,s2).call(this,e);for(let s=n;s<h(this,Oo).length;s++){const[i,a]=h(this,Oo)[s];if(i!==e)break;if(i===e&&a===t){h(this,Oo).splice(s,1);return}}for(let s=n-1;s>=0;s--){const[i,a]=h(this,Oo)[s];if(i!==e)break;if(i===e&&a===t){h(this,Oo).splice(s,1);return}}},VP=function(e){const[t,n,s]=e,i=[[t,n,s]],a=j(this,si,s2).call(this,s);for(let o=0;o<a;o++){const[l,c]=h(this,Oo)[o];for(let u=0,f=i.length;u<f;u++){const[,p,m]=i[u];if(!(c<=p||m<=l)){if(p>=l){if(m>c)i[u][1]=c;else{if(f===1)return[];i.splice(u,1),u--,f--}continue}i[u][2]=l,m>c&&i.push([t,c,m])}}}return i};var vb,ux;class Nae extends Be{constructor(t,n,s,i){super();R(this,vb);R(this,ux);C(this,ux,t),C(this,vb,n),this.firstPoint=s,this.lastPoint=i}toSVGPath(){const t=[];for(const n of h(this,ux)){let[s,i]=n;t.push(`M${s} ${i}`);for(let a=2;a<n.length;a+=2){const o=n[a],l=n[a+1];o===s?(t.push(`V${l}`),i=l):l===i&&(t.push(`H${o}`),s=o)}t.push("Z")}return t.join(" ")}serialize([t,n,s,i],a){const o=[],l=s-t,c=i-n;for(const u of h(this,ux)){const f=new Array(u.length);for(let p=0;p<u.length;p+=2)f[p]=t+u[p]*l,f[p+1]=i-u[p+1]*c;o.push(f)}return o}get box(){return h(this,vb)}get classNamesForOutlining(){return["highlightOutline"]}}vb=new WeakMap,ux=new WeakMap;class GP extends vS{newFreeDrawOutline(e,t,n,s,i,a){return new Pae(e,t,n,s,i,a)}}class Pae extends f9{newOutliner(e,t,n,s,i,a=0){return new GP(e,t,n,s,i,a)}}var dx,yb,Qc,Gp,wb,mi,bb,_b,Kp,qi,Zi,ss,hx,fx,Ts,px,za,kb,yt,KP,i2,v9,y9,w9,XP,mf,Xa,fm,b9,a2,o2,_9,k9,S9,E9,A9;const Bt=class Bt extends Wt{constructor(t){super({...t,name:"highlightEditor"});R(this,yt);R(this,dx,null);R(this,yb,0);R(this,Qc);R(this,Gp,null);R(this,wb,null);R(this,mi,null);R(this,bb,null);R(this,_b,0);R(this,Kp,null);R(this,qi,null);R(this,Zi,null);R(this,ss,!1);R(this,hx,null);R(this,fx,null);R(this,Ts,null);R(this,px,"");R(this,za);R(this,kb,"");this.color=t.color||Bt._defaultColor,C(this,za,t.thickness||Bt._defaultThickness),this.opacity=t.opacity||Bt._defaultOpacity,C(this,Qc,t.boxes||null),C(this,kb,t.methodOfCreation||""),C(this,px,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(C(this,ss,!0),j(this,yt,i2).call(this,t),j(this,yt,mf).call(this)):h(this,Qc)&&(C(this,dx,t.anchorNode),C(this,yb,t.anchorOffset),C(this,bb,t.focusNode),C(this,_b,t.focusOffset),j(this,yt,KP).call(this),j(this,yt,mf).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(Wt._l10nAlert.highlight)}static get _keyboardManager(){const t=Bt.prototype;return ct(this,"_keyboardManager",new Zb([[["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:h(this,ss)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:h(this,za),methodOfCreation:h(this,kb)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,n){var s;Wt.initialize(t,n),Bt._defaultColor||(Bt._defaultColor=((s=n.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(t,n){switch(t){case pt.HIGHLIGHT_COLOR:Bt._defaultColor=n;break;case pt.HIGHLIGHT_THICKNESS:Bt._defaultThickness=n;break}}translateInPage(t,n){}get toolbarPosition(){return h(this,fx)}get commentButtonPosition(){return h(this,hx)}updateParams(t,n){switch(t){case pt.HIGHLIGHT_COLOR:j(this,yt,v9).call(this,n);break;case pt.HIGHLIGHT_THICKNESS:j(this,yt,y9).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[pt.HIGHLIGHT_COLOR,Bt._defaultColor],[pt.HIGHLIGHT_THICKNESS,Bt._defaultThickness]]}get propertiesToUpdate(){return[[pt.HIGHLIGHT_COLOR,this.color||Bt._defaultColor],[pt.HIGHLIGHT_THICKNESS,h(this,za)||Bt._defaultThickness],[pt.HIGHLIGHT_FREE,h(this,ss)]]}onUpdatedColor(){var t,n;(t=this.parent)==null||t.drawLayer.updateProperties(h(this,Zi),{root:{fill:this.color,"fill-opacity":this.opacity}}),(n=h(this,wb))==null||n.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",C(this,wb,new mS({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(j(this,yt,o2).call(this))}getBaseTranslation(){return[0,0]}getRect(t,n){return super.getRect(t,n,j(this,yt,o2).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){j(this,yt,XP).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(j(this,yt,mf).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var s;let n=!1;this.parent&&!t?j(this,yt,XP).call(this):t&&(j(this,yt,mf).call(this,t),n=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(t),this.show(this._isVisible),n&&this.select()}rotate(t){var i,a,o;const{drawLayer:n}=this.parent;let s;h(this,ss)?(t=(t-this.rotation+360)%360,s=j(i=Bt,Xa,fm).call(i,h(this,qi).box,t)):s=j(a=Bt,Xa,fm).call(a,[this.x,this.y,this.width,this.height],t),n.updateProperties(h(this,Zi),{bbox:s,root:{"data-main-rotation":t}}),n.updateProperties(h(this,Ts),{bbox:j(o=Bt,Xa,fm).call(o,h(this,mi).box,t),root:{"data-main-rotation":t}})}
579render(){if(this.div)return this.div;const t=super.render();h(this,px)&&(t.setAttribute("aria-label",h(this,px)),t.setAttribute("role","mark")),h(this,ss)?t.classList.add("free"):this.div.addEventListener("keydown",j(this,yt,b9).bind(this),{signal:this._uiManager._signal});const n=C(this,Kp,document.createElement("div"));return t.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=h(this,Gp),this.setDims(),jU(this,h(this,Kp),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(h(this,Ts),{rootClass:{hovered:!0}})}pointerleave(){var t;this.isSelected||(t=this.parent)==null||t.drawLayer.updateProperties(h(this,Ts),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:j(this,yt,a2).call(this,!0);break;case 1:case 3:j(this,yt,a2).call(this,!1);break}}select(){var t;super.select(),h(this,Ts)&&((t=this.parent)==null||t.drawLayer.updateProperties(h(this,Ts),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var t;super.unselect(),h(this,Ts)&&((t=this.parent)==null||t.drawLayer.updateProperties(h(this,Ts),{rootClass:{selected:!1}}),h(this,ss)||j(this,yt,a2).call(this,!1))}get _mustFixPosition(){return!h(this,ss)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(h(this,Zi),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(h(this,Ts),{rootClass:{hidden:!t}}))}static startHighlighting(t,n,{target:s,x:i,y:a}){const{x:o,y:l,width:c,height:u}=s.getBoundingClientRect(),f=new AbortController,p=t.combinedSignal(f),m=x=>{f.abort(),j(this,Xa,E9).call(this,t,x)};window.addEventListener("blur",m,{signal:p}),window.addEventListener("pointerup",m,{signal:p}),window.addEventListener("pointerdown",Br,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",so,{signal:p}),s.addEventListener("pointermove",j(this,Xa,S9).bind(this,t),{signal:p}),this._freeHighlight=new GP({x:i,y:a},[o,l,c,u],t.scale,this._defaultThickness/2,n,.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,n,s){var y,v,w,b;let i=null;if(t instanceof e9){const{data:{quadPoints:_,rect:T,rotation:A,id:N,color:k,opacity:E,popupRef:P,richText:O,contentsObj:D,creationDate:H,modificationDate:B},parent:{page:{pageNumber:ee}}}=t;i=t={annotationType:lt.HIGHLIGHT,color:Array.from(k),opacity:E,quadPoints:_,boxes:null,pageIndex:ee-1,rect:T.slice(0),rotation:A,annotationElementId:N,id:N,deleted:!1,popupRef:P,richText:O,comment:(D==null?void 0:D.str)||null,creationDate:H,modificationDate:B}}else if(t instanceof bj){const{data:{inkLists:_,rect:T,rotation:A,id:N,color:k,borderStyle:{rawWidth:E},popupRef:P,richText:O,contentsObj:D,creationDate:H,modificationDate:B},parent:{page:{pageNumber:ee}}}=t;i=t={annotationType:lt.HIGHLIGHT,color:Array.from(k),thickness:E,inkLists:_,boxes:null,pageIndex:ee-1,rect:T.slice(0),rotation:A,annotationElementId:N,id:N,deleted:!1,popupRef:P,richText:O,comment:(D==null?void 0:D.str)||null,creationDate:H,modificationDate:B}}const{color:a,quadPoints:o,inkLists:l,outlines:c,opacity:u}=t,f=await super.deserialize(t,n,s);f.color=ke.makeHexColor(...a),f.opacity=u||1,l&&C(f,za,t.thickness),f._initialData=i,t.comment&&f.setCommentData(t);const[p,m]=f.pageDimensions,[x,g]=f.pageTranslation;if(o){const _=C(f,Qc,[]);for(let T=0;T<o.length;T+=8)_.push({x:(o[T]-x)/p,y:1-(o[T+1]-g)/m,width:(o[T+2]-o[T])/p,height:(o[T+1]-o[T+5])/m});j(y=f,yt,KP).call(y),j(v=f,yt,mf).call(v),f.rotate(f.rotation)}else if(l||c){C(f,ss,!0);const _=(l||c.points)[0],T={x:_[0]-x,y:m-(_[1]-g)},A=new GP(T,[0,0,p,m],1,h(f,za)/2,!0,.001);for(let E=0,P=_.length;E<P;E+=2)T.x=_[E]-x,T.y=m-(_[E+1]-g),A.add(T);const{id:N,clipPathId:k}=n.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:f.color,"fill-opacity":f._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:A.toSVGPath()}},!0,!0);j(w=f,yt,i2).call(w,{highlightOutlines:A.getOutlines(),highlightId:N,clipPathId:k}),j(b=f,yt,mf).call(b),f.rotate(f.parentRotation)}return f}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const n=Wt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),s=super.serialize(t);return Object.assign(s,{color:n,opacity:this.opacity,thickness:h(this,za),quadPoints:j(this,yt,_9).call(this),outlines:j(this,yt,k9).call(this,s.rect)}),this.addComment(s),this.annotationElementId&&!j(this,yt,A9).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};dx=new WeakMap,yb=new WeakMap,Qc=new WeakMap,Gp=new WeakMap,wb=new WeakMap,mi=new WeakMap,bb=new WeakMap,_b=new WeakMap,Kp=new WeakMap,qi=new WeakMap,Zi=new WeakMap,ss=new WeakMap,hx=new WeakMap,fx=new WeakMap,Ts=new WeakMap,px=new WeakMap,za=new WeakMap,kb=new WeakMap,yt=new WeakSet,KP=function(){const t=new WP(h(this,Qc),.001);C(this,qi,t.getOutlines()),[this.x,this.y,this.width,this.height]=h(this,qi).box;const n=new WP(h(this,Qc),.0025,.001,this._uiManager.direction==="ltr");C(this,mi,n.getOutlines());const{firstPoint:s}=h(this,qi);C(this,hx,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height]);const{lastPoint:i}=h(this,mi);C(this,fx,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},i2=function({highlightOutlines:t,highlightId:n,clipPathId:s}){var p,m;if(C(this,qi,t),C(this,mi,t.getNewOutline(h(this,za)/2+1.5,.0025)),n>=0)C(this,Zi,n),C(this,Gp,s),this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),C(this,Ts,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:h(this,mi).box,path:{d:h(this,mi).toSVGPath()}},!0));else if(this.parent){const x=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(h(this,Zi),{bbox:j(p=Bt,Xa,fm).call(p,h(this,qi).box,(x-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(h(this,Ts),{bbox:j(m=Bt,Xa,fm).call(m,h(this,mi).box,x),path:{d:h(this,mi).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,g]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*g/x,this.height=c*x/g;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[x,g]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*g/x,this.height=c*x/g;break}}const{firstPoint:u}=t;C(this,hx,[(u[0]-a)/l,(u[1]-o)/c]);const{lastPoint:f}=h(this,mi);C(this,fx,[(f[0]-a)/l,(f[1]-o)/c])},v9=function(t){const n=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},s=this.color,i=this.opacity;this.addCommands({cmd:n.bind(this,t,Bt._defaultOpacity),undo:n.bind(this,s,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},y9=function(t){const n=h(this,za),s=i=>{C(this,za,i),j(this,yt,w9).call(this,i)};this.addCommands({cmd:s.bind(this,t),undo:s.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},w9=function(t){h(this,ss)&&(j(this,yt,i2).call(this,{highlightOutlines:h(this,qi).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())},XP=function(){h(this,Zi)===null||!this.parent||(this.parent.drawLayer.remove(h(this,Zi)),C(this,Zi,null),this.parent.drawLayer.remove(h(this,Ts)),C(this,Ts,null))},mf=function(t=this.parent){h(this,Zi)===null&&({id:tr(this,Zi)._,clipPathId:tr(this,Gp)._}=t.drawLayer.draw({bbox:h(this,qi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:h(this,ss)},path:{d:h(this,qi).toSVGPath()}},!1,!0),C(this,Ts,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:h(this,ss)},bbox:h(this,mi).box,path:{d:h(this,mi).toSVGPath()}},h(this,ss))),h(this,Kp)&&(h(this,Kp).style.clipPath=h(this,Gp)))},Xa=new WeakSet,fm=function([t,n,s,i],a){switch(a){case 90:return[1-n-i,t,i,s];case 180:return[1-t-s,1-n-i,s,i];case 270:return[n,1-t-s,i,s]}return[t,n,s,i]},b9=function(t){Bt._keyboardManager.exec(this,t)},a2=function(t){if(!h(this,dx))return;const n=window.getSelection();t?n.setPosition(h(this,dx),h(this,yb)):n.setPosition(h(this,bb),h(this,_b))},o2=function(){return h(this,ss)?this.rotation:0},_9=function(){if(h(this,ss))return null;const[t,n]=this.pageDimensions,[s,i]=this.pageTranslation,a=h(this,Qc),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:u,width:f,height:p}of a){const m=c*t+s,x=(1-u)*n+i;o[l]=o[l+4]=m,o[l+1]=o[l+3]=x,o[l+2]=o[l+6]=m+f*t,o[l+5]=o[l+7]=x-p*n,l+=8}return o},k9=function(t){return h(this,qi).serialize(t,j(this,yt,o2).call(this))},S9=function(t,n){this._freeHighlight.add(n)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},E9=function(t,n){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},A9=function(t){const{color:n}=this._initialData;return this.hasEditedComment||t.color.some((s,i)=>s!==n[i])},R(Bt,Xa),oe(Bt,"_defaultColor",null),oe(Bt,"_defaultOpacity",1),oe(Bt,"_defaultThickness",12),oe(Bt,"_type","highlight"),oe(Bt,"_editorType",lt.HIGHLIGHT),oe(Bt,"_freeHighlightId",-1),oe(Bt,"_freeHighlight",null),oe(Bt,"_freeHighlightClipId","");let yS=Bt;var Xp;class T9{constructor(){R(this,Xp,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,n]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,n)}updateSVGProperty(e,t){h(this,Xp)[e]=t}toSVGProperties(){const e=h(this,Xp);return C(this,Xp,Object.create(null)),{root:e}}reset(){C(this,Xp,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Ut("Not implemented")}}Xp=new WeakMap;var Gs,mx,Ln,Yp,qp,jt,YP,qP,ZP,uy,C9,l2,dy,pm;const Tt=class Tt extends Wt{constructor(t){super(t);R(this,jt);R(this,Gs,null);R(this,mx);oe(this,"_colorPicker",null);oe(this,"_drawId",null);C(this,mx,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){var t;(t=this._colorPicker)==null||t.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){var t,n;(n=(t=this._colorPicker)==null?void 0:t.updateOpacity)==null||n.call(t,this.opacity)}
579_addOutlines(t){t.drawOutlines&&(j(this,jt,YP).call(this,t),j(this,jt,uy).call(this))}static _mergeSVGProperties(t,n){const s=new Set(Object.keys(t));for(const[i,a]of Object.entries(n))s.has(i)?Object.assign(t[i],a):t[i]=a;return t}static getDefaultDrawingOptions(t){Ut("Not implemented")}static get typesMap(){Ut("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,n){const s=this.typesMap.get(t);s&&this._defaultDrawingOptions.updateProperty(s,n),this._currentParent&&(h(Tt,Ln).updateProperty(s,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,n){const s=this.constructor.typesMap.get(t);s&&this._updateProperty(t,s,n)}static get defaultPropertiesToUpdate(){const t=[],n=this._defaultDrawingOptions;for(const[s,i]of this.typesMap)t.push([s,n[i]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:n}=this;for(const[s,i]of this.constructor.typesMap)t.push([s,n[i]]);return t}_updateProperty(t,n,s){const i=this._drawingOptions,a=i[n],o=l=>{var u;i.updateProperty(n,l);const c=h(this,Gs).updateProperty(n,l);c&&j(this,jt,dy).call(this,c),(u=this.parent)==null||u.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:o.bind(this,s),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,n){const s=this.constructor.typesMap.get(this.colorType),i=this.constructor.typesMap.get(this.opacityType),a=this._drawingOptions,o=a[s],l=a[i],c=(u,f)=>{var p;a.updateProperty(s,u),a.updateProperty(i,f),h(this,Gs).updateProperty(s,u),h(this,Gs).updateProperty(i,f),(p=this.parent)==null||p.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:c.bind(this,t,n),undo:c.bind(this,o,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tt._mergeSVGProperties(h(this,Gs).getPathResizingSVGProperties(j(this,jt,l2).call(this)),{bbox:j(this,jt,pm).call(this)}))}_onResized(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tt._mergeSVGProperties(h(this,Gs).getPathResizedSVGProperties(j(this,jt,l2).call(this)),{bbox:j(this,jt,pm).call(this)}))}_onTranslating(t,n){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:j(this,jt,pm).call(this)})}_onTranslated(){var t;(t=this.parent)==null||t.drawLayer.updateProperties(this._drawId,Tt._mergeSVGProperties(h(this,Gs).getPathTranslatedSVGProperties(j(this,jt,l2).call(this),this.parentDimensions),{bbox:j(this,jt,pm).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,h(this,mx)&&(C(this,mx,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){j(this,jt,ZP).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(j(this,jt,uy).call(this),j(this,jt,dy).call(this,h(this,Gs).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){var s;let n=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),j(this,jt,ZP).call(this)):t&&(this._uiManager.addShouldRescale(this),j(this,jt,uy).call(this,t),n=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(t),n&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Tt._mergeSVGProperties({bbox:j(this,jt,pm).call(this)},h(this,Gs).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&j(this,jt,dy).call(this,h(this,Gs).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
579render(){if(this.div)return this.div;let t,n;this._isCopy&&(t=this.x,n=this.y);const s=super.render();s.classList.add("draw");const i=document.createElement("div");return s.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,n),s}static createDrawerInstance(t,n,s,i,a){Ut("Not implemented")}static startDrawing(t,n,s,i){var y;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:u}=i;if(ks.isInitializedAndDifferentPointerType(u))return;const{viewport:{rotation:f}}=t,{width:p,height:m}=a.getBoundingClientRect(),x=C(Tt,Yp,new AbortController),g=t.combinedSignal(x);if(ks.setPointer(u,c),window.addEventListener("pointerup",v=>{ks.isSamePointerIdOrRemove(v.pointerId)&&this._endDraw(v)},{signal:g}),window.addEventListener("pointercancel",v=>{ks.isSamePointerIdOrRemove(v.pointerId)&&this._currentParent.endDrawingSession()},{signal:g}),window.addEventListener("pointerdown",v=>{ks.isSamePointerType(v.pointerType)&&(ks.initializeAndAddPointerId(v.pointerId),h(Tt,Ln).isCancellable()&&(h(Tt,Ln).removeLastElement(),h(Tt,Ln).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",so,{signal:g}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),a.addEventListener("touchmove",v=>{ks.isSameTimeStamp(v.timeStamp)&&Br(v)},{signal:g}),t.toggleDrawing(),(y=n._editorUndoBar)==null||y.hide(),h(Tt,Ln)){t.drawLayer.updateProperties(this._currentDrawId,h(Tt,Ln).startNew(o,l,p,m,f));return}n.updateUIForDefaultProperties(this),C(Tt,Ln,this.createDrawerInstance(o,l,p,m,f)),C(Tt,qp,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(h(Tt,qp).toSVGProperties(),h(Tt,Ln).defaultSVGProperties),!0,!1)}static _drawMove(t){if(ks.isSameTimeStamp(t.timeStamp),!h(Tt,Ln))return;const{offsetX:n,offsetY:s,pointerId:i}=t;if(ks.isSamePointerId(i)){if(ks.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,h(Tt,Ln).add(n,s)),ks.setTimeStamp(t.timeStamp),Br(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,C(Tt,Ln,null),C(Tt,qp,null),ks.clearTimeStamp()),h(Tt,Yp)&&(h(Tt,Yp).abort(),C(Tt,Yp,null),ks.clearPointerIds())}static _endDraw(t){const n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),(t==null?void 0:t.target)===n.div&&n.drawLayer.updateProperties(this._currentDrawId,h(Tt,Ln).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const s=h(Tt,Ln),i=this._currentDrawId,a=s.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(i,s.setLastElement(a))},undo:()=>{n.drawLayer.updateProperties(i,s.removeLastElement())},mustExec:!1,type:pt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){const n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(pt.DRAW_STEP),!h(Tt,Ln).isEmpty()){const{pageDimensions:[s,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:h(Tt,Ln).getOutlines(s*a,i*a,a,this._INNER_MARGIN),drawingOptions:h(Tt,qp),mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,n,s,i,a,o){Ut("Not implemented")}static async deserialize(t,n,s){var f,p;const{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:l}}=n.viewport,c=this.deserializeDraw(o,l,i,a,this._INNER_MARGIN,t),u=await super.deserialize(t,n,s);return u.createDrawingOptions(t),j(f=u,jt,YP).call(f,{drawOutlines:c}),j(p=u,jt,uy).call(p),u.onScaleChanging(),u.rotate(),u}serializeDraw(t){const[n,s]=this.pageTranslation,[i,a]=this.pageDimensions;return h(this,Gs).serialize([n,s,i,a],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Gs=new WeakMap,mx=new WeakMap,Ln=new WeakMap,Yp=new WeakMap,qp=new WeakMap,jt=new WeakSet,YP=function({drawOutlines:t,drawId:n,drawingOptions:s}){C(this,Gs,t),this._drawingOptions||(this._drawingOptions=s),this.annotationElementId||this._uiManager.a11yAlert(Wt._l10nAlert[this.editorType]),n>=0?(this._drawId=n,this.parent.drawLayer.finalizeDraw(n,t.defaultProperties)):this._drawId=j(this,jt,qP).call(this,t,this.parent),j(this,jt,dy).call(this,t.box)},qP=function(t,n){const{id:s}=n.drawLayer.draw(Tt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return s},ZP=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},uy=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=j(this,jt,qP).call(this,h(this,Gs),t)}},C9=function([t,n,s,i]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[n,1-t,s*(o/a),i*(a/o)];case 180:return[1-t,1-n,s,i];case 270:return[1-n,t,s*(o/a),i*(a/o)];default:return[t,n,s,i]}},l2=function(){const{x:t,y:n,width:s,height:i,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-n,t,s*(a/o),i*(o/a)];case 180:return[1-t,1-n,s,i];case 270:return[n,1-t,s*(a/o),i*(o/a)];default:return[t,n,s,i]}},dy=function(t){[this.x,this.y,this.width,this.height]=j(this,jt,C9).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},pm=function(){const{x:t,y:n,width:s,height:i,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-n-i,t,i,s];case 2:return[1-t-s,1-n-i,s,i];case 3:return[n,1-t-s,i,s];case 4:return[t,n-s*(l/c),i*(c/l),s*(l/c)];case 5:return[1-n,t,s*(l/c),i*(c/l)];case 6:return[1-t-i*(c/l),1-n,i*(c/l),s*(l/c)];case 7:return[n-s*(l/c),1-t-i*(c/l),s*(l/c),i*(c/l)];case 8:return[t-s,n-i,s,i];case 9:return[1-n,t-s,i,s];case 10:return[1-t,1-n,s,i];case 11:return[n-i,1-t,i,s];case 12:return[t-i*(c/l),n,i*(c/l),s*(l/c)];case 13:return[1-n-s*(l/c),t-i*(c/l),s*(l/c),i*(c/l)];case 14:return[1-t,1-n-s*(l/c),i*(c/l),s*(l/c)];case 15:return[n,1-t,s*(l/c),i*(c/l)];default:return[t,n,s,i]}},oe(Tt,"_currentDrawId",-1),oe(Tt,"_currentParent",null),R(Tt,Ln,null),R(Tt,Yp,null),R(Tt,qp,null),oe(Tt,"_INNER_MARGIN",3);let wS=Tt;var Ml,Bn,Un,Zp,gx,Ks,is,Ha,Jp,Qp,e0,xx,c2;class Rae{constructor(e,t,n,s,i,a){R(this,xx);R(this,Ml,new Float64Array(6));R(this,Bn);R(this,Un);R(this,Zp);R(this,gx);R(this,Ks);R(this,is,"");R(this,Ha,0);R(this,Jp,new Jb);
579R(this,Qp);R(this,e0);C(this,Qp,n),C(this,e0,s),C(this,Zp,i),C(this,gx,a),[e,t]=j(this,xx,c2).call(this,e,t);const o=C(this,Bn,[NaN,NaN,NaN,NaN,e,t]);C(this,Ks,[e,t]),C(this,Un,[{line:o,points:h(this,Ks)}]),h(this,Ml).set(o,0)}updateProperty(e,t){e==="stroke-width"&&C(this,gx,t)}isEmpty(){return!h(this,Un)||h(this,Un).length===0}isCancellable(){return h(this,Ks).length<=10}add(e,t){[e,t]=j(this,xx,c2).call(this,e,t);const[n,s,i,a]=h(this,Ml).subarray(2,6),o=e-i,l=t-a;return Math.hypot(h(this,Qp)*o,h(this,e0)*l)<=2?null:(h(this,Ks).push(e,t),isNaN(n)?(h(this,Ml).set([i,a,e,t],2),h(this,Bn).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(h(this,Ml)[0])&&h(this,Bn).splice(6,6),h(this,Ml).set([n,s,i,a,e,t],0),h(this,Bn).push(...Be.createBezierPoints(n,s,i,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const n=this.add(e,t);return n||(h(this,Ks).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,s,i){C(this,Qp,n),C(this,e0,s),C(this,Zp,i),[e,t]=j(this,xx,c2).call(this,e,t);const a=C(this,Bn,[NaN,NaN,NaN,NaN,e,t]);C(this,Ks,[e,t]);const o=h(this,Un).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),h(this,Un).push({line:a,points:h(this,Ks)}),h(this,Ml).set(a,0),C(this,Ha,0),this.toSVGPath(),null}getLastElement(){return h(this,Un).at(-1)}setLastElement(e){return h(this,Un)?(h(this,Un).push(e),C(this,Bn,e.line),C(this,Ks,e.points),C(this,Ha,0),{path:{d:this.toSVGPath()}}):h(this,Jp).setLastElement(e)}removeLastElement(){if(!h(this,Un))return h(this,Jp).removeLastElement();h(this,Un).pop(),C(this,is,"");for(let e=0,t=h(this,Un).length;e<t;e++){const{line:n,points:s}=h(this,Un)[e];C(this,Bn,n),C(this,Ks,s),C(this,Ha,0),this.toSVGPath()}return{path:{d:h(this,is)}}}toSVGPath(){const e=Be.svgRound(h(this,Bn)[4]),t=Be.svgRound(h(this,Bn)[5]);if(h(this,Ks).length===2)return C(this,is,`${h(this,is)} M ${e} ${t} Z`),h(this,is);if(h(this,Ks).length<=6){const s=h(this,is).lastIndexOf("M");C(this,is,`${h(this,is).slice(0,s)} M ${e} ${t}`),C(this,Ha,6)}if(h(this,Ks).length===4){const s=Be.svgRound(h(this,Bn)[10]),i=Be.svgRound(h(this,Bn)[11]);return C(this,is,`${h(this,is)} L ${s} ${i}`),C(this,Ha,12),h(this,is)}const n=[];h(this,Ha)===0&&(n.push(`M ${e} ${t}`),C(this,Ha,6));for(let s=h(this,Ha),i=h(this,Bn).length;s<i;s+=6){const[a,o,l,c,u,f]=h(this,Bn).slice(s,s+6).map(Be.svgRound);n.push(`C${a} ${o} ${l} ${c} ${u} ${f}`)}return C(this,is,h(this,is)+n.join(" ")),C(this,Ha,h(this,Bn).length),h(this,is)}getOutlines(e,t,n,s){const i=h(this,Un).at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),h(this,Jp).build(h(this,Un),e,t,n,h(this,Zp),h(this,gx),s),C(this,Ml,null),C(this,Bn,null),C(this,Un,null),C(this,is,null),h(this,Jp)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Ml=new WeakMap,Bn=new WeakMap,Un=new WeakMap,Zp=new WeakMap,gx=new WeakMap,Ks=new WeakMap,is=new WeakMap,Ha=new WeakMap,Jp=new WeakMap,Qp=new WeakMap,e0=new WeakMap,xx=new WeakSet,c2=function(e,t){return Be._normalizePoint(e,t,h(this,Qp),h(this,e0),h(this,Zp))};var Xs,Sb,Eb,Ji,Il,Ll,vx,yx,t0,ls,mc,N9,P9,R9;class Jb extends Be{constructor(){super(...arguments);R(this,ls);R(this,Xs);R(this,Sb,0);R(this,Eb);R(this,Ji);R(this,Il);R(this,Ll);R(this,vx);R(this,yx);R(this,t0)}build(t,n,s,i,a,o,l){C(this,Il,n),C(this,Ll,s),C(this,vx,i),C(this,yx,a),C(this,t0,o),C(this,Eb,l??0),C(this,Ji,t),j(this,ls,P9).call(this)}get thickness(){return h(this,t0)}setLastElement(t){return h(this,Ji).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return h(this,Ji).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:n}of h(this,Ji)){if(t.push(`M${Be.svgRound(n[4])} ${Be.svgRound(n[5])}`),n.length===6){t.push("Z");continue}if(n.length===12&&isNaN(n[6])){t.push(`L${Be.svgRound(n[10])} ${Be.svgRound(n[11])}`);continue}for(let s=6,i=n.length;s<i;s+=6){const[a,o,l,c,u,f]=n.subarray(s,s+6).map(Be.svgRound);t.push(`C${a} ${o} ${l} ${c} ${u} ${f}`)}}return t.join("")}serialize([t,n,s,i],a){const o=[],l=[],[c,u,f,p]=j(this,ls,N9).call(this);let m,x,g,y,v,w,b,_,T;switch(h(this,yx)){case 0:T=Be._rescale,m=t,x=n+i,g=s,y=-i,v=t+c*s,w=n+(1-u-p)*i,b=t+(c+f)*s,_=n+(1-u)*i;break;case 90:T=Be._rescaleAndSwap,m=t,x=n,g=s,y=i,v=t+u*s,w=n+c*i,b=t+(u+p)*s,_=n+(c+f)*i;break;case 180:T=Be._rescale,m=t+s,x=n,g=-s,y=i,v=t+(1-c-f)*s,w=n+u*i,b=t+(1-c)*s,_=n+(u+p)*i;break;case 270:T=Be._rescaleAndSwap,m=t+s,x=n+i,g=-s,y=-i,v=t+(1-u-p)*s,w=n+(1-c-f)*i,b=t+(1-u)*s,_=n+(1-c)*i;break}for(const{line:A,points:N}of h(this,Ji))o.push(T(A,m,x,g,y,a?new Array(A.length):null)),l.push(T(N,m,x,g,y,a?new Array(N.length):null));return{lines:o,points:l,rect:[v,w,b,_]}}static deserialize(t,n,s,i,a,{paths:{lines:o,points:l},rotation:c,thickness:u}){const f=[];let p,m,x,g,y;switch(c){case 0:y=Be._rescale,p=-t/s,m=n/i+1,x=1/s,g=-1/i;break;case 90:y=Be._rescaleAndSwap,p=-n/i,m=-t/s,x=1/i,g=1/s;break;case 180:y=Be._rescale,p=t/s+1,m=-n/i,x=-1/s,g=1/i;break;case 270:y=Be._rescaleAndSwap,p=n/i+1,m=t/s+1,x=-1/i,g=-1/s;break}if(!o){o=[];for(const w of l){const b=w.length;if(b===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1]]));continue}if(b===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1],NaN,NaN,NaN,NaN,w[2],w[3]]));continue}const _=new Float32Array(3*(b-2));o.push(_);let[T,A,N,k]=w.subarray(0,4);_.set([NaN,NaN,NaN,NaN,T,A],0);for(let E=4;E<b;E+=2){const P=w[E],O=w[E+1];_.set(Be.createBezierPoints(T,A,N,k,P,O),(E-2)*3),[T,A,N,k]=[N,k,P,O]}}}for(let w=0,b=o.length;w<b;w++)f.push({line:y(o[w].map(_=>_??NaN),p,m,x,g),points:y(l[w].map(_=>_??NaN),p,m,x,g)});const v=new this.prototype.constructor;return v.build(f,s,i,1,c,u,a),v}get box(){return h(this,Xs)}updateProperty(t,n){return t==="stroke-width"?j(this,ls,R9).call(this,n):null}updateParentDimensions([t,n],s){const[i,a]=j(this,ls,mc).call(this);C(this,Il,t),C(this,Ll,n),C(this,vx,s);const[o,l]=j(this,ls,mc).call(this),c=o-i,u=l-a,f=h(this,Xs);return f[0]-=c,f[1]-=u,f[2]+=2*c,f[3]+=2*u,f}updateRotation(t){return C(this,Sb,t),{path:{transform:this.rotationTransform}}}get viewBox(){return h(this,Xs).map(Be.svgRound).join(" ")}get defaultProperties(){const[t,n]=h(this,Xs);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Be.svgRound(t)} ${Be.svgRound(n)}`}}}get rotationTransform(){const[,,t,n]=h(this,Xs);let s=0,i=0,a=0,o=0,l=0,c=0;switch(h(this,Sb)){case 90:i=n/t,a=-t/n,l=t;break;case 180:s=-1,o=-1,l=t,c=n;break;case 270:i=-n/t,a=t/n,c=n;break;default:return""}return`matrix(${s} ${i} ${a} ${o} ${Be.svgRound(l)} ${Be.svgRound(c)})`}getPathResizingSVGProperties([t,n,s,i]){const[a,o]=j(this,ls,mc).call(this),[l,c,u,f]=h(this,Xs);if(Math.abs(u-a)<=Be.PRECISION||Math.abs(f-o)<=Be.PRECISION){const y=t+s/2-(l+u/2),v=n+i/2-(c+f/2);return{path:{"transform-origin":`${Be.svgRound(t)} ${Be.svgRound(n)}`,transform:`${this.rotationTransform} translate(${y} ${v})`}}}const p=(s-2*a)/(u-2*a),m=(i-2*o)/(f-2*o),x=u/s,g=f/i;return{path:{"transform-origin":`${Be.svgRound(l)} ${Be.svgRound(c)}`,transform:`${this.rotationTransform} scale(${x} ${g}) translate(${Be.svgRound(a)} ${Be.svgRound(o)}) scale(${p} ${m}) translate(${Be.svgRound(-a)} ${Be.svgRound(-o)})`}}}getPathResizedSVGProperties([t,n,s,i]){const[a,o]=j(this,ls,mc).call(this),l=h(this,Xs),[c,u,f,p]=l;if(l[0]=t,l[1]=n,l[2]=s,l[3]=i,Math.abs(f-a)<=Be.PRECISION||Math.abs(p-o)<=Be.PRECISION){const v=t+s/2-(c+f/2),w=n+i/2-(u+p/2);for(const{line:b,points:_}of h(this,Ji))Be._translate(b,v,w,b),Be._translate(_,v,w,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Be.svgRound(t)} ${Be.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const m=(s-2*a)/(f-2*a),x=(i-2*o)/(p-2*o),g=-m*(c+a)+t+a,y=-x*(u+o)+n+o;if(m!==1||x!==1||g!==0||y!==0)for(const{line:v,points:w}of h(this,Ji))Be._rescale(v,g,y,m,x,v),Be._rescale(w,g,y,m,x,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Be.svgRound(t)} ${Be.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,n],s){const[i,a]=s,o=h(this,Xs),l=t-o[0],c=n-o[1];if(h(this,Il)===i&&h(this,Ll)===a)for(const{line:u,points:f}of h(this,Ji))Be._translate(u,l,c,u),Be._translate(f,l,c,f);else{const u=h(this,Il)/i,f=h(this,Ll)/a;C(this,Il,i),C(this,Ll,a);for(const{line:p,points:m}of h(this,Ji))Be._rescale(p,l,c,u,f,p),Be._rescale(m,l,c,u,f,m);o[2]*=u,o[3]*=f}return o[0]=t,o[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Be.svgRound(t)} ${Be.svgRound(n)}`}}}get defaultSVGProperties(){const t=h(this,Xs);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Be.svgRound(t[0])} ${Be.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}Xs=new WeakMap,Sb=new WeakMap,Eb=new WeakMap,Ji=new WeakMap,Il=new WeakMap,Ll=new WeakMap,vx=new WeakMap,yx=new WeakMap,t0=new WeakMap,ls=new WeakSet,mc=function(t=h(this,t0)){const n=h(this,Eb)+t/2*h(this,vx);return h(this,yx)%180===0?[n/h(this,Il),n/h(this,Ll)]:[n/h(this,Ll),n/h(this,Il)]},N9=function(){const[t,n,s,i]=h(this,Xs),[a,o]=j(this,ls,mc).call(this,0);return[t+a,n+o,s-2*a,i-2*o]},P9=function(){const t=C(this,Xs,Af.slice());for(const{line:i}of h(this,Ji)){if(i.length<=12){for(let l=4,c=i.length;l<c;l+=6)ke.pointBoundingBox(i[l],i[l+1],t);continue}let a=i[4],o=i[5];for(let l=6,c=i.length;l<c;l+=6){const[u,f,p,m,x,g]=i.subarray(l,l+6);ke.bezierBoundingBox(a,o,u,f,p,m,x,g,t),a=x,o=g}}const[n,s]=j(this,ls,mc).call(this);t[0]=Pr(t[0]-n,0,1),t[1]=Pr(t[1]-s,0,1),t[2]=Pr(t[2]+n,0,1),t[3]=Pr(t[3]+s,0,1),t[2]-=t[0],t[3]-=t[1]},R9=function(t){const[n,s]=j(this,ls,mc).call(this);C(this,t0,t);const[i,a]=j(this,ls,mc).call(this),[o,l]=[i-n,a-s],c=h(this,Xs);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class uA extends T9{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:Wt._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 uA(this._viewParameters);return e.updateAll(this),e}}var oE,j9;const jm=class jm extends wS{constructor(t){super({...t,name:"inkEditor"});R(this,oE);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,n){Wt.initialize(t,n),this._defaultDrawingOptions=new uA(n.viewParameters)}static getDefaultDrawingOptions(t){const n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!0}static get typesMap(){return ct(this,"typesMap",new Map([[pt.INK_THICKNESS,"stroke-width"],[pt.INK_COLOR,"stroke"],[pt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,n,s,i,a){return new Rae(t,n,s,i,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,n,s,i,a,o){return Jb.deserialize(t,n,s,i,a,o)}static async deserialize(t,n,s){let i=null;if(t instanceof bj){const{data:{inkLists:o,rect:l,rotation:c,id:u,color:f,opacity:p,borderStyle:{rawWidth:m},popupRef:x,richText:g,contentsObj:y,creationDate:v,modificationDate:w},parent:{page:{pageNumber:b}}}=t;i=t={annotationType:lt.INK,color:Array.from(f),thickness:m,opacity:p,paths:{points:o},boxes:null,pageIndex:b-1,rect:l.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:x,richText:g,comment:(y==null?void 0:y.str)||null,creationDate:v,modificationDate:w}}const a=await super.deserialize(t,n,s);return a._initialData=i,t.comment&&a.setCommentData(t),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new gS(this)),[["colorPicker",this._colorPicker]]}get colorType(){return pt.INK_COLOR}get colorAndOpacityType(){return pt.INK_COLOR_AND_OPACITY}get opacityType(){return pt.INK_OPACITY}updateParams(t,n){if(t===pt.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(n.color,n.opacity);return}super.updateParams(t,n)}static updateDefaultParams(t,n){if(t===pt.INK_COLOR_AND_OPACITY){super.updateDefaultParams(pt.INK_COLOR,n.color),super.updateDefaultParams(pt.INK_OPACITY,n.opacity);return}super.updateDefaultParams(t,n)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:n,parent:s}=this;n.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(t,n.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:n,opacity:s}){this._drawingOptions=jm.getDefaultDrawingOptions({stroke:ke.makeHexColor(...t),"stroke-width":n,"stroke-opacity":s})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:n,points:s}=this.serializeDraw(t),{_drawingOptions:{stroke:i,"stroke-opacity":a,"stroke-width":o}}=this,l=Object.assign(super.serialize(t),{color:Wt._colorManager.convert(i),opacity:a,thickness:o,paths:{lines:n,points:s}});return this.addComment(l),t?(l.isCopy=!0,l):this.annotationElementId&&!j(this,oE,j9).call(this,l)?null:(l.id=this.annotationElementId,l)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;const{points:n,rect:s}=this.serializeDraw(!1);return t.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:n,popup:this.comment}),null}};oE=new WeakSet,j9=function(t){const{color:n,thickness:s,opacity:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((o,l)=>o!==n[l])||t.thickness!==s||t.opacity!==i||t.pageIndex!==a},oe(jm,"_type","ink"),oe(jm,"_editorType",lt.INK),oe(jm,"_defaultDrawingOptions",null);let JP=jm;class QP extends Jb{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const X_=8,Mv=3;var r0,Vt,eR,Fo,O9,F9,tR,u2,D9,M9,I9,rR,nR,L9;class au{static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:s},i,a,o,l){let c=new OffscreenCanvas(1,1),u=c.getContext("2d",{alpha:!1});const f=200,p=u.font=`${n} ${s} ${f}px ${t}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:x,actualBoundingBoxAscent:g,actualBoundingBoxDescent:y,fontBoundingBoxAscent:v,fontBoundingBoxDescent:w,width:b}=u.measureText(e),_=1.5,T=Math.ceil(Math.max(Math.abs(m)+Math.abs(x)||0,b)*_),A=Math.ceil(Math.max(Math.abs(g)+Math.abs(y)||f,Math.abs(v)+Math.abs(w)||f)*_);c=new OffscreenCanvas(T,A),u=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),u.font=p,u.filter="grayscale(1)",u.fillStyle="white",u.fillRect(0,0,T,A),u.fillStyle="black",u.fillText(e,T*(_-1)/2,A*(3-_)/2);const N=j(this,Vt,rR).call(this,u.getImageData(0,0,T,A).data),k=j(this,Vt,I9).call(this,N),E=j(this,Vt,nR).call(this,k),P=j(this,Vt,tR).call(this,N,T,A,E);return this.processDrawnLines({lines:{curves:P,width:T,height:A},pageWidth:i,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,t,n,s,i){const[a,o,l]=j(this,Vt,L9).call(this,e),[c,u]=j(this,Vt,M9).call(this,a,o,l,Math.hypot(o,l)*h(this,r0).sigmaSFactor,h(this,r0).sigmaR,h(this,r0).kernelSize),f=j(this,Vt,nR).call(this,u),p=j(this,Vt,tR).call(this,c,o,l,f);return this.processDrawnLines({lines:{curves:p,width:o,height:l},pageWidth:t,pageHeight:n,rotation:s,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:s,innerMargin:i,mustSmooth:a,areContours:o}){s%180!==0&&([t,n]=[n,t]);const{curves:l,width:c,height:u}=e,f=e.thickness??0,p=[],m=Math.min(t/c,n/u),x=m/t,g=m/n,y=[];for(const{points:w}of l){const b=a?j(this,Vt,D9).call(this,w):w;
579if(!b)continue;y.push(b);const _=b.length,T=new Float32Array(_),A=new Float32Array(3*(_===2?2:_-2));if(p.push({line:A,points:T}),_===2){T[0]=b[0]*x,T[1]=b[1]*g,A.set([NaN,NaN,NaN,NaN,T[0],T[1]],0);continue}let[N,k,E,P]=b;N*=x,k*=g,E*=x,P*=g,T.set([N,k,E,P],0),A.set([NaN,NaN,NaN,NaN,N,k],0);for(let O=4;O<_;O+=2){const D=T[O]=b[O]*x,H=T[O+1]=b[O+1]*g;A.set(Be.createBezierPoints(N,k,E,P,D,H),(O-2)*3),[N,k,E,P]=[E,P,D,H]}}if(p.length===0)return null;const v=o?new QP:new Jb;return v.build(p,t,n,1,s,o?0:f,i),{outline:v,newCurves:y,areContours:o,thickness:f,width:c,height:u}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:s,height:i}){let a=1/0,o=-1/0,l=0;for(const w of e){l+=w.length;for(let b=2,_=w.length;b<_;b++){const T=w[b]-w[b-2];a=Math.min(a,T),o=Math.max(o,T)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const u=e.length,f=X_+Mv*u,p=new Uint32Array(f);let m=0;p[m++]=f*Uint32Array.BYTES_PER_ELEMENT+(l-2*u)*c.BYTES_PER_ELEMENT,p[m++]=0,p[m++]=s,p[m++]=i,p[m++]=t?0:1,p[m++]=Math.max(0,Math.floor(n??0)),p[m++]=u,p[m++]=c.BYTES_PER_ELEMENT;for(const w of e)p[m++]=w.length-2,p[m++]=w[0],p[m++]=w[1];const x=new CompressionStream("deflate-raw"),g=x.writable.getWriter();await g.ready,g.write(p);const y=c.prototype.constructor;for(const w of e){const b=new y(w.length-2);for(let _=2,T=w.length;_<T;_++)b[_-2]=w[_]-w[_-2];g.write(b)}return g.close(),(await new Response(x.readable).bytes()).toBase64()}static async decompressSignature(e){try{const t=Uint8Array.fromBase64(e),{readable:n,writable:s}=new DecompressionStream("deflate-raw"),i=s.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(const b of n)a||(a=new Uint8Array(new Uint32Array(b.buffer,0,4)[0])),a.set(b,o),o+=b.length;const l=new Uint32Array(a.buffer,0,a.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const u=l[2],f=l[3],p=l[4]===0,m=l[5],x=l[6],g=l[7],y=[],v=(X_+Mv*x)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(g){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(a.buffer,v);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(a.buffer,v);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(a.buffer,v);break}o=0;for(let b=0;b<x;b++){const _=l[Mv*b+X_],T=new Float32Array(_+2);y.push(T);for(let A=0;A<Mv-1;A++)T[A]=l[Mv*b+X_+A+1];for(let A=0;A<_;A++)T[A+2]=T[A]+w[o++]}return{areContours:p,thickness:m,outlines:y,width:u,height:f}}catch(t){return mt(`decompressSignature: ${t}`),null}}}r0=new WeakMap,Vt=new WeakSet,eR=function(e,t,n,s){return n-=e,s-=t,n===0?s>0?0:4:n===1?s+6:2-s},Fo=new WeakMap,O9=function(e,t,n,s,i,a,o){const l=j(this,Vt,eR).call(this,n,s,i,a);for(let c=0;c<8;c++){const u=(-c+l-o+16)%8,f=h(this,Fo)[2*u],p=h(this,Fo)[2*u+1];if(e[(n+f)*t+(s+p)]!==0)return u}return-1},F9=function(e,t,n,s,i,a,o){const l=j(this,Vt,eR).call(this,n,s,i,a);for(let c=0;c<8;c++){const u=(c+l+o+16)%8,f=h(this,Fo)[2*u],p=h(this,Fo)[2*u+1];if(e[(n+f)*t+(s+p)]!==0)return u}return-1},tR=function(e,t,n,s){const i=e.length,a=new Int32Array(i);for(let u=0;u<i;u++)a[u]=e[u]<=s?1:0;for(let u=1;u<n-1;u++)a[u*t]=a[u*t+t-1]=0;for(let u=0;u<t;u++)a[u]=a[t*n-1-u]=0;let o=1,l;const c=[];for(let u=1;u<n-1;u++){l=1;for(let f=1;f<t-1;f++){const p=u*t+f,m=a[p];if(m===0)continue;let x=u,g=f;if(m===1&&a[p-1]===0)o+=1,g-=1;else if(m>=1&&a[p+1]===0)o+=1,g+=1,m>1&&(l=m);else{m!==1&&(l=Math.abs(m));continue}const y=[f,u],v=g===f+1,w={isHole:v,points:y,id:o,parent:0};c.push(w);let b;for(const O of c)if(O.id===l){b=O;break}b?b.isHole?w.parent=v?b.parent:l:w.parent=v?l:b.parent:w.parent=v?l:0;const _=j(this,Vt,O9).call(this,a,t,u,f,x,g,0);if(_===-1){a[p]=-o,a[p]!==1&&(l=Math.abs(a[p]));continue}let T=h(this,Fo)[2*_],A=h(this,Fo)[2*_+1];const N=u+T,k=f+A;x=N,g=k;let E=u,P=f;for(;;){const O=j(this,Vt,F9).call(this,a,t,E,P,x,g,1);T=h(this,Fo)[2*O],A=h(this,Fo)[2*O+1];const D=E+T,H=P+A;y.push(H,D);const B=E*t+P;if(a[B+1]===0?a[B]=-o:a[B]===1&&(a[B]=o),D===u&&H===f&&E===N&&P===k){a[p]!==1&&(l=Math.abs(a[p]));break}else x=E,g=P,E=D,P=H}}}return c},u2=function(e,t,n,s){if(n-t<=4){for(let N=t;N<n-2;N+=2)s.push(e[N],e[N+1]);return}const i=e[t],a=e[t+1],o=e[n-4]-i,l=e[n-3]-a,c=Math.hypot(o,l),u=o/c,f=l/c,p=u*a-f*i,m=l/o,x=1/c,g=Math.atan(m),y=Math.cos(g),v=Math.sin(g),w=x*(Math.abs(y)+Math.abs(v)),b=x*(1-w+w**2),_=Math.max(Math.atan(Math.abs(v+y)*b),Math.atan(Math.abs(v-y)*b));let T=0,A=t;for(let N=t+2;N<n-2;N+=2){const k=Math.abs(p-u*e[N+1]+f*e[N]);k>T&&(A=N,T=k)}T>(c*_)**2?(j(this,Vt,u2).call(this,e,t,A+2,s),j(this,Vt,u2).call(this,e,A,n,s)):s.push(i,a)},D9=function(e){const t=[],n=e.length;
579return j(this,Vt,u2).call(this,e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t},M9=function(e,t,n,s,i,a){const o=new Float32Array(a**2),l=-2*s**2,c=a>>1;for(let g=0;g<a;g++){const y=(g-c)**2;for(let v=0;v<a;v++)o[g*a+v]=Math.exp((y+(v-c)**2)/l)}const u=new Float32Array(256),f=-2*i**2;for(let g=0;g<256;g++)u[g]=Math.exp(g**2/f);const p=e.length,m=new Uint8Array(p),x=new Uint32Array(256);for(let g=0;g<n;g++)for(let y=0;y<t;y++){const v=g*t+y,w=e[v];let b=0,_=0;for(let A=0;A<a;A++){const N=g+A-c;if(!(N<0||N>=n))for(let k=0;k<a;k++){const E=y+k-c;if(E<0||E>=t)continue;const P=e[N*t+E],O=o[A*a+k]*u[Math.abs(P-w)];b+=P*O,_+=O}}const T=m[v]=Math.round(b/_);x[T]++}return[m,x]},I9=function(e){const t=new Uint32Array(256);for(const n of e)t[n]++;return t},rR=function(e){const t=e.length,n=new Uint8ClampedArray(t>>2);let s=-1/0,i=1/0;for(let o=0,l=n.length;o<l;o++){const c=n[o]=e[o<<2];s=Math.max(s,c),i=Math.min(i,c)}const a=255/(s-i);for(let o=0,l=n.length;o<l;o++)n[o]=(n[o]-i)*a;return n},nR=function(e){let t,n=-1/0,s=-1/0;const i=e.findIndex(l=>l!==0);let a=i,o=i;for(t=i;t<256;t++){const l=e[t];l>n&&(t-a>s&&(s=t-a,o=t-1),n=l,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t},L9=function(e){const t=e,{width:n,height:s}=e,{maxDim:i}=h(this,r0);let a=n,o=s;if(n>i||s>i){let p=n,m=s,x=Math.log2(Math.max(n,s)/i);const g=Math.floor(x);x=x===g?g-1:g;for(let v=0;v<x;v++){a=Math.ceil(p/2),o=Math.ceil(m/2);const w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(e,0,0,p,m,0,0,a,o),p=a,m=o,e!==t&&e.close(),e=w.transferToImageBitmap()}const y=Math.min(i/a,i/o);a=Math.round(a*y),o=Math.round(o*y)}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 u=c.getImageData(0,0,a,o).data;return[j(this,Vt,rR).call(this,u),a,o]},R(au,Vt),R(au,r0,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),R(au,Fo,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class _j extends T9{constructor(){super(),super.updateProperties({fill:Wt._defaultLineColor,"stroke-width":0})}clone(){const e=new _j;return e.updateAll(this),e}}class kj extends uA{constructor(e){super(e),super.updateProperties({stroke:Wt._defaultLineColor,"stroke-width":1})}clone(){const e=new kj(this._viewParameters);return e.updateAll(this),e}}var Jd,Bl,Qd,n0;const Di=class Di extends wS{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});R(this,Jd,!1);R(this,Bl,null);R(this,Qd,null);R(this,n0,null);this._willKeepAspectRatio=!0,C(this,Qd,t.signatureData||null),C(this,Bl,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,n){Wt.initialize(t,n),this._defaultDrawingOptions=new _j,this._defaultDrawnSignatureOptions=new kj(n.viewParameters)}static getDefaultDrawingOptions(t){const n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!1}static get typesMap(){return ct(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!h(this,Bl)}}static computeTelemetryFinalData(t){const n=t.get("hasDescription");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null)if(h(this,Qd)){const{lines:i,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:u}=h(this,Qd),{rawDims:{pageWidth:f,pageHeight:p},rotation:m}=this.parent.viewport,x=au.processDrawnLines({lines:i,pageWidth:f,pageHeight:p,rotation:m,innerMargin:Di._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(x,u,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:h(this,Bl)||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(t){C(this,n0,t),this.addEditToolbar()}getUuid(){return h(this,n0)}get description(){return h(this,Bl)}set description(t){C(this,Bl,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(n=>
579{n==null||n.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:n,thickness:s,width:i,height:a}=h(this,Qd),o=Math.max(i,a),l=au.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:s,width:i,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:n});return{areContours:n,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,s,i){const{x:a,y:o}=this,{outline:l}=C(this,Qd,t);C(this,Jd,l instanceof QP),this.description=s;let c;h(this,Jd)?c=Di.getDefaultDrawingOptions():(c=Di._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[,u]=this.pageDimensions;let f=n/u;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(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:n,pageHeight:s},rotation:i}=this.parent.viewport;return au.process(t,n,s,i,Di._INNER_MARGIN)}getFromText(t,n){const{rawDims:{pageWidth:s,pageHeight:i},rotation:a}=this.parent.viewport;return au.extractContoursFromText(t,n,s,i,a,Di._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:n,pageHeight:s},rotation:i}=this.parent.viewport;return au.processDrawnLines({lines:t,pageWidth:n,pageHeight:s,rotation:i,innerMargin:Di._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=Di.getDefaultDrawingOptions():(this._drawingOptions=Di._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:n,points:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":i}}=this,a=Object.assign(super.serialize(t),{isSignature:!0,areContours:h(this,Jd),color:[0,0,0],thickness:h(this,Jd)?0:i});return this.addComment(a),t?(a.paths={lines:n,points:s},a.uuid=h(this,n0),a.isCopy=!0):a.lines=n,h(this,Bl)&&(a.accessibilityData={type:"Figure",alt:h(this,Bl)}),a}static deserializeDraw(t,n,s,i,a,o){return o.areContours?QP.deserialize(t,n,s,i,a,o):Jb.deserialize(t,n,s,i,a,o)}static async deserialize(t,n,s){var a;const i=await super.deserialize(t,n,s);return C(i,Jd,t.areContours),i.description=((a=t.accessibilityData)==null?void 0:a.alt)||"",C(i,n0,t.uuid),i}};Jd=new WeakMap,Bl=new WeakMap,Qd=new WeakMap,n0=new WeakMap,oe(Di,"_type","signature"),oe(Di,"_editorType",lt.SIGNATURE),oe(Di,"_defaultDrawingOptions",null);let sR=Di;var Nr,$n,eh,eu,th,wx,tu,s0,Ul,Qi,bx,Ot,hy,fy,d2,h2,f2,aR,p2,B9;class iR extends Wt{constructor(t){super({...t,name:"stampEditor"});R(this,Ot);R(this,Nr,null);R(this,$n,null);R(this,eh,null);R(this,eu,null);R(this,th,null);R(this,wx,"");R(this,tu,null);R(this,s0,!1);R(this,Ul,null);R(this,Qi,!1);R(this,bx,!1);C(this,eu,t.bitmapUrl),C(this,th,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,n){Wt.initialize(t,n)}static isHandlingMimeForPasting(t){return zN.includes(t)}static paste(t,n){n.pasteEditor({mode:lt.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 n=t.get("hasAltText");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}async mlGuessAltText(t=null,n=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:a,height:o}=t||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:i,width:a,height:o,channels:i.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),n&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var t;h(this,$n)&&(C(this,Nr,null),this._uiManager.imageManager.deleteId(h(this,$n)),(t=h(this,tu))==null||t.remove(),C(this,tu,null),h(this,Ul)&&(clearTimeout(h(this,Ul)),C(this,Ul,null))),super.remove()}rebuild(){if(!this.parent){h(this,$n)&&j(this,Ot,d2).call(this);return}super.rebuild(),this.div!==null&&(h(this,$n)&&h(this,tu)===null&&j(this,Ot,d2).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(h(this,eh)||h(this,Nr)||h(this,eu)||h(this,th)||h(this,$n)||h(this,s0))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}
579render(){if(this.div)return this.div;let t,n;return this._isCopy&&(t=this.x,n=this.y),super.render(),this.div.hidden=!0,this.createAltText(),h(this,s0)||(h(this,Nr)?j(this,Ot,h2).call(this):j(this,Ot,d2).call(this)),this._isCopy&&this._moveAfterPaste(t,n),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,n){const{id:s,bitmap:i}=this._uiManager.imageManager.getFromCanvas(t,n);n.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(C(this,$n,s),i&&C(this,Nr,i),C(this,s0,!1),j(this,Ot,h2).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;h(this,Ul)!==null&&clearTimeout(h(this,Ul)),C(this,Ul,setTimeout(()=>{C(this,Ul,null),j(this,Ot,aR).call(this)},200))}copyCanvas(t,n,s=!1){t||(t=224);const{width:i,height:a}=h(this,Nr),o=new rc;let l=h(this,Nr),c=i,u=a,f=null;if(n){if(i>n||a>n){const N=Math.min(n/i,n/a);c=Math.floor(i*N),u=Math.floor(a*N)}f=document.createElement("canvas");const m=f.width=Math.ceil(c*o.sx),x=f.height=Math.ceil(u*o.sy);h(this,Qi)||(l=j(this,Ot,f2).call(this,m,x));const g=f.getContext("2d");g.filter=this._uiManager.hcmFilter;let y="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":Hse.isDarkMode&&(y="#8f8f9d",v="#42414d");const w=15,b=w*o.sx,_=w*o.sy,T=new OffscreenCanvas(b*2,_*2),A=T.getContext("2d");A.fillStyle=y,A.fillRect(0,0,b*2,_*2),A.fillStyle=v,A.fillRect(0,0,b,_),A.fillRect(b,_,b,_),g.fillStyle=g.createPattern(T,"repeat"),g.fillRect(0,0,m,x),g.drawImage(l,0,0,l.width,l.height,0,0,m,x)}let p=null;if(s){let m,x;if(o.symmetric&&l.width<t&&l.height<t)m=l.width,x=l.height;else if(l=h(this,Nr),i>t||a>t){const v=Math.min(t/i,t/a);m=Math.floor(i*v),x=Math.floor(a*v),h(this,Qi)||(l=j(this,Ot,f2).call(this,m,x))}const y=new OffscreenCanvas(m,x).getContext("2d",{willReadFrequently:!0});y.drawImage(l,0,0,l.width,l.height,0,0,m,x),p={width:m,height:x,data:y.getImageData(0,0,m,x).data}}return{canvas:f,width:c,height:u,imageData:p}}static async deserialize(t,n,s){var y;let i=null,a=!1;
579if(t instanceof t9){const{data:{rect:v,rotation:w,id:b,structParent:_,popupRef:T,richText:A,contentsObj:N,creationDate:k,modificationDate:E},container:P,parent:{page:{pageNumber:O}},canvas:D}=t;let H,B;D?(delete t.canvas,{id:H,bitmap:B}=s.imageManager.getFromCanvas(P.id,D),D.remove()):(a=!0,t._hasNoCanvas=!0);const ee=((y=await n._structTree.getAriaAttributes(`${Nm}${b}`))==null?void 0:y.get("aria-label"))||"";i=t={annotationType:lt.STAMP,bitmapId:H,bitmap:B,pageIndex:O-1,rect:v.slice(0),rotation:w,annotationElementId:b,id:b,deleted:!1,accessibilityData:{decorative:!1,altText:ee},isSvg:!1,structParent:_,popupRef:T,richText:A,comment:(N==null?void 0:N.str)||null,creationDate:k,modificationDate:E}}const o=await super.deserialize(t,n,s),{rect:l,bitmap:c,bitmapUrl:u,bitmapId:f,isSvg:p,accessibilityData:m}=t;a?(s.addMissingCanvas(t.id,o),C(o,s0,!0)):f&&s.imageManager.isValidId(f)?(C(o,$n,f),c&&C(o,Nr,c)):C(o,eu,u),C(o,Qi,p);const[x,g]=o.pageDimensions;return o.width=(l[2]-l[0])/x,o.height=(l[3]-l[1])/g,m&&(o.altTextData=m),o._initialData=i,t.comment&&o.setCommentData(t),C(o,bx,!!i),o}serialize(t=!1,n=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Object.assign(super.serialize(t),{bitmapId:h(this,$n),isSvg:h(this,Qi)});if(this.addComment(s),t)return s.bitmapUrl=j(this,Ot,p2).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:i,altText:a}=this.serializeAltText(!1);if(!i&&a&&(s.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=j(this,Ot,B9).call(this,s);return l.isSame?null:(l.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1,s.id=this.annotationElementId,delete s.bitmapId,s)}if(n===null)return s;n.stamps||(n.stamps=new Map);const o=h(this,Qi)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!n.stamps.has(h(this,$n)))n.stamps.set(h(this,$n),{area:o,serialized:s}),s.bitmap=j(this,Ot,p2).call(this,!1);else if(h(this,Qi)){const l=n.stamps.get(h(this,$n));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=j(this,Ot,p2).call(this,!1))}return s}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}Nr=new WeakMap,$n=new WeakMap,eh=new WeakMap,eu=new WeakMap,th=new WeakMap,wx=new WeakMap,tu=new WeakMap,s0=new WeakMap,Ul=new WeakMap,Qi=new WeakMap,bx=new WeakMap,Ot=new WeakSet,hy=function(t,n=!1){if(!t){this.remove();return}C(this,Nr,t.bitmap),n||(C(this,$n,t.id),C(this,Qi,t.isSvg)),t.file&&C(this,wx,t.file.name),j(this,Ot,h2).call(this)},fy=function(){if(C(this,eh,null),this._uiManager.enableWaiting(!1),!!h(this,tu)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&h(this,Nr)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&h(this,Nr)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},d2=function(){if(h(this,$n)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(h(this,$n)).then(s=>j(this,Ot,hy).call(this,s,!0)).finally(()=>j(this,Ot,fy).call(this));return}if(h(this,eu)){const s=h(this,eu);C(this,eu,null),this._uiManager.enableWaiting(!0),C(this,eh,this._uiManager.imageManager.getFromUrl(s).then(i=>j(this,Ot,hy).call(this,i)).finally(()=>j(this,Ot,fy).call(this)));return}if(h(this,th)){const s=h(this,th);C(this,th,null),this._uiManager.enableWaiting(!0),C(this,eh,this._uiManager.imageManager.getFromFile(s).then(i=>j(this,Ot,hy).call(this,i)).finally(()=>j(this,Ot,fy).call(this)));return}const t=document.createElement("input");t.type="file",t.accept=zN.join(",");const n=this._uiManager._signal;C(this,eh,new Promise(s=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),j(this,Ot,hy).call(this,i)}s()},{signal:n}),t.addEventListener("cancel",()=>{this.remove(),s()},{signal:n})}).finally(()=>j(this,Ot,fy).call(this))),t.click()},h2=function(){var c;const{div:t}=this;let{width:n,height:s}=h(this,Nr);const[i,a]=this.pageDimensions,o=.75;if(this.width)n=this.width*i,s=this.height*a;else if(n>o*i||s>o*a){const u=Math.min(o*i/n,o*a/s);n*=u,s*=u}this._uiManager.enableWaiting(!1);const l=C(this,tu,document.createElement("canvas"));l.setAttribute("role","img"),this.addContainer(l),this.width=n/i,this.height=s/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),j(this,Ot,aR).call(this),h(this,bx)||(this.parent.addUndoableEditor(this),C(this,bx,!0)),this._reportTelemetry({action:"inserted_image"}),h(this,wx)&&this.div.setAttribute("aria-description",h(this,wx)),this.annotationElementId||this._uiManager.a11yAlert(Wt._l10nAlert.stamp)},f2=function(t,n){const{width:s,height:i}=h(this,Nr);let a=s,o=i,l=h(this,Nr);for(;a>2*t||o>2*n;){const c=a,u=o;a>2*t&&(a=Math.ceil(a/2)),o>2*n&&(o=Math.ceil(o/2));const f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(l,0,0,c,u,0,0,a,o),l=f.transferToImageBitmap()}return l},aR=function(){const[t,n]=this.parentDimensions,{width:s,height:i}=this,a=new rc,o=Math.ceil(s*t*a.sx),l=Math.ceil(i*n*a.sy),c=h(this,tu);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const u=h(this,Qi)?h(this,Nr):j(this,Ot,f2).call(this,o,l),f=c.getContext("2d");f.filter=this._uiManager.hcmFilter,f.drawImage(u,0,0,u.width,u.height,0,0,o,l)},p2=function(t){if(t){if(h(this,Qi)){const i=this._uiManager.imageManager.getSvgUrl(h(this,$n));if(i)return i}const n=document.createElement("canvas");return{width:n.width,height:n.height}=h(this,Nr),n.getContext("2d").drawImage(h(this,Nr),0,0),n.toDataURL()}if(h(this,Qi)){const[n,s]=this.pageDimensions,i=Math.round(this.width*n*$h.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*$h.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(i,a);return o.getContext("2d").drawImage(h(this,Nr),0,0,h(this,Nr).width,h(this,Nr).height,0,0,i,a),o.transferToImageBitmap()}return structuredClone(h(this,Nr))},B9=function(t){var o;const{pageIndex:n,accessibilityData:{altText:s}}=this._initialData,i=t.pageIndex===n,a=(((o=t.accessibilityData)==null?void 0:o.alt)||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&a,isSameAltText:a}},oe(iR,"_type","stamp"),oe(iR,"_editorType",lt.STAMP);var i0,_x,rh,nh,ru,gi,sh,kx,Sx,Do,nu,zn,su,ih,Ex,We,ah,ur,lR,U9,dl,cR,uR,m2;const xo=class xo{constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:s,accessibilityManager:i,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:u}){R(this,ur);R(this,i0);R(this,_x,!1);R(this,rh,null);R(this,nh,null);R(this,ru,null);R(this,gi,new Map);R(this,sh,!1);R(this,kx,!1);R(this,Sx,!1);R(this,Do,null);R(this,nu,null);R(this,zn,null);R(this,su,null);R(this,ih,null);R(this,Ex,-1);R(this,We);const f=[...h(xo,ah).values()];if(!xo._initialized){xo._initialized=!0;for(const p of f)p.initialize(u,e)}
579e.registerEditorTypes(f),C(this,We,e),this.pageIndex=t,this.div=n,C(this,i0,i),C(this,rh,a),this.viewport=c,C(this,zn,l),this.drawLayer=o,this._structTree=s,h(this,We).addLayer(this)}get isEmpty(){return h(this,gi).size===0}get isInvisible(){return this.isEmpty&&h(this,We).getMode()===lt.NONE}updateToolbar(e){h(this,We).updateToolbar(e)}updateMode(e=h(this,We).getMode()){switch(j(this,ur,m2).call(this),e){case lt.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case lt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case lt.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===lt.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(const n of h(xo,ah).values())t.toggle(`${n._type}Editing`,e===n._editorType)}this.div.hidden=!1}hasTextLayer(e){var t;return e===((t=h(this,zn))==null?void 0:t.div)}setEditingState(e){h(this,We).setEditingState(e)}addCommands(e){h(this,We).addCommands(e)}cleanUndoStack(e){h(this,We).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=h(this,rh))==null||t.togglePointerEvents(e)}async enable(){var n;C(this,Sx,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),(n=h(this,ih))==null||n.abort(),C(this,ih,null);const e=new Set;for(const s of h(this,ur,lR))s.enableEditing(),s.show(!0),s.annotationElementId&&(h(this,We).removeChangedExistingAnnotation(s),e.add(s.annotationElementId));const t=h(this,rh);if(t)for(const s of t.getEditableAnnotations()){if(s.hide(),h(this,We).isDeletedAnnotationElement(s.data.id)||e.has(s.data.id))continue;const i=await this.deserialize(s);i&&(this.addOrRebuild(i),i.enableEditing())}C(this,Sx,!1),h(this,We)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){var s;if(C(this,kx,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),h(this,zn)&&!h(this,ih)){C(this,ih,new AbortController);const i=h(this,We).combinedSignal(h(this,ih));h(this,zn).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:u}=a,f=h(this,Ex);if(u-f>500){C(this,Ex,u);return}C(this,Ex,-1);const{classList:p}=this.div;p.toggle("getElements",!0);const m=document.elementsFromPoint(l,c);if(p.toggle("getElements",!1),!this.div.contains(m[0]))return;let x;const g=new RegExp(`^${S1}[0-9]+$`);for(const v of m)if(g.test(v.id)){x=v.id;break}if(!x)return;const y=h(this,gi).get(x);(y==null?void 0:y.annotationElementId)===null&&(Br(a),y.dblclick(a))},{signal:i,capture:!0})}const e=h(this,rh),t=[];if(e){const i=new Map,a=new Map;for(const o of h(this,ur,lR)){if(o.disableEditing(),!o.annotationElementId){t.push(o);continue}if(o.serialize()!==null){i.set(o.annotationElementId,o);continue}else a.set(o.annotationElementId,o);(s=this.getEditableAnnotation(o.annotationElementId))==null||s.show(),o.remove()}for(const o of e.getEditableAnnotations()){const{id:l}=o.data;if(h(this,We).isDeletedAnnotationElement(l)){o.updateEdited({deleted:!0});continue}let c=a.get(l);if(c){c.resetAnnotationElement(o),c.show(!1),o.show();continue}c=i.get(l),c&&(h(this,We).addChangedExistingAnnotation(c),c.renderAnnotationElement(o)&&c.show(!1)),o.show()}}j(this,ur,m2).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const i of h(xo,ah).values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e==null||e.updateFakeAnnotations(t),C(this,kx,!1)}getEditableAnnotation(e){var t;return((t=h(this,rh))==null?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){h(this,We).getActive()!==e&&h(this,We).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=h(this,zn))!=null&&e.div&&!h(this,su)){C(this,su,new AbortController);const t=h(this,We).combinedSignal(h(this,su));h(this,zn).div.addEventListener("pointerdown",j(this,ur,U9).bind(this),{signal:t}),h(this,zn).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=h(this,zn))!=null&&e.div&&h(this,su)&&(h(this,su).abort(),C(this,su,null),h(this,zn).div.classList.remove("highlighting"))}enableClick(){if(h(this,nh))return;C(this,nh,new AbortController);const e=h(this,We).combinedSignal(h(this,nh));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=h(this,nh))==null||e.abort(),C(this,nh,null)}attach(e){h(this,gi).set(e.id,e);const{annotationElementId:t}=e;t&&h(this,We).isDeletedAnnotationElement(t)&&h(this,We).removeDeletedAnnotationElement(e)}detach(e){var t;h(this,gi).delete(e.id),(t=h(this,i0))==null||t.removePointerInTextLayer(e.contentDiv),!h(this,kx)&&e.annotationElementId&&h(this,We).addDeletedAnnotationElement(e)}remove(e){this.detach(e),h(this,We).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&(h(this,We).addDeletedAnnotationElement(e),Wt.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)))}
579add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),h(this,We).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!h(this,Sx)),h(this,We).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var n;if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!h(this,ru)&&(e._focusEventsAllowed=!1,C(this,ru,setTimeout(()=>{C(this,ru,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:h(this,We)._signal}),t.focus())},0))),e._structTreeParentId=(n=h(this,i0))==null?void 0:n.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),n=()=>{e.remove()};this.addCommands({cmd:t,undo:n,mustExec:!1})}getEditorByUID(e){for(const t of h(this,gi).values())if(t.uid===e)return t;return null}combinedSignal(e){return h(this,We).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=h(this,ur,dl))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await h(this,We).updateMode(e.mode);const{offsetX:n,offsetY:s}=j(this,ur,uR).call(this),i=h(this,We).getId(),a=j(this,ur,cR).call(this,{parent:this,id:i,x:n,y:s,uiManager:h(this,We),isCentered:!0,...t});a&&this.add(a)}async deserialize(e){var t;return await((t=h(xo,ah).get(e.annotationType??e.annotationEditorType))==null?void 0:t.deserialize(e,this,h(this,We)))||null}createAndAddNewEditor(e,t,n={}){const s=h(this,We).getId(),i=j(this,ur,cR).call(this,{parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:h(this,We),isCentered:t,...n});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(j(this,ur,uR).call(this),!0,e)}setSelected(e){h(this,We).setSelected(e)}toggleSelected(e){h(this,We).toggleSelected(e)}unselect(e){h(this,We).unselect(e)}pointerup(e){var s;const{isMac:t}=gr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!h(this,sh)||(C(this,sh,!1),(s=h(this,ur,dl))!=null&&s.isDrawer&&h(this,ur,dl).supportMultipleDrawings))return;if(!h(this,_x)){C(this,_x,!0);return}const n=h(this,We).getMode();if(n===lt.STAMP||n===lt.POPUP||n===lt.SIGNATURE){h(this,We).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var s;if(h(this,We).getMode()===lt.HIGHLIGHT&&this.enableTextSelection(),h(this,sh)){C(this,sh,!1);return}const{isMac:t}=gr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(C(this,sh,!0),(s=h(this,ur,dl))!=null&&s.isDrawer){this.startDrawingSession(e);return}const n=h(this,We).getActive();C(this,_x,!n||n.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),h(this,Do)){h(this,ur,dl).startDrawing(this,h(this,We),!1,e);return}h(this,We).setCurrentDrawingSession(this),C(this,Do,new AbortController);const t=h(this,We).combinedSignal(h(this,Do));this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(C(this,nu,null),this.commitOrRemove())},{signal:t}),h(this,ur,dl).startDrawing(this,h(this,We),!1,e)}pause(e){if(e){const{activeElement:t}=document;this.div.contains(t)&&C(this,nu,t);return}h(this,nu)&&setTimeout(()=>{var t;(t=h(this,nu))==null||t.focus(),C(this,nu,null)},0)}endDrawingSession(e=!1){return h(this,Do)?(h(this,We).setCurrentDrawingSession(null),h(this,Do).abort(),C(this,Do,null),C(this,nu,null),h(this,ur,dl).endDrawing(e)):null}findNewParent(e,t,n){const s=h(this,We).findParent(t,n);return s===null||s===this?!1:(s.changeParent(e),!0)}commitOrRemove(){return h(this,Do)?(this.endDrawingSession(),!0):!1}onScaleChanging(){h(this,Do)&&h(this,ur,dl).onScaleChangingWhenDrawing(this)}destroy(){var e,t;this.commitOrRemove(),((e=h(this,We).getActive())==null?void 0:e.parent)===this&&(h(this,We).commitOrRemove(),h(this,We).setActiveEditor(null)),h(this,ru)&&(clearTimeout(h(this,ru)),C(this,ru,null));for(const n of h(this,gi).values())(t=h(this,i0))==null||t.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove();this.div=null,h(this,gi).clear(),h(this,We).removeLayer(this)}async render({viewport:e}){this.viewport=e,_0(this.div,e);for(const t of h(this,We).getEditors(this.pageIndex))this.add(t),t.rebuild();await h(this,We).findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){h(this,We).commitOrRemove(),j(this,ur,m2).call(this);const t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,_0(this.div,{rotation:n}),t!==n)for(const s of h(this,gi).values())s.rotate(n)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return h(this,We).viewParameters.realScale}};i0=new WeakMap,_x=new WeakMap,rh=new WeakMap,nh=new WeakMap,ru=new WeakMap,gi=new WeakMap,sh=new WeakMap,kx=new WeakMap,Sx=new WeakMap,Do=new WeakMap,nu=new WeakMap,zn=new WeakMap,su=new WeakMap,ih=new WeakMap,Ex=new WeakMap,We=new WeakMap,ah=new WeakMap,ur=new WeakSet,lR=function(){return h(this,gi).size!==0?h(this,gi).values():h(this,We).getEditors(this.pageIndex)},U9=function(e){h(this,We).unselectAll();const{target:t}=e;if(t===h(this,zn).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent")||t.classList.contains("textLayerImages")||t.classList.contains("textLayerImagePlaceholder"))&&h(this,zn).div.contains(t)){const{isMac:n}=gr.platform;if(e.button!==0||e.ctrlKey&&n)return;h(this,We).showAllEditors("highlight",!0,!0),h(this,zn).div.classList.add("free"),this.toggleDrawing(),yS.startHighlighting(this,h(this,We).direction==="ltr",{target:h(this,zn).div,x:e.x,y:e.y}),h(this,zn).div.addEventListener("pointerup",()=>{h(this,zn).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:h(this,We)._signal}),e.preventDefault()}},dl=function(){return h(xo,ah).get(h(this,We).getMode())},cR=function(e){const t=h(this,ur,dl);return t?new t.prototype.constructor(e):null},uR=function(){const{x:e,y:t,width:n,height:s}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),l=Math.min(window.innerHeight,t+s),c=(i+o)/2-e,u=(a+l)/2-t,[f,p]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:f,offsetY:p}},m2=function(){for(const e of h(this,gi).values())e.isEmpty()&&e.remove()},oe(xo,"_initialized",!1),R(xo,ah,new Map([zP,JP,iR,yS,sR].map(e=>[e._editorType,e])));let oR=xo;function jae(r,e){return r===e?0:r.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Y_(r){var e;return r?r.nodeType===Node.ELEMENT_NODE?r.closest(".textLayer"):((e=r.parentElement)==null?void 0:e.closest(".textLayer"))||null:null}function Oae(r,e,t,n){if(r===t)return e<=n;const s=r.compareDocumentPosition(t);return s&Node.DOCUMENT_POSITION_FOLLOWING?!0:s&Node.DOCUMENT_POSITION_PRECEDING?!1:null}function xM(r,e,t){if(r.nodeType!==Node.ELEMENT_NODE||!r.classList.contains("textLayer")||e!==r.childNodes.length)return{container:r,offset:e};let n=r.lastChild;return(n==null?void 0:n.nodeType)===Node.ELEMENT_NODE&&n.classList.contains("endOfContent")&&(n=n.previousSibling),!n||!t.contains(n)?null:n.nodeType===Node.TEXT_NODE?{container:n,offset:n.textContent.length}:{container:n,offset:n.childNodes.length}}var xi,Ys,Wa,Ab,Tb,a0,o0,Cb,lE,oh,lh,ch,uh,iu,Ds,hR,fR,$9,g2,z9,sc,pR,H9,mR;const Xe=class Xe{constructor({filterFactory:e=null,pageColors:t=null,pageIndex:n,textLayer:s=null}){R(this,sc);R(this,xi,null);R(this,Ys,new Map);R(this,Wa,null);R(this,Ab,null);R(this,Tb,null);R(this,a0,null);R(this,o0,new Map);if(this.pageIndex=n,C(this,Ab,e),C(this,Tb,t),s){const i=h(Xe,iu).get(s);if(i!=null&&i.selectionDiv&&(i.selectionDiv.remove(),h(Xe,lh).delete(i.selectionDiv)),h(Xe,iu).set(s,{drawLayer:this}),h(Xe,uh).add(s),C(this,Wa,s),C(this,a0,new MutationObserver(a=>{var o,l,c;if(!(!h(this,xi)||!((o=h(this,Wa))!=null&&o.isConnected)||!j(l=Xe,Ds,fR).call(l))){for(const{addedNodes:u}of a)for(const f of u)if(f.nodeType===Node.ELEMENT_NODE&&f.classList.contains("endOfContent")){j(c=Xe,Ds,g2).call(c);return}}})),h(this,a0).observe(s,{childList:!0}),h(Xe,oh)===null){C(Xe,oh,new AbortController);const{signal:a}=h(Xe,oh);document.addEventListener("selectionchange",j(Xe,Ds,g2).bind(Xe),{signal:a}),document.addEventListener("pointerdown",()=>{C(Xe,ch,!0)},{signal:a}),document.addEventListener("pointerup",()=>{C(Xe,ch,!1)},{signal:a}),window.addEventListener("blur",()=>{C(Xe,ch,!1)},{signal:a})}}}setParent(e){var t,n,s;if(!h(this,xi)){C(this,xi,e),(t=h(this,Wa))!=null&&t.isConnected&&j(n=Xe,Ds,fR).call(n)&&j(s=Xe,Ds,g2).call(s);return}if(h(this,xi)!==e){if(h(this,Ys).size>0)for(const i of h(this,Ys).values())i.remove(),e.append(i);C(this,xi,e)}}static get _svgFactory(){return ct(this,"_svgFactory",new xS)}draw(e,t=!1,n=!1){const s=tr(Xe,Cb)._++,i=j(this,sc,pR).call(this),a=Xe._svgFactory.createElement("defs");i.append(a);const o=Xe._svgFactory.createElement("path");a.append(o);const l=`path_${s}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),t&&h(this,o0).set(s,o);const c=n?j(this,sc,H9).call(this,a,l):null,u=Xe._svgFactory.createElement("use");return i.append(u),u.setAttribute("href",`#${l}`),this.updateProperties(i,e),h(this,Ys).set(s,i),{id:s,clipPathId:`url(#${c})`}}drawOutline(e,t){const n=tr(Xe,Cb)._++,s=j(this,sc,pR).call(this),i=Xe._svgFactory.createElement("defs");s.append(i);const a=Xe._svgFactory.createElement("path");i.append(a);const o=`path_${n}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(t){const f=Xe._svgFactory.createElement("mask");i.append(f),l=`mask_${n}`,f.setAttribute("id",l),f.setAttribute("maskUnits","objectBoundingBox");const p=Xe._svgFactory.createElement("rect");f.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");const m=Xe._svgFactory.createElement("use");f.append(m),m.setAttribute("href",`#${o}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}const c=Xe._svgFactory.createElement("use");s.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const u=c.cloneNode();return s.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(s,e),h(this,Ys).set(n,s),n}finalizeDraw(e,t){h(this,o0).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var l;if(!t)return;const{root:n,bbox:s,rootClass:i,path:a}=t,o=typeof e=="number"?h(this,Ys).get(e):e;if(o){if(n&&j(this,sc,mR).call(this,o,n),s&&j(l=Xe,Ds,z9).call(l,o,s),i){const{classList:c}=o;for(const[u,f]of Object.entries(i))c.toggle(u,f)}if(a){const u=o.firstElementChild.firstElementChild;j(this,sc,mR).call(this,u,a)}}}updateParent(e,t){if(t===this)return;const n=h(this,Ys).get(e);n&&(h(t,xi).append(n),h(this,Ys).delete(e),h(t,Ys).set(e,n))}remove(e){h(this,o0).delete(e),h(this,xi)!==null&&(h(this,Ys).get(e).remove(),h(this,Ys).delete(e))}destroy(){var e,t,n;C(this,xi,null);for(const s of h(this,Ys).values())s.remove();if(h(this,Ys).clear(),h(this,o0).clear(),(e=h(this,a0))==null||e.disconnect(),C(this,a0,null),h(this,Wa)){const s=h(Xe,iu).get(h(this,Wa));(s==null?void 0:s.drawLayer)===this&&(j(t=Xe,Ds,hR).call(t,h(this,Wa)),h(Xe,iu).delete(h(this,Wa)),h(Xe,uh).delete(h(this,Wa)),h(Xe,uh).size===0&&((n=h(Xe,oh))==null||n.abort(),C(Xe,oh,null),C(Xe,ch,!1))),C(this,Wa,null)}}};xi=new WeakMap,Ys=new WeakMap,Wa=new WeakMap,Ab=new WeakMap,Tb=new WeakMap,a0=new WeakMap,o0=new WeakMap,Cb=new WeakMap,lE=new WeakMap,oh=new WeakMap,lh=new WeakMap,ch=new WeakMap,uh=new WeakMap,iu=new WeakMap,Ds=new WeakSet,hR=function(e){const t=h(this,iu).get(e);t!=null&&t.selectionDiv&&(t.selectionDiv.remove(),h(this,lh).delete(t.selectionDiv),t.selectionDiv=null,t.path=null)},fR=function(){const e=document.getSelection();return!!e&&!e.isCollapsed},$9=function(){return[...h(this,uh)].filter(e=>e.isConnected).sort(jae)},g2=function(){var a;const e=document.getSelection();if(!e||e.isCollapsed){for(const o of h(this,lh))o.remove();h(this,lh).clear();return}const t=new WeakMap,n=j(this,Ds,$9).call(this),s=[];for(let o=0,l=e.rangeCount;o<l;o++){const c=e.getRangeAt(o);if(c.collapsed)continue;let{startContainer:u,startOffset:f,endContainer:p,endOffset:m}=c,x=Y_(u),g=Y_(p);const y=x===null,v=g===null;if(h(this,ch)&&y!==v)return;if(e.rangeCount===1){const{anchorNode:_,anchorOffset:T,focusNode:A,focusOffset:N}=e,k=Y_(_),E=Y_(A),P=Oae(_,T,A,N);k&&E&&P!==null&&(P?(u=_,f=T,x=k,p=A,m=N,g=E):(u=A,f=N,x=E,p=_,m=T,g=k))}const w=n.filter(_=>c.intersectsNode(_));if(w.length===0)continue;let b=!1;if(x||(x=w[0],u=x,f=0,b=!0),g||(g=w.at(-1),p=g,m=g.childNodes.length,b=!0),p.nodeType===Node.ELEMENT_NODE){if(p.classList.contains("endOfContent")){const _=p.previousSibling;if(!_)continue;p=_,m=_.nodeType===Node.TEXT_NODE?_.textContent.length:_.childNodes.length}else if(p.classList.contains("textLayer")&&p.childNodes.length===m){const _=xM(p,m,g);if(!_)continue;p=_.container,m=_.offset}}if(u.nodeType===Node.ELEMENT_NODE){const _=xM(u,f,x);if(!_)continue;u=_.container,f=_.offset}if(x===g&&!b&&w.includes(x)){s.push([c,x]);continue}for(const _ of w){const T=_.firstChild;if(!T)continue;const A=document.createRange();if(_===x?A.setStart(u,f):A.setStartBefore(T),_===g)A.setEnd(p,m);else{const N=_.lastChild;if(!N)continue;if(N.nodeType===Node.ELEMENT_NODE&&N.classList.contains("endOfContent")){const k=N.previousSibling;if(!k)continue;A.setEndAfter(k)}else A.setEndAfter(N)}A.collapsed||s.push([A,_])}}const i=new Set(s.map(o=>o[1]));for(const o of h(this,uh))i.has(o)||j(this,Ds,hR).call(this,o);for(const[o,l]of s){const c=h(Xe,iu).get(l);if(!c)continue;let u=t.get(l);if(!u){const g=l.getBoundingClientRect();u=(y,v,w,b)=>({x:(y-g.x)/g.width,y:(v-g.y)/g.height,width:w/g.width,height:b/g.height}),t.set(l,u)}const f=[];for(let{x:g,y,width:v,height:w}of o.getClientRects())v===0||w===0||({x:g,y,width:v,height:w}=u(g,y,v,w),!(v===1&&w===1)&&f.push(`M${g} ${y} h${v} v${w} h-${v} Z`));if(f.length===0)continue;const p=c.drawLayer;let m=c.selectionDiv,x=c.path;if(!m){const g=`clip_selection_${tr(Xe,lE)._++}`;m=document.createElement("div"),m.className="selection",m.style.clipPath=`url(#${g})`;const y=(a=h(p,Ab))==null?void 0:a.createSelectionStyle(h(p,Tb));if(y)for(const[b,_]of Object.entries(y))m.style.setProperty(b,_);const v=Xe._svgFactory.create(1,1,!0);v.setAttribute("aria-hidden","true"),v.setAttribute("width","100%"),v.setAttribute("height","100%");const w=Xe._svgFactory.createElement("clipPath");w.setAttribute("id",g),w.setAttribute("clipPathUnits","objectBoundingBox"),x=Xe._svgFactory.createElement("path"),w.append(x),v.append(w),m.append(v),c.path=x,c.selectionDiv=m}!m.parentNode&&h(p,xi)&&(h(p,xi).append(m),h(this,lh).add(m)),x.setAttribute("d",f.join(" "))}},z9=function(e,[t,n,s,i]){const{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*s}%`,a.height=`${100*i}%`},sc=new WeakSet,pR=function(){const e=Xe._svgFactory.create(1,1,!0);return h(this,xi).append(e),e.setAttribute("aria-hidden","true"),e},H9=function(e,t){const n=Xe._svgFactory.createElement("clipPath");e.append(n);const s=`clip_${t}`;n.setAttribute("id",s),n.setAttribute("clipPathUnits","objectBoundingBox");const i=Xe._svgFactory.createElement("use");return n.append(i),i.setAttribute("href",`#${t}`),i.classList.add("clip"),s},mR=function(e,t){for(const[n,s]of Object.entries(t))s===null?e.removeAttribute(n):e.setAttribute(n,s)},R(Xe,Ds),R(Xe,Cb,0),R(Xe,lE,0),R(Xe,oh,null),R(Xe,lh,new Set),R(Xe,ch,!1),R(Xe,uh,new Set),R(Xe,iu,new WeakMap);let dR=Xe;function q_(r){return`${(r*100).toFixed(2)}%`}var Ax,Nb,Pb,Tx,$l,zl,Rb,cE,W9;const zy=class zy{constructor(e,t,n,s){R(this,cE);R(this,Ax,[]);R(this,Nb,new Map);R(this,Pb,null);R(this,Tx,0);R(this,$l,0);R(this,zl,0);C(this,Tx,e),C(this,Ax,t),C(this,$l,n.rawDims.pageWidth),C(this,zl,n.rawDims.pageHeight),C(this,Pb,s)}render(){const e=document.createElement("div");e.className="textLayerImages";for(let t=0;t<h(this,Ax).length;t+=6){const n=j(this,cE,W9).call(this,h(this,Ax).subarray(t,t+6));n&&e.append(n)}return e.addEventListener("contextmenu",t=>{var v;if(!(t.target instanceof HTMLCanvasElement))return;const n=t.target,s=h(this,Nb).get(n);if(!s)return;const
579i=(v=h(zy,Rb))==null?void 0:v.deref();if(i===n)return;i&&(i.width=0,i.height=0),C(zy,Rb,new WeakRef(n));const{inverseTransform:a,x1:o,y1:l,width:c,height:u}=s,f=h(this,Pb).call(this),p=Math.ceil(o*f.width),m=Math.ceil(l*f.height),x=Math.floor((o+c/h(this,$l))*f.width),g=Math.floor((l+u/h(this,zl))*f.height);n.width=x-p,n.height=g-m;const y=n.getContext("2d");y.setTransform(...a),y.translate(-p,-m),y.drawImage(f,0,0)}),e}};Ax=new WeakMap,Nb=new WeakMap,Pb=new WeakMap,Tx=new WeakMap,$l=new WeakMap,zl=new WeakMap,Rb=new WeakMap,cE=new WeakSet,W9=function([e,t,n,s,i,a]){const o=Math.hypot((i-e)*h(this,$l),(a-t)*h(this,zl)),l=Math.hypot((n-e)*h(this,$l),(s-t)*h(this,zl));if(o<h(this,Tx)||l<h(this,Tx))return null;const c=[(i-e)*h(this,$l)/o,(a-t)*h(this,zl)/o,(n-e)*h(this,$l)/l,(s-t)*h(this,zl)/l,0,0],u=ke.inverseTransform(c),f=document.createElement("canvas");return f.className="textLayerImagePlaceholder",f.width=0,f.height=0,Object.assign(f.style,{opacity:0,position:"absolute",left:q_(e),top:q_(t),width:q_(o/h(this,$l)),height:q_(l/h(this,zl)),transformOrigin:"0% 0%",transform:`matrix(${c.join(",")})`}),h(this,Nb).set(f,{inverseTransform:u,width:o,height:l,x1:e,y1:t}),f},R(zy,Rb,null);let gR=zy;globalThis._pdfjsTestingUtils={HighlightOutliner:WP};globalThis.pdfjsLib={AbortException:Uh,AnnotationEditorLayer:oR,AnnotationEditorParamsType:pt,AnnotationEditorType:lt,AnnotationEditorUIManager:k0,AnnotationLayer:UP,AnnotationMode:nd,AnnotationType:gn,applyOpacity:Vse,build:lae,ColorPicker:mS,createValidAbsoluteUrl:bU,CSSConstants:Wse,DOMSVGFactory:xS,DrawLayer:dR,FeatureTest:gr,fetchData:mj,findContrastColor:Gse,getDocument:U$,getFilenameFromUrl:Use,getPdfFilenameFromUrl:$se,getRGB:qb,getRGBA:Yb,getUuid:kU,GlobalWorkerOptions:Vl,ImageKind:Rk,InvalidPDFException:BN,isDataScheme:tA,isPdfFile:xj,isValidExplicitDest:fie,makeArr:fj,makeMap:pj,makeObj:$N,MathClamp:Pr,noContextMenu:so,normalizeUnicode:Lse,OPS:_c,OutputScale:rc,PasswordResponses:Rse,PDFDataRangeTransport:$$,PDFDateString:hS,PDFWorker:N1,PermissionFlag:Pse,PixelsPerInch:$h,RenderingCancelledException:gj,renderRichText:EU,ResponseException:dS,setLayerDimensions:_0,shadow:ct,SignatureExtractor:au,stopEvent:Br,SupportedImageMimeTypes:zN,TextLayer:C1,TextLayerImages:gR,TouchManager:pS,updateUrlHash:_U,Util:ke,VerbosityLevel:ZE,version:oae,XfaLayer:SU};function Fae(r){return new Worker("/assets/pdf.worker.min-UR5MwJ9W.js",{name:r==null?void 0:r.name})}Vl.workerPort=new Fae;function Sj({url:r,height:e="70vh",className:t="",fit:n="width"}){const s=S.useRef(null),[i,a]=S.useState([]),[o,l]=S.useState(null),[c,u]=S.useState(!0);return S.useEffect(()=>{let f=!1;return u(!0),l(null),a([]),(async()=>{var p;try{const m=await U$({url:r,withCredentials:!1}).promise,x=((p=s.current)==null?void 0:p.clientWidth)??375,g=Math.min(window.devicePixelRatio||1,2),y=[];for(let v=1;v<=m.numPages;v++){const w=await m.getPage(v),b=w.getViewport({scale:1}),_=x/b.width*2,T=w.getViewport({scale:_}),A=document.createElement("canvas");A.width=Math.floor(T.width*g),A.height=Math.floor(T.height*g),A.style.width=`${T.width/2}px`,A.style.height=`${T.height/2}px`;const N=A.getContext("2d");if(N.scale(g,g),await w.render({canvasContext:N,viewport:T,canvas:A}).promise,f)return;y.push(A)}f||(a(y),u(!1))}catch(m){f||(l((m==null?void 0:m.message)??"PDF konnte nicht geladen werden."),u(!1))}})(),()=>{f=!0}},[r]),d.jsxs("div",{ref:s,className:`relative w-full bg-neutral-100 overflow-hidden ${t}`,style:{height:e,touchAction:"none"},children:[c&&d.jsx("div",{className:"absolute inset-0 grid place-items-center text-xs text-muted-foreground",children:"PDF wird geladenâ¦"}),o&&d.jsxs("div",{className:"absolute inset-0 grid place-items-center p-4 text-center text-xs text-destructive",children:[o,d.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"block mt-2 underline",children:"PDF öffnen"})]}),!c&&!o&&d.jsx(YE,{minScale:1,maxScale:8,initialScale:1,doubleClick:{mode:"toggle",step:2},wheel:{step:.15},pinch:{step:5},panning:{velocityDisabled:!0},children:d.jsx(qE,{wrapperStyle:{width:"100%",height:"100%"},contentStyle:n==="contain"?{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:8}:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:8,padding:8},children:i.map((f,p)=>d.jsx("img",{src:f.toDataURL("image/png"),alt:`Seite ${p+1}`,draggable:!1,style:n==="contain"?{maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",objectFit:"contain",userSelect:"none"}:{width:"100%",height:"auto",userSelect:"none"}},p))})})]})}function V9({url:r,standNumber:e,standLabel:t,height:n="70vh",fullscreen:s=!1,onHallSelect:i,onStandSelect:a}){const[o,l]=S.useState(null),[c,u]=S.useState(null),f=S.useRef(null),p=S.useRef(null),m=S.useRef(null);S.useEffect(()=>{let y=!1;return l(null),u(null),fetch(r).then(v=>v.ok?v.text():Promise.reject(new Error(`HTTP ${v.status}`))).then(v=>{y||l(v)}
579).catch(v=>{y||u(v.message||"Konnte SVG nicht laden")}),()=>{y=!0}},[r]),S.useEffect(()=>{const y=p.current;if(!y||!o)return;y.innerHTML=o,m.current=y.querySelector("svg");const v=m.current;if(!v)return;qae(v),v.setAttribute("width","100%"),v.setAttribute("height","100%"),v.setAttribute("preserveAspectRatio","xMidYMid meet"),v.style.width="100%",v.style.height="100%",v.style.maxWidth="100%",v.style.maxHeight="100%",v.style.display="block";const w=(e==null?void 0:e.trim())||"",b=(t==null?void 0:t.trim())||"";if(!w&&!b)return;const _=requestAnimationFrame(()=>{const T=window.setTimeout(()=>x(w,b),80);y.dataset.focusTimer=String(T)});return()=>{cancelAnimationFrame(_),y.dataset.focusTimer&&window.clearTimeout(Number(y.dataset.focusTimer)),f.current&&G9(f.current)}},[o,e,t]),S.useEffect(()=>{if(!i)return;const y=m.current;if(!y)return;const v=[],w=(T,A)=>{T.style.cursor="pointer",T.setAttribute("tabindex","0"),T.classList.add("qcad-hall-hit"),T.setAttribute("role","button");const N=k=>{k.preventDefault(),k.stopPropagation(),i(A)};T.addEventListener("click",N),v.push(()=>T.removeEventListener("click",N))},b=document.createTreeWalker(y,NodeFilter.SHOW_COMMENT);let _=b.nextNode();for(;_;){const T=bS(_.nodeValue||""),A=T?wM(T):null;if(A){const N=P1(_);N&&w(N,A)}_=b.nextNode()}return y.querySelectorAll("[id], [data-name], [aria-label]").forEach(T=>{const A=T.getAttribute("data-name")||T.getAttribute("aria-label")||T.getAttribute("id")||"",N=wM(A);N&&w(T,N)}),()=>{v.forEach(T=>T())}},[o,i]),S.useEffect(()=>{if(!a)return;const y=m.current;if(!y||!o)return;const v=[],w=document.createTreeWalker(y,NodeFilter.SHOW_COMMENT);let b=w.nextNode();for(;b;){const _=bS(b.nodeValue||"");if(_){const T=Aj(_);if(/^H\d+-\d+/i.test(T.compact)||/^\d{2,4}$/.test(T.compact)){const N=P1(b);if(N){N.style.cursor="pointer",N.setAttribute("tabindex","0");const k=T.compact,E=P=>{P.preventDefault(),P.stopPropagation(),a(k)};N.addEventListener("click",E),v.push(()=>N.removeEventListener("click",E))}}}b=w.nextNode()}return()=>{v.forEach(_=>_())}},[o,a]);function x(y,v){const w=m.current,b=f.current;if(!w||!b)return;const _=(y?Uae(w,y):null)||(v?zae(w,v):null);if(!_){console.warn("[InteractiveSvg] no match in SVG for:",{cleanedStand:y,cleanedLabel:v});return}Dae(w,_,b,y||v)}const g=S.useMemo(()=>s?{width:"100vw",height:"100vh",maxWidth:"100vw",maxHeight:"100vh",overflow:"hidden"}:{width:"100%",height:n,maxWidth:"100%",maxHeight:"100%",overflow:"hidden"},[s,n]);return c?d.jsxs("div",{className:"p-6 text-sm text-muted-foreground text-center",children:["Plan konnte nicht geladen werden: ",c]}):o?d.jsx("div",{ref:f,style:g,className:"relative bg-white",children:d.jsx(YE,{minScale:1,maxScale:10,doubleClick:{mode:"toggle",step:2},wheel:{step:.15},centerOnInit:!0,limitToBounds:!0,children:d.jsx(qE,{wrapperStyle:{width:"100%",height:"100%",overflow:"hidden"},contentStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("div",{ref:p,style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}})})})}):d.jsx("div",{className:"p-6 text-sm text-muted-foreground text-center",children:"Plan wird geladenâ¦"})}const xR="http://www.w3.org/2000/svg";function Dae(r,e,t,n,s){G9(r);const i=Iae(r,e,n);if(!i.length)return;let a=1/0,o=1/0,l=-1/0,c=-1/0;if(i.forEach(v=>{const w=Lae(r,v,e);!w||w.width<=0||w.height<=0||(a=Math.min(a,w.x),o=Math.min(o,w.y),l=Math.max(l,w.x+w.width),c=Math.max(c,w.y+w.height))}),!isFinite(a)||l<=a||c<=o)return;const u=(a+l)/2,f=(o+c)/2,p=Math.max(Math.max(l-a,c-o)/2,1),m=dA(r),x=r.getBoundingClientRect(),g=x.width>0?m.width/x.width:1,y=document.createElementNS(xR,"g");y.setAttribute("class","qcad-stand-marker qcad-sonar-layer"),y.setAttribute("pointer-events","none"),y.setAttribute("aria-label",n?`Messestand ${n}`:"Messestand"),y.setAttribute("transform",`translate(${u} ${f})`),[0,-.6].forEach(v=>{const w=document.createElementNS(xR,"circle");w.setAttribute("class","qcad-sonar-ring"),w.setAttribute("cx","0"),w.setAttribute("cy","0"),w.setAttribute("r",String(p)),w.setAttribute("fill","none"),w.setAttribute("stroke","#bfd100"),w.setAttribute("stroke-width",String(3*g)),w.style.animationDelay=`${v}s`,y.appendChild(w)}
579),r.appendChild(y),i.forEach(v=>Bae(r,v))}const Mae="path, rect, polygon, polyline, circle, ellipse";function Iae(r,e,t){const n=dA(r),s=[],i=p=>{const m=Ej(r,p);return m?m.width>n.width*.5||m.height>n.height*.5:!0},a=p=>{if(!(!p||p===r)&&!i(p)&&!s.some(m=>m===p||m.contains(p))){for(let m=s.length-1;m>=0;m-=1)p.contains(s[m])&&s.splice(m,1);s.push(p)}},o=["data-stand","data-stand-nr","data-booth-id"],l=new Set,c=(t||"").trim();if(c&&l.add(c),o.forEach(p=>{var x,g;const m=(g=(x=e.closest(`[${p}]`))==null?void 0:x.getAttribute(p))==null?void 0:g.trim();m&&l.add(m)}),!l.size){const p=vM(r,e);return a(p),s.length||s.push(e),s}const u=(p,m)=>{if(!p)return!1;const x=p.trim();if(!x)return!1;if(x===m)return!0;if(!x.toLowerCase().startsWith(m.toLowerCase()))return!1;const g=x.slice(m.length);return!/^\d/.test(g)};if(l.forEach(p=>{const m=CSS.escape(p),x=o.map(y=>`[${y}^="${m}" i]`).concat([`[id^="${m}" i]`,`[class*="${m}"]`]).join(", ");let g=[];try{g=Array.from(r.querySelectorAll(x))}catch{g=[]}g.forEach(y=>{const v=[...o.map(A=>y.getAttribute(A)),y.getAttribute("id")],w=Array.from(y.classList).some(A=>u(A,p)||A.toLowerCase().includes(p.toLowerCase()));if(!v.some(A=>u(A,p))&&!w)return;let b=y,_=null;for(;b&&b!==r;)b instanceof SVGGElement&&[...o.map(N=>b.getAttribute(N)),b.getAttribute("id")].some(N=>u(N,p))&&(_=b),b=b.parentElement;const T=_&&!i(_)?_:y;a(T)})}),s.length)return s;const f=vM(r,e);return a(f),s.length||s.push(e),s}function vM(r,e){const t=e.closest("g[data-stand], [data-booth-id]");if(t)return t;const n=dA(r);let s=e,i=s.parentElement;for(;i&&i!==r&&i instanceof SVGGElement;){const a=Ej(r,i);if(!a||a.width>n.width*.5||a.height>n.height*.5)break;s=i,i=i.parentElement}return s}function Lae(r,e,t){const n=[],s=a=>{const o=Ej(r,a);o&&Number.isFinite(o.width)&&Number.isFinite(o.height)&&o.width>=0&&o.height>=0&&n.push(o)};s(e),e.querySelectorAll(Mae).forEach(s);const i=Y9(n);return i&&i.width>0&&i.height>0?i:K9(r,t)}function Ej(r,e){try{return K9(r,e)}catch{return null}}function Bae(r,e){if(!r.querySelector(".qcad-stand-marker"))return;const n=e.querySelectorAll("text, image, use");if(!n.length)return;const s=document.createElementNS(xR,"g");s.setAttribute("class","qcad-stand-marker qcad-booth-foreground"),s.setAttribute("pointer-events","none"),n.forEach(i=>s.appendChild(i.cloneNode(!0))),r.appendChild(s)}function G9(r){r.querySelectorAll(".qcad-stand-marker").forEach(e=>e.remove()),r.querySelectorAll(".qcad-booth-white-tint").forEach(e=>{e.classList.remove("qcad-booth-white-tint"),e.style.removeProperty("fill");const t=e.getAttribute("data-original-fill");t&&(e.setAttribute("fill",t),e.removeAttribute("data-original-fill"))})}function K9(r,e){const t=e instanceof SVGGElement&&Hae(e)?Wae(r,e):_S(e);if(!Number.isFinite(t.width)||!Number.isFinite(t.height))return null;const n=r.getScreenCTM(),s=e.getScreenCTM();if(!n||!s)return t;const i=n.inverse().multiply(s),a=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}].map(({x:f,y:p})=>{const m=r.createSVGPoint();return m.x=f,m.y=p,m.matrixTransform(i)}),o=a.map(f=>f.x),l=a.map(f=>f.y),c=Math.min(...o),u=Math.min(...l);return{x:c,y:u,width:Math.max(...o)-c,height:Math.max(...l)-u}}function Uae(r,e){const t=Aj(e);if(!t.compact&&!t.lastNumber)return null;const n=$ae(r,t);if(n)return n;const s=r.querySelectorAll("path, rect, polygon, circle, ellipse, polyline, line, g");for(const i of Array.from(s)){if(i.classList.contains("qcad-stand-highlight"))continue;if([i.getAttribute("id")||"",i.getAttribute("data-name")||"",i.getAttribute("name")||"",i.getAttribute("class")||"",...Array.from(i.attributes).filter(o=>o.name.toLowerCase().startsWith("qcad:")).map(o=>o.value)].some(o=>X9(o,t)))return i}return null}function $ae(r,e){const t=document.createTreeWalker(r,NodeFilter.SHOW_COMMENT);let n=t.nextNode();for(;n;){const s=bS(n.nodeValue||"");if(s&&X9(s,e)){const i=P1(n);if(i instanceof SVGGElement)return i}n=t.nextNode()}return null}function zae(r,e){const t=yM(e);if(!t)return null;const n=document.createTreeWalker(r,NodeFilter.SHOW_COMMENT);let s=n.nextNode(),i=null;for(;s;){const a=bS(s.nodeValue||"");if(a){const o=yM(a);if(o){if(o===t){const l=P1(s);if(l instanceof SVGGElement)return l}if(!i&&(o.includes(t)||t.includes(o))&&o.length>=4){const l=P1(s);l instanceof SVGGElement&&(i=l)}}}s=n.nextNode()}return i}function yM(r){return r.toLowerCase().replace(/&/g," und ").replace(/[^a-z0-9]+/g," ").replace(/\b(gmbh|gesmbh|ag|kg|og|eu|ges|m\.?b\.?h\.?|co|inh|e\.?u\.?)\b/g," ").replace(/\s+/g," ").trim()}function bS(r){var n;const e=r.match(/^\s*Text:\s*([\s\S]*?)\s*$/i);return((n=e==null?void 0:e[1])==null?void 0:n.replace(/\s+/g," ").trim())||null}function wM(r){const e=r.toLowerCase().replace(/[_\-]+/g," ").trim();if(!e)return null;if(/freigel(a|ä)nde/.test(e)||e==="freigelaende")return"freigelaende";const t=e.match(/halle\s*[- ]?\s*(\d{1,2})/);if(t){const n=parseInt(t[1],10);if(n>=1&&n<=13)return`halle-${n}`}return null}function P1(r){let e=r.nextSibling;for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;return e}function Aj(r){const e=r.trim().toUpperCase().replace(/\s+/g,"").replace(/[ââ]/g,"-").replace(/\*+$/g,""),t=e.replace(/[^A-Z0-9]/g,""),n=e.match(/\d+/g)||[];return{compact:e,alnum:t,lastNumber:n[n.length-1]||""}}function X9(r,e){const t=Aj(r);return!t.compact&&!t.lastNumber?!1:t.compact===e.compact||t.alnum===e.alnum||e.lastNumber.length>=2&&t.lastNumber===e.lastNumber?!0:e.lastNumber.length===1?t.compact===e.lastNumber:!1}function Hae(r){return r.querySelector("path")!==null&&!r.querySelector("text")}function Wae(r,e){const t=_S(e),n=kS(t),s=dA(r),i=Vae(r,t,s);if(i)return i;const a=Math.max(t.width*2.5,t.height*2.5,Math.min(s.width,s.height)*.18,5),o=Array.from(r.querySelectorAll("path, rect, polygon, circle, ellipse, polyline, line")).filter(u=>!e.contains(u)&&!u.classList.contains("qcad-stand-highlight")).map(u=>_S(u)).filter(u=>Gae(u,t,s)&&Yae(u,n.x,n.y)<=a),l=Y9(o),c=l?Kae(l,t):Xae(t,8,6);return{x:mh(c.x),y:mh(c.y),width:mh(Math.max(c.width,t.width+8,8)),height:mh(Math.max(c.height,t.height+8,8))}}function Vae(r,e,t){const n=e.x+e.width,s=e.y+e.height;kS(e);const i=Math.max(Math.min(t.width,t.height)*.01,.12),a=Array.from(r.querySelectorAll("path, rect, polygon, circle, ellipse, polyline, line")).filter(w=>!w.classList.contains("qcad-stand-highlight")).map(w=>_S(w)).filter(w=>Number.isFinite(w.x)&&Number.isFinite(w.y)),o=a.filter(w=>w.width>=Math.max(e.width*.5,1)&&w.height<=i&&bM(w.x,w.x+w.width,e.x,n)),l=kM(o.filter(w=>w.y<=e.y),w=>w.y),c=_M(o.filter(w=>w.y>=s),w=>w.y),u=l==null?void 0:l.y,f=c==null?void 0:c.y;if(u==null||f==null||f<=u)return null;const p=a.filter(w=>w.height>=Math.max(e.height*.35,.8)&&w.width<=i&&bM(w.y,w.y+w.height,u,f)),m=kM(p.filter(w=>w.x<=e.x),w=>w.x),x=_M(p.filter(w=>w.x>=n),w=>w.x);if(!m||!x||x.x<=m.x)return null;const g={x:m.x,y:u,width:x.x-m.x,height:f-u},y=g.width>t.width*.65||g.height>t.height*.65,v=g.width<e.width*.8||g.height<e.height*.6;return y||v?null:{x:mh(g.x),y:mh(g.y),width:mh(g.width),height:mh(g.height)}}function _S(r){const e=r.getBBox();return{x:e.x,y:e.y,width:e.width,height:e.height}}function dA(r){var t;const e=(t=r.viewBox)==null?void 0:t.baseVal;return e&&e.width&&e.height?{x:e.x,y:e.y,width:e.width,height:e.height}:{x:0,y:0,width:r.clientWidth||1,height:r.clientHeight||1}}
579function Gae(r,e,t){if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return!1;const n=Math.max(r.width,r.height);if(n<=0)return!1;const s=Math.max(e.width*8,e.height*8,Math.min(t.width,t.height)*.35,8);if(n>s)return!1;const i=Math.max(e.width*e.height*80,t.width*t.height*.08,20);return r.width*r.height<=i}function Kae(r,e){const t=kS(e),n=kS(r),s=Math.max(e.width+10,10),i=Math.max(e.height+10,10),a=Math.max(r.width,s),o=Math.max(r.height,i),l=r.width>=s?n.x:t.x,c=r.height>=i?n.y:t.y;return{x:l-a/2,y:c-o/2,width:a,height:o}}function Y9(r){if(!r.length)return null;const e=Math.min(...r.map(i=>i.x)),t=Math.min(...r.map(i=>i.y)),n=Math.max(...r.map(i=>i.x+i.width)),s=Math.max(...r.map(i=>i.y+i.height));return{x:e,y:t,width:n-e,height:s-t}}function Xae(r,e,t){return{x:r.x-e,y:r.y-t,width:r.width+e*2,height:r.height+t*2}}function kS(r){return{x:r.x+r.width/2,y:r.y+r.height/2}}function bM(r,e,t,n){return Math.max(r,t)<=Math.min(e,n)}function _M(r,e){return r.length?r.reduce((t,n)=>e(n)<e(t)?n:t):null}function kM(r,e){return r.length?r.reduce((t,n)=>e(n)>e(t)?n:t):null}function Yae(r,e,t){const n=Math.max(r.x-e,0,e-(r.x+r.width)),s=Math.max(r.y-t,0,t-(r.y+r.height));return Math.hypot(n,s)}function mh(r){return Math.round(r*1e3)/1e3}function qae(r){if(r.getAttribute("viewBox"))return;const e=parseFloat(r.getAttribute("width")||""),t=parseFloat(r.getAttribute("height")||"");if(Number.isFinite(e)&&Number.isFinite(t)&&e>0&&t>0){r.setAttribute("viewBox",`0 0 ${e} ${t}`);return}try{const n=r.getBBox();n.width>0&&n.height>0&&r.setAttribute("viewBox",`${n.x} ${n.y} ${n.width} ${n.height}`)}catch{}}function zu(r){if(!r)return null;const e=r.trim().toLowerCase();if(e.startsWith("freigel"))return"freigelaende";const t=e.match(/(\d{1,2})/);if(t){const n=parseInt(t[1],10);if(n>=1&&n<=13)return`halle-${n}`}return null}function SM(r){if(r==null||isNaN(r))return null;const e=Number(r);return e<=1.0001?e*100:e<=100?e:null}function Zae(r,e){const t=r.trim().toUpperCase().replace(/\s+/g,"").replace(/[ââ]/g,"-").replace(/\*+$/g,""),n=e.trim().toUpperCase().replace(/\s+/g,"").replace(/[ââ]/g,"-").replace(/\*+$/g,"");if(!t||!n)return!1;if(t===n)return!0;const s=(t.match(/\d+/g)||[]).pop()||"",i=(n.match(/\d+/g)||[]).pop()||"";return s.length>=2&&s===i}function q9({x:r,y:e,label:t,fallback:n}){return d.jsxs("div",{"data-stand-id":t,className:"is-highlighted-pulse pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 z-20",style:{left:`${r}%`,top:`${e}%`},children:[d.jsx("span",{className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 block rounded-full bg-accent/40 animate-ping ${n?"w-40 h-40":"w-16 h-16"}`}),d.jsx("span",{className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 block rounded-full bg-accent/60 animate-pulse ${n?"w-24 h-24":"w-10 h-10"}`}),n?d.jsx("span",{className:"relative grid place-items-center min-w-[3.5rem] h-14 px-3 rounded-2xl bg-accent text-accent-foreground shadow-pop ring-4 ring-white font-display font-extrabold text-base",children:t??"Hier"}):d.jsx("span",{className:"relative grid place-items-center w-8 h-8 rounded-full bg-accent text-accent-foreground shadow-pop ring-4 ring-white",children:d.jsx(Pn,{className:"w-4 h-4"})}),t&&!n&&d.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 mt-1 whitespace-nowrap rounded-md bg-black/80 text-white text-[10px] font-bold px-1.5 py-0.5",children:t})]})}function Jae({area:r,marker:e,standNumber:t,standLabel:n,onExpand:s,onHallSelect:i,onStandSelect:a}){const o=r.active,l=S.useRef(null);if(S.useEffect(()=>{if(!e||!l.current)return;const f=setTimeout(()=>{var p;try{(p=l.current)==null||p.setTransform(-(e.x/100)*600+200,-(e.y/100)*600+200,2.2,600,"easeOut")}catch{}},250);return()=>clearTimeout(f)},[e==null?void 0:e.x,e==null?void 0:e.y]),!(o!=null&&o.url))return d.jsxs("div",{className:"rounded-2xl bg-card border border-border shadow-card p-8 text-center text-sm text-muted-foreground",children:["Für ",r.label," ist derzeit kein Plan hinterlegt."]});const c=(o.content_type??"").includes("pdf")||(o.original_filename??"").toLowerCase().endsWith(".pdf"),u=(o.content_type??"").includes("svg")||(o.original_filename??"").toLowerCase().endsWith(".svg");return d.jsxs("div",{className:"relative w-full rounded-2xl overflow-hidden bg-white shadow-card border border-border map-safe-frame",children:[d.jsx("div",{className:"map-safe-inner",children:c?d.jsx(Sj,{url:o.url,height:"100%"}):u?d.jsx(V9,{url:o.url,standNumber:t,standLabel:n,height:"100%",onHallSelect:i,onStandSelect:a}):d.jsx("div",{className:"w-full h-full bg-neutral-100",style:{touchAction:"none"},children:d.jsx(YE,{ref:l,minScale:1,maxScale:8,doubleClick:{mode:"toggle",step:2},wheel:{step:.15},children:d.jsx(qE,{wrapperStyle:{width:"100%",height:"100%"},contentStyle:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[d.jsx("img",{src:o.url,alt:`Hallenplan ${r.label}`,className:"block select-none",style:{maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",margin:"auto"},draggable:!1}),e&&d.jsx(q9,{x:e.x,y:e.y,label:e.label,fallback:e.fallback})]})})})})}),d.jsx("div",{className:"absolute top-2 left-2 rounded-lg bg-primary text-primary-foreground px-2 py-1 text-xs font-extrabold shadow z-10",children:r.label}),d.jsx("button",{onClick:s,className:"absolute top-2 right-2 z-10 grid place-items-center w-9 h-9 rounded-xl bg-white/90 text-foreground shadow tap-scale","aria-label":"Vollbild",children:d.jsx(oN,{className:"w-4 h-4"})})]})}function Z9({hideBack:r=!1,focusExhibitorId:e=null,focusHall:t=null,focusStand:n=null}={}){var Y;const[s,i]=I4(),a=e??s.get("exhibitor"),o=t??s.get("hall"),l=n??s.get("stand"),c=e||t||n?"1":s.get("focus"),[u,f]=S.useState([]),[p,m]=S.useState([]),[x,g]=S.useState(null),[y,v]=S.useState(null),[w,b]=S.useState(!1),[_,T]=S.useState(!0),[A,N]=S.useState(null);S.useEffect(()=>{(async()=>{var U;const[{data:F},J]=await Promise.all([et.from("exhibitors").select("id,name,hall,stand_no,map_x,map_y"),et.functions.invoke("public-maps",{body:{}})]);f(F??[]);const I=(((U=J.data)==null?void 0:U.areas)??[]).filter(te=>{var re;return(re=te.active)==null?void 0:re.url}),M=I.some(te=>te.key==="gesamtplan")?I:[{key:"gesamtplan",label:"Gesamtplan",active:null},...I];m(M),T(!1)})()},[]),S.useEffect(()=>{if(!u.length||!p.length)return;let F;
579if(a&&(F=u.find(J=>J.id===a)),!F&&(o||l)){const J=zu(o);F=u.find(ne=>{var I;return(!l||((I=ne.stand_no)==null?void 0:I.toLowerCase())===l.toLowerCase())&&(!o||zu(ne.hall)===J)})}if(F){v(F);const J=zu(F.hall);J&&p.some(ne=>ne.key===J)&&g(J)}else if(o){const J=zu(o);J&&p.some(ne=>ne.key===J)&&g(J)}(a||o||l||c)&&requestAnimationFrame(()=>window.scrollTo({top:0,left:0,behavior:"instant"}))},[a,o,l,c,u,p]);const k=p.find(F=>F.key===x)??null,E=S.useMemo(()=>k?u.filter(F=>zu(F.hall)===k.key):[],[u,k]),P=S.useMemo(()=>{if(!y||!k||zu(y.hall)!==k.key)return null;const F=SM(y.map_x),J=SM(y.map_y),ne=`Stand ${y.stand_no}`;return F!=null&&J!=null?{x:F,y:J,label:ne,fallback:!1}:{x:50,y:50,label:ne,fallback:!0}},[y,k]);function O(){v(null),b(!1);const F=new URLSearchParams(s);["exhibitor","hall","stand","focus"].forEach(J=>F.delete(J)),i(F)}const D=x===null,H=s.get("from")==="matches",B=s.get("from")==="rallye",ee=s.get("from")==="levelup",X=s.get("from")==="program",W=s.get("topic");return d.jsxs("div",{className:"px-5 safe-top",children:[!r&&(X?d.jsxs(Jt,{to:"/program",className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary text-primary-foreground px-4 py-2 text-sm font-bold shadow-pop tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zum Programm"]}):B?d.jsxs(Jt,{to:"/rallye",className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary text-primary-foreground px-4 py-2 text-sm font-bold shadow-pop tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zur Rallye"]}):ee?d.jsxs(Jt,{to:"/level-up",className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary text-primary-foreground px-4 py-2 text-sm font-bold shadow-pop tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zur Level Up Challenge"]}):H?d.jsxs(Jt,{to:"/quiz?view=matches",className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary text-primary-foreground px-4 py-2 text-sm font-bold shadow-pop tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zu deinen Matches"]}):D?d.jsx(no,{fallback:"/home"}):d.jsxs("button",{onClick:()=>{g(null),v(null)},className:"mt-2 inline-flex items-center gap-1.5 rounded-xl bg-primary text-primary-foreground px-3 py-2 text-sm font-bold shadow-soft tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zur Hallenübersicht"]})),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(Ix,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Hallenpläne"})]}),H&&W&&d.jsx("div",{className:"mt-3 rounded-xl border border-primary/30 bg-primary/10 px-3 py-2",children:d.jsxs("p",{className:"text-xs font-bold text-primary truncate",children:["Match-Kategorie: ",W]})}),_?d.jsx("div",{className:"mt-6 rounded-2xl bg-card border border-border p-8 text-center text-sm text-muted-foreground",children:"Hallenpläne werden geladenâ¦"}):p.length===0?d.jsx("div",{className:"mt-6 rounded-2xl bg-card border border-border p-8 text-center text-sm text-muted-foreground",children:"Die Hallenpläne werden derzeit vorbereitet."}):(()=>{var U,te,re;const F=x==="gesamtplan",J=p.filter(se=>se.key!=="gesamtplan"),ne=p.find(se=>se.key==="gesamtplan")??null,I=[...ne?[ne]:[],...J],z=se=>{g(se),v(null)},M=se=>{const ie=E.filter(ae=>ae.stand_no&&Zae(ae.stand_no,se));ie.length===1?(v(ie[0]),N(null)):ie.length>1&&N({stand:se,options:ie})};return x===null?d.jsxs("div",{className:"mt-4 space-y-3",children:[d.jsx("button",{onClick:()=>z("gesamtplan"),className:"w-full rounded-2xl bg-primary text-primary-foreground font-display font-extrabold text-lg py-6 shadow-pop tap-scale hover:brightness-110",children:"Gesamtplan Areal"}),J.length===0?d.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"Es sind noch keine Hallenpläne verfügbar."}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:J.map(se=>d.jsx("button",{onClick:()=>z(se.key),className:"rounded-2xl bg-card text-foreground border-2 border-primary/30 font-display font-extrabold text-base py-6 shadow-card tap-scale hover:bg-primary/5",children:se.label},se.key))})]}):d.jsxs(d.Fragment,{children:[x&&d.jsx("div",{className:"mt-4 flex items-center gap-2 overflow-x-auto pb-1 -mx-1 px-1",children:I.map(se=>d.jsx("button",{onClick:()=>z(se.key),className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-bold tap-scale border whitespace-nowrap ${se.key===x?"bg-primary text-primary-foreground border-primary":"bg-card text-foreground border-border hover:bg-secondary"}`,children:se.label},se.key))}),k&&((U=k.active)==null?void 0:U.url)&&d.jsx("div",{className:"mt-3",children:d.jsx(Jae,{area:k,marker:P,standNumber:y&&zu(y.hall)===k.key?y.stand_no:null,
579standLabel:y&&zu(y.hall)===k.key?y.name:null,onExpand:()=>b(!0),onHallSelect:F?z:void 0,onStandSelect:F?void 0:M})}),F&&!((te=k==null?void 0:k.active)!=null&&te.url)&&d.jsx("div",{className:"mt-4",children:d.jsxs("div",{className:"rounded-2xl bg-card border border-border p-5 shadow-card",children:[d.jsx("p",{className:"text-sm text-muted-foreground text-center mb-4",children:"Kein Gesamtlageplan hinterlegt. Wähle eine Halle:"}),J.length===0?d.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Es sind noch keine Hallenpläne verfügbar."}):d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:J.map(se=>d.jsx("button",{onClick:()=>z(se.key),className:"rounded-2xl bg-primary text-primary-foreground font-display font-extrabold text-base py-6 shadow-pop tap-scale border-2 border-primary hover:brightness-110",children:se.label},se.key))})]})}),!F&&k&&!((re=k.active)!=null&&re.url)&&d.jsxs("div",{className:"mt-4 rounded-2xl bg-card border border-border shadow-card p-8 text-center text-sm text-muted-foreground",children:["Für ",k.label," ist derzeit kein Plan hinterlegt."]}),y&&!F&&d.jsxs("div",{className:"mt-4 rounded-2xl gradient-accent text-accent-foreground p-4 shadow-pop flex items-start gap-3 ring-4 ring-accent/40 animate-pulse",children:[d.jsx("div",{className:"grid place-items-center w-9 h-9 rounded-xl bg-white/20",children:d.jsx(Pn,{className:"w-5 h-5"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-xs font-bold opacity-90",children:"Hervorgehoben"}),d.jsx("p",{className:"font-display font-bold leading-tight",children:y.name}),d.jsxs("p",{className:"text-xs opacity-90",children:["Halle ",y.hall," · Stand ",y.stand_no]}),d.jsx(Jt,{to:`/exhibitors/${y.id}`,className:"text-xs font-bold underline-offset-2 hover:underline",children:"Aussteller-Details â"})]}),d.jsx("button",{onClick:O,className:"grid place-items-center w-8 h-8 rounded-xl bg-white/15 hover:bg-white/25 tap-scale","aria-label":"Markierung entfernen",children:d.jsx(Xn,{className:"w-4 h-4"})})]}),!F&&k&&d.jsxs("div",{className:"mt-5",children:[d.jsxs("h2",{className:"font-display text-base font-bold",children:["Stände in ",k.label]}),d.jsxs("ul",{className:"mt-2 divide-y divide-border rounded-2xl bg-card shadow-card overflow-hidden",children:[E.map(se=>{const ie=(y==null?void 0:y.id)===se.id;return d.jsx("li",{className:ie?"ring-4 ring-accent/70 animate-pulse rounded-xl":"",children:d.jsxs("button",{onClick:()=>{v(se),requestAnimationFrame(()=>window.scrollTo({top:0,left:0,behavior:"smooth"}))},className:`w-full flex items-center justify-between px-4 py-3 text-left tap-scale ${ie?"bg-accent/10":"hover:bg-secondary/60"}`,children:[d.jsx("span",{className:`font-semibold ${ie?"text-accent":""}`,children:se.name}),d.jsxs("span",{className:`text-xs font-bold ${ie?"text-accent":"text-muted-foreground"}`,children:["Stand ",se.stand_no]})]})},se.id)}),E.length===0&&d.jsx("li",{className:"px-4 py-6 text-sm text-muted-foreground text-center",children:"Noch keine Aussteller in dieser Halle erfasst."})]})]})]})})(),w&&((Y=k==null?void 0:k.active)==null?void 0:Y.url)&&d.jsx(Qae,{area:k,areas:p,onSelect:g,marker:P,highlight:y,onClose:()=>b(!1),onClearHighlight:O}),A&&d.jsx("div",{className:"fixed inset-0 z-[210] flex items-end sm:items-center justify-center bg-black/50 animate-in fade-in duration-200",onClick:()=>N(null),children:d.jsxs("div",{className:"w-full sm:max-w-md bg-card rounded-t-3xl sm:rounded-3xl shadow-pop border border-border p-5 pb-8 safe-top",onClick:F=>F.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:"Gemeinsam genutzter Stand"}),d.jsxs("h3",{className:"font-display text-lg font-extrabold",children:["Stand ",A.stand," wird gemeinsam genutzt von:"]})]}),d.jsx("button",{onClick:()=>N(null),className:"grid place-items-center w-9 h-9 rounded-xl bg-secondary text-foreground tap-scale shrink-0","aria-label":"SchlieÃen",children:d.jsx(Xn,{className:"w-4 h-4"})})]}),d.jsx("ul",{className:"mt-4 divide-y divide-border rounded-2xl border border-border overflow-hidden",children:A.options.map(F=>d.jsx("li",{children:d.jsxs("button",{onClick:()=>{v(F),N(null)},className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left hover:bg-secondary/60 tap-scale",children:[d.jsx("span",{className:"font-semibold",children:F.name}),d.jsxs("span",{className:"text-xs font-bold text-muted-foreground",children:["Halle ",F.hall," · Stand ",F.stand_no]})]})},F.id))})]})})]})}function Qae({area:r,areas:e,onSelect:t,marker:n,highlight:s,onClose:i,onClearHighlight:a}){const o=r.active,l=(o.content_type??"").includes("pdf")||(o.original_filename??"").toLowerCase().endsWith(".pdf"),c=(o.content_type??"").includes("svg")||(o.original_filename??"").toLowerCase().endsWith(".svg"),u=S.useRef(null),f=S.useRef(null);return S.useEffect(()=>{if(!n||l||c)return;const p=()=>{const m=f.current,x=u.current;
579if(!m||!x||!m.naturalWidth)return!1;const g=window.innerWidth,y=window.innerHeight,v=2.5,w=Math.min(g/m.naturalWidth,y/m.naturalHeight),b=m.naturalWidth*w,_=m.naturalHeight*w,T=(g-b)/2,A=(y-_)/2,N=T+n.x/100*b,k=A+n.y/100*_,E=g/2-N*v,P=y/2-k*v;try{x.setTransform(E,P,v,700,"easeOut")}catch{}return!0};if(!p()){const m=setTimeout(p,400);return()=>clearTimeout(m)}},[n==null?void 0:n.x,n==null?void 0:n.y,l,c,r.key]),d.jsxs("div",{className:"fixed inset-0 z-[200] bg-black animate-in fade-in duration-300",style:{width:"100vw",height:"100vh"},children:[l?d.jsx(Sj,{url:o.url,height:"100vh",fit:"contain",className:"!rounded-none"}):c?d.jsx(V9,{url:o.url,standNumber:(s==null?void 0:s.stand_no)??null,standLabel:(s==null?void 0:s.name)??null,fullscreen:!0}):d.jsx("div",{className:"w-full h-full",style:{touchAction:"none"},children:d.jsx(YE,{ref:u,minScale:1,maxScale:8,doubleClick:{mode:"toggle",step:2},wheel:{step:.15},children:d.jsx(qE,{wrapperStyle:{width:"100vw",height:"100vh"},contentStyle:{width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("div",{className:"relative",style:{width:"100vw",height:"100vh"},children:[d.jsx("img",{ref:f,src:o.url,alt:`Hallenplan ${r.label}`,draggable:!1,style:{width:"100vw",height:"100vh",objectFit:"contain",userSelect:"none"}}),n&&d.jsx(q9,{x:n.x,y:n.y,label:n.label,fallback:n.fallback})]})})})}),d.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center gap-2 p-2 bg-gradient-to-b from-black/70 to-transparent safe-top",children:[d.jsx("div",{className:"rounded-lg bg-primary text-primary-foreground px-2.5 py-1 text-xs font-extrabold shadow shrink-0",children:r.label}),d.jsx("div",{className:"flex-1 flex gap-1.5 overflow-x-auto",children:e.map(p=>d.jsx("button",{onClick:()=>t(p.key),className:`shrink-0 rounded-full px-3 py-1 text-xs font-bold tap-scale border ${p.key===r.key?"bg-primary text-primary-foreground border-primary":"bg-white/85 text-foreground border-white/30"}`,children:p.label},p.key))}),d.jsx("button",{onClick:i,className:"grid place-items-center w-9 h-9 rounded-xl bg-white/90 text-foreground tap-scale shrink-0","aria-label":"Vollbild schlieÃen",children:d.jsx(Xn,{className:"w-4 h-4"})})]}),s&&d.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 rounded-2xl gradient-accent text-accent-foreground px-3 py-2 shadow-pop max-w-[92vw]",children:[d.jsx(Pn,{className:"w-4 h-4 shrink-0"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-[11px] font-bold truncate",children:s.name}),d.jsxs("p",{className:"text-[10px] opacity-90",children:["Halle ",s.hall," · Stand ",s.stand_no]})]}),d.jsx("button",{onClick:a,className:"ml-2 rounded-lg bg-white/20 hover:bg-white/30 px-2 py-1 text-[11px] font-bold tap-scale shrink-0",children:"Markierung entfernen"})]})]})}function J9({hideBack:r=!1}={}){const[e,t]=S.useState([]),[n,s]=S.useState("");S.useEffect(()=>{(async()=>{const{data:a}=await et.from("exhibitors").select("id,name,hall,stand_no,categories,promo_text").order("name");t(a??[])})()},[]);const i=S.useMemo(()=>{const a=n.trim().toLowerCase();return a?e.filter(o=>o.name.toLowerCase().includes(a)):e},[n,e]);return d.jsxs("div",{className:"px-5 safe-top",children:[!r&&d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(ec,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Aussteller"})]}),d.jsxs("div",{className:"mt-4 relative",children:[d.jsx(IE,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{value:n,onChange:a=>s(a.target.value),placeholder:"Suche nach Ausstellernameâ¦",className:"w-full rounded-2xl border border-border bg-card pl-10 pr-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary"})]}),d.jsx("ul",{className:"mt-4 flex flex-col gap-2",children:i.map(a=>d.jsx("li",{children:d.jsxs(Jt,{to:`/exhibitors/${a.id}`,className:"flex items-center justify-between gap-3 rounded-2xl bg-card shadow-card px-4 py-3 tap-scale",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-display font-bold leading-tight truncate",children:a.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.hall," · Stand ",a.stand_no]}),d.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:a.categories.slice(0,3).map(o=>d.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wide bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:o},o))})]}),d.jsx(Mx,{className:"w-5 h-5 text-muted-foreground shrink-0"})]})},a.id))})]})}const eoe=r=>{const e=Number(String(r??"").replace(/[^0-9]/g,""));return Number.isFinite(e)&&String(r??"").match(/[0-9]/)?e:null};function Q9({hideBack:r=!1,onShowOnMap:e}={}){const[t,n]=S.useState([]),[s,i]=S.useState([]),[a,o]=S.useState(""),[l,c]=S.useState(null);S.useEffect(()=>{(async()=>{const[{data:x},{data:g}]=await Promise.all([et.from("exhibitors").select("id,name,hall,stand_no,kvz_nrs").order("name"),et.from("categories").select("code,name,sort_order").order("sort_order")]);n(x??[]),i(g??[])})()},[]);const u=S.useMemo(()=>{const x=new Map;for(const g of t)for(const y of g.kvz_nrs??[])x.has(y)||x.set(y,[]),x.get(y).push(g);return x},[t]),f=S.useMemo(()=>s.map(x=>{const g=eoe(x.code);return{...x,nr:g,exs:g!=null?u.get(g)??[]:[]}}),[s,u]),p=S.useMemo(()=>{const x=a.trim().toLowerCase();return x?f.filter(g=>g.name.toLowerCase().includes(x)||g.code.toLowerCase().includes(x)||g.exs.some(y=>y.name.toLowerCase().includes(x))):f},[f,a]),m=l?f.find(x=>x.code===l):null;return m?d.jsxs("div",{className:"px-5 safe-top pb-6",children:[d.jsxs("button",{onClick:()=>c(null),className:"inline-flex items-center gap-1 text-sm font-semibold text-primary tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück zum Kategorienverzeichnis"]}),d.jsx("h1",{className:"font-display text-2xl font-extrabold mt-3 leading-tight",children:m.name}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[m.exs.length," Aussteller"]}),d.jsxs("ul",{className:"mt-4 flex flex-col gap-2",children:[m.exs.map(x=>d.jsxs("li",{className:"rounded-2xl bg-card shadow-card p-4",children:[e?d.jsxs("div",{children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:x.name}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[x.hall," · Stand ",x.stand_no]})]}):d.jsxs(Jt,{to:`/exhibitors/${x.id}`,className:"block tap-scale",children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:x.name}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[x.hall," · Stand ",x.stand_no]})]}),e?d.jsxs("button",{onClick:()=>e({id:x.id,hall:x.hall??"",stand_no:x.stand_no??""}),className:"mt-3 inline-flex items-center gap-2 rounded-xl bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Auf dem Hallenplan anzeigen"]}):d.jsxs(Jt,{to:`/map?exhibitor=${x.id}&hall=${encodeURIComponent(x.hall??"")}&stand=${encodeURIComponent(x.stand_no??"")}&focus=1`,className:"mt-3 inline-flex items-center gap-2 rounded-xl bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground tap-scale",children:[d.jsx(Pn,{className:"w-4 h-4"})," Auf dem Hallenplan anzeigen"]})]},x.id)),m.exs.length===0&&d.jsx("li",{className:"rounded-2xl bg-card shadow-card p-6 text-center text-sm text-muted-foreground",children:"Für diese Kategorie sind derzeit keine Aussteller eingetragen."})]})]}):d.jsxs("div",{className:"px-5 safe-top pb-6",children:[!r&&d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(Rh,{className:"w-4 h-4"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Kategorienverzeichnis"})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Aussteller nach Kategorie sortiert."}),d.jsxs("div",{className:"mt-4 relative",children:[d.jsx(IE,{className:"w-4 h-4 absolute left-3.5 to
579p-1/2 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{value:a,onChange:x=>o(x.target.value),placeholder:"Kategorie oder Aussteller suchenâ¦",className:"w-full rounded-2xl border border-border bg-card pl-10 pr-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary"})]}),d.jsxs("ul",{className:"mt-4 flex flex-col gap-2",children:[p.map(x=>d.jsx("li",{className:"rounded-2xl bg-card shadow-card overflow-hidden",children:d.jsxs("button",{onClick:()=>c(x.code),className:"w-full flex items-center justify-between gap-3 px-4 py-3.5 tap-scale",children:[d.jsxs("div",{className:"text-left min-w-0",children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:x.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.exs.length," Aussteller"]})]}),d.jsx(Mx,{className:"w-5 h-5 text-muted-foreground shrink-0"})]})},x.code)),p.length===0&&d.jsx("li",{className:"rounded-2xl bg-card shadow-card p-6 text-center text-sm text-muted-foreground",children:"Noch keine Kategorien erfasst."})]})]})}function toe(){const{id:r}=HK(),e=ba(),[t,n]=S.useState(null);function s(){window.history.length>1?e(-1):e("/exhibitors")}return S.useEffect(()=>{r&&(async()=>{const{data:i}=await et.from("exhibitors").select("id,name,hall,stand_no,promo_text,categories,contact_email,contact_phone,website").eq("id",r).maybeSingle();n(i??null)})()},[r]),t?d.jsxs("div",{children:[d.jsxs("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem]",children:[d.jsxs("button",{onClick:s,className:"inline-flex items-center gap-1 text-primary-foreground/90 text-sm font-semibold tap-scale",children:[d.jsx(_i,{className:"w-4 h-4"})," Zurück"]}),d.jsx("h1",{className:"font-display text-2xl font-extrabold mt-2 leading-tight",children:t.name}),d.jsxs("p",{className:"opacity-85 text-sm mt-1",children:[t.hall," · Stand ",t.stand_no]})]}),d.jsxs("section",{className:"px-5 mt-5",children:[t.promo_text&&d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-5 border-l-4 border-accent",children:[d.jsx("p",{className:"text-xs font-extrabold uppercase tracking-wider text-accent",children:"Was wir zeigen"}),d.jsx("p",{className:"mt-2 text-foreground/90 leading-relaxed whitespace-pre-line text-[15px]",children:t.promo_text})]}),d.jsxs(Jt,{to:`/map?exhibitor=${t.id}&hall=${encodeURIComponent(t.hall??"")}&stand=${encodeURIComponent(t.stand_no??"")}&focus=1`,className:"mt-3 flex items-center justify-center gap-2 gradient-accent text-accent-foreground rounded-2xl py-3.5 font-display font-bold shadow-pop tap-scale",children:[d.jsx(Pn,{className:"w-5 h-5"})," Auf dem Hallenplan anzeigen"]}),d.jsxs("div",{className:"mt-4 rounded-2xl bg-card shadow-card divide-y divide-border",children:[t.contact_email&&d.jsxs("a",{href:`mailto:${t.contact_email}`,className:"flex items-center gap-3 px-4 py-3 tap-scale",children:[d.jsx(I8,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold",children:t.contact_email})]}),t.contact_phone&&d.jsxs("a",{href:`tel:${t.contact_phone}`,className:"flex items-center gap-3 px-4 py-3 tap-scale",children:[d.jsx(U8,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold",children:t.contact_phone})]}),t.website&&d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[d.jsx(D8,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold truncate text-foreground/70",children:t.website})]})]})]})]}):d.jsx("div",{className:"p-6 text-muted-foreground",children:"Lädtâ¦"})}function EM(r){const e=new URLSearchParams;return r.aussteller_id&&e.set("exhibitor",r.aussteller_id),r.halle&&e.set("hall",r.halle),r.stand_buehne&&e.set("stand",r.stand_buehne),!r.aussteller_id&&!r.halle&&!r.stand_buehne?null:(e.set("from","program"),`/map?${e.toString()}`)}function ez({hideBack:r=!1}={}){const[e,t]=S.useState([]),[n,s]=S.useState(null),[i,a]=S.useState(!0);S.useEffect(()=>{(async()=>{const{data:f}=await et.from("program_events").select("*").order("datum",{ascending:!0}).order("startzeit",{ascending:!0});t(f??[]),a(!1)})()},[]);const o=S.useMemo(()=>{const f=new Set;return e.forEach(p=>f.add(p.datum??"sonstige")),[...f].sort()},[e]),l=n??o[0]??null,c=e.filter(f=>(f.datum??"sonstige")===l),u=f=>f==="sonstige"?"Ohne Datum":new Date(f+"T00:00:00").toLocaleDateString("de-AT",{weekday:"short",day:"2-digit",month:"2-digit"});return d.jsxs("div",{className:"px-5 safe-top pb-6",children:[!r&&d.jsx(no,{fallback:"/home"}),d.jsxs("header",{className:"flex items-center gap-2 text-primary mt-4",children:[d.jsx(Su,{className:"w-5 h-5"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Programm & Ablauf"})]}),o.length>1&&d.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-1",children:o.map(f=>d.jsx("button",{onClick:()=>s(f),className:`px-3 py-1.5 rounded-full text-xs font-extrabold whitespace-nowrap tap-scale ${f===l?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:u(f)},f))}),!i&&e.length===0&&d.jsxs("div",{className:"mt-8 rounded-2xl bg-card shadow-card p-6 text-center",children:[d.jsx("p",{className:"font-display font-bold",children:"Programm folgt in Kürze"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Die Programmpunkte werden gerade finalisiert."})]}),d.jsx("div",{className:"mt-4 space-y-3",children:c.map(f=>d.jsxs("article",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"text-[10px] font-extrabold uppercase tracking-wide px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:f.kategorie}),(f.startzeit||f.endzeit)&&d.jsxs("span",{className:"text-[11px] font-bold text-muted-foreground inline-flex items-center gap-1",children:[d.jsx($b,{className:"w-3.5 h-3.5"}
vendor: 4,618 bytes, line 579
579),[f.startzeit,f.endzeit].filter(Boolean).join(" â ")," Uhr"]})]}),d.jsx("h2",{className:"font-display font-bold leading-tight mt-1.5",children:f.titel}),f.referent_veranstalter&&d.jsxs("p",{className:"text-xs text-muted-foreground mt-1 inline-flex items-center gap-1",children:[d.jsx(Bq,{className:"w-3.5 h-3.5"})," ",f.referent_veranstalter]}),f.beschreibung&&d.jsx("p",{className:"text-sm text-muted-foreground mt-2 whitespace-pre-line",children:f.beschreibung}),d.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:(f.halle||f.stand_buehne||f.raum_ort)&&d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 text-primary font-bold px-2.5 py-1",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"}),[f.halle,f.stand_buehne||f.raum_ort].filter(Boolean).join(" â ")]})}),EM(f)&&d.jsxs(Jt,{to:EM(f),className:"mt-2 inline-flex items-center gap-1.5 rounded-full bg-primary text-primary-foreground px-3 py-2 text-xs font-extrabold shadow-soft tap-scale",children:[d.jsx(Pn,{className:"w-3.5 h-3.5"})," Auf dem Hallenplan anzeigen"]})]},f.id))})]})}var DT="focusScope.autoFocusOnMount",MT="focusScope.autoFocusOnUnmount",AM={bubbles:!1,cancelable:!0},roe="FocusScope",tz=S.forwardRef((r,e)=>{const{loop:t=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=r,[o,l]=S.useState(null),c=Ql(s),u=Ql(i),f=S.useRef(null),p=ms(e,g=>l(g)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(n){let g=function(b){if(m.paused||!o)return;const _=b.target;o.contains(_)?f.current=_:Yu(f.current,{select:!0})},y=function(b){if(m.paused||!o)return;const _=b.relatedTarget;_!==null&&(o.contains(_)||Yu(f.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const T of b)T.removedNodes.length>0&&Yu(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(v);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[n,o,m.paused]),S.useEffect(()=>{if(o){CM.add(m);const g=document.activeElement;if(!o.contains(g)){const v=new CustomEvent(DT,AM);o.addEventListener(DT,c),o.dispatchEvent(v),v.defaultPrevented||(noe(loe(rz(o)),{select:!0}),document.activeElement===g&&Yu(o))}return()=>{o.removeEventListener(DT,c),setTimeout(()=>{const v=new CustomEvent(MT,AM);o.addEventListener(MT,u),o.dispatchEvent(v),v.defaultPrevented||Yu(g??document.body,{select:!0}),o.removeEventListener(MT,u),CM.remove(m)},0)}}},[o,c,u,m]);const x=S.useCallback(g=>{if(!t&&!n||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const w=g.currentTarget,[b,_]=soe(w);b&&_?!g.shiftKey&&v===_?(g.preventDefault(),t&&Yu(b,{select:!0})):g.shiftKey&&v===b&&(g.preventDefault(),t&&Yu(_,{select:!0})):v===w&&g.preventDefault()}},[t,n,m.paused]);return d.jsx(sn.div,{tabIndex:-1,...a,ref:p,onKeyDown:x})});tz.displayName=roe;function noe(r,{select:e=!1}={}){const t=document.activeElement;for(const n of r)if(Yu(n,{select:e}),document.activeElement!==t)return}function soe(r){const e=rz(r),t=TM(e,r),n=TM(e.reverse(),r);return[t,n]}function rz(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function TM(r,e){for(const t of r)if(!ioe(t,{upTo:e}))return t}function ioe(r,{upTo:e}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(e!==void 0&&r===e)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function aoe(r){return r instanceof HTMLInputElement&&"select"in r}function Yu(r,{select:e=!1}={}){if(r&&r.focus){const t=document.activeElement;r.focus({preventScroll:!0}),r!==t&&aoe(r)&&e&&r.select()}}var CM=ooe();function ooe(){let r=[];return{add(e){const t=r[0];e!==t&&(t==null||t.pause()),r=NM(r,e),r.unshift(e)},remove(e){var t;r=NM(r,e),(t=r[0])==null||t.resume()}}}function NM(r,e){const t=[...r],n=t.indexOf(e);return n!==-1&&t.splice(n,1),t}function loe(r){return r.filter(e=>e.tagName!=="A")}var IT=0;function coe(){S.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??PM()),document.body.insertAdjacentElement("beforeend",r[1]??PM()),IT++,()=>{IT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,215 bytes, line 579
579=>e.remove()),IT--}},[])}function PM(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var Gl=function(){return Gl=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Gl.apply(this,arguments)};function nz(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function uoe(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}var x2="right-scroll-bar-position",v2="width-before-scroll-bar",doe="with-scroll-bars-hidden",hoe="--removed-body-scroll-bar-size";function LT(r,e){return typeof r=="function"?r(e):r&&(r.current=e),r}function foe(r,e){var t=S.useState(function(){return{value:r,callback:e,facade:{get current(){return t.value},set current(n){var s=t.value;s!==n&&(t.value=n,t.callback(n,s))}}}})[0];return t.callback=e,t.facade}var poe=typeof window<"u"?S.useLayoutEffect:S.useEffect,RM=new WeakMap;function moe(r,e){var t=foe(null,function(n){return r.forEach(function(s){return LT(s,n)})});return poe(function(){var n=RM.get(t);if(n){var s=new Set(n),i=new Set(r),a=t.current;s.forEach(function(o){i.has(o)||LT(o,null)}),i.forEach(function(o){s.has(o)||LT(o,a)})}RM.set(t,r)},[r]),t}function goe(r){return r}function xoe(r,e){e===void 0&&(e=goe);var t=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:r},useMedium:function(i){var a=e(i,n);return t.push(a),function(){t=t.filter(function(o){return o!==a})}},assignSyncMedium:function(i){for(n=!0;t.length;){var a=t;t=[],a.forEach(i)}t={push:function(o){return i(o)},filter:function(){return t}}},assignMedium:function(i){n=!0;var a=[];if(t.length){var o=t;t=[],o.forEach(i),a=t}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),t={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),t}}}};return s}function voe(r){r===void 0&&(r={});var e=xoe(null);return e.options=Gl({async:!0,ssr:!1},r),e}var sz=function(r){var e=r.sideCar,t=nz(r,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return S.createElement(n,Gl({},t))};sz.isSideCarExport=!0;function yoe(r,e){return r.useMedium(e),sz}var iz=voe(),BT=function(){},hA=S.forwardRef(function(r,e){var t=S.useRef(null),n=S.useState({onScrollCapture:BT,onWheelCapture:BT,onTouchMoveCapture:BT}),s=n[0],i=n[1],a=r.forwardProps,o=r.children,l=r.className,c=r.removeScrollBar,u=r.enabled,f=r.shards,p=r.sideCar,m=r.noRelative,x=r.noIsolation,g=r.inert,y=r.allowPinchZoom,v=r.as,w=v===void 0?"div":v,b=r.gapMode,_=nz(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=p,A=moe([t,e]),N=Gl(Gl({},_),s);return S.createElement(S.Fragment,null,u&&S.createElement(T,{sideCar:iz,removeScrollBar:c,shards:f,noRelative:m,noIsolation:x,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:t,gapMode:b}),a?S.cloneElement(S.Children.only(o),Gl(Gl({},N),{ref:A})):S.createElement(w,Gl({},N,{className:l,ref:A}),o))});hA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hA.classNames={fullWidth:v2,zeroRight:x2};var woe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function boe(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var e=woe();return e&&r.setAttribute("nonce",e),r}function _oe(r,e){r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}function koe(r){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(r)}var Soe=function(){var r=0,e=null;return{add:function(t){r==0&&(e=boe())&&(_oe(e,t),koe(e)),r++},remove:function(){r--,!r&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Eoe=function(){var r=Soe();return function(e,t){S.useEffect(function(){return r.add(e),function(){r.remove()}},[e&&t])}},az=function(){var r=Eoe(),e=function(t){var n=t.styles,s=t.dynamic;return r(n,s),null};return e},Aoe={left:0,top:0,right:0,gap:0},UT=function(r){return parseInt(r||"",10)||0},Toe=function(r){var e=window.getComputedStyle(document.body),t=e[r==="padding"?"paddingLeft":"marginLeft"],n=e[r==="padding"?"paddingTop":"marginTop"],s=e[r==="padding"?"paddingRight":"marginRight"];return[UT(t),UT(n),UT(s)]},Coe=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return Aoe;var e=Toe(r),t=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-t+e[2]-e[0])}}
vendor: 1,794 bytes, lines 579-616
579,Noe=az(),Hm="data-scroll-locked",Poe=function(r,e,t,n){var s=r.left,i=r.top,a=r.right,o=r.gap;return t===void 0&&(t="margin"),` 580 .`.concat(doe,` { 581 overflow: hidden `).concat(n,`; 582 padding-right: `).concat(o,"px ").concat(n,`; 583 } 584 body[`).concat(Hm,`] { 585 overflow: hidden `).concat(n,`; 586 overscroll-behavior: contain; 587 `).concat([e&&"position: relative ".concat(n,";"),t==="margin"&&` 588 padding-left: `.concat(s,`px; 589 padding-top: `).concat(i,`px; 590 padding-right: `).concat(a,`px; 591 margin-left:0; 592 margin-top:0; 593 margin-right: `).concat(o,"px ").concat(n,`; 594 `),t==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),` 595 } 596 597 .`).concat(x2,` { 598 right: `).concat(o,"px ").concat(n,`; 599 } 600 601 .`).concat(v2,` { 602 margin-right: `).concat(o,"px ").concat(n,`; 603 } 604 605 .`).concat(x2," .").concat(x2,` { 606 right: 0 `).concat(n,`; 607 } 608 609 .`).concat(v2," .").concat(v2,` { 610 margin-right: 0 `).concat(n,`; 611 } 612 613 body[`).concat(Hm,`] { 614 `).concat(hoe,": ").concat(o,`px; 615 } 616`)},jM=function(){var r=parseInt(document.body.getAttribute(Hm)||"0",10);return isFinite(r)?r:0},Roe=function(){S.useEffect(function(){return document.body.setAttribute(Hm,(jM()+1).toString()),function(){var r=jM()-1;r<=0?document.body.removeAttribute(Hm):document.body.setAttribute(Hm,r.toString())}},[])},joe=function(r){var e=r.noRelative,t=r.noImportant,n=r.gapMode,s=n===void 0?"margin":n;Roe();var i=S.useMemo(function(){return Coe(s)},[s]);return S.createElement(Noe,{styles:Poe(i,!e,s,t?"":"!important")})},vR=!1;if(typeof window<"u")try{var Z_=Object.defineProperty({},"passive",{get:function(){return vR=!0,!0}});window.addEventListener("test",Z_,Z_),window.removeEventListener("test",Z_,Z_)}catch{vR=!1}var J0=vR?{passive:!1}
vendor: 5,211 bytes, lines 616-619
616:!1,Ooe=function(r){return r.tagName==="TEXTAREA"},oz=function(r,e){if(!(r instanceof Element))return!1;var t=window.getComputedStyle(r);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!Ooe(r)&&t[e]==="visible")},Foe=function(r){return oz(r,"overflowY")},Doe=function(r){return oz(r,"overflowX")},OM=function(r,e){var t=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=lz(r,n);if(s){var i=cz(r,n),a=i[1],o=i[2];if(a>o)return!0}n=n.parentNode}while(n&&n!==t.body);return!1},Moe=function(r){var e=r.scrollTop,t=r.scrollHeight,n=r.clientHeight;return[e,t,n]},Ioe=function(r){var e=r.scrollLeft,t=r.scrollWidth,n=r.clientWidth;return[e,t,n]},lz=function(r,e){return r==="v"?Foe(e):Doe(e)},cz=function(r,e){return r==="v"?Moe(e):Ioe(e)},Loe=function(r,e){return r==="h"&&e==="rtl"?-1:1},Boe=function(r,e,t,n,s){var i=Loe(r,window.getComputedStyle(e).direction),a=i*n,o=t.target,l=e.contains(o),c=!1,u=a>0,f=0,p=0;do{if(!o)break;var m=cz(r,o),x=m[0],g=m[1],y=m[2],v=g-y-i*x;(x||v)&&lz(r,o)&&(f+=v,p+=x);var w=o.parentNode;o=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(p)<1||!s))&&(c=!0),c},J_=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},FM=function(r){return[r.deltaX,r.deltaY]},DM=function(r){return r&&"current"in r?r.current:r},Uoe=function(r,e){return r[0]===e[0]&&r[1]===e[1]},$oe=function(r){return` 617 .block-interactivity-`.concat(r,` {pointer-events: none;} 618 .allow-interactivity-`).concat(r,` {pointer-events: all;} 619`)},zoe=0,Q0=[];function Hoe(r){var e=S.useRef([]),t=S.useRef([0,0]),n=S.useRef(),s=S.useState(zoe++)[0],i=S.useState(az)[0],a=S.useRef(r);S.useEffect(function(){a.current=r},[r]),S.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(s));var g=uoe([r.lockRef.current],(r.shards||[]).map(DM),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[r.inert,r.lockRef.current,r.shards]);var o=S.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var v=J_(g),w=t.current,b="deltaX"in g?g.deltaX:w[0]-v[0],_="deltaY"in g?g.deltaY:w[1]-v[1],T,A=g.target,N=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in g&&N==="h"&&A.type==="range")return!1;var k=OM(N,A);if(!k)return!0;if(k?T=N:(T=N==="v"?"h":"v",k=OM(N,A)),!k)return!1;if(!n.current&&"changedTouches"in g&&(b||_)&&(n.current=T),!T)return!0;var E=n.current||T;return Boe(E,y,g,E==="h"?b:_,!0)},[]),l=S.useCallback(function(g){var y=g;if(!(!Q0.length||Q0[Q0.length-1]!==i)){var v="deltaY"in y?FM(y):J_(y),w=e.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&Uoe(T.delta,v)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(DM).filter(Boolean).filter(function(T){return T.contains(y.target)}),_=b.length>0?o(y,b[0]):!a.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),c=S.useCallback(function(g,y,v,w){var b={name:g,delta:y,target:v,should:w,shadowParent:Woe(v)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(_){return _!==b})},1)},[]),u=S.useCallback(function(g){t.current=J_(g),n.current=void 0},[]),f=S.useCallback(function(g){c(g.type,FM(g),g.target,o(g,r.lockRef.current))},[]),p=S.useCallback(function(g){c(g.type,J_(g),g.target,o(g,r.lockRef.current))},[]);S.useEffect(function(){return Q0.push(i),r.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,J0),document.addEventListener("touchmove",l,J0),document.addEventListener("touchstart",u,J0),function(){Q0=Q0.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,J0),document.removeEventListener("touchmove",l,J0),document.removeEventListener("touchstart",u,J0)}},[]);var m=r.removeScrollBar,x=r.inert;return S.createElement(S.Fragment,null,x?S.createElement(i,{styles:$oe(s)}):null,m?S.createElement(joe,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function Woe(r){for(var e=null;r!==null;)r instanceof ShadowRoot&&(e=r.host,r=r.host),r=r.parentNode;return e}const Voe=yoe(iz,Hoe);var uz=S.forwardRef(function(r,e){return S.createElement(hA,Gl({},r,{ref:e,sideCar:Voe}))});uz.classNames=hA.classNames;var Goe=function(r){if(typeof document>"u")return null;var e=Array.isArray(r)?r[0]:r;return e.ownerDocument.body},em=new WeakMap,Q_=new WeakMap,ek={},$T=0,dz=function(r){return r&&(r.host||dz(r.parentNode))},Koe=function(r,e){return e.map(function(t){if(r.contains(t))return t;var n=dz(t);return n&&r.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",r,". Doing nothing"),null)}).filter(function(t){return!!t})},Xoe=function(r,e,t,n){var s=Koe(e,Array.isArray(r)?r:[r]);ek[t]||(ek[t]=new WeakMap);var i=ek[t],a=[],o=new Set,l=new Set(s),c=function(f){!f||o.has(f)||(o.add(f),c(f.parentNode))};
vendor: 6,969 bytes, lines 619-623
619s.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(o.has(p))u(p);else try{var m=p.getAttribute(n),x=m!==null&&m!=="false",g=(em.get(p)||0)+1,y=(i.get(p)||0)+1;em.set(p,g),i.set(p,y),a.push(p),g===1&&x&&Q_.set(p,!0),y===1&&p.setAttribute(t,"true"),x||p.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return u(e),o.clear(),$T++,function(){a.forEach(function(f){var p=em.get(f)-1,m=i.get(f)-1;em.set(f,p),i.set(f,m),p||(Q_.has(f)||f.removeAttribute(n),Q_.delete(f)),m||f.removeAttribute(t)}),$T--,$T||(em=new WeakMap,em=new WeakMap,Q_=new WeakMap,ek={})}},Yoe=function(r,e,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(r)?r:[r]),s=Goe(r);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Xoe(n,s,t,"aria-hidden")):function(){return null}},fA="Dialog",[hz,x1e]=sv(fA),[qoe,nl]=hz(fA),fz=r=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:s,onOpenChange:i,modal:a=!0}=r,o=S.useRef(null),l=S.useRef(null),[c,u]=B4({prop:n,defaultProp:s??!1,onChange:i,caller:fA});return d.jsx(qoe,{scope:e,triggerRef:o,contentRef:l,contentId:dT(),titleId:dT(),descriptionId:dT(),open:c,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(f=>!f),[u]),modal:a,children:t})};fz.displayName=fA;var pz="DialogTrigger",Zoe=S.forwardRef((r,e)=>{const{__scopeDialog:t,...n}=r,s=nl(pz,t),i=ms(e,s.triggerRef);return d.jsx(sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nj(s.open),...n,ref:i,onClick:kr(r.onClick,s.onOpenToggle)})});Zoe.displayName=pz;var Tj="DialogPortal",[Joe,mz]=hz(Tj,{forceMount:void 0}),gz=r=>{const{__scopeDialog:e,forceMount:t,children:n,container:s}=r,i=nl(Tj,e);return d.jsx(Joe,{scope:e,forceMount:t,children:S.Children.map(n,a=>d.jsx(iv,{present:t||i.open,children:d.jsx(L4,{asChild:!0,container:s,children:a})}))})};gz.displayName=Tj;var SS="DialogOverlay",xz=S.forwardRef((r,e)=>{const t=mz(SS,r.__scopeDialog),{forceMount:n=t.forceMount,...s}=r,i=nl(SS,r.__scopeDialog);return i.modal?d.jsx(iv,{present:n||i.open,children:d.jsx(ele,{...s,ref:e})}):null});xz.displayName=SS;var Qoe=G2("DialogOverlay.RemoveScroll"),ele=S.forwardRef((r,e)=>{const{__scopeDialog:t,...n}=r,s=nl(SS,t);return d.jsx(uz,{as:Qoe,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(sn.div,{"data-state":Nj(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),E0="DialogContent",vz=S.forwardRef((r,e)=>{const t=mz(E0,r.__scopeDialog),{forceMount:n=t.forceMount,...s}=r,i=nl(E0,r.__scopeDialog);return d.jsx(iv,{present:n||i.open,children:i.modal?d.jsx(tle,{...s,ref:e}):d.jsx(rle,{...s,ref:e})})});vz.displayName=E0;var tle=S.forwardRef((r,e)=>{const t=nl(E0,r.__scopeDialog),n=S.useRef(null),s=ms(e,t.contentRef,n);return S.useEffect(()=>{const i=n.current;if(i)return Yoe(i)},[]),d.jsx(yz,{...r,ref:s,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:kr(r.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:kr(r.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:kr(r.onFocusOutside,i=>i.preventDefault())})}),rle=S.forwardRef((r,e)=>{const t=nl(E0,r.__scopeDialog),n=S.useRef(!1),s=S.useRef(!1);return d.jsx(yz,{...r,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=r.onCloseAutoFocus)==null||a.call(r,i),i.defaultPrevented||(n.current||(o=t.triggerRef.current)==null||o.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=r.onInteractOutside)==null||l.call(r,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),yz=S.forwardRef((r,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=r,o=nl(E0,t),l=S.useRef(null),c=ms(e,l);return coe(),d.jsxs(d.Fragment,{children:[d.jsx(tz,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:d.jsx(jE,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Nj(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(nle,{titleId:o.titleId}),d.jsx(ile,{contentRef:l,descriptionId:o.descriptionId})]})]})}),Cj="DialogTitle",wz=S.forwardRef((r,e)=>{const{__scopeDialog:t,...n}=r,s=nl(Cj,t);return d.jsx(sn.h2,{id:s.titleId,...n,ref:e})});wz.displayName=Cj;var bz="DialogDescription",_z=S.forwardRef((r,e)=>{const{__scopeDialog:t,...n}=r,s=nl(bz,t);return d.jsx(sn.p,{id:s.descriptionId,...n,ref:e})});_z.displayName=bz;var kz="DialogClose",Sz=S.forwardRef((r,e)=>{const{__scopeDialog:t,...n}=r,s=nl(kz,t);return d.jsx(sn.button,{type:"button",...n,ref:e,onClick:kr(r.onClick,()=>s.onOpenChange(!1))})});Sz.displayName=kz;function Nj(r){return r?"open":"closed"}var Ez="DialogTitleWarning",[v1e,Az]=SY(Ez,{contentName:E0,titleName:Cj,docsSlug:"dialog"}),nle=({titleId:r})=>{const e=Az(Ez),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 620 621If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 622 623For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return S.useEffect(()=>{r&&(document.getElementById(r)||console.error(t))},[t,r]),null},sle="DialogDescriptionWarning",ile=({contentRef:r,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Az(sle).contentName}}.`;return S.useEffect(()=>{var i;const s=(i=r.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,r,e]),null},ale=fz,ole=gz,Tz=xz,Cz=vz,Nz=wz,Pz=_z,lle=Sz;const Zl=ale,cle=ole,Rz=S.forwardRef(({className:r,...e},t)=>d.jsx(Tz,{ref:t,className:Is("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...e}));Rz.displayName=Tz.displayName;const Xo=S.forwardRef(({className:r,children:e,...t},n)=>d.jsxs(cle,{children:[d.jsx(Rz,{}),d.jsxs(Cz,{ref:n,className:Is("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...t,children:[e,d.jsxs(lle,{className:"absolute right-4 top-4 roun
623ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[d.jsx(Xn,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xo.displayName=Cz.displayName;const Yo=({className:r,...e})=>d.jsx("div",{className:Is("flex flex-col space-y-1.5 text-center sm:text-left",r),...e});Yo.displayName="DialogHeader";const Jl=({className:r,...e})=>d.jsx("div",{className:Is("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...e});Jl.displayName="DialogFooter";const qo=S.forwardRef(({className:r,...e},t)=>d.jsx(Nz,{ref:t,className:Is("text-lg font-semibold leading-none tracking-tight",r),...e}));qo.displayName=Nz.displayName;const Zo=S.forwardRef(({className:r,...e},t)=>d.jsx(Pz,{ref:t,className:Is("text-sm text-muted-foreground",r),...e}));Zo.displayName=Pz.displayName;const ule=A8("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ch({className:r,variant:e,...t}){return d.jsx("div",{className:Is(ule({variant:e}),r),...t})}const MM=["Allgemeine Infos","Anreise","FAQs","Tipps für Schüler"],jz={Info:D0,MapPin:Pn,Clock:$b,Ticket:Iq,Bus:kq,Utensils:Uq,HelpCircle:j8,Star:$8,Wifi:$q,Baby:_q,Accessibility:yq,PhoneCall:Pq};function Oz(r){return jz[r??"Info"]??D0}function dle({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(!1),[i,a]=S.useState(!1),[o,l]=S.useState(null);async function c(){s(!0);try{const x=await r("list_wissenswertes");t(x.items??[])}catch(x){le.error((x==null?void 0:x.message)??"Laden fehlgeschlagen")}finally{s(!1)}}S.useEffect(()=>{c()},[]);const u=S.useMemo(()=>{const x=new Map;for(const g of e){const y=g.kategorie||"Ohne Kategorie";x.has(y)||x.set(y,[]),x.get(y).push(g)}return[...x.entries()].sort((g,y)=>g[0].localeCompare(y[0],"de"))},[e]);async function f(){var x;if(!((x=o==null?void 0:o.titel)!=null&&x.trim())){le.error("Titel ist erforderlich");return}a(!0);try{await r("save_wissenswertes",{item:o}),le.success("Eintrag gespeichert"),l(null),await c()}catch(g){le.error((g==null?void 0:g.message)??"Speichern fehlgeschlagen")}finally{a(!1)}}async function p(x){try{await r("toggle_wissenswertes",{id:x.id,is_active:!x.is_active}),t(g=>g.map(y=>y.id===x.id?{...y,is_active:!y.is_active}:y))}catch(g){le.error((g==null?void 0:g.message)??"Umschalten fehlgeschlagen")}}async function m(x){if(confirm("Eintrag wirklich löschen?"))try{await r("delete_wissenswertes",{id:x}),await c(),le.success("Gelöscht")}catch(g){le.error((g==null?void 0:g.message)??"Löschen fehlgeschlagen")}}return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-display font-bold",children:"Wissenswertes & Infos"}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Info- und FAQ-Kacheln für die Besucher-Ansicht · ",e.length," Einträge"]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:()=>void c(),className:"text-xs font-bold text-primary tap-scale inline-flex items-center gap-1",children:[d.jsx(Ou,{className:"w-3.5 h-3.5"})," Refresh"]}),d.jsxs("button",{onClick:()=>{var x;return l({kategorie:MM[0],icon:"Info",sort_order:(((x=e.at(-1))==null?void 0:x.sort_order)??0)+10,is_active:!0})},className:"inline-flex items-center gap-1 text-xs font-extrabold gradient-hero text-primary-foreground px-3 py-1.5 rounded-full tap-scale",children:[d.jsx(qh,{className:"w-3.5 h-3.5"})," Neuer Eintrag"]})]})]}),n?d.jsxs("p",{className:"mt-4 text-sm text-muted-foreground inline-flex items-center gap-2",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Lädtâ¦"]}):e.length===0?d.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Noch keine Einträge angelegt."}):d.jsx("div",{className:"mt-4 space-y-4",children:u.map(([x,g])=>d.jsxs("div",{children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-muted-foreground",children:x}),d.jsx("div",{className:"mt-2 space-y-2",children:g.map(y=>{const v=Oz(y.icon);return d.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-muted/50 p-3",children:[d.jsx("div",{className:"grid place-items-center w-9 h-9 rounded-lg bg-primary/10 text-primary shrink-0",children:d.jsx(v,{className:"w-4 h-4"})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("p",{className:"font-bold text-sm leading-tight",children:y.titel}),d.jsxs(Ch,{variant:"secondary",className:"text-[10px]",children:["#",y.sort_order]}),!y.is_active&&d.jsx(Ch,{variant:"outline",className:"text-[10px]",children:"inaktiv"})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2 whitespace-pre-wrap",children:y.inhalt})]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx("button",{onClick:()=>void p(y),title:y.is_active?"Ausblenden":"Einblenden",className:"p-1.5 rounded-lg hover:bg-background tap-scale",children:y.is_active?d.jsx(H4,{className:"w-4 h-4 text-primary"}):d.jsx(F8,{className:"w-4 h-4 text-muted-foreground"})}),d.jsx("button",{onClick:()=>l(y),title:"Bearbeiten",className:"p-1.5 rounded-lg hover:bg-background tap-scale",children:d.jsx(av,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>void m(y.id),title:"Löschen",className:"p-1.5 rounded-lg hover:bg-background tap-scale",children:d.jsx(fs,{className:"w-4 h-4 text-destructive"})})]})]},y.id)})})]},x))}),d.jsx(Zl,{open:!!o,onOpenChange:x=>!x&&l(null),children:d.jsxs(Xo,{className:"max-w-lg",children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:o!=null&&o.id?"Eintrag bearbeiten":"Neuer Eintrag"}),d.jsx(Zo,{children:"Wird in der Besucher-Ansicht âWissenswertesâ angezeigt."})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Titel"}),d.jsx("input",{value:(o==null?void 0:o.titel)??"",onChange:x=>l(g=>({...g,titel:x.target.value})),className:"mt-1 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm",placeholder:"z. B. Anreise & Parken"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Kategorie"}),d.jsx("input",{list:"ws-kategorien",value:(o==null?void 0:o.kategorie)??"",onChange:x=>l(g=>({...g,kategorie:x.target.value})),className:"mt-1 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm",placeholder:"Kategorie wählen oder neu"}),d.jsx("datalist",{id:"ws-kategorien",children:[...new Set([...MM,...e.map(x=>x.kategorie)])].map(x=>d.jsx("option",{value:x},x))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Sortierung"}),d.jsx("input",{type:"number",value:(o==null?void 0:o.sort_order)??0,onChange:x=>l(g=>({...g,sort_order:Number(x.target.value)})),className:"mt-1 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Icon"}),d.jsx("div",{className:"mt-1 grid grid-cols-6 gap-2",children:Object.entries(jz).map(([x,g])=>d.jsx("button",{type:"button",onClick:()=>l(y=>({...y,icon:x})),title:x,className:`grid place-items-center h-10 rounded-xl border tap-scale ${((o==null?void 0:o.icon)??"Info")===x?"border-primary bg-primary/10 text-primary":"border-border bg-background"}`,children:d.jsx(g,{className:"w-4 h-4"})},x))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Inhalt"}),d.jsx("textarea",{rows:6,value:(o==null?void 0:o.inhalt)??"",onChange:x=>l(g=>({...g,inhalt:x.target.value})),className:"mt-1 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm",placeholder:"Detaillierte Infos â¦"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[d.jsx("input",{type:"checkbox",checked:(o==null?void 0:o.is_active)!==!1,onChange:x=>l(g=>({...g,is_active:x.target.checked}))}),"In der App sichtbar"]})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>l(null),className:"text-sm font-bold px-4 py-2 rounded-xl bg-muted tap-scale",children:"Abbrechen"}),d.jsx("button",{onClick:()=>void f(),disabled:i,className:"text-sm font-extrabold px-4 py-2 rounded-xl gradient-hero text-primary-foreground tap-scale disabled:opacity-60",children:i?"Speichertâ¦":"Speichern"})]})]})})]})}function hle(){const[r,e]=S.useState([]),[t,n]=S.useState(!0);S.useEffect(()=>{let i=!0;return(async()=>{const{data:a}
623=await et.from("wissenswertes").select("id,titel,kategorie,icon,inhalt,sort_order,is_active").eq("is_active",!0).order("sort_order",{ascending:!0});i&&(e(a??[]),n(!1))})(),()=>{i=!1}},[]);const s=S.useMemo(()=>{const i=new Map;for(const a of r){const o=a.kategorie||"Allgemeine Infos";i.has(o)||i.set(o,[]),i.get(o).push(a)}return[...i.entries()]},[r]);return d.jsxs("div",{children:[d.jsxs("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem] shadow-card",children:[d.jsx(no,{}),d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx(D0,{className:"w-5 h-5"}),d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider opacity-80",children:"Info"})]}),d.jsx("h1",{className:"font-display text-3xl font-extrabold mt-1",children:"Wissenswertes"}),d.jsx("p",{className:"text-primary-foreground/85 text-sm mt-1",children:"Alles Wichtige rund um deinen Messebesuch auf einen Blick."})]}),d.jsx("section",{className:"px-4 mt-5 space-y-5 pb-6",children:t?d.jsx("p",{className:"text-sm text-muted-foreground",children:"Lädtâ¦"}):s.length===0?d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-5 text-center",children:[d.jsx("p",{className:"font-display font-bold",children:"Noch keine Infos verfügbar"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Die Informationen werden in Kürze ergänzt."})]}):s.map(([i,a])=>d.jsxs("div",{children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-muted-foreground px-1",children:i}),d.jsx("div",{className:"mt-2 space-y-3",children:a.map(o=>{const l=Oz(o.icon);return d.jsxs("div",{className:"flex gap-3 items-start rounded-2xl bg-card text-card-foreground shadow-card p-4",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 rounded-xl bg-primary/10 text-primary shrink-0",children:d.jsx(l,{className:"w-5 h-5"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-display font-bold leading-tight",children:o.titel}),d.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 whitespace-pre-wrap",children:o.inhalt})]})]},o.id)})})]},i))})]})}function fle(){const r=ba(),[e,t]=S.useState(""),[n,s]=S.useState(null),[i,a]=S.useState(!1);async function o(l){l.preventDefault(),s(null);const c=e.trim();if(c.length<2||c.length>64){s("Bitte gültigen Code eingeben.");return}a(!0);const{data:u,error:f}=await et.rpc("exhibitor_login_by_code",{p_code:c});a(!1);const p=Array.isArray(u)?u[0]:u;if(f||!p){s("Code nicht gefunden.");return}sj({exhibitor_id:p.exhibitor_id,name:p.name,hall:p.hall,stand_no:p.stand_no,code:p.aussteller_code??c}),r("/aussteller-dashboard")}return d.jsxs("div",{className:"min-h-screen gradient-soft px-6 safe-top pb-8 flex flex-col",children:[d.jsxs("button",{type:"button",onClick:()=>r("/"),className:"self-start inline-flex items-center gap-1.5 rounded-full bg-card border border-border px-3 py-1.5 text-sm font-semibold text-foreground shadow-soft tap-scale hover:bg-secondary","aria-label":"Zurück zur Auswahl",children:[d.jsx(_i,{className:"w-4 h-4"}),"Zurück zur Auswahl"]}),d.jsxs("h1",{className:"font-display text-3xl font-extrabold flex items-center gap-2 mt-6",children:[d.jsx(M8,{className:"w-6 h-6 text-primary"})," Aussteller-Login"]}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Gib deinen Stand-Code ein, um Workshop-Teilnehmer zu sehen."}),d.jsxs("form",{onSubmit:o,className:"mt-7",children:[d.jsx("label",{className:"block text-sm font-bold",children:"Stand-Code"}),d.jsx("input",{autoFocus:!0,value:e,onChange:l=>t(l.target.value),placeholder:"z. B. MW-2026-XYZ",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,autoComplete:"off",className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base tracking-widest font-mono focus:outline-none focus:ring-2 focus:ring-primary"}),n&&d.jsx("p",{className:"mt-2 text-sm font-semibold text-destructive",children:n}),d.jsxs("button",{type:"submit",disabled:i,className:"mt-5 w-full inline-flex items-center justify-center gap-2 gradient-hero text-primary-foreground font-display font-bold rounded-2xl py-4 shadow-pop tap-scale disabled:opacity-60",children:[i?"Prüftâ¦":"Einloggen",d.jsx(Dx,{className:"w-5 h-5"})]})]}),!1,d.jsx(Lh,{className:"mt-4"})]})}function ple(){const r=ba(),[e,t]=S.useState(""),[n,s]=S.useState(null),[i,a]=S.useState(!1);async function o(l){l.preventDefault(),s(null);const c=e.trim();if(!c){s("Ungültiger Aussteller-Code. Bitte überprüfen Sie Ihre Eingabe.");return}a(!0);const{data:u,error:f}=await et.rpc("exhibitor_login_by_code",{p_code:c});a(!1);const p=Array.isArray(u)?u[0]:u;if(f||!p){s("Ungültiger Aussteller-Code. Bitte überprüfen Sie Ihre Eingabe.");return}let m=localStorage.getItem("sb_device_id");m||(m=crypto.randomUUID(),localStorage.setItem("sb_device_id",m)),et.rpc("record_exhibitor_login",{p_code:c,p_device_id:m,p_display_name:null}),sj({exhibitor_id:p.exhibitor_id,name:p.name,hall:p.hall??"",stand_no:p.stand_no??"",code:p.aussteller_code??c}),r("/aussteller-dashboard")}return d.jsxs("div",{className:"min-h-screen bg-background px-6 safe-top pb-8 flex flex-col",children:[d.jsxs("button",{type:"button",onClick:()=>
623r("/"),className:"self-start inline-flex items-center gap-1.5 rounded-full bg-card border border-border px-3 py-1.5 text-sm font-semibold text-foreground shadow-soft tap-scale hover:bg-secondary",children:[d.jsx(_i,{className:"w-4 h-4"}),"Zurück"]}),d.jsxs("h1",{className:"font-display text-3xl font-extrabold flex items-center gap-2 mt-6",children:[d.jsx(M8,{className:"w-6 h-6 text-primary"})," Aussteller-Login"]}),d.jsx("p",{className:"text-muted-foreground mt-1",children:"Bitte geben Sie Ihren Aussteller-Code ein, um Ihre Workshop-Teilnehmer zu sehen."}),d.jsxs("form",{onSubmit:o,className:"mt-7",children:[d.jsx("label",{className:"block text-sm font-bold",children:"Aussteller-Code"}),d.jsx("input",{autoFocus:!0,value:e,onChange:l=>t(l.target.value),placeholder:"z. B. MW-2026-XYZ",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,autoComplete:"off",className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base tracking-wider font-mono focus:outline-none focus:ring-2 focus:ring-primary"}),n&&d.jsx("p",{className:"mt-2 text-sm font-semibold text-destructive",role:"alert",children:n}),d.jsxs("button",{type:"submit",disabled:i,className:"mt-5 w-full inline-flex items-center justify-center gap-2 text-white font-display font-bold rounded-2xl py-4 shadow-pop tap-scale disabled:opacity-60",style:{backgroundColor:"#ef6e00"},children:[i?"Prüftâ¦":"Einloggen",d.jsx(Dx,{className:"w-5 h-5"})]})]}),d.jsx(Lh,{className:"mt-auto"})]})}const mle=["Donnerstag","Freitag","Samstag"],kc="#ef6e00",IM=[{key:"participants",label:`Workshop- 624Teilnehmer`,subtitle:"Anmeldungen pro Tag",Icon:ec},{key:"map",label:"Hallenplan",subtitle:"Interaktive Karte",Icon:Ix},{key:"program",label:"Programm",subtitle:"Alle Termine",Icon:Su},{key:"exhibitors",label:"Aussteller",subtitle:"Alle Stände & Suche",Icon:ec},{key:"categories",label:`Kategorien- 625Verzeichnis`,subtitle:"Nach Warengruppe",Icon:Rh},{key:"info",label:"Wissenswertes",subtitle:"Infos für Aussteller",Icon:D0}];function LM(){const r=ij(),e=ba(),[t,n]=S.useState(null),[s,i]=S.useState(null);if(S.useEffect(()=>{r||e("/aussteller-login")},[r,e]),!r)return null;if(t){const a=IM.find(o=>o.key===t);return d.jsxs("div",{className:"min-h-screen bg-background pb-10",children:[d.jsxs("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem] shadow-card",children:[d.jsxs("button",{onClick:()=>n(null),className:"inline-flex items-center gap-1.5 text-xs font-bold bg-white/20 hover:bg-white/30 px-3 py-1.5 rounded-full tap-scale",children:[d.jsx(_i,{className:"w-3.5 h-3.5"})," Zurück"]}),d.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[d.jsx(a.Icon,{className:"w-5 h-5"}),d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider opacity-80",children:"Aussteller-Portal"})]}),d.jsx("h1",{className:"font-display text-3xl font-extrabold mt-1 whitespace-pre-line",children:a.label.replace(` 626`," ")}),d.jsx("p",{className:"text-primary-foreground/85 text-sm mt-1",children:r.name})]}),d.jsxs("div",{className:"mt-4",children:[t==="participants"&&d.jsx(gle,{code:r.code}),t==="map"&&d.jsx(Z9,{hideBack:!0,focusExhibitorId:s?s.id:r.exhibitor_id,focusHall:s?s.hall:r.hall||null,focusStand:s?s.stand:r.stand_no||null}),t==="program"&&d.jsx(ez,{hideBack:!0}),t==="info"&&d.jsx(xle,{}),t==="exhibitors"&&d.jsx(J9,{hideBack:!0}),t==="categories"&&d.jsx(Q9,{hideBack:!0,onShowOnMap:o=>{i({id:o.id,hall:o.hall||null,stand:o.stand_no||null}),n("map"),window.scrollTo({top:0})}})]}),d.jsx(Lh,{})]})}return d.jsxs("div",{className:"min-h-screen bg-background pb-10",children:[d.jsxs("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem] shadow-card",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3 pr-10",children:[d.jsxs("div",{className:"pt-1",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider opacity-80",children:"Aussteller-Portal"}),d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider opacity-80",children:"Messe Wieselburg"})]}),d.jsx("img",{src:tU.url,alt:"Schule & Beruf",className:"h-16 w-auto object-contain drop-shadow-md mt-4"})]}),d.jsx("h1",{className:"font-display text-3xl font-extrabold -mt-3 leading-tight",children:"Guten Tag ð"}),d.jsx("p",{className:"font-display text-xl font-bold leading-snug break-normal mt-0.5",style:{hyphens:"none",wordBreak:"normal",overflowWrap:"break-word"},lang:"de",children:r.name}),(r.hall||r.stand_no)&&d.jsxs("p",{className:"text-primary-foreground
626/85 text-sm mt-1",children:[r.hall,r.stand_no?` · Stand ${r.stand_no}`:""]})]}),d.jsx("section",{className:"px-4 mt-5 grid grid-cols-2 gap-3",children:IM.map(({key:a,label:o,subtitle:l,Icon:c})=>d.jsxs("button",{onClick:()=>{i(null),n(a)},className:"group relative rounded-2xl p-4 shadow-card tap-scale overflow-hidden cursor-pointer bg-card text-card-foreground text-left",children:[d.jsx("div",{className:"grid place-items-center w-10 h-10 rounded-xl bg-primary/10 text-primary",children:d.jsx(c,{className:"w-5 h-5"})}),d.jsx("p",{className:"mt-3 font-display font-bold leading-tight whitespace-pre-line",children:o}),d.jsx("p",{className:"text-xs mt-0.5 text-muted-foreground",children:l})]},a))}),d.jsx(Lh,{})]})}function BM(r,e){const t=(r??"").match(/(\d{1,2})[:.](\d{2})/);if(t)return parseInt(t[1],10)*60+parseInt(t[2],10);if(e){const s=new Intl.DateTimeFormat("de-AT",{timeZone:"Europe/Vienna",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)).match(/(\d{1,2})[:.](\d{2})/);if(s)return parseInt(s[1],10)*60+parseInt(s[2],10)}return Number.MAX_SAFE_INTEGER}function UM(r,e){return r&&r.trim()!==""?r.trim():e?new Intl.DateTimeFormat("de-AT",{timeZone:"Europe/Vienna",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):""}function gle({code:r}){const[e,t]=S.useState("Donnerstag"),[n,s]=S.useState([]),[i,a]=S.useState(!1),[o,l]=S.useState({});S.useEffect(()=>{let p=!1;return(async()=>{a(!0);const{data:m,error:x}=await et.rpc("get_exhibitor_participants_by_day",{p_code:r,p_day:e});p||(a(!1),s(x?[]:m??[]))})(),()=>{p=!0}},[r,e]);const c=S.useMemo(()=>{const p=new Map;for(const m of n){const x=p.get(m.workshop_id)??{title:m.workshop_title,uhrzeit:m.uhrzeit,room:m.room,starts_at:m.starts_at,max_capacity:m.max_capacity,items:[]};m.booking_id&&x.items.push(m),p.set(m.workshop_id,x)}return Array.from(p.entries()).map(([m,x])=>({id:m,...x,seats:x.items.reduce((g,y)=>g+(y.seats||1),0)})).sort((m,x)=>BM(m.uhrzeit,m.starts_at)-BM(x.uhrzeit,x.starts_at))},[n]),u=c.reduce((p,m)=>p+m.seats,0),f=()=>{const m=[["Zeitslot","Workshop","Raum","Buchungsart","Name","Schule","PLZ","Personen","Gebucht am"]];for(const v of c){const w=`${UM(v.uhrzeit,v.starts_at)} Uhr`;if(v.items.length===0){m.push([w,v.title,v.room??"","â","Keine Anmeldungen","","","0",""]);continue}for(const b of v.items)m.push([w,v.title,v.room??"",b.booking_type==="group"?"Gruppe":"Einzel",(b.booking_type==="group"?b.teacher_name??b.first_name:b.first_name)??"",b.school??"",b.zip_code??"",String(b.seats||1),b.created_at?new Date(b.created_at).toLocaleString("de-AT",{timeZone:"Europe/Vienna"}):""])}const x="\uFEFF"+m.map(v=>v.map(w=>`"${String(w).replace(/"/g,'""')}"`).join(";")).join(`\r 627`),g=URL.createObjectURL(new Blob([x],{type:"text/csv;charset=utf-8;"})),y=document.createElement("a");y.href=g,y.download=`Teilnehmerliste_${e}.csv`,y.click(),URL.revokeObjectURL(g)};return d.jsxs(d.Fragment,{children:[d.jsx("div",{role:"tablist","aria-label":"Tag auswählen",className:"px-5 flex gap-2",children:mle.map(p=>{const m=e===p;return d.jsx("button",{role:"tab","aria-selected":m,onClick:()=>t(p),className:"flex-1 rounded-full py-2.5 text-sm font-bold border tap-scale transition-colors",style:m?{backgroundColor:kc,color:"white",borderColor:kc}:{backgroundColor:"white",color:"#111",borderColor:"hsl(var(--border))"},children:p},p)})}),d.jsxs("section",{className:"px-5 mt-5",children:[i&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Lädtâ¦"}),!i&&c.length===0&&d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-6 text-center",children:[d.jsx(ec,{className:"w-8 h-8 mx-auto mb-2",style:{color:kc}}),d.jsx("p",{className:"font-display font-bold",children:"Keine Workshops"}),d.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Für ",e," sind keine Workshops hinterlegt."]})]}),!i&&c.length>0&&d.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.length," Zeitslots · ",d.jsxs("span",{className:"font-bold text-foreground",children:[u," Personen"]})," gebucht"]}),d.jsxs("button",{onClick:f,className:"inline-flex items-center gap-1.5 rounded-full px-3 py-2 text-xs font-bold text-white tap-scale",style:{backgroundColor:kc},children:[d.jsx(ME,{className:"w-3.5 h-3.5"})," Export"]})]}),d.jsx("div",{className:"flex flex-col gap-4",children:c.map(p=>{const m=o[p.id]??!1,x=p.max_capacity??0,g=x>0?Math.min(100,Math.round(p.seats/x*100)):0,y=x>0&&p.seats>=x;return d.jsxs("article",{className:"rounded-2xl bg-card shadow-card overflow-hidden",children:[d.jsxs("div",{className:"px-4 pt-3 pb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx($b,{className:"w-4 h-4",style:{color:kc}}),d.jsxs("p",{className:"font-display text-lg font-extrabold",children:[UM(p.uhrzeit,p.starts_at)," Uhr"]})]}),d.jsx("p",{className:"font-display font-bold mt-1",children:p.title}),p.room&&d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:p.room}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-3",children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 text-primary px-3 py-1 text-xs font-bold",children:[d.jsx(ec,{className:"w-3.5 h-3.5"}),p.seats," ",p.seats===1?"Person":"Personen"," gebucht"]}),d.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.items.length," Buchungen"]})]}),x>0&&d.jsxs("div",{className:"mt-3",children:[d.jsxs("div",{className:"flex justify-between text-xs font-semibold",children:[d.jsxs("span",{className:y?"text-destructive":"text-muted-foreground",children:[p.seats," / ",x," Plätze belegt"]}),d.jsxs("span",{className:"text-muted-foreground",children:[g,"%"]})]}),d.jsx("div",{className:"mt-1 h-2 rounded-full bg-muted overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${g}%`,backgroundColor:y?"hsl(var(--destructive))":kc}})})]}),d.jsxs("button",{onClick:()=>l(v=>({...v,[p.id]:!m})),className:"mt-3 inline-flex items-center gap-1.5 text-xs font-bold text-primary tap-scale","aria-expanded":m,children:[m?d.jsx(R8,{className:"w-4 h-4"}):d.jsx(DE,{className:"w-4 h-4"}
627),m?"Teilnehmerliste ausblenden":"Teilnehmerliste anzeigen"]})]}),m&&d.jsx("div",{className:"max-h-96 overflow-auto border-t border-border",children:d.jsxs("ul",{className:"divide-y divide-border",children:[p.items.length===0&&d.jsx("li",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Noch keine Anmeldungen."}),p.items.map((v,w)=>{const b=v.booking_type==="group";return d.jsxs("li",{className:`px-3 py-2 text-sm ${b?"bg-primary/10 border-l-4 border-l-primary":""}`,children:[d.jsxs("span",{className:"tabular-nums text-muted-foreground mr-2",children:[w+1,"."]}),b?d.jsxs("span",{children:[d.jsxs("span",{className:"font-extrabold text-primary",children:[v.teacher_name??v.first_name??"Lehrperson"," â GRUPPENBUCHUNG (",v.seats," Schüler)"]}),d.jsxs("span",{className:"block text-xs text-muted-foreground mt-0.5",children:["Schule: ",v.school??"â"," · PLZ: ",v.zip_code??"â"]})]}):d.jsxs("span",{children:[d.jsx("span",{className:"font-semibold",children:v.first_name??"â"}),d.jsxs("span",{className:"text-muted-foreground",children:[" (PLZ: ",v.zip_code??"â",", Schule: ",v.school??"â",")"]})]})]},v.booking_id)})]})})]},p.id)})})]})]})}function xle(){const[r,e]=S.useState(null),[t,n]=S.useState(!0);return S.useEffect(()=>{let s=!1;return(async()=>{const{data:i,error:a}=await et.rpc("get_aussteller_infotext");if(!s){if(n(!1),a){e("");return}e(i??"")}})(),()=>{s=!0}},[]),d.jsxs("section",{className:"px-5",children:[d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(D0,{className:"w-5 h-5",style:{color:kc}}),d.jsx("h2",{className:"font-display text-lg font-extrabold",children:"Wissenswertes für Aussteller"})]}),t&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Lädtâ¦"}),!t&&(!r||r.trim()==="")&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Es sind derzeit keine Informationen hinterlegt. Der Veranstalter pflegt hier operative Hinweise, Standaufbau-Details und Logistikinfos ein."}),!t&&r&&r.trim()!==""&&d.jsx("div",{className:"prose prose-sm max-w-none whitespace-pre-wrap text-foreground leading-relaxed",children:r})]}),d.jsx(vle,{})]})}function vle(){const[r,e]=S.useState([]),[t,n]=S.useState(null);return S.useEffect(()=>{let s=!1;return(async()=>{const{data:i}=await et.from("exhibitor_faqs").select("id,question,answer").eq("is_published",!0).order("display_order",{ascending:!0});s||e(i??[])})(),()=>{s=!0}},[]),r.length===0?null:d.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[d.jsx("h3",{className:"font-display font-extrabold px-1",children:"Häufige Fragen"}),r.map(s=>{const i=t===s.id;return d.jsxs("article",{className:"rounded-2xl bg-card shadow-card overflow-hidden",children:[d.jsxs("button",{onClick:()=>n(i?null:s.id),"aria-expanded":i,className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-left tap-scale",children:[d.jsx("span",{className:"font-bold text-sm",children:s.question}),i?d.jsx(R8,{className:"w-4 h-4 shrink-0",style:{color:kc}}):d.jsx(DE,{className:"w-4 h-4 shrink-0",style:{color:kc}})]}),i&&d.jsx("div",{className:"px-4 pb-4 -mt-1 text-sm leading-relaxed whitespace-pre-wrap text-muted-foreground",children:s.answer})]},s.id)})]})}const yle=()=>{const r=Ni();return S.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",r.pathname)},[r.pathname]),d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:d.jsxs("div",{className:"text-center",children:[d.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),d.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),d.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})};var Fz={exports:{}};/* @license
628Papa Parse 629v5.5.3 630https://github.com/mholt/PapaParse 631License: MIT 632*/(function(r,e){((t,n)=>{r.exports=n()})(aW,function t(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},s,i=!n.document&&!!n.postMessage,a=n.IS_PAPA_WORKER||!1,o={},l=0,c={};function u(k){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(E){var P=T(E);P.chunkSize=parseInt(P.chunkSize),E.step||E.chunk||(P.chunkSize=null),this._handle=new g(P),(this._handle.streamer=this)._config=P}).call(this,k),this.parseChunk=function(E,P){var O=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<O){let H=this._config.newline;H||(D=this._config.quoteChar||'"',H=this._handle.guessLineEndings(E,D)),E=[...E.split(H).slice(O)].join(H)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(D=this._config.beforeFirstChunk(E))!==void 0&&(E=D),this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+E,D=(this._partialLine="",this._handle.parse(O,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(E=D.meta.cursor,O=(this._finished||(this._partialLine=O.substring(E-this._baseIndex),this._baseIndex=E),D&&D.data&&(this._rowCount+=D.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),a)n.postMessage({results:D,workerId:c.WORKER_ID,finished:O});else if(N(this._config.chunk)&&!P){if(this._config.chunk(D,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=D=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(D.data),this._completeResults.errors=this._completeResults.errors.concat(D.errors),this._completeResults.meta=D.meta),this._completed||!O||!N(this._config.complete)||D&&D.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),O||D&&D.meta.paused||this._nextChunk(),D}this._halted=!0},this._sendError=function(E){N(this._config.error)?this._config.error(E):a&&this._config.error&&n.postMessage({workerId:c.WORKER_ID,error:E,finished:!1})}}function f(k){var E;(k=k||{}).chunkSize||(k.chunkSize=c.RemoteChunkSize),u.call(this,k),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(E=new XMLHttpRequest,this._config.withCredentials&&(E.withCredentials=this._config.withCredentials),i||(E.onload=A(this._chunkLoaded,this),E.onerror=A(this._chunkError,this)),E.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var P,O=this._config.downloadRequestHeaders;for(P in O)E.setRequestHeader(P,O[P])}var D;this._config.chunkSize&&(D=this._start+this._config.chunkSize-1,E.setRequestHeader("Range","bytes="+this._start+"-"+D));try{E.send(this._config.downloadRequestBody)}catch(H){this._chunkError(H.message)}i&&E.status===0&&this._chunkError()}},this._chunkLoaded=function(){E.readyState===4&&(E.status<200||400<=E.status?this._chunkError():(this._start+=this._config.chunkSize||E.responseText.length,this._finished=!this._config.chunkSize||this._start>=(P=>(P=P.getResponseHeader("Content-Range"))!==null?parseInt(P.substring(P.lastIndexOf("/")+1)):-1)(E),this.parseChunk(E.responseText)))},this._chunkError=function(P){P=E.statusText||P,this._sendError(new Error(P))}}function p(k){(k=k||{}).chunkSize||(k.chunkSize=c.LocalChunkSize),u.call(this,k);var E,P,O=typeof FileReader<"u";this.stream=function(D){this._input=D,P=D.slice||D.webkitSlice||D.mozSlice,O?((E=new FileReader).onload=A(this._chunkLoaded,this),E.onerror=A(this._chunkError,this)):E=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var D=this._input,H=(this._config.chunkSize&&(H=Math.min(this._start+this._config.chunkSize,this._input.size),D=P.call(D,this._start,H)),E.readAsText(D,this._config.encoding));O||this._chunkLoaded({target:{result:H}})},this._chunkLoaded=function(D){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(D.target.result)},this._chunkError=function(){this._sendError(E.error)}}function m(k){var E;u.call(this,k=k||{}),this.stream=function(P){return E=P,this._nextChunk()},this._nextChunk=function(){var P,O;if(!this._finished)return P=this._config.chunkSize,E=P?(O=E.substring(0,P),E.substring(P)):(O=E,""),this._finished=!E,this.parseChunk(O)}}function x(k){u.call(this,k=k||{});var E=[],P=!0,O=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(D){this._input=D,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){O&&E.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),E.length?this.parseChunk(E.shift()):P=!0}
vendor: 15,603 bytes, lines 632-641
632,this._streamData=A(function(D){try{E.push(typeof D=="string"?D:D.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(E.shift()))}catch(H){this._streamError(H)}},this),this._streamError=A(function(D){this._streamCleanUp(),this._sendError(D)},this),this._streamEnd=A(function(){this._streamCleanUp(),O=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function g(k){var E,P,O,D,H=Math.pow(2,53),B=-H,ee=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,X=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,Y=0,F=0,J=!1,ne=!1,I=[],z={data:[],errors:[],meta:{}};function M(se){return k.skipEmptyLines==="greedy"?se.join("").trim()==="":se.length===1&&se[0].length===0}function U(){if(z&&O&&(re("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),O=!1),k.skipEmptyLines&&(z.data=z.data.filter(function(ge){return!M(ge)})),te()){let ge=function(G,Ue){N(k.transformHeader)&&(G=k.transformHeader(G,Ue)),I.push(G)};if(z)if(Array.isArray(z.data[0])){for(var se=0;te()&&se<z.data.length;se++)z.data[se].forEach(ge);z.data.splice(0,1)}else z.data.forEach(ge)}function ie(ge,G){for(var Ue=k.header?{}:[],Re=0;Re<ge.length;Re++){var He=Re,Te=ge[Re],Te=((we,Me)=>(at=>(k.dynamicTypingFunction&&k.dynamicTyping[at]===void 0&&(k.dynamicTyping[at]=k.dynamicTypingFunction(at)),(k.dynamicTyping[at]||k.dynamicTyping)===!0))(we)?Me==="true"||Me==="TRUE"||Me!=="false"&&Me!=="FALSE"&&((at=>{if(ee.test(at)&&(at=parseFloat(at),B<at&&at<H))return 1})(Me)?parseFloat(Me):X.test(Me)?new Date(Me):Me===""?null:Me):Me)(He=k.header?Re>=I.length?"__parsed_extra":I[Re]:He,Te=k.transform?k.transform(Te,He):Te);He==="__parsed_extra"?(Ue[He]=Ue[He]||[],Ue[He].push(Te)):Ue[He]=Te}return k.header&&(Re>I.length?re("FieldMismatch","TooManyFields","Too many fields: expected "+I.length+" fields but parsed "+Re,F+G):Re<I.length&&re("FieldMismatch","TooFewFields","Too few fields: expected "+I.length+" fields but parsed "+Re,F+G)),Ue}var ae;z&&(k.header||k.dynamicTyping||k.transform)&&(ae=1,!z.data.length||Array.isArray(z.data[0])?(z.data=z.data.map(ie),ae=z.data.length):z.data=ie(z.data,0),k.header&&z.meta&&(z.meta.fields=I),F+=ae)}function te(){return k.header&&I.length===0}function re(se,ie,ae,ge){se={type:se,code:ie,message:ae},ge!==void 0&&(se.row=ge),z.errors.push(se)}N(k.step)&&(D=k.step,k.step=function(se){z=se,te()?U():(U(),z.data.length!==0&&(Y+=se.data.length,k.preview&&Y>k.preview?P.abort():(z.data=z.data[0],D(z,W))))}),this.parse=function(se,ie,ae){var ge=k.quoteChar||'"',ge=(k.newline||(k.newline=this.guessLineEndings(se,ge)),O=!1,k.delimiter?N(k.delimiter)&&(k.delimiter=k.delimiter(se),z.meta.delimiter=k.delimiter):((ge=((G,Ue,Re,He,Te)=>{var we,Me,at,Tr;Te=Te||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var pe=0;pe<Te.length;pe++){for(var je,nt=Te[pe],tt=0,Nt=0,ht=0,Et=(at=void 0,new v({comments:He,delimiter:nt,newline:Ue,preview:10}).parse(G)),cr=0;cr<Et.data.length;cr++)Re&&M(Et.data[cr])?ht++:(je=Et.data[cr].length,Nt+=je,at===void 0?at=je:0<je&&(tt+=Math.abs(je-at),at=je));0<Et.data.length&&(Nt/=Et.data.length-ht),(Me===void 0||tt<=Me)&&(Tr===void 0||Tr<Nt)&&1.99<Nt&&(Me=tt,we=nt,Tr=Nt)}return{successful:!!(k.delimiter=we),bestDelimiter:we}})(se,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=ge.bestDelimiter:(O=!0,k.delimiter=c.DefaultDelimiter),z.meta.delimiter=k.delimiter),T(k));return k.preview&&k.header&&ge.preview++,E=se,P=new v(ge),z=P.parse(E,ie,ae),U(),J?{meta:{paused:!0}}:z||{meta:{paused:!1}}},this.paused=function(){return J},this.pause=function(){J=!0,P.abort(),E=N(k.chunk)?"":E.substring(P.getCharIndex())},this.resume=function(){W.streamer._halted?(J=!1,W.streamer.parseChunk(E,!0)):setTimeout(W.resume,3)},this.aborted=function(){return ne},this.abort=function(){ne=!0,P.abort(),z.meta.aborted=!0,N(k.complete)&&k.complete(z),E=""},this.guessLineEndings=function(G,ge){G=G.substring(0,1048576);var ge=new RegExp(y(ge)+"([^]*?)"+y(ge),"gm"),ae=(G=G.replace(ge,"")).split("\r"),ge=G.split(` 633`),G=1<ge.length&&ge[0].length<ae[0].length;if(ae.length===1||G)return` 634`;for(var Ue=0,Re=0;Re<ae.length;Re++)ae[Re][0]===` 635`&&Ue++;return Ue>=ae.length/2?`\r 636`:"\r"}}function y(k){return k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(k){var E=(k=k||{}).delimiter,P=k.newline,O=k.comments,D=k.step,H=k.preview,B=k.fastMode,ee=null,X=!1,W=k.quoteChar==null?'"':k.quoteChar,Y=W;if(k.escapeChar!==void 0&&(Y=k.escapeChar),(typeof E!="string"||-1<c.BAD_DELIMITERS.indexOf(E))&&(E=","),O===E)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<c.BAD_DELIMITERS.indexOf(O))&&(O=!1),P!==` 637`&&P!=="\r"&&P!==`\r 638`&&(P=` 639`);var F=0,J=!1;this.parse=function(ne,I,z){if(typeof ne!="string")throw new Error("Input must be a string");var M=ne.length,U=E.length,te=P.length,re=O.length,se=N(D),ie=[],ae=[],ge=[],G=F=0;if(!ne)return tt();if(B||B!==!1&&ne.indexOf(W)===-1){for(var Ue=ne.split(P),Re=0;Re<Ue.length;Re++){if(ge=Ue[Re],F+=ge.length,Re!==Ue.length-1)F+=P.length;else if(z)return tt();if(!O||ge.substring(0,re)!==O){if(se){if(ie=[],Tr(ge.split(E)),Nt(),J)return tt()}else Tr(ge.split(E));if(H&&H<=Re)return ie=ie.slice(0,H),tt(!0)}}return tt()}for(var He=ne.indexOf(E,F),Te=ne.indexOf(P,F),we=new RegExp(y(Y)+y(W),"g"),Me=ne.indexOf(W,F);;)if(ne[F]===W)for(Me=F,F++;;){if((Me=ne.indexOf(W,Me+1))===-1)return z||ae.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ie.length,index:F}),je();if(Me===M-1)return je(ne.substring(F,Me).replace(we,W));if(W===Y&&ne[Me+1]===Y)Me++;else if(W===Y||Me===0||ne[Me-1]!==Y){He!==-1&&He<Me+1&&(He=ne.indexOf(E,Me+1));var at=pe((Te=Te!==-1&&Te<Me+1?ne.indexOf(P,Me+1):Te)===-1?He:Math.min(He,Te));if(ne.substr(Me+1+at,U)===E){ge.push(ne.substring(F,Me).replace(we,W)),ne[F=Me+1+at+U]!==W&&(Me=ne.indexOf(W,F)),He=ne.indexOf(E,F),Te=ne.indexOf(P,F);break}if(at=pe(Te),ne.substring(Me+1+at,Me+1+at+te)===P){if(ge.push(ne.substring(F,Me).replace(we,W)),nt(Me+1+at+te),He=ne.indexOf(E,F),Me=ne.indexOf(W,F),se&&(Nt(),J))return tt();if(H&&ie.length>=H)return tt(!0);break}ae.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ie.length,index:F}),Me++}}else if(O&&ge.length===0&&ne.substring(F,F+re)===O){if(Te===-1)return tt();F=Te+te,Te=ne.indexOf(P,F),He=ne.indexOf(E,F)}else if(He!==-1&&(He<Te||Te===-1))ge.push(ne.substring(F,He)),F=He+U,He=ne.indexOf(E,F);else{if(Te===-1)break;if(ge.push(ne.substring(F,Te)),nt(Te+te),se&&(Nt(),J))return tt();if(H&&ie.length>=H)return tt(!0)}return je();function Tr(ht){ie.push(ht),G=F}function pe(ht){var Et=0;return Et=ht!==-1&&(ht=ne.substring(Me+1,ht))&&ht.trim()===""?ht.length:Et}function je(ht){return z||(ht===void 0&&(ht=ne.substring(F)),ge.push(ht),F=M,Tr(ge),se&&Nt()),tt()}function nt(ht){F=ht,Tr(ge),ge=[],Te=ne.indexOf(P,F)}function tt(ht){if(k.header&&!I&&ie.length&&!X){var Et=ie[0],cr=Object.create(null),gs=new Set(Et);let it=!1;for(let $t=0;$t<Et.length;$t++){let dr=Et[$t];if(cr[dr=N(k.transformHeader)?k.transformHeader(dr,$t):dr]){let Gt,Yn=cr[dr];for(;Gt=dr+"_"+Yn,Yn++,gs.has(Gt););gs.add(Gt),Et[$t]=Gt,cr[dr]++,it=!0,(ee=ee===null?{}:ee)[Gt]=dr}else cr[dr]=1,Et[$t]=dr;gs.add(dr)}it&&console.warn("Duplicate headers found and renamed."),X=!0}return{data:ie,errors:ae,meta:{delimiter:E,linebreak:P,aborted:J,truncated:!!ht,cursor:G+(I||0),renamedHeaders:ee}}}function Nt(){D(tt()),ie=[],ae=[]}},this.abort=function(){J=!0},this.getCharIndex=function(){return F}}function w(k){var E=k.data,P=o[E.workerId],O=!1;if(E.error)P.userError(E.error,E.file);else if(E.results&&E.results.data){var D={abort:function(){O=!0,b(E.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_,resume:_};if(N(P.userStep)){for(var H=0;H<E.results.data.length&&(P.userStep({data:E.results.data[H],errors:E.results.errors,meta:E.results.meta},D),!O);H++);delete E.results}else N(P.userChunk)&&(P.userChunk(E.results,D,E.file),delete E.results)}E.finished&&!O&&b(E.workerId,E.results)}function b(k,E){var P=o[k];N(P.userComplete)&&P.userComplete(E),P.terminate(),delete o[k]}function _(){throw new Error("Not implemented.")}function T(k){if(typeof k!="object"||k===null)return k;var E,P=Array.isArray(k)?[]:{};for(E in k)P[E]=T(k[E]);return P}function A(k,E){return function(){k.apply(E,arguments)}}function N(k){return typeof k=="function"}return c.parse=function(k,E){var P=(E=E||{}).dynamicTyping||!1;if(N(P)&&(E.dynamicTypingFunction=P,P={}),E.dynamicTyping=P,E.transform=!!N(E.transform)&&E.transform,!E.worker||!c.WORKERS_SUPPORTED)return P=null,c.NODE_STREAM_INPUT,typeof k=="string"?(k=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(k),P=new(E.download?f:m)(E)):k.readable===!0&&N(k.read)&&N(k.on)?P=new x(E):(n.File&&k instanceof File||k instanceof Object)&&(P=new p(E)),P.stream(k);(P=(()=>{var O;return!!c.WORKERS_SUPPORTED&&(O=(()=>{var D=n.URL||n.webkitURL||null,H=t.toString();return c.BLOB_URL||(c.BLOB_URL=D.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",H,")();"],{type:"text/javascript"})))})(),(O=new n.Worker(O)).onmessage=w,O.id=l++,o[O.id]=O)})()).userStep=E.step,P.userChunk=E.chunk,P.userComplete=E.complete,P.userError=E.error,E.step=N(E.step),E.chunk=N(E.chunk),E.complete=N(E.complete),E.error=N(E.error),delete E.worker,P.postMessage({input:k,config:E,workerId:P.id})},c.unparse=function(k,E){var P=!1,O=!0,D=",",H=`\r 640`,B='"',ee=B+B,X=!1,W=null,Y=!1,F=((()=>{if(typeof E=="object"){if(typeof E.delimiter!="string"||c.BAD_DELIMITERS.filter(function(I){return E.delimiter.indexOf(I)!==-1}).length||(D=E.delimiter),typeof E.quotes!="boolean"&&typeof E.quotes!="function"&&!Array.isArray(E.quotes)||(P=E.quotes),typeof E.skipEmptyLines!="boolean"&&typeof E.skipEmptyLines!="string"||(X=E.skipEmptyLines),typeof E.newline=="string"&&(H=E.newline),typeof E.quoteChar=="string"&&(B=E.quoteChar),typeof E.header=="boolean"&&(O=E.header),Array.isArray(E.columns)){if(E.columns.length===0)throw new Error("Option columns is empty");W=E.columns}E.escapeChar!==void 0&&(ee=E.escapeChar+B),E.escapeFormulae instanceof RegExp?Y=E.escapeFormulae:typeof E.escapeFormulae=="boolean"&&E.escapeFormulae&&(Y=/^[=+\-@\t\r].*$/)}})(),new RegExp(y(B),"g"));if(typeof k=="string"&&(k=JSON.parse(k)),Array.isArray(k)){if(!k.length||Array.isArray(k[0]))return J(null,k,X);if(typeof k[0]=="object")return J(W||Object.keys(k[0]),k,X)}else if(typeof k=="object")return typeof k.data=="string"&&(k.data=JSON.parse(k.data)),Array.isArray(k.data)&&(k.fields||(k.fields=k.meta&&k.meta.fields||W),k.fields||(k.fields=Array.isArray(k.data[0])?k.fields:typeof k.data[0]=="object"?Object.keys(k.data[0]):[]),Array.isArray(k.data[0])||typeof k.data[0]=="object"||(k.data=[k.data])),J(k.fields||[],k.data||[],X);throw new Error("Unable to serialize unrecognized input");function J(I,z,M){var U="",te=(typeof I=="string"&&(I=JSON.parse(I)),typeof z=="string"&&(z=JSON.parse(z)),Array.isArray(I)&&0<I.length),re=!Array.isArray(z[0]);if(te&&O){for(var se=0;se<I.length;se++)0<se&&(U+=D),U+=ne(I[se],se);0<z.length&&(U+=H)}for(var ie=0;ie<z.length;ie++){var ae=(te?I:z[ie]).length,ge=!1,G=te?Object.keys(z[ie]).length===0:z[ie].length===0;if(M&&!te&&(ge=M==="greedy"?z[ie].join("").trim()==="":z[ie].length===1&&z[ie][0].length===0),M==="greedy"&&te){for(var Ue=[],Re=0;Re<ae;Re++){var He=re?I[Re]:Re;Ue.push(z[ie][He])}ge=Ue.join("").trim()===""}if(!ge){for(var Te=0;Te<ae;Te++){0<Te&&!G&&(U+=D);var we=te&&re?I[Te]:Te;U+=ne(z[ie][we],Te)}ie<z.length-1&&(!M||0<ae&&!G)&&(U+=H)}}return U}function ne(I,z){var M,U;return I==null?"":I.constructor===Date?JSON.stringify(I).slice(1,25):(U=!1,Y&&typeof I=="string"&&Y.test(I)&&(I="'"+I,U=!0),M=I.toString().replace(F,ee),(U=U||P===!0||typeof P=="function"&&P(I,z)||Array.isArray(P)&&P[z]||((te,re)=>{for(var se=0;se<re.length;se++)if(-1<te.indexOf(re[se]))return!0;return!1})(M,c.BAD_DELIMITERS)||-1<M.indexOf(D)||M.charAt(0)===" "||M.charAt(M.length-1)===" ")?B+M+B:M)}},c.RECORD_SEP="�",c.UNIT_SEP="�",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",` 641`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!i&&!!n.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=g,c.NetworkStreamer=f,c.FileStreamer=p,c.StringStreamer=m,c.ReadableStreamStreamer=x,n.jQuery&&((s=n.jQuery).fn.parse=function(k){var E=k.config||{},P=[];return this.each(function(H){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var B=0;B<this.files.length;B++)P.push({file:this.files[B],inputElem:this,instanceConfig:s.extend({},E)})}),O(),this;function O(){if(P.length===0)N(k.complete)&&k.complete();else{var H,B,ee,X,W=P[0];if(N(k.before)){var Y=k.before(W.file,W.inputElem);if(typeof Y=="object"){if(Y.action==="abort")return H="AbortError",B=W.file,ee=W.inputElem,X=Y.reason,void(N(k.error)&&k.error({name:H},B,ee,X));if(Y.action==="skip")return void D();typeof Y.config=="object"&&(W.instanceConfig=s.extend(W.instanceConfig,Y.config))}else if(Y==="skip")return void D()}var F=W.instanceConfig.complete;W.instanceConfig.complete=function(J){N(F)&&F(J,W.file,W.inputElem),D()},c.parse(W.file,W.instanceConfig)}}function D(){P.splice(0,1),O()}}),a&&(n.onmessage=function(k){k=k.data,c.WORKER_ID===void 0&&k&&(c.WORKER_ID=k.workerId),typeof k.input=="string"?n.postMessage({workerId:c.WORKER_ID,results:c.parse(k.input,k.config),finished:!0}):(n.File&&k.input instanceof File||k.input instanceof Object)&&(k=c.parse(k.input,k.config))&&n.postMessage({workerId:c.WORKER_ID,results:k,finished:!0})}),(f.prototype=Object.create(u.prototype)).constructor=f,(p.prototype=Object.create(u.prototype)).constructor=p,(m.prototype=Object.create(m.prototype)).constructor=m,(x.prototype=Object.create(u.prototype)).constructor=x,c})})(Fz);var wle=Fz.exports;const Dz=jR(wle);/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var ES={};ES.version="0.18.5";var Mz=1252,ble=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Pj={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},Rj=function(r){ble.indexOf(r)!=-1&&(Mz=Pj[0]=r)};function _le(){Rj(1252)}var Uo=function(r){Rj(r)};function jj(){Uo(1200),_le()}function $M(r){for(var e=[],t=0,n=r.length;t<n;++t)e[t]=r.charCodeAt(t);return e}function kle(r){for(var e=[],t=0;t<r.length>>1;++t)e[t]=String.fromCharCode(r.charCodeAt(2*t)+(r.charCodeAt(2*t+1)<<8));return e.join("")}function Iz(r){for(var e=[],t=0;t<r.length>>1;++t)e[t]=String.fromCharCode(r.charCodeAt(2*t+1)+(r.charCodeAt(2*t)<<8));return e.join("")}var py=function(r){var e=r.charCodeAt(0),t=r.charCodeAt(1);return e==255&&t==254?kle(r.slice(2)):e==254&&t==255?Iz(r.slice(2)):e==65279?r.slice(1):r},tk=function(e){return String.fromCharCode(e)},zM=function(e){return String.fromCharCode(e)},sd,gh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
641+/=";function R1(r){for(var e="",t=0,n=0,s=0,i=0,a=0,o=0,l=0,c=0;c<r.length;)t=r.charCodeAt(c++),i=t>>2,n=r.charCodeAt(c++),a=(t&3)<<4|n>>4,s=r.charCodeAt(c++),o=(n&15)<<2|s>>6,l=s&63,isNaN(n)?o=l=64:isNaN(s)&&(l=64),e+=gh.charAt(i)+gh.charAt(a)+gh.charAt(o)+gh.charAt(l);return e}function xa(r){var e="",t=0,n=0,s=0,i=0,a=0,o=0,l=0;r=r.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<r.length;)i=gh.indexOf(r.charAt(c++)),a=gh.indexOf(r.charAt(c++)),t=i<<2|a>>4,e+=String.fromCharCode(t),o=gh.indexOf(r.charAt(c++)),n=(a&15)<<4|o>>2,o!==64&&(e+=String.fromCharCode(n)),l=gh.indexOf(r.charAt(c++)),s=(o&3)<<6|l,l!==64&&(e+=String.fromCharCode(s));return e}var bt=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Du=function(){if(typeof Buffer<"u"){var r=!Buffer.from;if(!r)try{Buffer.from("foo","utf8")}catch{r=!0}return r?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function zh(r){return bt?Buffer.alloc?Buffer.alloc(r):new Buffer(r):typeof Uint8Array<"u"?new Uint8Array(r):new Array(r)}function HM(r){return bt?Buffer.allocUnsafe?Buffer.allocUnsafe(r):new Buffer(r):typeof Uint8Array<"u"?new Uint8Array(r):new Array(r)}var ca=function(e){return bt?Du(e,"binary"):e.split("").map(function(t){return t.charCodeAt(0)&255})};function pA(r){if(typeof ArrayBuffer>"u")return ca(r);for(var e=new ArrayBuffer(r.length),t=new Uint8Array(e),n=0;n!=r.length;++n)t[n]=r.charCodeAt(n)&255;return e}function Qh(r){if(Array.isArray(r))return r.map(function(n){return String.fromCharCode(n)}).join("");for(var e=[],t=0;t<r.length;++t)e[t]=String.fromCharCode(r[t]);return e.join("")}function Sle(r){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(r)}function Oj(r){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(r instanceof ArrayBuffer)return Oj(new Uint8Array(r));for(var e=new Array(r.length),t=0;t<r.length;++t)e[t]=r[t];return e}var Vn=bt?function(r){return Buffer.concat(r.map(function(e){return Buffer.isBuffer(e)?e:Du(e)}))}:function(r){if(typeof Uint8Array<"u"){var e=0,t=0;for(e=0;e<r.length;++e)t+=r[e].length;var n=new Uint8Array(t),s=0;for(e=0,t=0;e<r.length;t+=s,++e)if(s=r[e].length,r[e]instanceof Uint8Array)n.set(r[e],t);else{if(typeof r[e]=="string")throw"wtf";n.set(new Uint8Array(r[e]),t)}return n}return[].concat.apply([],r.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Ele(r){for(var e=[],t=0,n=r.length+250,s=zh(r.length+255),i=0;i<r.length;++i){var a=r.charCodeAt(i);if(a<128)s[t++]=a;else if(a<2048)s[t++]=192|a>>6&31,s[t++]=128|a&63;else if(a>=55296&&a<57344){a=(a&1023)+64;var o=r.charCodeAt(++i)&1023;s[t++]=240|a>>8&7,s[t++]=128|a>>2&63,s[t++]=128|o>>6&15|(a&3)<<4,s[t++]=128|o&63}else s[t++]=224|a>>12&15,s[t++]=128|a>>6&63,s[t++]=128|a&63;t>n&&(e.push(s.slice(0,t)),t=0,s=zh(65535),n=65530)}return e.push(s.slice(0,t)),Vn(e)}var ni=/\u0000/g,my=/[\u0001-\u0006]/g;function Wm(r){for(var e="",t=r.length-1;t>=0;)e+=r.charAt(t--);return e}function $o(r,e){var t=""+r;return t.length>=e?t:tn("0",e-t.length)+t}function Fj(r,e){var t=""+r;return t.length>=e?t:tn(" ",e-t.length)+t}function AS(r,e){var t=""+r;return t.length>=e?t:t+tn(" ",e-t.length)}function Ale(r,e){var t=""+Math.round(r);return t.length>=e?t:tn("0",e-t.length)+t}function Tle(r,e){var t=""+r;return t.length>=e?t:tn("0",e-t.length)+t}var WM=Math.pow(2,32);function tm(r,e){if(r>WM||r<-WM)return Ale(r,e);var t=Math.round(r);return Tle(t,e)}function TS(r,e){return e=e||0,r.length>=7+e&&(r.charCodeAt(e)|32)===103&&(r.charCodeAt(e+1)|32)===101&&(r.charCodeAt(e+2)|32)===110&&(r.charCodeAt(e+3)|32)===101&&(r.charCodeAt(e+4)|32)===114&&(r.charCodeAt(e+5)|32)===97&&(r.charCodeAt(e+6)|32)===108}var VM=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],zT=[["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 Cle(r){return r||(r={}),r[0]="General",r[1]="0",r[2]="0.00",r[3]="#,##0",r[4]="#,##0.00",r[9]="0%",r[10]="0.00%",r[11]="0.00E+00",r[12]="# ?/?",r[13]="# ??/??",r[14]="m/d/yy",r[15]="d-mmm-yy",r[16
vendor: 5,618 bytes, line 641
641]="d-mmm",r[17]="mmm-yy",r[18]="h:mm AM/PM",r[19]="h:mm:ss AM/PM",r[20]="h:mm",r[21]="h:mm:ss",r[22]="m/d/yy h:mm",r[37]="#,##0 ;(#,##0)",r[38]="#,##0 ;[Red](#,##0)",r[39]="#,##0.00;(#,##0.00)",r[40]="#,##0.00;[Red](#,##0.00)",r[45]="mm:ss",r[46]="[h]:mm:ss",r[47]="mmss.0",r[48]="##0.0E+0",r[49]="@",r[56]='"ä¸å/ä¸å "hh"æ"mm"å"ss"ç§ "',r}var Je={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"ç§ "'},GM={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},Nle={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 CS(r,e,t){for(var n=r<0?-1:1,s=r*n,i=0,a=1,o=0,l=1,c=0,u=0,f=Math.floor(s);c<e&&(f=Math.floor(s),o=f*a+i,u=f*c+l,!(s-f<5e-8));)s=1/(s-f),i=a,a=o,l=c,c=u;if(u>e&&(c>e?(u=l,o=i):(u=c,o=a)),!t)return[0,n*o,u];var p=Math.floor(n*o/u);return[p,n*o-p*u,u]}function Tf(r,e,t){if(r>2958465||r<0)return null;var n=r|0,s=Math.floor(86400*(r-n)),i=0,a=[],o={D:n,T:s,u:86400*(r-n)-s,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&&(n+=1462),o.u>.9999&&(o.u=0,++s==86400&&(o.T=s=0,++n,++o.D)),n===60)a=t?[1317,10,29]:[1900,2,29],i=3;else if(n===0)a=t?[1317,8,29]:[1900,1,0],i=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),a=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),n<60&&(i=(i+6)%7),t&&(i=Dle(l,a))}return o.y=a[0],o.m=a[1],o.d=a[2],o.S=s%60,s=Math.floor(s/60),o.M=s%60,s=Math.floor(s/60),o.H=s,o.q=i,o}var Lz=new Date(1899,11,31,0,0,0),Ple=Lz.getTime(),Rle=new Date(1900,2,1,0,0,0);function Bz(r,e){var t=r.getTime();return e?t-=1461*24*60*60*1e3:r>=Rle&&(t+=24*60*60*1e3),(t-(Ple+(r.getTimezoneOffset()-Lz.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function Dj(r){return r.indexOf(".")==-1?r:r.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function jle(r){return r.indexOf("E")==-1?r:r.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Ole(r){var e=r<0?12:11,t=Dj(r.toFixed(12));return t.length<=e||(t=r.toPrecision(10),t.length<=e)?t:r.toExponential(5)}function Fle(r){var e=Dj(r.toFixed(11));return e.length>(r<0?12:11)||e==="0"||e==="-0"?r.toPrecision(6):e}function j1(r){var e=Math.floor(Math.log(Math.abs(r))*Math.LOG10E),t;return e>=-4&&e<=-1?t=r.toPrecision(10+e):Math.abs(e)<=9?t=Ole(r):e===10?t=r.toFixed(10).substr(0,12):t=Fle(r),Dj(jle(t.toUpperCase()))}function A0(r,e){switch(typeof r){case"string":return r;case"boolean":return r?"TRUE":"FALSE";case"number":return(r|0)===r?r.toString(10):j1(r);case"undefined":return"";case"object":if(r==null)return"";if(r instanceof Date)return io(14,Bz(r,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+r)}function Dle(r,e){e[0]-=581;var t=r.getDay();return r<60&&(t=(t+6)%7),t}function Mle(r,e,t,n){var s="",i=0,a=0,o=t.y,l,c=0;switch(r){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 zT[t.m-1][1];case 5:return zT[t.m-1][0];default:return zT[t.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=t.d,c=e.length;break;case 3:return VM[t.q][0];default:return VM[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")?$o(t.S,e.length):(n>=2?a=n===3?1e3:100:a=n===1?10:1,i=Math.round(a*(t.S+t.u)),i>=60*a&&(i=0),e==="s"?i===0?"0":""+i/a:(s=$o(i,2+n),e==="ss"?s.substr(0,2):"."+s.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 u=c>0?$o(l,c):"";return u}function xh(r){var e=3;if(r.length<=e)return r;for(var t=r.length%e,n=r.substr(0,t);t!=r.length;t+=e)n+=(n.length>0?",":"")+r.substr(t,e);return n}var Uz=/%/g;function Ile(r,e,t){var n=e.replace(Uz,""),s=e.length-n.length;return hu(r,n,t*Math.pow(10,2*s))+tn("%",s)}function Lle(r,e,t){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return hu(r,e.substr(0,n),t/Math.pow(10,3*(e.length-n)))}function $z(r,e){var t,n=r.indexOf("E")-r.indexOf(".")-1;if(r.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+$z(r,-e);var s=r.indexOf(".");
vendor: 4,481 bytes, line 641
641s===-1&&(s=r.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%s;if(i<0&&(i+=s),t=(e/Math.pow(10,i)).toPrecision(n+1+(s+i)%s),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+i):t+="E+"+(a-i);t.substr(0,2)==="0.";)t=t.charAt(0)+t.substr(2,s)+"."+t.substr(2+s),t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,u){return l+c+u.substr(0,(s+i)%s)+"."+u.substr(i)+"E"})}else t=e.toExponential(n);return r.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),r.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var zz=/# (\?+)( ?)\/( ?)(\d+)/;function Ble(r,e,t){var n=parseInt(r[4],10),s=Math.round(e*n),i=Math.floor(s/n),a=s-i*n,o=n;return t+(i===0?"":""+i)+" "+(a===0?tn(" ",r[1].length+1+r[4].length):Fj(a,r[1].length)+r[2]+"/"+r[3]+$o(o,r[4].length))}function Ule(r,e,t){return t+(e===0?"":""+e)+tn(" ",r[1].length+2+r[4].length)}var Hz=/^#*0*\.([0#]+)/,Wz=/\).*[0#]/,Vz=/\(###\) ###\\?-####/;function Js(r){for(var e="",t,n=0;n!=r.length;++n)switch(t=r.charCodeAt(n)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(t)}return e}function KM(r,e){var t=Math.pow(10,e);return""+Math.round(r*t)/t}function XM(r,e){var t=r-Math.floor(r),n=Math.pow(10,e);return e<(""+Math.round(t*n)).length?0:Math.round(t*n)}function $le(r,e){return e<(""+Math.round((r-Math.floor(r))*Math.pow(10,e))).length?1:0}function zle(r){return r<2147483647&&r>-2147483648?""+(r>=0?r|0:r-1|0):""+Math.floor(r)}function Aa(r,e,t){if(r.charCodeAt(0)===40&&!e.match(Wz)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?Aa("n",n,t):"("+Aa("n",n,-t)+")"}if(e.charCodeAt(e.length-1)===44)return Lle(r,e,t);if(e.indexOf("%")!==-1)return Ile(r,e,t);if(e.indexOf("E")!==-1)return $z(e,t);if(e.charCodeAt(0)===36)return"$"+Aa(r,e.substr(e.charAt(1)==" "?2:1),t);var s,i,a,o,l=Math.abs(t),c=t<0?"-":"";if(e.match(/^00+$/))return c+tm(l,e.length);if(e.match(/^[#?]+$/))return s=tm(t,0),s==="0"&&(s=""),s.length>e.length?s:Js(e.substr(0,e.length-s.length))+s;if(i=e.match(zz))return Ble(i,l,c);if(e.match(/^#+0+$/))return c+tm(l,e.length-e.indexOf("0"));if(i=e.match(Hz))return s=KM(t,i[1].length).replace(/^([^\.]+)$/,"$1."+Js(i[1])).replace(/\.$/,"."+Js(i[1])).replace(/\.(\d*)$/,function(x,g){return"."+g+tn("0",Js(i[1]).length-g.length)}),e.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+KM(l,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+xh(tm(l,0));if(i=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+Aa(r,e,-t):xh(""+(Math.floor(t)+$le(t,i[1].length)))+"."+$o(XM(t,i[1].length),i[1].length);if(i=e.match(/^#,#*,#0/))return Aa(r,e.replace(/^#,#*,/,""),t);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return s=Wm(Aa(r,e.replace(/[\\-]/g,""),t)),a=0,Wm(Wm(e.replace(/\\/g,"")).replace(/[0#]/g,function(x){return a<s.length?s.charAt(a++):x==="0"?"0":""}));if(e.match(Vz))return s=Aa(r,"##########",t),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var u="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(i[4].length,7),o=CS(l,Math.pow(10,a)-1,!1),s=""+c,u=hu("n",i[1],o[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),s+=u+i[2]+"/"+i[3],u=AS(o[2],a),u.length<i[4].length&&(u=Js(i[4].substr(i[4].length-u.length))+u),s+=u,s;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(i[1].length,i[4].length),7),o=CS(l,Math.pow(10,a)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?Fj(o[1],a)+i[2]+"/"+i[3]+AS(o[2],a):tn(" ",2*a+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return s=tm(t,0),e.length<=s.length?s:Js(e.substr(0,e.length-s.length))+s;if(i=e.match(/^([#0?]+)\.([#0]+)$/)){s=""+t.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),a=s.indexOf(".");var f=e.indexOf(".")-a,p=e.length-s.length-f;return Js(e.substr(0,f)+s+e.substr(e.length-p))}if(i=e.match(/^00,000\.([#0]*0)$/))return a=XM(t,i[1].length),t<0?"-"+Aa(r,e,-t):xh(zle(t)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(x){return"00,"+(x.length<3?$o(0,3-x.length):"")+x})+"."+$o(a,i[1].length);switch(e){case"###,##0.00":return Aa(r,"#,##0.00",t);case"###,###":case"##,###":case"#,###":var m=xh(tm(l,0));return m!=="0"?c+m:"";
vendor: 13,687 bytes, line 641
641case"###,###.00":return Aa(r,"###,##0.00",t).replace(/^0\./,".");case"#,###.00":return Aa(r,"#,##0.00",t).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function Hle(r,e,t){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return hu(r,e.substr(0,n),t/Math.pow(10,3*(e.length-n)))}function Wle(r,e,t){var n=e.replace(Uz,""),s=e.length-n.length;return hu(r,n,t*Math.pow(10,2*s))+tn("%",s)}function Gz(r,e){var t,n=r.indexOf("E")-r.indexOf(".")-1;if(r.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+Gz(r,-e);var s=r.indexOf(".");s===-1&&(s=r.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%s;if(i<0&&(i+=s),t=(e/Math.pow(10,i)).toPrecision(n+1+(s+i)%s),!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+i):t+="E+"+(a-i),t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,c,u){return l+c+u.substr(0,(s+i)%s)+"."+u.substr(i)+"E"})}else t=e.toExponential(n);return r.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),r.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}function hl(r,e,t){if(r.charCodeAt(0)===40&&!e.match(Wz)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?hl("n",n,t):"("+hl("n",n,-t)+")"}if(e.charCodeAt(e.length-1)===44)return Hle(r,e,t);if(e.indexOf("%")!==-1)return Wle(r,e,t);if(e.indexOf("E")!==-1)return Gz(e,t);if(e.charCodeAt(0)===36)return"$"+hl(r,e.substr(e.charAt(1)==" "?2:1),t);var s,i,a,o,l=Math.abs(t),c=t<0?"-":"";if(e.match(/^00+$/))return c+$o(l,e.length);if(e.match(/^[#?]+$/))return s=""+t,t===0&&(s=""),s.length>e.length?s:Js(e.substr(0,e.length-s.length))+s;if(i=e.match(zz))return Ule(i,l,c);if(e.match(/^#+0+$/))return c+$o(l,e.length-e.indexOf("0"));if(i=e.match(Hz))return s=(""+t).replace(/^([^\.]+)$/,"$1."+Js(i[1])).replace(/\.$/,"."+Js(i[1])),s=s.replace(/\.(\d*)$/,function(x,g){return"."+g+tn("0",Js(i[1]).length-g.length)}),e.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return c+xh(""+l);if(i=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+hl(r,e,-t):xh(""+t)+"."+tn("0",i[1].length);if(i=e.match(/^#,#*,#0/))return hl(r,e.replace(/^#,#*,/,""),t);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return s=Wm(hl(r,e.replace(/[\\-]/g,""),t)),a=0,Wm(Wm(e.replace(/\\/g,"")).replace(/[0#]/g,function(x){return a<s.length?s.charAt(a++):x==="0"?"0":""}));if(e.match(Vz))return s=hl(r,"##########",t),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var u="";if(i=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(i[4].length,7),o=CS(l,Math.pow(10,a)-1,!1),s=""+c,u=hu("n",i[1],o[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),s+=u+i[2]+"/"+i[3],u=AS(o[2],a),u.length<i[4].length&&(u=Js(i[4].substr(i[4].length-u.length))+u),s+=u,s;if(i=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return a=Math.min(Math.max(i[1].length,i[4].length),7),o=CS(l,Math.pow(10,a)-1,!0),c+(o[0]||(o[1]?"":"0"))+" "+(o[1]?Fj(o[1],a)+i[2]+"/"+i[3]+AS(o[2],a):tn(" ",2*a+1+i[2].length+i[3].length));if(i=e.match(/^[#0?]+$/))return s=""+t,e.length<=s.length?s:Js(e.substr(0,e.length-s.length))+s;if(i=e.match(/^([#0]+)\.([#0]+)$/)){s=""+t.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),a=s.indexOf(".");var f=e.indexOf(".")-a,p=e.length-s.length-f;return Js(e.substr(0,f)+s+e.substr(e.length-p))}if(i=e.match(/^00,000\.([#0]*0)$/))return t<0?"-"+hl(r,e,-t):xh(""+t).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(x){return"00,"+(x.length<3?$o(0,3-x.length):"")+x})+"."+$o(0,i[1].length);switch(e){case"###,###":case"##,###":case"#,###":var m=xh(""+l);return m!=="0"?c+m:"";default:if(e.match(/\.[0#?]*$/))return hl(r,e.slice(0,e.lastIndexOf(".")),t)+Js(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function hu(r,e,t){return(t|0)===t?hl(r,e,t):Aa(r,e,t)}function Vle(r){for(var e=[],t=!1,n=0,s=0;n<r.length;++n)switch(r.charCodeAt(n)){case 34:t=!t;break;case 95:case 42:case 92:++n;break;case 59:e[e.length]=r.substr(s,n-s),s=n+1}if(e[e.length]=r.substr(s),t===!0)throw new Error("Format |"+r+"| unterminated string ");return e}var Kz=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function dv(r){for(var e=0,t="",n="";e<r.length;)switch(t=r.charAt(e)){case"G":TS(r,e)&&(e+=6),e++;break;case'"':for(;r.charCodeAt(++e)!==34&&e<r.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(r.charAt(e+1)==="1"||r.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(r.substr(e,3).toUpperCase()==="A/P"||r.substr(e,5).toUpperCase()==="AM/PM"||r.substr(e,5).toUpperCase()==="ä¸å/ä¸å")return!0;++e;break;case"[":for(n=t;r.charAt(e++)!=="]"&&e<r.length;)n+=r.charAt(e);if(n.match(Kz))return!0;break;case".":case"0":case"#":for(;e<r.length&&("0#?.,E+-%".indexOf(t=r.charAt(++e))>-1||t=="\\"&&r.charAt(e+1)=="-"&&"0#".indexOf(r.charAt(e+2))>-1););break;case"?":for(;r.charAt(++e)===t;);break;case"*":++e,(r.charAt(e)==" "||r.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<r.length&&"0123456789".indexOf(r.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function Gle(r,e,t,n){for(var s=[],i="",a=0,o="",l="t",c,u,f,p="H";a<r.length;)switch(o=r.charAt(a)){case"G":if(!TS(r,a))throw new Error("unrecognized character "+o+" in "+r);s[s.length]={t:"G",v:"General"},a+=7;break;case'"':for(i="";(f=r.charCodeAt(++a))!==34&&a<r.length;)i+=String.fromCharCode(f);s[s.length]={t:"t",v:i},++a;break;case"\\":var m=r.charAt(++a),x=m==="("||m===")"?m:"t";s[s.length]={t:x,v:m},++a;break;case"_":s[s.length]={t:"t",v:" "},a+=2;break;case"@":s[s.length]={t:"T",v:e},++a;break;case"B":case"b":if(r.charAt(a+1)==="1"||r.charAt(a+1)==="2"){if(c==null&&(c=Tf(e,t,r.charAt(a+1)==="2"),c==null))return"";s[s.length]={t:"X",v:r.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=Tf(e,t),c==null))return"";for(i=o;++a<r.length&&r.charAt(a).toLowerCase()===o;)i+=o;o==="m"&&l.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=p),s[s.length]={t:o,v:i},l=o;break;case"A":case"a":case"ä¸":var g={t:o,v:o};if(c==null&&(c=Tf(e,t)),r.substr(a,3).toUpperCase()==="A/P"?(c!=null&&(g.v=c.H>=12?"P":"A"),g.t="T",p="h",a+=3):r.substr(a,5).toUpperCase()==="AM/PM"?(c!=null&&(g.v=c.H>=12?"PM":"AM"),g.t="T",a+=5,p="h"):r.substr(a,5).toUpperCase()==="ä¸å/ä¸å"?(c!=null&&(g.v=c.H>=12?"ä¸å":"ä¸å"),g.t="T",a+=5,p="h"):(g.t="t",++a),c==null&&g.t==="T")return"";s[s.length]=g,l=o;break;case"[":for(i=o;r.charAt(a++)!=="]"&&a<r.length;)i+=r.charAt(a);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(Kz)){if(c==null&&(c=Tf(e,t),c==null))return"";s[s.length]={t:"Z",v:i.toLowerCase()},l=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",dv(r)||(s[s.length]={t:"t",v:i}));break;case".":if(c!=null){for(i=o;++a<r.length&&(o=r.charAt(a))==="0";)i+=o;s[s.length]={t:"s",v:i};break}case"0":case"#":for(i=o;++a<r.length&&"0#?.,E+-%".indexOf(o=r.charAt(a))>-1;)i+=o;s[s.length]={t:"n",v:i};break;case"?":for(i=o;r.charAt(++a)===o;)i+=o;s[s.length]={t:o,v:i},l=o;break;case"*":++a,(r.charAt(a)==" "||r.charAt(a)=="*")&&++a;break;case"(":case")":s[s.length]={t:n===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(i=o;a<r.length&&"0123456789".indexOf(r.charAt(++a))>-1;)i+=r.charAt(a);s[s.length]={t:"D",v:i};break;case" ":s[s.length]={t:o,v:o},++a;break;case"$":s[s.length]={t:"t",v:"$"},++a;break;default:if(",$-+/():!^&'~{}<>=â¬acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+r);s[s.length]={t:"t",v:o},++a;break}var y=0,v=0,w;for(a=s.length-1,l="t";a>=0;--a)switch(s[a].t){case"h":case"H":s[a].t=p,l="h",y<1&&(y=1);break;case"s":(w=s[a].v.match(/\.0+$/))&&(v=Math.max(v,w[0].length-1)),y<3&&(y=3);case"d":case"y":case"M":case"e":l=s[a].t;break;case"m":l==="s"&&(s[a].t="M",y<2&&(y=2));break;case"X":break;case"Z":y<1&&s[a].v.match(/[Hh]/)&&(y=1),y<2&&s[a].v.match(/[Mm]/)&&(y=2),y<3&&s[a].v.match(/[Ss]/)&&(y=3)}switch(y){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 b="",_;for(a=0;a<s.length;++a)switch(s[a].t){case"t":case"T":case" ":case"D":break;case"X":s[a].v="",s[a].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[a].v=Mle(s[a].t.charCodeAt(0),s[a].v,c,v),s[a].t="t";break;case"n":case"?":for(_=a+1;s[_]!=null&&((o=s[_].t)==="?"||o==="D"||(o===" "||o==="t")&&s[_+1]!=null&&(s[_+1].t==="?"||s[_+1].t==="t"&&s[_+1].v==="/")||s[a].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(s[_].v==="/"||s[_].v===" "&&s[_+1]!=null&&s[_+1].t=="?"));)s[a].v+=s[_].v,s[_]={v:"",t:";"},++_;b+=s[a].v,a=_-1;break;case"G":s[a].t="t",s[a].v=A0(e,t);break}var T="",A,N;if(b.length>0){b.charCodeAt(0)==40?(A=e<0&&b.charCodeAt(0)===45?-e:e,N=hu("n",b,A)):(A=e<0&&n>1?-e:e,N=hu("n",b,A),A<0&&s[0]&&s[0].t=="t"&&(N=N.substr(1),s[0].v="-"+s[0].v)),_=N.length-1;var k=s.length;for(a=0;a<s.length;++a)if(s[a]!=null&&s[a].t!="t"&&s[a].v.indexOf(".")>-1){k=a;break}var E=s.length;if(k===s.length&&N.indexOf("E")===-1){for(a=s.length-1;a>=0;--a)s[a]==null||"n?".indexOf(s[a].t)===-1||(_>=s[a].v.length-1?(_-=s[a].v.length,s[a].v=N.substr(_+1,s[a].v.length)):_<0?s[a].v="":(s[a].v=N.substr(0,_+1),_=-1),s[a].t="t",E=a);_>=0&&E<s.length&&(s[E].v=N.substr(0,_+1)+s[E].v)}else if(k!==s.length&&N.indexOf("E")===-1){for(_=N.indexOf(".")-1,a=k;a>=0;--a)if(!(s[a]==null||"n?".indexOf(s[a].t)===-1)){for(u=s[a].v.indexOf(".")>-1&&a===k?s[a].v.indexOf(".")-1:s[a].v.length-1,T=s[a].v.substr(u+1);u>=0;--u)_>=0&&(s[a].v.charAt(u)==="0"||s[a].v.charAt(u)==="#")&&(T=N.charAt(_--)+T);s[a].v=T,s[a].t="t",E=a}for(_>=0&&E<s.length&&(s[E].v=N.substr(0,_+1)+s[E].v),_=N.indexOf(".")+1,a=k;a<s.length;++a)if(!(s[a]==null||"n?(".indexOf(s[a].t)===-1&&a!==k)){for(u=s[a].v.indexOf(".")>-1&&a===k?s[a].v.indexOf(".")+1:0,T=s[a].v.substr(0,u);u<s[a].v.length;++u)_<N.length&&(T+=N.charAt(_++));s[a].v=T,s[a].t="t",E=a}}}for(a=0;a<s.length;++a)s[a]!=null&&"n?".indexOf(s[a].t)>-1&&(A=n>1&&e<0&&a>0&&s[a-1].v==="-"?-e:e,s[a].v=hu(s[a].t,s[a].v,A),s[a].t="t");var P="";for(a=0;a!==s.length;++a)s[a]!=null&&(P+=s[a].v);return P}var YM=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function qM(r,e){if(e==null)return!1;var t=parseFloat(e[2]);switch(e[1]){case"=":if(r==t)return!0;break;case">":if(r>t)return!0;break;case"<":if(r<t)return!0;break;case"<>":if(r!=t)return!0;break;case">=":if(r>=t)return!0;break;case"<=":if(r<=t)return!0;break}return!1}function Kle(r,e){var t=Vle(r),n=t.length,s=t[n-1].indexOf("@");if(n<4&&s>-1&&--n,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof e!="number")return[4,t.length===4||s>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=s>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=s>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=s>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break}var i=e>0?t[0]:e<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[n,i];if(t[0].match(/\[[=<>]/)!=null||t[1].match(/\[[=<>]/)!=null){var a=t[0].match(YM),o=t[1].match(YM);return qM(e,a)?[n,t[0]]:qM(e,o)?[n,t[1]]:[n,t[a!=null&&o!=null?2:1]]}return[n,i]}function io(r,e,t){t==null&&(t={});var n="";switch(typeof r){case"string":r=="m/d/yy"&&t.dateNF?n=t.dateNF:n=r;break;case"number":r==14&&t.dateNF?n=t.dateNF:n=(t.table!=null?t.table:Je)[r],n==null&&(n=t.table&&t.table[GM[r]]||Je[GM[r]]),n==null&&(n=Nle[r]||"General");break}if(TS(n,0))return A0(e,t);e instanceof Date&&(e=Bz(e,t.date1904));var s=Kle(n,e);if(TS(s[1]))return A0(e,t);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return Gle(s[1],e,t,s[0])}function fu(r,e){if(typeof e!="number"){e=+e||-1;for(var t=0;t<392;++t){if(Je[t]==null){e<0&&(e=t);continue}if(Je[t]==r){e=t;break}}e<0&&(e=391)}return Je[e]=r,e}function mA(r){for(var e=0;e!=392;++e)r[e]!==void 0&&fu(r[e],e)}function hv(){Je=Cle()}var Xle={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},Xz=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function Yle(r){var e=typeof r=="number"?Je[r]:r;return e=e.replace(Xz,"(\\d+)"),new RegExp("^"+e+"$")}function qle(r,e,t){var n=-1,s=-1,i=-1,a=-1,o=-1,l=-1;
vendor: 5,595 bytes, line 641
641(e.match(Xz)||[]).forEach(function(f,p){var m=parseInt(t[p+1],10);switch(f.toLowerCase().charAt(0)){case"y":n=m;break;case"d":i=m;break;case"h":a=m;break;case"s":l=m;break;case"m":a>=0?o=m:s=m;break}}),l>=0&&o==-1&&s>=0&&(o=s,s=-1);var c=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(s>=1?s:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var u=("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:n==-1&&s==-1&&i==-1?u:c+"T"+u}var Zle=function(){var r={};r.version="1.2.0";function e(){for(var N=0,k=new Array(256),E=0;E!=256;++E)N=E,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,N=N&1?-306674912^N>>>1:N>>>1,k[E]=N;return typeof Int32Array<"u"?new Int32Array(k):k}var t=e();function n(N){var k=0,E=0,P=0,O=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)O[P]=N[P];for(P=0;P!=256;++P)for(E=N[P],k=256+P;k<4096;k+=256)E=O[k]=E>>>8^N[E&255];var D=[];for(P=1;P!=16;++P)D[P-1]=typeof Int32Array<"u"?O.subarray(P*256,P*256+256):O.slice(P*256,P*256+256);return D}var s=n(t),i=s[0],a=s[1],o=s[2],l=s[3],c=s[4],u=s[5],f=s[6],p=s[7],m=s[8],x=s[9],g=s[10],y=s[11],v=s[12],w=s[13],b=s[14];function _(N,k){for(var E=k^-1,P=0,O=N.length;P<O;)E=E>>>8^t[(E^N.charCodeAt(P++))&255];return~E}function T(N,k){for(var E=k^-1,P=N.length-15,O=0;O<P;)E=b[N[O++]^E&255]^w[N[O++]^E>>8&255]^v[N[O++]^E>>16&255]^y[N[O++]^E>>>24]^g[N[O++]]^x[N[O++]]^m[N[O++]]^p[N[O++]]^f[N[O++]]^u[N[O++]]^c[N[O++]]^l[N[O++]]^o[N[O++]]^a[N[O++]]^i[N[O++]]^t[N[O++]];for(P+=15;O<P;)E=E>>>8^t[(E^N[O++])&255];return~E}function A(N,k){for(var E=k^-1,P=0,O=N.length,D=0,H=0;P<O;)D=N.charCodeAt(P++),D<128?E=E>>>8^t[(E^D)&255]:D<2048?(E=E>>>8^t[(E^(192|D>>6&31))&255],E=E>>>8^t[(E^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,H=N.charCodeAt(P++)&1023,E=E>>>8^t[(E^(240|D>>8&7))&255],E=E>>>8^t[(E^(128|D>>2&63))&255],E=E>>>8^t[(E^(128|H>>6&15|(D&3)<<4))&255],E=E>>>8^t[(E^(128|H&63))&255]):(E=E>>>8^t[(E^(224|D>>12&15))&255],E=E>>>8^t[(E^(128|D>>6&63))&255],E=E>>>8^t[(E^(128|D&63))&255]);return~E}return r.table=t,r.bstr=_,r.buf=T,r.str=A,r}(),Ke=function(){var e={};e.version="1.2.1";function t(L,q){for(var V=L.split("/"),K=q.split("/"),Z=0,Q=0,ue=Math.min(V.length,K.length);Z<ue;++Z){if(Q=V[Z].length-K[Z].length)return Q;if(V[Z]!=K[Z])return V[Z]<K[Z]?-1:1}return V.length-K.length}function n(L){if(L.charAt(L.length-1)=="/")return L.slice(0,-1).indexOf("/")===-1?L:n(L.slice(0,-1));var q=L.lastIndexOf("/");return q===-1?L:L.slice(0,q+1)}function s(L){if(L.charAt(L.length-1)=="/")return s(L.slice(0,-1));var q=L.lastIndexOf("/");return q===-1?L:L.slice(q+1)}function i(L,q){typeof q=="string"&&(q=new Date(q));var V=q.getHours();V=V<<6|q.getMinutes(),V=V<<5|q.getSeconds()>>>1,L.write_shift(2,V);var K=q.getFullYear()-1980;K=K<<4|q.getMonth()+1,K=K<<5|q.getDate(),L.write_shift(2,K)}function a(L){var q=L.read_shift(2)&65535,V=L.read_shift(2)&65535,K=new Date,Z=V&31;V>>>=5;var Q=V&15;V>>>=4,K.setMilliseconds(0),K.setFullYear(V+1980),K.setMonth(Q-1),K.setDate(Z);var ue=q&31;q>>>=5;var me=q&63;return q>>>=6,K.setHours(q),K.setMinutes(me),K.setSeconds(ue<<1),K}function o(L){cs(L,0);for(var q={},V=0;L.l<=L.length-4;){var K=L.read_shift(2),Z=L.read_shift(2),Q=L.l+Z,ue={};switch(K){case 21589:V=L.read_shift(1),V&1&&(ue.mtime=L.read_shift(4)),Z>5&&(V&2&&(ue.atime=L.read_shift(4)),V&4&&(ue.ctime=L.read_shift(4))),ue.mtime&&(ue.mt=new Date(ue.mtime*1e3));break}L.l=Q,q[K]=ue}return q}var l;function c(){return l||(l={})}function u(L,q){if(L[0]==80&&L[1]==75)return xv(L,q);if((L[0]|32)==109&&(L[1]|32)==105)return ji(L,q);if(L.length<512)throw new Error("CFB file size "+L.length+" < 512");var V=3,K=512,Z=0,Q=0,ue=0,me=0,ce=0,de=[],he=L.slice(0,512);cs(he,0);var ve=f(he);switch(V=ve[0],V){case 3:K=512;break;case 4:K=4096;break;case 0:if(ve[1]==0)return xv(L,q);default:throw new Error("Major Version: Expected 3 or 4 saw "+V)}K!==512&&(he=L.slice(0,K),cs(he,28));var Ce=L.slice(0,K);p(he,V);var Le=he.read_shift(4,"i");if(V===3&&Le!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Le);he.l+=4,ue=he.read_shift(4,"i"),he.l+=4,he.chk("00100000","Mini Stream Cutoff Size: "),me=he.read_shift(4,"i"),Z=he.read_shift(4,"i"),ce=he.read_shift(4,"i"),Q=he.read_shift(4,"i");for(var Se=-1,De=0;De<109&&(Se=he.read_shift(4,"i"),!(Se<0));++De)de[De]=Se;var ft=m(L,K);y(ce,Q,ft,K,de);var Or=w(ft,ue,de,K);Or[ue].name="!Directory",Z>0&&me!==H&&(Or[me].name="!MiniFAT"),Or[de[0]].name="!FAT",Or.fat_addrs=de,Or.ssz=K;var Fr={},xs=[],yv=[],wv=[];b(ue,Or,ft,xs,Z,Fr,yv,me),x(yv,wv,xs),xs.shift();var bv={FileIndex:yv,FullPaths:wv};return q&&q.raw&&(bv.raw={header:Ce,sectors:ft}),bv}function f(L){if(L[L.l]==80&&L[L.l+1]==75)return[0,0];L.chk(B,"Header Signature: "),L.l+=16;var q=L.read_shift(2,"u");return[L.read_shift(2,"u"),q]}function p(L,q){var V=9;switch(L.l+=2,V=L.read_shift(2)){case 9:if(q!=3)throw new Error("Sector Shift: Expected 9 saw "+V);break;case 12:if(q!=4)throw new Error("Sector Shift: Expected 12 saw "+V);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+V)}L.chk("0600","Mini Sector Shift: "),L.chk("000000000000","Reserved: ")}function m(L,q){for(var V=Math.ceil(L.length/q)-1,K=[],Z=1;Z<V;++Z)K[Z-1]=L.slice(Z*q,(Z+1)*q);return K[V-1]=L.slice(V*q),K}function x(L,q,V){for(var K=0,Z=0,Q=0,ue=0,me=0,ce=V.length,de=[],he=[];K<ce;++K)de[K]=he[K]=K,q[K]=V[K];for(;me<he.length;
vendor: 5,595 bytes, line 641
641++me)K=he[me],Z=L[K].L,Q=L[K].R,ue=L[K].C,de[K]===K&&(Z!==-1&&de[Z]!==Z&&(de[K]=de[Z]),Q!==-1&&de[Q]!==Q&&(de[K]=de[Q])),ue!==-1&&(de[ue]=K),Z!==-1&&K!=de[K]&&(de[Z]=de[K],he.lastIndexOf(Z)<me&&he.push(Z)),Q!==-1&&K!=de[K]&&(de[Q]=de[K],he.lastIndexOf(Q)<me&&he.push(Q));for(K=1;K<ce;++K)de[K]===K&&(Q!==-1&&de[Q]!==Q?de[K]=de[Q]:Z!==-1&&de[Z]!==Z&&(de[K]=de[Z]));for(K=1;K<ce;++K)if(L[K].type!==0){if(me=K,me!=de[me])do me=de[me],q[K]=q[me]+"/"+q[K];while(me!==0&&de[me]!==-1&&me!=de[me]);de[K]=-1}for(q[0]+="/",K=1;K<ce;++K)L[K].type!==2&&(q[K]+="/")}function g(L,q,V){for(var K=L.start,Z=L.size,Q=[],ue=K;V&&Z>0&&ue>=0;)Q.push(q.slice(ue*D,ue*D+D)),Z-=D,ue=xf(V,ue*4);return Q.length===0?fe(0):Vn(Q).slice(0,L.size)}function y(L,q,V,K,Z){var Q=H;if(L===H){if(q!==0)throw new Error("DIFAT chain shorter than expected")}else if(L!==-1){var ue=V[L],me=(K>>>2)-1;if(!ue)return;for(var ce=0;ce<me&&(Q=xf(ue,ce*4))!==H;++ce)Z.push(Q);y(xf(ue,K-4),q-1,V,K,Z)}}function v(L,q,V,K,Z){var Q=[],ue=[];Z||(Z=[]);var me=K-1,ce=0,de=0;for(ce=q;ce>=0;){Z[ce]=!0,Q[Q.length]=ce,ue.push(L[ce]);var he=V[Math.floor(ce*4/K)];if(de=ce*4&me,K<4+de)throw new Error("FAT boundary crossed: "+ce+" 4 "+K);if(!L[he])break;ce=xf(L[he],de)}return{nodes:Q,data:lI([ue])}}function w(L,q,V,K){var Z=L.length,Q=[],ue=[],me=[],ce=[],de=K-1,he=0,ve=0,Ce=0,Le=0;for(he=0;he<Z;++he)if(me=[],Ce=he+q,Ce>=Z&&(Ce-=Z),!ue[Ce]){ce=[];var Se=[];for(ve=Ce;ve>=0;){Se[ve]=!0,ue[ve]=!0,me[me.length]=ve,ce.push(L[ve]);var De=V[Math.floor(ve*4/K)];if(Le=ve*4&de,K<4+Le)throw new Error("FAT boundary crossed: "+ve+" 4 "+K);if(!L[De]||(ve=xf(L[De],Le),Se[ve]))break}Q[Ce]={nodes:me,data:lI([ce])}}return Q}function b(L,q,V,K,Z,Q,ue,me){for(var ce=0,de=K.length?2:0,he=q[L].data,ve=0,Ce=0,Le;ve<he.length;ve+=128){var Se=he.slice(ve,ve+128);cs(Se,64),Ce=Se.read_shift(2),Le=zj(Se,0,Ce-de),K.push(Le);var De={name:Le,type:Se.read_shift(1),color:Se.read_shift(1),L:Se.read_shift(4,"i"),R:Se.read_shift(4,"i"),C:Se.read_shift(4,"i"),clsid:Se.read_shift(16),state:Se.read_shift(4,"i"),start:0,size:0},ft=Se.read_shift(2)+Se.read_shift(2)+Se.read_shift(2)+Se.read_shift(2);ft!==0&&(De.ct=_(Se,Se.l-8));var Or=Se.read_shift(2)+Se.read_shift(2)+Se.read_shift(2)+Se.read_shift(2);Or!==0&&(De.mt=_(Se,Se.l-8)),De.start=Se.read_shift(4,"i"),De.size=Se.read_shift(4,"i"),De.size<0&&De.start<0&&(De.size=De.type=0,De.start=H,De.name=""),De.type===5?(ce=De.start,Z>0&&ce!==H&&(q[ce].name="!StreamData")):De.size>=4096?(De.storage="fat",q[De.start]===void 0&&(q[De.start]=v(V,De.start,q.fat_addrs,q.ssz)),q[De.start].name=De.name,De.content=q[De.start].data.slice(0,De.size)):(De.storage="minifat",De.size<0?De.size=0:ce!==H&&De.start!==H&&q[ce]&&(De.content=g(De,q[ce].data,(q[me]||{}).data))),De.content&&cs(De.content,0),Q[Le]=De,ue.push(De)}}function _(L,q){return new Date((aa(L,q+4)/1e7*Math.pow(2,32)+aa(L,q)/1e7-11644473600)*1e3)}function T(L,q){return c(),u(l.readFileSync(L),q)}function A(L,q){var V=q&&q.type;switch(V||bt&&Buffer.isBuffer(L)&&(V="buffer"),V||"base64"){case"file":return T(L,q);case"base64":return u(ca(xa(L)),q);case"binary":return u(ca(L),q)}return u(L,q)}function N(L,q){var V=q||{},K=V.root||"Root Entry";if(L.FullPaths||(L.FullPaths=[]),L.FileIndex||(L.FileIndex=[]),L.FullPaths.length!==L.FileIndex.length)throw new Error("inconsistent CFB structure");L.FullPaths.length===0&&(L.FullPaths[0]=K+"/",L.FileIndex[0]={name:K,type:5}),V.CLSID&&(L.FileIndex[0].clsid=V.CLSID),k(L)}function k(L){var q="�Sh33tJ5";if(!Ke.find(L,"/"+q)){var V=fe(4);V[0]=55,V[1]=V[3]=50,V[2]=54,L.FileIndex.push({name:q,type:2,content:V,size:4,L:69,R:69,C:69}),L.FullPaths.push(L.FullPaths[0]+q),E(L)}}function E(L,q){N(L);for(var V=!1,K=!1,Z=L.FullPaths.length-1;Z>=0;--Z){var Q=L.FileIndex[Z];switch(Q.type){case 0:K?V=!0:(L.FileIndex.pop(),L.FullPaths.pop());break;case 1:case 2:case 5:K=!0,isNaN(Q.R*Q.L*Q.C)&&(V=!0),Q.R>-1&&Q.L>-1&&Q.R==Q.L&&(V=!0);break;default:V=!0;break}}if(!(!V&&!q)){var ue=new Date(1987,1,19),me=0,ce=Object.create?Object.create(null):{},de=[];for(Z=0;Z<L.FullPaths.length;++Z)ce[L.FullPaths[Z]]=!0,L.FileIndex[Z].type!==0&&de.push([L.FullPaths[Z],L.FileIndex[Z]]);for(Z=0;Z<de.length;++Z){var he=n(de[Z][0]);K=ce[he],K||(de.push([he,{name:s(he).replace("/",""),type:1,clsid:X,ct:ue,mt:ue,content:null}]),ce[he]=!0)}for(de.sort(function(Le,Se){return t(Le[0],Se[0])}),L.FullPaths=[],L.FileIndex=[],Z=0;Z<de.length;++Z)L.FullPaths[Z]=de[Z][0],L.FileIndex[Z]=de[Z][1];for(Z=0;Z<de.length;++Z){var ve=L.FileIndex[Z],Ce=L.FullPaths[Z];if(ve.name=s(Ce).replace("/",""),ve.L=ve.R=ve.C=-(ve.color=1),ve.size=ve.content?ve.content.length:0,ve.start=0,ve.clsid=ve.clsid||X,Z===0)ve.C=de.length>1?1:-1,ve.size=0,ve.type=5;else if(Ce.slice(-1)=="/"){for(me=Z+1;me<de.length&&n(L.FullPaths[me])!=Ce;++me);for(ve.C=me>=de.length?-1:me,me=Z+1;me<de.length&&n(L.FullPaths[me])!=n(Ce);++me);ve.R=me>=de.length?-1:me,ve.type=1}else n(L.FullPaths[Z+1]||"")==n(Ce)&&(ve.R=Z+1),ve.type=2}}}function P(L,q){var V=q||{};if(V.fileType=="mad")return sl(L,V);switch(E(L),V.fileType){case"zip":return vv(L,V)}var K=function(Le){for(var Se=0,De=0,ft=0;ft<Le.FileIndex.length;++ft){var Or=Le.FileIndex[ft];if(Or.content){var Fr=Or.content.length;Fr>0&&(Fr<4096?Se+=Fr+63>>6:De+=Fr+511>>9)}}for(var xs=Le.FullPaths.length+3>>2,yv=Se+7>>3,wv=Se+127>>7,bv=yv+De+xs+wv,rf=bv+127>>7,CA=rf<=109?0:Math.ceil((rf-109)/127);bv+rf+CA+127>>7>rf;)CA=++rf<=109?0:Math.ceil((rf-109)/127);var cc=[1,CA,rf,wv,xs,De,Se,0];return Le.FileIndex[0].size=Se<<6,cc[7]=(Le.FileIndex[0].start=cc[0]+cc[1]+cc[2]+cc[3]+cc[4]+cc[5])+(cc[6]+7>>3),cc}(L),Z=fe(K[7]<<9),Q=0,ue=0;
vendor: 10,550 bytes, line 641
641{for(Q=0;Q<8;++Q)Z.write_shift(1,ee[Q]);for(Q=0;Q<8;++Q)Z.write_shift(2,0);for(Z.write_shift(2,62),Z.write_shift(2,3),Z.write_shift(2,65534),Z.write_shift(2,9),Z.write_shift(2,6),Q=0;Q<3;++Q)Z.write_shift(2,0);for(Z.write_shift(4,0),Z.write_shift(4,K[2]),Z.write_shift(4,K[0]+K[1]+K[2]+K[3]-1),Z.write_shift(4,0),Z.write_shift(4,4096),Z.write_shift(4,K[3]?K[0]+K[1]+K[2]-1:H),Z.write_shift(4,K[3]),Z.write_shift(-4,K[1]?K[0]-1:H),Z.write_shift(4,K[1]),Q=0;Q<109;++Q)Z.write_shift(-4,Q<K[2]?K[1]+Q:-1)}if(K[1])for(ue=0;ue<K[1];++ue){for(;Q<236+ue*127;++Q)Z.write_shift(-4,Q<K[2]?K[1]+Q:-1);Z.write_shift(-4,ue===K[1]-1?H:ue+1)}var me=function(Le){for(ue+=Le;Q<ue-1;++Q)Z.write_shift(-4,Q+1);Le&&(++Q,Z.write_shift(-4,H))};for(ue=Q=0,ue+=K[1];Q<ue;++Q)Z.write_shift(-4,W.DIFSECT);for(ue+=K[2];Q<ue;++Q)Z.write_shift(-4,W.FATSECT);me(K[3]),me(K[4]);for(var ce=0,de=0,he=L.FileIndex[0];ce<L.FileIndex.length;++ce)he=L.FileIndex[ce],he.content&&(de=he.content.length,!(de<4096)&&(he.start=ue,me(de+511>>9)));for(me(K[6]+7>>3);Z.l&511;)Z.write_shift(-4,W.ENDOFCHAIN);for(ue=Q=0,ce=0;ce<L.FileIndex.length;++ce)he=L.FileIndex[ce],he.content&&(de=he.content.length,!(!de||de>=4096)&&(he.start=ue,me(de+63>>6)));for(;Z.l&511;)Z.write_shift(-4,W.ENDOFCHAIN);for(Q=0;Q<K[4]<<2;++Q){var ve=L.FullPaths[Q];if(!ve||ve.length===0){for(ce=0;ce<17;++ce)Z.write_shift(4,0);for(ce=0;ce<3;++ce)Z.write_shift(4,-1);for(ce=0;ce<12;++ce)Z.write_shift(4,0);continue}he=L.FileIndex[Q],Q===0&&(he.start=he.size?he.start-1:H);var Ce=Q===0&&V.root||he.name;if(de=2*(Ce.length+1),Z.write_shift(64,Ce,"utf16le"),Z.write_shift(2,de),Z.write_shift(1,he.type),Z.write_shift(1,he.color),Z.write_shift(-4,he.L),Z.write_shift(-4,he.R),Z.write_shift(-4,he.C),he.clsid)Z.write_shift(16,he.clsid,"hex");else for(ce=0;ce<4;++ce)Z.write_shift(4,0);Z.write_shift(4,he.state||0),Z.write_shift(4,0),Z.write_shift(4,0),Z.write_shift(4,0),Z.write_shift(4,0),Z.write_shift(4,he.start),Z.write_shift(4,he.size),Z.write_shift(4,0)}for(Q=1;Q<L.FileIndex.length;++Q)if(he=L.FileIndex[Q],he.size>=4096)if(Z.l=he.start+1<<9,bt&&Buffer.isBuffer(he.content))he.content.copy(Z,Z.l,0,he.size),Z.l+=he.size+511&-512;else{for(ce=0;ce<he.size;++ce)Z.write_shift(1,he.content[ce]);for(;ce&511;++ce)Z.write_shift(1,0)}for(Q=1;Q<L.FileIndex.length;++Q)if(he=L.FileIndex[Q],he.size>0&&he.size<4096)if(bt&&Buffer.isBuffer(he.content))he.content.copy(Z,Z.l,0,he.size),Z.l+=he.size+63&-64;else{for(ce=0;ce<he.size;++ce)Z.write_shift(1,he.content[ce]);for(;ce&63;++ce)Z.write_shift(1,0)}if(bt)Z.l=Z.length;else for(;Z.l<Z.length;)Z.write_shift(1,0);return Z}function O(L,q){var V=L.FullPaths.map(function(ce){return ce.toUpperCase()}),K=V.map(function(ce){var de=ce.split("/");return de[de.length-(ce.slice(-1)=="/"?2:1)]}),Z=!1;q.charCodeAt(0)===47?(Z=!0,q=V[0].slice(0,-1)+q):Z=q.indexOf("/")!==-1;var Q=q.toUpperCase(),ue=Z===!0?V.indexOf(Q):K.indexOf(Q);if(ue!==-1)return L.FileIndex[ue];var me=!Q.match(my);for(Q=Q.replace(ni,""),me&&(Q=Q.replace(my,"!")),ue=0;ue<V.length;++ue)if((me?V[ue].replace(my,"!"):V[ue]).replace(ni,"")==Q||(me?K[ue].replace(my,"!"):K[ue]).replace(ni,"")==Q)return L.FileIndex[ue];return null}var D=64,H=-2,B="d0cf11e0a1b11ae1",ee=[208,207,17,224,161,177,26,225],X="00000000000000000000000000000000",W={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:H,FREESECT:-1,HEADER_SIGNATURE:B,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:X,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Y(L,q,V){c();var K=P(L,V);l.writeFileSync(q,K)}function F(L){for(var q=new Array(L.length),V=0;V<L.length;++V)q[V]=String.fromCharCode(L[V]);return q.join("")}function J(L,q){var V=P(L,q);switch(q&&q.type||"buffer"){case"file":return c(),l.writeFileSync(q.filename,V),V;case"binary":return typeof V=="string"?V:F(V);case"base64":return R1(typeof V=="string"?V:F(V));case"buffer":if(bt)return Buffer.isBuffer(V)?V:Du(V);case"array":return typeof V=="string"?ca(V):V}return V}var ne;function I(L){try{var q=L.InflateRaw,V=new q;if(V._processChunk(new Uint8Array([3,0]),V._finishFlushFlag),V.bytesRead)ne=L;else throw new Error("zlib does not expose bytesRead")}catch(K){console.error("cannot use native zlib: "+(K.message||K))}}function z(L,q){if(!ne)return o_(L,q);var V=ne.InflateRaw,K=new V,Z=K._processChunk(L.slice(L.l),K._finishFlushFlag);return L.l+=K.bytesRead,Z}function M(L){return ne?ne.deflateRawSync(L):it(L)}var U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],te=[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],re=[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 se(L){var q=(L<<1|L<<11)&139536|(L<<5|L<<15)&558144;return(q>>16|q>>8|q)&255}for(var ie=typeof Uint8Array<"u",ae=ie?new Uint8Array(256):[],ge=0;ge<256;++ge)ae[ge]=se(ge);function G(L,q){var V=ae[L&255];return q<=8?V>>>8-q:(V=V<<8|ae[L>>8&255],q<=16?V>>>16-q:(V=V<<8|ae[L>>16&255],V>>>24-q))}function Ue(L,q){var V=q&7,K=q>>>3;return(L[K]|(V<=6?0:L[K+1]<<8))>>>V&3}function Re(L,q){var V=q&7,K=q>>>3;return(L[K]|(V<=5?0:L[K+1]<<8))>>>V&7}function He(L,q){var V=q&7,K=q>>>3;return(L[K]|(V<=4?0:L[K+1]<<8))>>>V&15}function Te(L,q){var V=q&7,K=q>>>3;return(L[K]|(V<=3?0:L[K+1]<<8))>>>V&31}function we(L,q){var V=q&7,K=q>>>3;return(L[K]|(V<=1?0:L[K+1]<<8))>>>V&127}function Me(L,q,V){var K=q&7,Z=q>>>3,Q=(1<<V)-1,ue=L[Z]>>>K;return V<8-K||(ue|=L[Z+1]<<8-K,V<16-K)||(ue|=L[Z+2]<<16-K,V<24-K)||(ue|=L[Z+3]<<24-K),ue&Q}function at(L,q,V){var K=q&7,Z=q>>>3;return K<=5?L[Z]|=(V&7)<<K:(L[Z]|=V<<K&255,L[Z+1]=(V&7)>>8-K),q+3}function Tr(L,q,V){var K=q&7,Z=q>>>3;return V=(V&1)<<K,L[Z]|=V,q+1}function pe(L,q,V){var K=q&7,Z=q>>>3;return V<<=K,L[Z]|=V&255,V>>>=8,L[Z+1]=V,q+8}function je(L,q,V){var K=q&7,Z=q>>>3;return V<<=K,L[Z]|=V&255,V>>>=8,L[Z+1]=V&255,L[Z+2]=V>>>8,q+16}function nt(L,q){var V=L.length,K=2*V>q?2*V:q+5,Z=0;if(V>=q)return L;if(bt){var Q=HM(K);if(L.copy)L.copy(Q);else for(;Z<L.length;++Z)Q[Z]=L[Z];return Q}else if(ie){var ue=new Uint8Array(K);if(ue.set)ue.set(L);else for(;Z<V;++Z)ue[Z]=L[Z];return ue}return L.length=K,L}function tt(L){for(var q=new Array(L),V=0;V<L;++V)q[V]=0;return q}function Nt(L,q,V){var K=1,Z=0,Q=0,ue=0,me=0,ce=L.length,de=ie?new Uint16Array(32):tt(32);for(Q=0;Q<32;++Q)de[Q]=0;for(Q=ce;Q<V;++Q)L[Q]=0;ce=L.length;var he=ie?new Uint16Array(ce):tt(ce);for(Q=0;Q<ce;++Q)de[Z=L[Q]]++,K<Z&&(K=Z),he[Q]=0;for(de[0]=0,Q=1;Q<=K;++Q)de[Q+16]=me=me+de[Q-1]<<1;for(Q=0;Q<ce;++Q)me=L[Q],me!=0&&(he[Q]=de[me+16]++);var ve=0;for(Q=0;Q<ce;++Q)if(ve=L[Q],ve!=0)for(me=G(he[Q],K)>>K-ve,ue=(1<<K+4-ve)-1;ue>=0;--ue)q[me|ue<<ve]=ve&15|Q<<4;return K}var ht=ie?new Uint16Array(512):tt(512),Et=ie?new Uint16Array(32):tt(32);if(!ie){for(var cr=0;cr<512;++cr)ht[cr]=0;for(cr=0;cr<32;++cr)Et[cr]=0}(function(){for(var L=[],q=0;q<32;q++)L.push(5);Nt(L,Et,32);var V=[];for(q=0;q<=143;q++)V.push(8);for(;q<=255;q++)V.push(9);for(;q<=279;q++)V.push(7);for(;q<=287;q++)V.push(8);Nt(V,ht,288)})();var gs=function(){for(var q=ie?new Uint8Array(32768):[],V=0,K=0;V<re.length-1;++V)for(;K<re[V+1];++K)q[K]=V;for(;K<32768;++K)q[K]=29;var Z=ie?new Uint8Array(259):[];for(V=0,K=0;V<te.length-1;++V)for(;K<te[V+1];++K)Z[K]=V;function Q(me,ce){for(var de=0;de<me.length;){var he=Math.min(65535,me.length-de),ve=de+he==me.length;for(ce.write_shift(1,+ve),ce.write_shift(2,he),ce.write_shift(2,~he&65535);he-- >0;)ce[ce.l++]=me[de++]}return ce.l}function ue(me,ce){for(var de=0,he=0,ve=ie?new Uint16Array(32768):[];he<me.length;){var Ce=Math.min(65535,me.length-he);if(Ce<10){for(de=at(ce,de,+(he+Ce==me.length)),de&7&&(de+=8-(de&7)),ce.l=de/8|0,ce.write_shift(2,Ce),ce.write_shift(2,~Ce&65535);Ce-- >0;)ce[ce.l++]=me[he++];de=ce.l*8;continue}de=at(ce,de,+(he+Ce==me.length)+2);for(var Le=0;Ce-- >0;){var Se=me[he];Le=(Le<<5^Se)&32767;var De=-1,ft=0;if((De=ve[Le])&&(De|=he&-32768,De>he&&(De-=32768),De<he))for(;me[De+ft]==me[he+ft]&&ft<250;)++ft;if(ft>2){Se=Z[ft],Se<=22?de=pe(ce,de,ae[Se+1]>>1)-1:(pe(ce,de,3),de+=5,pe(ce,de,ae[Se-23]>>5),de+=3);var Or=Se<8?0:Se-4>>2;Or>0&&(je(ce,de,ft-te[Se]),de+=Or),Se=q[he-De],de=pe(ce,de,ae[Se]>>3),de-=3;var Fr=Se<4?0:Se-2>>1;Fr>0&&(je(ce,de,he-De-re[Se]),de+=Fr);for(var xs=0;xs<ft;++xs)ve[Le]=he&32767,Le=(Le<<5^me[he])&32767,++he;Ce-=ft-1}else Se<=143?Se=Se+48:de=Tr(ce,de,1),de=pe(ce,de,ae[Se]),ve[Le]=he&32767,++he}de=pe(ce,de,0)-1}return ce.l=(de+7)/8|0,ce.l}return function(ce,de){return ce.length<8?Q(ce,de):ue(ce,de)}}();function it(L){var q=fe(50+Math.floor(L.length*1.1)),V=gs(L,q);return q.slice(0,V)}var $t=ie?new Uint16Array(32768):tt(32768),dr=ie?new Uint16Array(32768):tt(32768),Gt=ie?new Uint16Array(128):tt(128),Yn=1,mv=1;function Lu(L,q){var V=Te(L,q)+257;q+=5;var K=Te(L,q)+1;q+=5;var Z=He(L,q)+4;q+=4;for(var Q=0,ue=ie?new Uint8Array(19):tt(19),me=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ce=1,de=ie?new Uint8Array(8):tt(8),he=ie?new Uint8Array(8):tt(8),ve=ue.length,Ce=0;Ce<Z;++Ce)ue[U[Ce]]=Q=Re(L,q),ce<Q&&(ce=Q),de[Q]++,q+=3;var Le=0;for(de[0]=0,Ce=1;Ce<=ce;++Ce)he[Ce]=Le=Le+de[Ce-1]<<1;for(Ce=0;Ce<ve;++Ce)(Le=ue[Ce])!=0&&(me[Ce]=he[Le]++);var Se=0;for(Ce=0;Ce<ve;++Ce)if(Se=ue[Ce],Se!=0){Le=ae[me[Ce]]>>8-Se;for(var De=(1<<7-Se)-1;De>=0;--De)Gt[Le|De<<Se]=Se&7|Ce<<3}var ft=[];for(ce=1;ft.length<V+K;)switch(Le=Gt[we(L,q)],q+=Le&7,Le>>>=3){case 16:for(Q=3+Ue(L,q),q+=2,Le=ft[ft.length-1];Q-- >0;)ft.push(Le);break;case 17:for(Q=3+Re(L,q),q+=3;Q-- >0;)ft.push(0);break;case 18:for(Q=11+we(L,q),q+=7;Q-- >0;)ft.push(0);break;default:ft.push(Le),ce<Le&&(ce=Le);break}var Or=ft.slice(0,V),Fr=ft.slice(V);for(Ce=V;Ce<286;++Ce)Or[Ce]=0;for(Ce=K;Ce<30;++Ce)Fr[Ce]=0;return Yn=Nt(Or,$t,286),mv=Nt(Fr,dr,30),q}function EA(L,q){if(L[0]==3&&!(L[1]&3))return[zh(q),2];for(var V=0,K=0,Z=HM(q||1<<18),Q=0,ue=Z.length>>>0,me=0,ce=0;!(K&1);){if(K=Re(L,V),V+=3,K>>>1)K>>1==1?(me=9,ce=5):(V=Lu(L,V),me=Yn,ce=mv);else{V&7&&(V+=8-(V&7));var de=L[V>>>3]|L[(V>>>3)+1]<<8;if(V+=32,de>0)for(!q&&ue<Q+de&&(Z=nt(Z,Q+de),ue=Z.length);de-- >0;)Z[Q++]=L[V>>>3],V+=8;continue}for(;;){!q&&ue<Q+32767&&(Z=nt(Z,Q+32767),ue=Z.length);var he=Me(L,V,me),ve=K>>>1==1?ht[he]:$t[he];if(V+=ve&15,ve>>>=4,!(ve>>>8&255))Z[Q++]=ve;else{if(ve==256)break;ve-=257;var Ce=ve<8?0:ve-4>>2;Ce>5&&(Ce=0);var Le=Q+te[ve];Ce>0&&(Le+=Me(L,V,Ce),V+=Ce),he=Me(L,V,ce),ve=K>>>1==1?Et[he]:dr[he],V+=ve&15,ve>>>=4;var Se=ve<4?0:ve-2>>1,De=re[ve];for(Se>0&&(De+=Me(L,V,Se),V+=Se),!q&&ue<Le&&(Z=nt(Z,Le+100),ue=Z.length);Q<Le;)Z[Q]=Z[Q-De],++Q}}}return q?[Z,V+7>>>3]:[Z.slice(0,Q),V+7>>>3]}function o_(L,q){var V=L.slice(L.l||0),K=EA(V,q);return L.l+=K[1],K[0]}
vendor: 2,148 bytes, line 641
641function gv(L,q){if(L)typeof console<"u"&&console.error(q);else throw new Error(q)}function xv(L,q){var V=L;cs(V,0);var K=[],Z=[],Q={FileIndex:K,FullPaths:Z};N(Q,{root:q.root});for(var ue=V.length-4;(V[ue]!=80||V[ue+1]!=75||V[ue+2]!=5||V[ue+3]!=6)&&ue>=0;)--ue;V.l=ue+4,V.l+=4;var me=V.read_shift(2);V.l+=6;var ce=V.read_shift(4);for(V.l=ce,ue=0;ue<me;++ue){V.l+=20;var de=V.read_shift(4),he=V.read_shift(4),ve=V.read_shift(2),Ce=V.read_shift(2),Le=V.read_shift(2);V.l+=8;var Se=V.read_shift(4),De=o(V.slice(V.l+ve,V.l+ve+Ce));V.l+=ve+Ce+Le;var ft=V.l;V.l=Se+4,AA(V,de,he,Q,De),V.l=ft}return Q}function AA(L,q,V,K,Z){L.l+=2;var Q=L.read_shift(2),ue=L.read_shift(2),me=a(L);if(Q&8257)throw new Error("Unsupported ZIP encryption");for(var ce=L.read_shift(4),de=L.read_shift(4),he=L.read_shift(4),ve=L.read_shift(2),Ce=L.read_shift(2),Le="",Se=0;Se<ve;++Se)Le+=String.fromCharCode(L[L.l++]);if(Ce){var De=o(L.slice(L.l,L.l+Ce));(De[21589]||{}).mt&&(me=De[21589].mt),((Z||{})[21589]||{}).mt&&(me=Z[21589].mt)}L.l+=Ce;var ft=L.slice(L.l,L.l+de);switch(ue){case 8:ft=z(L,he);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+ue)}var Or=!1;Q&8&&(ce=L.read_shift(4),ce==134695760&&(ce=L.read_shift(4),Or=!0),de=L.read_shift(4),he=L.read_shift(4)),de!=q&&gv(Or,"Bad compressed size: "+q+" != "+de),he!=V&&gv(Or,"Bad uncompressed size: "+V+" != "+he),Us(K,Le,ft,{unsafe:!0,mt:me})}function vv(L,q){var V=q||{},K=[],Z=[],Q=fe(1),ue=V.compression?8:0,me=0,ce=0,de=0,he=0,ve=0,Ce=L.FullPaths[0],Le=Ce,Se=L.FileIndex[0],De=[],ft=0;for(ce=1;ce<L.FullPaths.length;++ce)if(Le=L.FullPaths[ce].slice(Ce.length),Se=L.FileIndex[ce],!(!Se.size||!Se.content||Le=="�Sh33tJ5")){var Or=he,Fr=fe(Le.length);for(de=0;de<Le.length;++de)Fr.write_shift(1,Le.charCodeAt(de)&127);Fr=Fr.slice(0,Fr.l),De[ve]=Zle.buf(Se.content,0);var xs=Se.content;ue==8&&(xs=M(xs)),Q=fe(30),Q.write_shift(4,67324752),Q.write_shift(2,20),Q.write_shift(2,me),Q.write_shift(2,ue),Se.mt?i(Q,Se.mt):Q.write_shift(4,0),Q.write_shift(-4,De[ve]),Q.write_shift(4,xs.length),Q.write_shift(4,Se.content.length),Q.write_shift(2,Fr.length),Q.write_shift(2,0),he+=Q.length,K.push(Q
vendor: 7,250 bytes, lines 641-651
641),he+=Fr.length,K.push(Fr),he+=xs.length,K.push(xs),Q=fe(46),Q.write_shift(4,33639248),Q.write_shift(2,0),Q.write_shift(2,20),Q.write_shift(2,me),Q.write_shift(2,ue),Q.write_shift(4,0),Q.write_shift(-4,De[ve]),Q.write_shift(4,xs.length),Q.write_shift(4,Se.content.length),Q.write_shift(2,Fr.length),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(4,0),Q.write_shift(4,Or),ft+=Q.l,Z.push(Q),ft+=Fr.length,Z.push(Fr),++ve}return Q=fe(22),Q.write_shift(4,101010256),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(2,ve),Q.write_shift(2,ve),Q.write_shift(4,ft),Q.write_shift(4,he),Q.write_shift(2,0),Vn([Vn(K),Vn(Z),Q])}var Pi={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 TA(L,q){if(L.ctype)return L.ctype;var V=L.name||"",K=V.match(/\.([^\.]+)$/);return K&&Pi[K[1]]||q&&(K=(V=q).match(/[\.\\]([^\.\\])+$/),K&&Pi[K[1]])?Pi[K[1]]:"application/octet-stream"}function ot(L){for(var q=R1(L),V=[],K=0;K<q.length;K+=76)V.push(q.slice(K,K+76));return V.join(`\r 642`)+`\r 643`}function zt(L){var q=L.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(de){var he=de.charCodeAt(0).toString(16).toUpperCase();return"="+(he.length==1?"0"+he:he)});q=q.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),q.charAt(0)==` 644`&&(q="=0D"+q.slice(1)),q=q.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,` 645=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var V=[],K=q.split(`\r 646`),Z=0;Z<K.length;++Z){var Q=K[Z];if(Q.length==0){V.push("");continue}for(var ue=0;ue<Q.length;){var me=76,ce=Q.slice(ue,ue+me);ce.charAt(me-1)=="="?me--:ce.charAt(me-2)=="="?me-=2:ce.charAt(me-3)=="="&&(me-=3),ce=Q.slice(ue,ue+me),ue+=me,ue<Q.length&&(ce+="="),V.push(ce)}}return V.join(`\r 647`)}function hr(L){for(var q=[],V=0;V<L.length;++V){for(var K=L[V];V<=L.length&&K.charAt(K.length-1)=="=";)K=K.slice(0,K.length-1)+L[++V];q.push(K)}for(var Z=0;Z<q.length;++Z)q[Z]=q[Z].replace(/[=][0-9A-Fa-f]{2}/g,function(Q){return String.fromCharCode(parseInt(Q.slice(1),16))});return ca(q.join(`\r 648`))}function Ri(L,q,V){for(var K="",Z="",Q="",ue,me=0;me<10;++me){var ce=q[me];if(!ce||ce.match(/^\s*$/))break;var de=ce.match(/^(.*?):\s*([^\s].*)$/);if(de)switch(de[1].toLowerCase()){case"content-location":K=de[2].trim();break;case"content-type":Q=de[2].trim();break;case"content-transfer-encoding":Z=de[2].trim();break}}switch(++me,Z.toLowerCase()){case"base64":ue=ca(xa(q.slice(me).join("")));break;case"quoted-printable":ue=hr(q.slice(me));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+Z)}var he=Us(L,K.slice(V.length),ue,{unsafe:!0});Q&&(he.ctype=Q)}function ji(L,q){if(F(L.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var V=q&&q.root||"",K=(bt&&Buffer.isBuffer(L)?L.toString("binary"):F(L)).split(`\r 649`),Z=0,Q="";for(Z=0;Z<K.length;++Z)if(Q=K[Z],!!/^Content-Location:/i.test(Q)&&(Q=Q.slice(Q.indexOf("file")),V||(V=Q.slice(0,Q.lastIndexOf("/")+1)),Q.slice(0,V.length)!=V))for(;V.length>0&&(V=V.slice(0,V.length-1),V=V.slice(0,V.lastIndexOf("/")+1),Q.slice(0,V.length)!=V););var ue=(K[1]||"").match(/boundary="(.*?)"/);if(!ue)throw new Error("MAD cannot find boundary");var me="--"+(ue[1]||""),ce=[],de=[],he={FileIndex:ce,FullPaths:de};N(he);var ve,Ce=0;for(Z=0;Z<K.length;++Z){var Le=K[Z];Le!==me&&Le!==me+"--"||(Ce++&&Ri(he,K.slice(ve,Z),V),ve=Z)}return he}function sl(L,q){var V=q||{},K=V.boundary||"SheetJS";K="------="+K;for(var Z=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+K.slice(2)+'"',"","",""],Q=L.FullPaths[0],ue=Q,me=L.FileIndex[0],ce=1;ce<L.FullPaths.length;++ce)if(ue=L.FullPaths[ce].slice(Q.length),me=L.FileIndex[ce],!(!me.size||!me.content||ue=="�Sh33tJ5")){ue=ue.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 de=me.content,he=bt&&Buffer.isBuffer(de)?de.toString("binary"):F(de),ve=0,Ce=Math.min(1024,he.length),Le=0,Se=0;Se<=Ce;++Se)(Le=he.charCodeAt(Se))>=32&&Le<128&&++ve;var De=ve>=Ce*4/5;Z.push(K),Z.push("Content-Location: "+(V.root||"file:///C:/SheetJS/")+ue),Z.push("Content-Transfer-Encoding: "+(De?"quoted-printable":"base64")),Z.push("Content-Type: "+TA(me,ue)),Z.push(""),Z.push(De?zt(he):ot(he))}return Z.push(K+`--\r 650`),Z.join(`\r 651`)}function lc(L){var q={};return N(q,L),q}function Us(L,q,V,K){var Z=K&&K.unsafe;Z||N(L);var Q=!Z&&Ke.find(L,q);if(!Q){var ue=L.FullPaths[0];q.slice(0,ue.length)==ue?ue=q:(ue.slice(-1)!="/"&&(ue+="/"),ue=(ue+q).replace("//","/")),Q={name:s(q),type:2},L.FileIndex.push(Q),L.FullPaths.push(ue),Z||Ke.utils.cfb_gc(L)}return Q.content=V,Q.size=V?V.length:0,K&&(K.CLSID&&(Q.clsid=K.CLSID),K.mt&&(Q.mt=K.mt),K.ct&&(Q.ct=K.ct)),Q}function il(L,q){N(L);var V=Ke.find(L,q);if(V){for(var K=0;K<L.FileIndex.length;++K)if(L.FileIndex[K]==V)return L.FileIndex.splice(K,1),L.FullPaths.splice(K,1),!0}return!1}function tW(L,q,V){N(L);var K=Ke.find(L,q);if(K){for(var Z=0;Z<L.FileIndex.length;++Z)if(L.FileIndex[Z]==K)return L.FileIndex[Z].name=s(V),L.FullPaths[Z]=V,!0}return!1}function rW(L){E(L,!0)}return e.find=O,e.read=A,e.parse=u,e.write=J,e.writeFile=Y,e.utils={cfb_new:lc,cfb_add:Us,cfb_del:il,cfb_mov:tW,cfb_gc:rW,ReadShift:Oy,CheckField:g7,prep_blob:cs,bconcat:Vn,use_zlib:I,_deflateRaw:it,_inflateRaw:o_,consts:W},e}();function Jle(r){return typeof r=="string"?pA(r):Array.isArray(r)?Sle(r):r}function Qb(r,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=pA(e);break;default:throw new Error("Unsupported encoding "+t)}return Deno.writeFileSync(r,e)}var n=t=="utf8"?Kl(e):e;if(typeof IE_SaveFile<"u")return IE_SaveFile(n,r);if(typeof Blob<"u"){var s=new Blob([Jle(n)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(s,r);if(typeof saveAs<"u")return saveAs(s,r);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var i=URL.createObjectURL(s);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),chrome.downloads.download({url:i,filename:r,saveAs:!0});var a=document.createElement("a");if(a.download!=null)return a.download=r,a.href=i,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),i}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var o=File(r);return o.open("w"),o.encoding="binary",Array.isArray(e)&&(e=Qh(e)),o.write(e),o.close(),e}catch(l){if(!l.message||!l.message.match(/onstruct/))throw l}throw new Error("cannot save file "+r)}function Qle(r){if(typeof Deno<"u")return Deno.readFileSync(r);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var e=File(r);e.open("r"),e.encoding="binary";var t=e.read();return e.close(),t}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+r)}function nn(r){for(var e=Object.keys(r),t=[],n=0;n<e.length;
651++n)Object.prototype.hasOwnProperty.call(r,e[n])&&t.push(e[n]);return t}function ZM(r,e){for(var t=[],n=nn(r),s=0;s!==n.length;++s)t[r[n[s]][e]]==null&&(t[r[n[s]][e]]=n[s]);return t}function gA(r){for(var e=[],t=nn(r),n=0;n!==t.length;++n)e[r[t[n]]]=t[n];return e}function xA(r){for(var e=[],t=nn(r),n=0;n!==t.length;++n)e[r[t[n]]]=parseInt(t[n],10);return e}function ece(r){for(var e=[],t=nn(r),n=0;n!==t.length;++n)e[r[t[n]]]==null&&(e[r[t[n]]]=[]),e[r[t[n]]].push(t[n]);return e}var NS=new Date(1899,11,30,0,0,0);function Rn(r,e){var t=r.getTime(),n=NS.getTime()+(r.getTimezoneOffset()-NS.getTimezoneOffset())*6e4;return(t-n)/(24*60*60*1e3)}var Yz=new Date,tce=NS.getTime()+(Yz.getTimezoneOffset()-NS.getTimezoneOffset())*6e4,JM=Yz.getTimezoneOffset();function vA(r){var e=new Date;return e.setTime(r*24*60*60*1e3+tce),e.getTimezoneOffset()!==JM&&e.setTime(e.getTime()+(e.getTimezoneOffset()-JM)*6e4),e}function rce(r){var e=0,t=0,n=!1,s=r.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!s)throw new Error("|"+r+"| is not an ISO8601 Duration");for(var i=1;i!=s.length;++i)if(s[i]){switch(t=1,i>3&&(n=!0),s[i].slice(s[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+s[i].slice(s[i].length-1));case"D":t*=24;case"H":t*=60;case"M":if(n)t*=60;else throw new Error("Unsupported ISO Duration Field: M")}e+=t*parseInt(s[i],10)}return e}var QM=new Date("2017-02-19T19:06:09.000Z"),qz=isNaN(QM.getFullYear())?new Date("2/19/17"):QM,nce=qz.getFullYear()==2017;function Er(r,e){var t=new Date(r);if(nce)return e>0?t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3):e<0&&t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3),t;if(r instanceof Date)return r;if(qz.getFullYear()==1917&&!isNaN(t.getFullYear())){var n=t.getFullYear();return r.indexOf(""+n)>-1||t.setFullYear(t.getFullYear()+100),t}var s=r.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return r.indexOf("Z")>-1&&(i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3)),i}function T0(r,e){if(bt&&Buffer.isBuffer(r)){if(e){if(r[0]==255&&r[1]==254)return Kl(r.slice(2).toString("utf16le"));if(r[1]==254&&r[2]==255)return Kl(Iz(r.slice(2).toString("binary")))}return r.toString("binary")}if(typeof TextDecoder<"u")try{if(e){if(r[0]==255&&r[1]==254)return Kl(new TextDecoder("utf-16le").decode(r.slice(2)));if(r[0]==254&&r[1]==255)return Kl(new TextDecoder("utf-16be").decode(r.slice(2)))}var t={"â¬":"Â","â":"Â",Æ:"Â","â":"Â","â¦":"Â
","â ":"Â","â¡":"Â","Ë":"Â","â°":"Â",Å :"Â","â¹":"Â",Å:"Â",Ž:"Â","â":"Â","â":"Â","â":"Â","â":"Â","â¢":"Â","â":"Â","â":"Â","Ë":"Â","â¢":"Â",Å¡:"Â","âº":"Â",Å:"Â",ž:"Â",Ÿ:"Â"};return Array.isArray(r)&&(r=new Uint8Array(r)),new TextDecoder("latin1").decode(r).replace(/[â¬âÆââ¦â â¡Ëâ°Å â¹ÅŽâââââ¢ââËâ¢Å¡âºÅžŸ]/g,function(i){return t[i]||i})}catch{}for(var n=[],s=0;s!=r.length;++s)n.push(String.fromCharCode(r[s]));return n.join("")}function Ar(r){if(typeof JSON<"u"&&!Array.isArray(r))return JSON.parse(JSON.stringify(r));if(typeof r!="object"||r==null)return r;if(r instanceof Date)return new Date(r.getTime());var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=Ar(r[t]));return e}function tn(r,e){for(var t="";t.length<e;)t+=r;return t}function Jo(r){var e=Number(r);if(!isNaN(e))return isFinite(e)?e:NaN;if(!/\d/.test(r))return e;var t=1,n=r.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return t*=100,""});return!isNaN(e=Number(n))||(n=n.replace(/[(](.*)[)]/,function(s,i){return t=-t,i}),!isNaN(e=Number(n)))?e/t:e}var sce=["january","february","march","april","may","june","july","august","september","october","november","december"];function Xx(r){var e=new Date(r),t=new Date(NaN),n=e.getYear(),s=e.getMonth(),i=e.getDate();if(isNaN(i))return t;var a=r.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&&sce.indexOf(a)==-1)return t}else if(a.match(/[a-z]/))return t;return n<0||n>8099?t:(s>0||i>1)&&n!=101?e:r.match(/[^-0-9:,\/\\]/)?t:e}var ice=function(){var r="abacaba".split(/(:?b)/i).length==5;return function(t,n,s){if(r||typeof n=="string")return t.split(n);for(var i=t.split(n),a=[i[0]],o=1;o<i.length;++o)a.push(s),a.push(i[o]);return a}}();function Zz(r){return r?r.content&&r.type?T0(r.content,!0):r.data?py(r.data):r.asNodeBuffer&&bt?py(r.asNodeBuffer().toString("binary")):r.asBinary?py(r.asBinary()):r._data&&r._data.getContent?py(T0(Array.prototype.slice.call(r._data.getContent(),0))):null:null}function Jz(r){if(!r)return null;if(r.data)return $M(r.data);if(r.asNodeBuffer&&bt)return r.asNodeBuffer();if(r._data&&r._data.getContent){var e=r._data.getContent();return typeof e=="string"?$M(e):Array.prototype.slice.call(e)}return r.content&&r.type?r.content:null}function ace(r){return r&&r.name.slice(-4)===".bin"?Jz(r):Zz(r)}function Na(r,e){for(var t=r.FullPaths||nn(r.files),n=e.toLowerCase().replace(/[\/]/g,"\\"),s=n.replace(/\\/g,"/"),i=0;i<t.length;++i){var a=t[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==a||s==a)return r.files?r.files[t[i]]:r.FileIndex[i]}return null}function Mj(r,e){var t=Na(r,e);if(t==null)throw new Error("Cannot find file "+e+" in zip");return t}function vn(r,e,t){if(!t)return ace(Mj(r,e));if(!e)return null;try{return vn(r,e)}catch{return null}}function ua(r,e,t){if(!t)return Zz(Mj(r,e));if(!e)return null;try{return ua(r,e)}catch{return null}}function oce(r,e,t){return Jz(Mj(r,e))}function eI(r){for(var e=r.FullPaths||nn(r.files),t=[],n=0;n<e.length;++n)e[n].slice(-1)!="/"&&t.push(e[n].replace(/^Root Entry[\/]/,""));return t.sort()}function vt(r,e,t){if(r.FullPaths){if(typeof t=="string"){var n;return bt?n=Du(t):n=Ele(t),Ke.utils.cfb_add(r,e,n)}Ke.utils.cfb_add(r,e,t)}
vendor: 1,602 bytes, lines 651-652
651else r.file(e,t)}function Ij(){return Ke.utils.cfb_new()}function Qz(r,e){switch(e.type){case"base64":return Ke.read(r,{type:"base64"});case"binary":return Ke.read(r,{type:"binary"});case"buffer":case"array":return Ke.read(r,{type:"buffer"})}throw new Error("Unrecognized type "+e.type)}function gy(r,e){if(r.charAt(0)=="/")return r.slice(1);var t=e.split("/");e.slice(-1)!="/"&&t.pop();for(var n=r.split("/");n.length!==0;){var s=n.shift();s===".."?t.pop():s!=="."&&t.push(s)}return t.join("/")}var fn=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r 652`,lce=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,tI=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,cce=/<[^>]*>/g,Bs=fn.match(tI)?tI:cce,uce=/<\w*:/,dce=/<(\/?)\w+:/;function rt(r,e,t){for(var n={},s=0,i=0;s!==r.length&&!((i=r.charCodeAt(s))===32||i===10||i===13);++s);if(e||(n[0]=r.slice(0,s)),s===r.length)return n;var a=r.match(lce),o=0,l="",c=0,u="",f="",p=1;if(a)for(c=0;c!=a.length;++c){for(f=a[c],i=0;i!=f.length&&f.charCodeAt(i)!==61;++i);for(u=f.slice(0,i).trim();f.charCodeAt(i+1)==32;)++i;for(p=(s=f.charCodeAt(i+1))==34||s==39?1:0,l=f.slice(i+1+p,f.length-p),o=0;o!=u.length&&u.charCodeAt(o)!==58;++o);if(o===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,n[u.toLowerCase()]=l;else{var m=(o===5&&u.slice(0,5)==="xmlns"?"xmlns":"")+u.slice(o+1);if(n[m]&&u.slice(o-3,o)=="ext")continue;n[m]=l,n[m.toLowerCase()]=l}}return n}function ac(r){return r.replace(dce,"<$1")}var e7={""":'"',"'":"'",">":">","<":"<","&":"&"}
vendor: 1,059 bytes, line 652
652,Lj=gA(e7),Rt=function(){var r=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,e=/_x([\da-fA-F]{4})_/ig;return function t(n){var s=n+"",i=s.indexOf("<![CDATA[");if(i==-1)return s.replace(r,function(o,l){return e7[o]||String.fromCharCode(parseInt(l,o.indexOf("x")>-1?16:10))||o}).replace(e,function(o,l){return String.fromCharCode(parseInt(l,16))});var a=s.indexOf("]]>");return t(s.slice(0,i))+s.slice(i+9,a)+t(s.slice(a+3))}}(),Bj=/[&<>'"]/g,hce=/[\u0000-\u0008\u000b-\u001f]/g;function Qt(r){var e=r+"";return e.replace(Bj,function(t){return Lj[t]}).replace(hce,function(t){return"_x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+"_"})}function rI(r){return Qt(r).replace(/ /g,"_x0020_")}var t7=/[\u0000-\u001f]/g;function Uj(r){var e=r+"";return e.replace(Bj,function(t){return Lj[t]}).replace(/\n/g,"<br/>").replace(t7,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}function fce(r){var e=r+"";return e.replace(Bj,function(t){return Lj[t]}).replace(t7,function(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"})}
652var nI=function(){var r=/&#(\d+);/g;function e(t,n){return String.fromCharCode(parseInt(n,10))}return function(n){return n.replace(r,e)}}();function pce(r){return r.replace(/(\r\n|[\r\n])/g," ")}function _r(r){switch(r){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function HT(r){for(var e="",t=0,n=0,s=0,i=0,a=0,o=0;t<r.length;){if(n=r.charCodeAt(t++),n<128){e+=String.fromCharCode(n);continue}if(s=r.charCodeAt(t++),n>191&&n<224){a=(n&31)<<6,a|=s&63,e+=String.fromCharCode(a);continue}if(i=r.charCodeAt(t++),n<240){e+=String.fromCharCode((n&15)<<12|(s&63)<<6|i&63);continue}a=r.charCodeAt(t++),o=((n&7)<<18|(s&63)<<12|(i&63)<<6|a&63)-65536,e+=String.fromCharCode(55296+(o>>>10&1023)),e+=String.fromCharCode(56320+(o&1023))}return e}function sI(r){var e=zh(2*r.length),t,n,s=1,i=0,a=0,o;for(n=0;n<r.length;n+=s)s=1,(o=r.charCodeAt(n))<128?t=o:o<224?(t=(o&31)*64+(r.charCodeAt(n+1)&63),s=2):o<240?(t=(o&15)*4096+(r.charCodeAt(n+1)&63)*64+(r.charCodeAt(n+2)&63),s=3):(s=4,t=(o&7)*262144+(r.charCodeAt(n+1)&63)*4096+(r.charCodeAt(n+2)&63)*64+(r.charCodeAt(n+3)&63),t-=65536,a=55296+(t>>>10&1023),t=56320+(t&1023)),a!==0&&(e[i++]=a&255,e[i++]=a>>>8,a=0),e[i++]=t%256,e[i++]=t>>>8;return e.slice(0,i).toString("ucs2")}function iI(r){return Du(r,"binary").toString("utf8")}var rk="foo bar bazâÂÂð£",lr=bt&&(iI(rk)==HT(rk)&&iI||sI(rk)==HT(rk)&&sI)||HT,Kl=bt?function(r){return Du(r,"utf8").toString("binary")}:function(r){for(var e=[],t=0,n=0,s=0;t<r.length;)switch(n=r.charCodeAt(t++),!0){case n<128:e.push(String.fromCharCode(n));break;case n<2048:e.push(String.fromCharCode(192+(n>>6))),e.push(String.fromCharCode(128+(n&63)));break;case(n>=55296&&n<57344):n-=55296,s=r.charCodeAt(t++)-56320+(n<<10),e.push(String.fromCharCode(240+(s>>18&7))),e.push(String.fromCharCode(144+(s>>12&63))),e.push(String.fromCharCode(128+(s>>6&63))),e.push(String.fromCharCode(128+(s&63)));break;default:e.push(String.fromCharCode(224+(n>>12))),e.push(String.fromCharCode(128+(n>>6&63))),e.push(String.fromCharCode(128+(n&63)))}return e.join("")},O1=function(){var r={};return function(t,n){var s=t+"|"+(n||"");return r[s]?r[s]:r[s]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",n||"")}}(),r7=function(){var r=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(t){for(var n=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,` 653`).replace(/<[^>]*>/g,""),s=0;s<r.length;++s)n=n.replace(r[s][0],r[s][1]);return n}}(),mce=function(){var r={};return function(t){return r[t]!==void 0?r[t]:r[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),gce=/<\/?(?:vt:)?variant>/g,xce=/<(?:vt:)([^>]*)>([\s\S]*)</;function aI(r,e){var t=rt(r),n=r.match(mce(t.baseType))||[],s=[];if(n.length!=t.size){if(e.WTF)throw new Error("unexpected vector length "+n.length+" != "+t.size);return s}return n.forEach(function(i){var a=i.replace(gce,"").match(xce);a&&s.push({v:lr(a[2]),t:a[1]})}),s}var n7=/(^\s|\s$|\n)/;function us(r,e){return"<"+r+(e.match(n7)?' xml:space="preserve"':"")+">"+e+"</"+r+">"}function F1(r){return nn(r).map(function(e){return" "+e+'="'+r[e]+'"'}).join("")}function Ee(r,e,t){return"<"+r+(t!=null?F1(t):"")+(e!=null?(e.match(n7)?' xml:space="preserve"':"")+">"+e+"</"+r:"/")+">"}function yR(r,e){try{return r.toISOString().replace(/\.\d*/,"")}catch(t){if(e)throw t}return""}function vce(r,e){switch(typeof r){case"string":var t=Ee("vt:lpwstr",Qt(r));return t=t.replace(/"/g,"_x0022_"),t;case"number":return Ee((r|0)==r?"vt:i4":"vt:r8",Qt(String(r)));case"boolean":return Ee("vt:bool",r?"true":"false")}if(r instanceof Date)return Ee("vt:filetime",yR(r));throw new Error("Unable to serialize "+r)}function $j(r){if(bt&&Buffer.isBuffer(r))return r.toString("utf8");if(typeof r=="string")return r;if(typeof Uint8Array<"u"&&r instanceof Uint8Array)return lr(Qh(Oj(r)));throw new Error("Bad input format: expected Buffer or string")}var D1=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>
653/mg,Tn={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/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},L0=["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"],ia={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 yce(r,e){for(var t=1-2*(r[e+7]>>>7),n=((r[e+7]&127)<<4)+(r[e+6]>>>4&15),s=r[e+6]&15,i=5;i>=0;--i)s=s*256+r[e+i];return n==2047?s==0?t*(1/0):NaN:(n==0?n=-1022:(n-=1023,s+=Math.pow(2,52)),t*Math.pow(2,n-52)*s)}function wce(r,e,t){var n=(e<0||1/e==-1/0?1:0)<<7,s=0,i=0,a=n?-e:e;isFinite(a)?a==0?s=i=0:(s=Math.floor(Math.log(a)/Math.LN2),i=a*Math.pow(2,52-s),s<=-1023&&(!isFinite(i)||i<Math.pow(2,52))?s=-1022:(i-=Math.pow(2,52),s+=1023)):(s=2047,i=isNaN(e)?26985:0);for(var o=0;o<=5;++o,i/=256)r[t+o]=i&255;r[t+6]=(s&15)<<4|i&15,r[t+7]=s>>4|n}var oI=function(r){for(var e=[],t=10240,n=0;n<r[0].length;++n)if(r[0][n])for(var s=0,i=r[0][n].length;s<i;s+=t)e.push.apply(e,r[0][n].slice(s,s+t));return e},lI=bt?function(r){return r[0].length>0&&Buffer.isBuffer(r[0][0])?Buffer.concat(r[0].map(function(e){return Buffer.isBuffer(e)?e:Du(e)})):oI(r)}:oI,cI=function(r,e,t){for(var n=[],s=e;s<t;s+=2)n.push(String.fromCharCode(uu(r,s)));return n.join("").replace(ni,"")},zj=bt?function(r,e,t){return Buffer.isBuffer(r)?r.toString("utf16le",e,t).replace(ni,""):cI(r,e,t)}:cI,uI=function(r,e,t){for(var n=[],s=e;s<e+t;++s)n.push(("0"+r[s].toString(16)).slice(-2));return n.join("")},s7=bt?function(r,e,t){return Buffer.isBuffer(r)?r.toString("hex",e,e+t):uI(r,e,t)}:uI,dI=function(r,e,t){for(var n=[],s=e;s<t;s++)n.push(String.fromCharCode(mm(r,s)));return n.join("")},e_=bt?function(e,t,n){return Buffer.isBuffer(e)?e.toString("utf8",t,n):dI(e,t,n)}:dI,i7=function(r,e){var t=aa(r,e);return t>0?e_(r,e+4,e+4+t-1):""},a7=i7,o7=function(r,e){var t=aa(r,e);return t>0?e_(r,e+4,e+4+t-1):""},l7=o7,c7=function(r,e){var t=2*aa(r,e);return t>0?e_(r,e+4,e+4+t-1):""},u7=c7,d7=function(e,t){var n=aa(e,t);return n>0?zj(e,t+4,t+4+n):""},h7=d7,f7=function(r,e){var t=aa(r,e);return t>0?e_(r,e+4,e+4+t):""},p7=f7,m7=function(r,e){return yce(r,e)},PS=m7,Hj=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};bt&&(a7=function(e,t){if(!Buffer.isBuffer(e))return i7(e,t);var n=e.readUInt32LE(t);return n>0?e.toString("utf8",t+4,t+4+n-1):""},l7=function(e,t){if(!Buffer.isBuffer(e))return o7(e,t);var n=e.readUInt32LE(t);return n>0?e.toString("utf8",t+4,t+4+n-1):""},u7=function(e,t){if(!Buffer.isBuffer(e))return c7(e,t);var n=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+n-1)},h7=function(e,t){if(!Buffer.isBuffer(e))return d7(e,t);var n=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+n)},p7=function(e,t){if(!Buffer.isBuffer(e))return f7(e,t);var n=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+n)},PS=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):m7(e,t)},Hj=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var mm=function(r,e){return r[e]},uu=function(r,e){return r[e+1]*256+r[e]},bce=function(r,e){var t=r[e+1]*256+r[e];return t<32768?t:(65535-t+1)*-1},aa=function(r,e){return r[e+3]*(1<<24)+(r[e+2]<<16)+(r[e+1]<<8)+r[e]},xf=function(r,e){return r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]},_ce=function(r,e){return r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]};function Oy(r,e){var t="",n,s,i=[],a,o,l,c;switch(e){case"dbcs":if(c=this.l,bt&&Buffer.isBuffer(this))t=this.slice(this.l,this.l+2*r).toString("utf16le");else for(l=0;l<r;++l)t+=String.fromCharCode(uu(this,c)),c+=2;r*=2;break;case"utf8":t=e_(this,this.l,this.l+r);break;case"utf16le":r*=2,t=zj(this,this.l,this.l+r);break;case"wstr":return Oy.call(this,r,"dbcs");case"lpstr-ansi":t=a7(this,this.l),r=4+aa(this,this.l);break;case"lpstr-cp":t=l7(this,this.l),r=4+aa(this,this.l);break;case"lpwstr":t=u7(this,this.l),r=4+2*aa(this,this.l);break;case"lpp4":r=4+aa(this,this.l),t=h7(this,this.l),r&2&&(r+=2);break;case"8lpp4":r=4+aa(this,this.l),t=p7(this,this.l),r&3&&(r+=4-(r&3));break;case"cstr":for(r=0,t="";(a=mm(this,this.l+r++))!==0;)i.push(tk(a));t=i.join("");break;case"_wstr":for(r=0,t="";(a=uu(this,this.l+r))!==0;)i.push(tk(a)),r+=2;r+=2,t=i.join("");break;case"dbcs-cont":for(t="",c=this.l,l=0;l<r;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return a=mm(this,c),this.l=c+1,o=Oy.call(this,r-l,a?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(tk(uu(this,c))),c+=2}t=i.join(""),r*=2;break;case"cpstr":case"sbcs-cont":for(t="",c=this.l,l=0;l!=r;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return a=mm(this,c),this.l=c+1,o=Oy.call(this,r-l,a?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(tk(mm(this,c))),c+=1}t=i.join("");break;default:switch(r){case 1:return n=mm(this,this.l),this.l++,n;case 2:return n=(e==="i"?bce:uu)(this,this.l),this.l+=2,n;case 4:case-4:return e==="i"||!(this[this.l+3]&128)?(n=(r>0?xf:_ce)(this,this.l),this.l+=4,n):(s=aa(this,this.l),this.l+=4,s);case 8:case-8:if(e==="f")return r==8?s=PS(this,this.l):s=PS([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,s;r=8;case 16:t=s7(this,this.l,r);break}}return this.l+=r,t}var kce=function(r,e,t){r[t]=e&255,r[t+1]=e>>>8&255,r[t+2]=e>>>16&255,r[t+3]=e>>>24&255},Sce=function(r,e,t){r[t]=e&255,r[t+1]=e>>8&255,r[t+2]=e>>16&255,r[t+3]=e>>24&255},Ece=function(r,e,t){r[t]=e&255,r[t+1]=e>>>8&255};function Ace(r,e,t){var n=0,s=0;if(t==="dbcs"){for(s=0;s!=e.length;++s)Ece(this,e.charCodeAt(s),this.l+2*s);n=2*e.length}else if(t==="sbcs"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),s=0;s!=e.length;++s)this[this.l+s]=e.charCodeAt(s)&255;n=e.length}else if(t==="hex"){for(;s<r;++s)this[this.l++]=parseInt(e.slice(2*s,2*s+2),16)||0;return this}else if(t==="utf16le"){var i=Math.min(this.l+r,this.length);for(s=0;s<Math.min(e.length,r);++s){var a=e.charCodeAt(s);this[this.l++]=a&255,this[this.l++]=a>>8}for(;this.l<i;)this[this.l++]=0;return this}else switch(r){case 1:n=1,this[this.l]=e&255;break;case 2:n=2,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255;break;case 3:n=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:n=4,kce(this,e,this.l);break;case 8:if(n=8,t==="f"){wce(this,e,this.l);break}case 16:break;case-4:n=4,Sce(this,e,this.l);break}return this.l+=n,this}function g7(r,e){var t=s7(this,this.l,r.length>>1);if(t!==r)throw new Error(e+"Expected "+r+" saw "+t);this.l+=r.length>>1}function cs(r,e){r.l=e,r.read_shift=Oy,r.chk=g7,r.write_shift=Ace}function Ls(r,e){r.l+=e}function fe(r){var e=zh(r);return cs(e,0),e}function Mu(r,e,t){if(r){var n,s,i;cs(r,r.l||0);for(var a=r.length,o=0,l=0;r.l<a;){o=r.read_shift(1),o&128&&(o=(o&127)+((r.read_shift(1)&127)<<7));var c=$1[o]||$1[65535];for(n=r.read_shift(1),i=n&127,s=1;s<4&&n&128;++s)i+=((n=r.read_shift(1))&127)<<7*s;l=r.l+i;var u=c.f&&c.f(r,i,t);if(r.l=l,e(u,c,o))return}}}function Ti(){var r=[],e=bt?256:2048,t=function(c){var u=fe(c);return cs(u,0),u},n=t(e),s=function(){n&&(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&r.push(n),n=null)},i=function(c){return n&&c<n.length-n.l?n:(s(),n=t(Math.max(c+1,e)))},a=function(){return s(),Vn(r)},o=function(c){s(),n=c,n.l==null&&(n.l=n.length),i(e)};return{next:i,push:o,end:a,_bufs:r}}function xe(r,e,t,n){var s=+e,i;if(!isNaN(s)){n||(n=$1[s].p||(t||[]).length||0),i=1+(s>=128?1:0)+1,n>=128&&++i,n>=16384&&++i,n>=2097152&&++i;
vendor: 9,548 bytes, line 653
653var a=r.next(i);s<=127?a.write_shift(1,s):(a.write_shift(1,(s&127)+128),a.write_shift(1,s>>7));for(var o=0;o!=4;++o)if(n>=128)a.write_shift(1,(n&127)+128),n>>=7;else{a.write_shift(1,n);break}n>0&&Hj(t)&&r.push(t)}}function Fy(r,e,t){var n=Ar(r);if(e.s?(n.cRel&&(n.c+=e.s.c),n.rRel&&(n.r+=e.s.r)):(n.cRel&&(n.c+=e.c),n.rRel&&(n.r+=e.r)),!t||t.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function hI(r,e,t){var n=Ar(r);return n.s=Fy(n.s,e.s,t),n.e=Fy(n.e,e.s,t),n}function Dy(r,e){if(r.cRel&&r.c<0)for(r=Ar(r);r.c<0;)r.c+=e>8?16384:256;if(r.rRel&&r.r<0)for(r=Ar(r);r.r<0;)r.r+=e>8?1048576:e>5?65536:16384;var t=Qe(r);return!r.cRel&&r.cRel!=null&&(t=Nce(t)),!r.rRel&&r.rRel!=null&&(t=Tce(t)),t}function WT(r,e){return r.s.r==0&&!r.s.rRel&&r.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!r.e.rRel?(r.s.cRel?"":"$")+$r(r.s.c)+":"+(r.e.cRel?"":"$")+$r(r.e.c):r.s.c==0&&!r.s.cRel&&r.e.c==(e.biff>=12?16383:255)&&!r.e.cRel?(r.s.rRel?"":"$")+hn(r.s.r)+":"+(r.e.rRel?"":"$")+hn(r.e.r):Dy(r.s,e.biff)+":"+Dy(r.e,e.biff)}function Wj(r){return parseInt(Cce(r),10)-1}function hn(r){return""+(r+1)}function Tce(r){return r.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Cce(r){return r.replace(/\$(\d+)$/,"$1")}function Vj(r){for(var e=Pce(r),t=0,n=0;n!==e.length;++n)t=26*t+e.charCodeAt(n)-64;return t-1}function $r(r){if(r<0)throw new Error("invalid column "+r);var e="";for(++r;r;r=Math.floor((r-1)/26))e=String.fromCharCode((r-1)%26+65)+e;return e}function Nce(r){return r.replace(/^([A-Z])/,"$$$1")}function Pce(r){return r.replace(/^\$([A-Z])/,"$1")}function Rce(r){return r.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function zr(r){for(var e=0,t=0,n=0;n<r.length;++n){var s=r.charCodeAt(n);s>=48&&s<=57?e=10*e+(s-48):s>=65&&s<=90&&(t=26*t+(s-64))}return{c:t-1,r:e-1}}function Qe(r){for(var e=r.c+1,t="";e;e=(e-1)/26|0)t=String.fromCharCode((e-1)%26+65)+t;return t+(r.r+1)}function Ci(r){var e=r.indexOf(":");return e==-1?{s:zr(r),e:zr(r)}:{s:zr(r.slice(0,e)),e:zr(r.slice(e+1))}}function gt(r,e){return typeof e>"u"||typeof e=="number"?gt(r.s,r.e):(typeof r!="string"&&(r=Qe(r)),typeof e!="string"&&(e=Qe(e)),r==e?r:r+":"+e)}function Ft(r){var e={s:{c:0,r:0},e:{c:0,r:0}},t=0,n=0,s=0,i=r.length;for(t=0;n<i&&!((s=r.charCodeAt(n)-64)<1||s>26);++n)t=26*t+s;for(e.s.c=--t,t=0;n<i&&!((s=r.charCodeAt(n)-48)<0||s>9);++n)t=10*t+s;if(e.s.r=--t,n===i||s!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++n,t=0;n!=i&&!((s=r.charCodeAt(n)-64)<1||s>26);++n)t=26*t+s;for(e.e.c=--t,t=0;n!=i&&!((s=r.charCodeAt(n)-48)<0||s>9);++n)t=10*t+s;return e.e.r=--t,e}function fI(r,e){var t=r.t=="d"&&e instanceof Date;if(r.z!=null)try{return r.w=io(r.z,t?Rn(e):e)}catch{}try{return r.w=io((r.XF||{}).numFmtId||(t?14:0),t?Rn(e):e)}catch{return""+e}}function Cu(r,e,t){return r==null||r.t==null||r.t=="z"?"":r.w!==void 0?r.w:(r.t=="d"&&!r.z&&t&&t.dateNF&&(r.z=t.dateNF),r.t=="e"?Iu[r.v]||r.v:e==null?fI(r,r.v):fI(r,e))}function ef(r,e){var t=e&&e.sheet?e.sheet:"Sheet1",n={};return n[t]=r,{SheetNames:[t],Sheets:n}}function x7(r,e,t){var n=t||{},s=r?Array.isArray(r):n.dense,i=r||(s?[]:{}),a=0,o=0;if(i&&n.origin!=null){if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?zr(n.origin):n.origin;a=l.r,o=l.c}i["!ref"]||(i["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var u=Ft(i["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),a==-1&&(c.e.r=a=u.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 m={v:e[f][p]},x=a+f,g=o+p;if(c.s.r>x&&(c.s.r=x),c.s.c>g&&(c.s.c=g),c.e.r<x&&(c.e.r=x),c.e.c<g&&(c.e.c=g),e[f][p]&&typeof e[f][p]=="object"&&!Array.isArray(e[f][p])&&!(e[f][p]instanceof Date))m=e[f][p];else if(Array.isArray(m.v)&&(m.f=e[f][p][1],m.v=m.v[0]),m.v===null)if(m.f)m.t="n";else if(n.nullError)m.t="e",m.v=0;else if(n.sheetStubs)m.t="z";else continue;else typeof m.v=="number"?m.t="n":typeof m.v=="boolean"?m.t="b":m.v instanceof Date?(m.z=n.dateNF||Je[14],n.cellDates?(m.t="d",m.w=io(m.z,Rn(m.v))):(m.t="n",m.v=Rn(m.v),m.w=io(m.z,m.v))):m.t="s";if(s)i[x]||(i[x]=[]),i[x][g]&&i[x][g].z&&(m.z=i[x][g].z),i[x][g]=m;else{var y=Qe({c:g,r:x});i[y]&&i[y].z&&(m.z=i[y].z),i[y]=m}}}return c.s.c<1e7&&(i["!ref"]=gt(c)),i}function fv(r,e){return x7(null,r,e)}function jce(r){return r.read_shift(4,"i")}function Qo(r,e){return e||(e=fe(4)),e.write_shift(4,r),e}function Fs(r){var e=r.read_shift(4);return e===0?"":r.read_shift(e,"dbcs")}function Gn(r,e){var t=!1;return e==null&&(t=!0,e=fe(4+2*r.length)),e.write_shift(4,r.length),r.length>0&&e.write_shift(0,r,"dbcs"),t?e.slice(0,e.l):e}function Oce(r){return{ich:r.read_shift(2),ifnt:r.read_shift(2)}}function Fce(r,e){return e||(e=fe(4)),e.write_shift(2,0),e.write_shift(2,0),e}function Gj(r,e){var t=r.l,n=r.read_shift(1),s=Fs(r),i=[],a={t:s,h:s};if(n&1){for(var o=r.read_shift(4),l=0;l!=o;++l)i.push(Oce(r));a.r=i}else a.r=[{ich:0,ifnt:0}];return r.l=t+e,a}function Dce(r,e){var t=!1;return e==null&&(t=!0,e=fe(15+4*r.t.length)),e.write_shift(1,0),Gn(r.t,e),t?e.slice(0,e.l):e}var Mce=Gj;function Ice(r,e){var t=!1;return e==null&&(t=!0,e=fe(23+4*r.t.length)),e.write_shift(1,1),Gn(r.t,e),e.write_shift(4,1),Fce({ich:0,ifnt:0},e),t?e.slice(0,e.l):e}function lo(r){var e=r.read_shift(4),t=r.read_shift(2);return t+=r.read_shift(1)<<16,r.l++,{c:e,iStyleRef:t}}function B0(r,e){return e==null&&(e=fe(8)),e.write_shift(-4,r.c),e.write_shift(3,r.iStyleRef||r.s),e.write_shift(1,0),e}function U0(r){var e=r.read_shift(2);return e+=r.read_shift(1)<<16,r.l++,{c:-1,iStyleRef:e}}function $0(r,e){return e==null&&(e=fe(4)),e.write_shift(3,r.iStyleRef||r.s),e.write_shift(1,0),e}var Lce=Fs,v7=Gn;function Kj(r){var e=r.read_shift(4);return e===0||e===4294967295?"":r.read_shift(e,"dbcs")}function RS(r,e){var t=!1;return e==null&&(t=!0,e=fe(127)),e.write_shift(4,r.length>0?r.length:4294967295),r.length>0&&e.write_shift(0,r,"dbcs"),t?e.slice(0,e.l):e}var Bce=Fs,wR=Kj,Xj=RS;function Yj(r){var e=r.slice(r.l,r.l+4),t=e[0]&1,n=e[0]&2;r.l+=4;var s=n===0?PS([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):xf(e,0)>>2;return t?s/100:s}function y7(r,e){e==null&&(e=fe(4));var t=0,n=0,s=r*100;if(r==(r|0)&&r>=-(1<<29)&&r<1<<29?n=1:s==(s|0)&&s>=-(1<<29)&&s<1<<29&&(n=1,t=1),n)e.write_shift(-4,((t?s:r)<<2)+(t+2));else throw new Error("unsupported RkNumber "+r)}function w7(r){var e={s:{},e:{}};return e.s.r=r.read_shift(4),e.e.r=r.read_shift(4),e.s.c=r.read_shift(4),e.e.c=r.read_shift(4),e}function Uce(r,e){return e||(e=fe(16)),e.write_shift(4,r.s.r),e.write_shift(4,r.e.r),e.write_shift(4,r.s.c),e.write_shift(4,r.e.c),e}var z0=w7,pv=Uce;function js(r){if(r.length-r.l<8)throw"XLS Xnum Buffer underflow";return r.read_shift(8,"f")}function C0(r,e){return(e||fe(8)).write_shift(8,r,"f")}function $ce(r){var e={},t=r.read_shift(1),n=t>>>1,s=r.read_shift(1),i=r.read_shift(2,"i"),a=r.read_shift(1),o=r.read_shift(1),l=r.read_shift(1);switch(r.l++,n){case 0:e.auto=1;break;case 1:e.index=s;var c=u0[s];c&&(e.rgb=I1(c));break;case 2:e.rgb=I1([a,o,l]);break;case 3:e.theme=s;break}return i!=0&&(e.tint=i>0?i/32767:i/32768),e}function jS(r,e){if(e||(e=fe(8)),!r||r.auto)return e.write_shift(4,0),e.write_shift(4,0),e;r.index!=null?(e.write_shift(1,2),e.write_shift(1,r.index)):r.theme!=null?(e.write_shift(1,6),e.write_shift(1,r.theme)):(e.write_shift(1,5),e.write_shift(1,0));var t=r.tint||0;if(t>0?t*=32767:t<0&&(t*=32768),e.write_shift(2,t),!r.rgb||r.theme!=null)e.write_shift(2,0),e.write_shift(1,0),e.write_shift(1,0);else{var n=r.rgb||"FFFFFF";typeof n=="number"&&(n=("000000"+n.toString(16)).slice(-6)),e.write_shift(1,parseInt(n.slice(0,2),16)),e.write_shift(1,parseInt(n.slice(2,4),16)),e.write_shift(1,parseInt(n.slice(4,6),16)),e.write_shift(1,255)}return e}function zce(r){var e=r.read_shift(1);r.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 Hce(r,e){e||(e=fe(2));var t=(r.italic?2:0)|(r.strike?8:0)|(r.outline?16:0)|(r.shadow?32:0)|(r.condense?64:0)|(r.extend?128:0);return e.write_shift(1,t),e.write_shift(1,0),e}function b7(r,e){var t={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},n=r.read_shift(4);switch(n){case 0:return"";case 4294967295:case 4294967294:return t[r.read_shift(4)]||""}if(n>400)throw new Error("Unsupported Clipboard: "+n.toString(16));return r.l-=4,r.read_shift(0,e==1?"lpstr":"lpwstr")}function Wce(r){return b7(r,1)}function Vce(r){return b7(r,2)}var qj=2,wi=3,nk=11,pI=12,OS=19,sk=64,Gce=65,Kce=71,Xce=4108,Yce=4126,Hn=80,_7=81,qce=[Hn,_7],bR={1:{n:"CodePage",t:qj},2:{n:"Category",t:Hn},3:{n:"PresentationFormat",t:Hn},4:{n:"ByteCount",t:wi},5:{n:"LineCount",t:wi},6:{n:"ParagraphCount",t:wi},7:{n:"SlideCount",t:wi},8:{n:"NoteCount",t:wi},9:{n:"HiddenCount",t:wi},10:{n:"MultimediaClipCount",t:wi},11:{n:"ScaleCrop",t:nk},12:{n:"HeadingPairs",t:Xce},13:{n:"TitlesOfParts",t:Yce},14:{n:"Manager",t:Hn},15:{n:"Company",t:Hn},16:{n:"LinksUpToDate",t:nk},17:{n:"CharacterCount",t:wi},19:{n:"SharedDoc",t:nk},22:{n:"HyperlinksChanged",t:nk},23:{n:"AppVersion",t:wi,p:"version"},24:{n:"DigSig",t:Gce},26:{n:"ContentType",t:Hn},27:{n:"ContentStatus",t:Hn},28:{n:"Language",t:Hn},29:{n:"Version",t:Hn},255:{},2147483648:{n:"Locale",t:OS},2147483651:{n:"Behavior",t:OS},1919054434:{}},_R={1:{n:"CodePage",t:qj},2:{n:"Title",t:Hn},3:{n:"Subject",t:Hn},4:{n:"Author",t:Hn},5:{n:"Keywords",t:Hn},6:{n:"Comments",t:Hn},7:{n:"Template",t:Hn},8:{n:"LastAuthor",t:Hn},9:{n:"RevNumber",t:Hn}
vendor: 10,395 bytes, line 653
653,10:{n:"EditTime",t:sk},11:{n:"LastPrinted",t:sk},12:{n:"CreatedDate",t:sk},13:{n:"ModifiedDate",t:sk},14:{n:"PageCount",t:wi},15:{n:"WordCount",t:wi},16:{n:"CharCount",t:wi},17:{n:"Thumbnail",t:Kce},18:{n:"Application",t:Hn},19:{n:"DocSecurity",t:wi},255:{},2147483648:{n:"Locale",t:OS},2147483651:{n:"Behavior",t:OS},1919054434:{}},mI={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},Zce=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function Jce(r){return r.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var Qce=Jce([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]),u0=Ar(Qce),Iu={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},k7={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},kR={"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"},ik={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 Zj(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function eue(r){var e=Zj();if(!r||!r.match)return e;var t={};if((r.match(Bs)||[]).forEach(function(n){var s=rt(n);switch(s[0].replace(uce,"<")){case"<?xml":break;case"<Types":e.xmlns=s["xmlns"+(s[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":t[s.Extension]=s.ContentType;break;case"<Override":e[kR[s.ContentType]]!==void 0&&e[kR[s.ContentType]].push(s.PartName);break}}),e.xmlns!==Tn.CT)throw new Error("Unknown Namespace: "+e.xmlns);return e.calcchain=e.calcchains.length>0?e.calcchains[0]:"",e.sst=e.strs.length>0?e.strs[0]:"",e.style=e.styles.length>0?e.styles[0]:"",e.defaults=t,delete e.calcchains,e}function S7(r,e){var t=ece(kR),n=[],s;n[n.length]=fn,n[n.length]=Ee("Types",null,{xmlns:Tn.CT,"xmlns:xsd":Tn.xsd,"xmlns:xsi":Tn.xsi}),n=n.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"],["t
653if","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(l){return Ee("Default",null,{Extension:l[0],ContentType:l[1]})}));var i=function(l){r[l]&&r[l].length>0&&(s=r[l][0],n[n.length]=Ee("Override",null,{PartName:(s[0]=="/"?"":"/")+s,ContentType:ik[l][e.bookType]||ik[l].xlsx}))},a=function(l){(r[l]||[]).forEach(function(c){n[n.length]=Ee("Override",null,{PartName:(c[0]=="/"?"":"/")+c,ContentType:ik[l][e.bookType]||ik[l].xlsx})})},o=function(l){(r[l]||[]).forEach(function(c){n[n.length]=Ee("Override",null,{PartName:(c[0]=="/"?"":"/")+c,ContentType:t[l][0]})})};return i("workbooks"),a("sheets"),a("charts"),o("themes"),["strs","styles"].forEach(i),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),a("metadata"),o("people"),n.length>2&&(n[n.length]="</Types>",n[1]=n[1].replace("/>",">")),n.join("")}var kt
vendor: 2,399 bytes, line 653
653={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.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",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",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",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",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",
vendor: 21,451 bytes, lines 653-663
653VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function M1(r){var e=r.lastIndexOf("/");return r.slice(0,e+1)+"_rels/"+r.slice(e+1)+".rels"}function My(r,e){var t={"!id":{}};if(!r)return t;e.charAt(0)!=="/"&&(e="/"+e);var n={};return(r.match(Bs)||[]).forEach(function(s){var i=rt(s);if(i[0]==="<Relationship"){var a={};a.Type=i.Type,a.Target=i.Target,a.Id=i.Id,i.TargetMode&&(a.TargetMode=i.TargetMode);var o=i.TargetMode==="External"?i.Target:gy(i.Target,e);t[o]=a,n[i.Id]=a}}),t["!id"]=n,t}function Vm(r){var e=[fn,Ee("Relationships",null,{xmlns:Tn.RELS})];return nn(r["!id"]).forEach(function(t){e[e.length]=Ee("Relationship",null,r["!id"][t])}),e.length>2&&(e[e.length]="</Relationships>",e[1]=e[1].replace("/>",">")),e.join("")}function qt(r,e,t,n,s,i){if(s||(s={}),r["!id"]||(r["!id"]={}),r["!idx"]||(r["!idx"]=1),e<0)for(e=r["!idx"];r["!id"]["rId"+e];++e);if(r["!idx"]=e+1,s.Id="rId"+e,s.Type=n,s.Target=t,[kt.HLINK,kt.XPATH,kt.XMISS].indexOf(s.Type)>-1&&(s.TargetMode="External"),r["!id"][s.Id])throw new Error("Cannot rewrite rId "+e);return r["!id"][s.Id]=s,r[("/"+s.Target).replace("//","/")]=s,e}var tue="application/vnd.oasis.opendocument.spreadsheet";function rue(r,e){for(var t=$j(r),n,s;n=D1.exec(t);)switch(n[3]){case"manifest":break;case"file-entry":if(s=rt(n[0],!1),s.path=="/"&&s.type!==tue)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(e&&e.WTF)throw n}}function nue(r){var e=[fn];e.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2"> 654`),e.push(` <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/> 655`);for(var t=0;t<r.length;++t)e.push(' <manifest:file-entry manifest:full-path="'+r[t][0]+'" manifest:media-type="'+r[t][1]+`"/> 656`);return e.push("</manifest:manifest>"),e.join("")}function gI(r,e,t){return[' <rdf:Description rdf:about="'+r+`"> 657`,' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(t||"odf")+"#"+e+`"/> 658`,` </rdf:Description> 659`].join("")}function sue(r,e){return[' <rdf:Description rdf:about="'+r+`"> 660`,' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+e+`"/> 661`,` </rdf:Description> 662`].join("")}function iue(r){var e=[fn];e.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 663`);for(var t=0;t!=r.length;++t)e.push(gI(r[t][0],r[t][1])),e.push(sue("",r[t][0]));return e.push(gI("","Document","pkg")),e.push("</rdf:RDF>"),e.join("")}function E7(){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 '+ES.version+"</meta:generator></office:meta></office:document-meta>"}var Ja=[["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"]],aue=function(){for(var r=new Array(Ja.length),e=0;e<Ja.length;++e){var t=Ja[e],n="(?:"+t[0].slice(0,t[0].indexOf(":"))+":)"+t[0].slice(t[0].indexOf(":")+1);r[e]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return r}();function A7(r){var e={};r=lr(r);for(var t=0;t<Ja.length;++t){var n=Ja[t],s=r.match(aue[t]);s!=null&&s.length>0&&(e[n[1]]=Rt(s[1])),n[2]==="date"&&e[n[1]]&&(e[n[1]]=Er(e[n[1]]))}return e}function VT(r,e,t,n,s){s[r]!=null||e==null||e===""||(s[r]=e,e=Qt(e),n[n.length]=t?Ee(r,e,t):us(r,e))}function T7(r,e){var t=e||{},n=[fn,Ee("cp:coreProperties",null,{"xmlns:cp":Tn.CORE_PROPS,"xmlns:dc":Tn.dc,"xmlns:dcterms":Tn.dcterms,"xmlns:dcmitype":Tn.dcmitype,"xmlns:xsi":Tn.xsi})],s={};if(!r&&!t.Props)return n.join("");r&&(r.CreatedDate!=null&&VT("dcterms:created",typeof r.CreatedDate=="string"?r.CreatedDate:yR(r.CreatedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},n,s),r.ModifiedDate!=null&&VT("dcterms:modified",typeof r.ModifiedDate=="string"?r.ModifiedDate:yR(r.ModifiedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},n,s));for(var i=0;i!=Ja.length;++i){var a=Ja[i],o=t.Props&&t.Props[a[1]]!=null?t.Props[a[1]]:r?r[a[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&VT(a[0],o,null,n,s)}return n.length>2&&(n[n.length]="</cp:coreProperties>",n[1]=n[1].replace("/>",">")),n.join("")}var d0=[["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"]],C7=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function N7(r,e,t,n){var s=[];if(typeof r=="string")s=aI(r,n);else for(var i=0;i<r.length;++i)s=s.concat(r[i].map(function(u){return{v:u}}));var a=typeof e=="string"?aI(e,n).map(function(u){return u.v}):e,o=0,l=0;if(a.length>0)for(var c=0;c!==s.length;c+=2){switch(l=+s[c+1].v,s[c].v){case"Worksheets":case"å·¥ä½è¡¨":case"ÐиÑÑÑ":case"Ø£ÙØ±Ø§Ù Ø§ÙØ¹Ù Ù":case"ã¯ã¼ã¯ã·ã¼ã":case"××××× ×ת ×¢××××":case"Arbeitsblätter":case"ÃalıÅma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":t.Worksheets=l,t.SheetNames=a.slice(o,o+l);break;case"Named Ranges":case"Rangos con nombre":case"ååä»ãä¸è¦§":case"Benannte Bereiche":case"Navngivne omrÃ¥der":t.NamedRanges=l,t.DefinedNames=a.slice(o,o+l);break;case"Charts":case"Diagramme":t.Chartsheets=l,t.ChartNames=a.slice(o,o+l);break}o+=l}}function oue(r,e,t){var n={};return e||(e={}),r=lr(r),d0.forEach(function(s){var i=(r.match(O1(s[0]))||[])[1];switch(s[2]){case"string":i&&(e[s[1]]=Rt(i));break;case"bool":e[s[1]]=i==="true";break;case"raw":var a=r.match(new RegExp("<"+s[0]+"[^>]*>([\\s\\S]*?)</"+s[0]+">"));a&&a.length>0&&(n[s[1]]=a[1]);break}}),n.HeadingPairs&&n.TitlesOfParts&&N7(n.HeadingPairs,n.TitlesOfParts,e,t),e}function P7(r){var e=[],t=Ee;return r||(r={}),r.Application="SheetJS",e[e.length]=fn,e[e.length]=Ee("Properties",null,{xmlns:Tn.EXT_PROPS,"xmlns:vt":Tn.vt}),d0.forEach(function(n){if(r[n[1]]!==void 0){var s;switch(n[2]){case"string":s=Qt(String(r[n[1]]));break;case"bool":s=r[n[1]]?"true":"false";break}s!==void 0&&(e[e.length]=t(n[0],s))}}),e[e.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+t("vt:variant",t("vt:i4",String(r.Worksheets))),{size:2,baseType:"variant"})),e[e.length]=t("TitlesOfParts",t("vt:vector",r.SheetNames.map(function(n){return"<vt:lpstr>"+Qt(n)+"</vt:lpstr>"}).join(""),{size:r.Worksheets,baseType:"lpstr"})),e.length>2&&(e[e.length]="</Properties>",e[1]=e[1].replace("/>",">")),e.join("")}var lue=/<[^>]+>[^<]*/g;function cue(r,e){var t={},n="",s=r.match(lue);if(s)for(var i=0;i!=s.length;++i){var a=s[i],o=rt(a);switch(o[0]){case"<?xml":break;case"<Properties":break;case"<property":n=Rt(o.name);break;case"</property>":n=null;break;default:if(a.indexOf("<vt:")===0){var l=a.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":t[n]=Rt(u);break;case"bool":t[n]=_r(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":t[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":t[n]=parseFloat(u);break;case"filetime":case"date":t[n]=Er(u);break;case"cy":case"error":t[n]=Rt(u);break;default:if(c.slice(-1)=="/")break;e.WTF&&typeof console<"u"&&console.warn("Unexpected",a,c,l)}}else if(a.slice(0,2)!=="</"){if(e.WTF)throw new Error(a)}}}return t}function R7(r){var e=[fn,Ee("Properties",null,{xmlns:Tn.CUST_PROPS,"xmlns:vt":Tn.vt})];if(!r)return e.join("");var t=1;return nn(r).forEach(function(s){++t,e[e.length]=Ee("property",vce(r[s]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t,name:Qt(s)})}),e.length>2&&(e[e.length]="</Properties>",e[1]=e[1].replace("/>",">")),e.join("")}var SR={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"},GT;function uue(r,e,t){GT||(GT=gA(SR)),e=GT[e]||e,r[e]=t}function due(r,e){var t=[];return nn(SR).map(function(n){for(var s=0;s<Ja.length;++s)if(Ja[s][1]==n)return Ja[s];for(s=0;s<d0.length;++s)if(d0[s][1]==n)return d0[s];throw n}).forEach(function(n){if(r[n[1]]!=null){var s=e&&e.Props&&e.Props[n[1]]!=null?e.Props[n[1]]:r[n[1]];switch(n[2]){case"date":s=new Date(s).toISOString().replace(/\.\d*Z/,"Z");break}typeof s=="number"?s=String(s):s===!0||s===!1?s=s?"1":"0":s instanceof Date&&(s=new Date(s).toISOString().replace(/\.\d*Z/,"")),t.push(us(SR[n[1]]||n[1],s))}}),Ee("DocumentProperties",t.join(""),{xmlns:ia.o})}function hue(r,e){var t=["Worksheets","SheetNames"],n="CustomDocumentProperties",s=[];return r&&nn(r).forEach(function(i){if(Object.prototype.hasOwnProperty.call(r,i)){for(var a=0;a<Ja.length;++a)if(i==Ja[a][1])return;for(a=0;a<d0.length;++a)if(i==d0[a][1])return;for(a=0;a<t.length;++a)if(i==t[a])return;var o=r[i],l="string";typeof o=="number"?(l="float",o=String(o)):o===!0||o===!1?(l="boolean",o=o?"1":"0"):o=String(o),s.push(Ee(rI(i),o,{"dt:dt":l}))}}),e&&nn(e).forEach(function(i){if(Object.prototype.hasOwnProperty.call(e,i)&&!(r&&Object.prototype.hasOwnProperty.call(r,i))){var a=e[i],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),s.push(Ee(rI(i),a,{"dt:dt":o}))}}),"<"+n+' xmlns="'+ia.o+'">'+s.join("")+"</"+n+">"}function Jj(r){var e=r.read_shift(4),t=r.read_shift(4);return new Date((t/1e7*Math.pow(2,32)+e/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function fue(r){var e=typeof r=="string"?new Date(Date.parse(r)):r,t=e.getTime()/1e3+11644473600,n=t%Math.pow(2,32),s=(t-n)/Math.pow(2,32);n*=1e7,s*=1e7;var i=n/Math.pow(2,32)|0;i>0&&(n=n%Math.pow(2,32),s+=i);var a=fe(8);return a.write_shift(4,n),a.write_shift(4,s),a}function j7(r,e,t){var n=r.l,s=r.read_shift(0,"lpstr-cp");if(t)for(;r.l-n&3;)++r.l;return s}function O7(r,e,t){var n=r.read_shift(0,"lpwstr");return n}function F7(r,e,t){return e===31?O7(r):j7(r,e,t)}function ER(r,e,t){return F7(r,e,t===!1?0:4)}function pue(r,e){if(!e)throw new Error("VtUnalignedString must have positive length");return F7(r,e,0)}function mue(r){for(var e=r.read_shift(4),t=[],n=0;n!=e;++n){var s=r.l;t[n]=r.read_shift(0,"lpwstr").replace(ni,""),r.l-s&2&&(r.l+=2)}return t}function gue(r){for(var e=r.read_shift(4),t=[],n=0;n!=e;++n)t[n]=r.read_shift(0,"lpstr-cp").replace(ni,"");return t}function xue(r){var e=r.l,t=FS(r,_7);r[r.l]==0&&r[r.l+1]==0&&r.l-e&2&&(r.l+=2);var n=FS(r,wi);return[t,n]}function vue(r){for(var e=r.read_shift(4),t=[],n=0;n<e/2;++n)t.push(xue(r));return t}function xI(r,e){for(var t=r.read_shift(4),n={},s=0;s!=t;++s){var i=r.read_shift(4),a=r.read_shift(4);n[i]=r.read_shift(a,e===1200?"utf16le":"utf8").replace(ni,"").replace(my,"!"),e===1200&&a%2&&(r.l+=2)}return r.l&3&&(r.l=r.l>>3<<2),n}function D7(r){var e=r.read_shift(4),t=r.slice(r.l,r.l+e);return r.l+=e,(e&3)>0&&(r.l+=4-(e&3)&3),t}function yue(r){var e={};return e.Size=r.read_shift(4),r.l+=e.Size+3-(e.Size-1)%4,e}function FS(r,e,t){var n=r.read_shift(2),s,i=t||{};if(r.l+=2,e!==pI&&n!==e&&qce.indexOf(e)===-1&&!((e&65534)==4126&&(n&65534)==4126))throw new Error("Expected type "+e+" saw "+n);switch(e===pI?n:e){case 2:return s=r.read_shift(2,"i"),i.raw||(r.l+=2),s;case 3:return s=r.read_shift(4,"i"),s;case 11:return r.read_shift(4)!==0;case 19:return s=r.read_shift(4),s;case 30:return j7(r,n,4).replace(ni,"");case 31:return O7(r);case 64:return Jj(r);case 65:return D7(r);case 71:return yue(r);case 80:return ER(r,n,!i.raw).replace(ni,"");case 81:return pue(r,n).replace(ni,"");case 4108:return vue(r);case 4126:case 4127:return n==4127?mue(r):gue(r);default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+n)}}function vI(r,e){var t=fe(4),n=fe(4);switch(t.write_shift(4,r==80?31:r),r){case 3:n.write_shift(-4,e);break;case 5:n=fe(8),n.write_shift(8,e,"f");break;case 11:n.write_shift(4,e?1:0);break;case 64:n=fue(e);break;case 31:case 80:for(n=fe(4+2*(e.length+1)+(e.length%2?0:2)),n.write_shift(4,e.length+1),n.write_shift(0,e,"dbcs");n.l!=n.length;)n.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+r+" "+e)}return Vn([t,n])}function yI(r,e){var t=r.l,n=r.read_shift(4),s=r.read_shift(4),i=[],a=0,o=0,l=-1,c={};for(a=0;a!=s;++a){var u=r.read_shift(4),f=r.read_shift(4);i[a]=[u,f+t]}i.sort(function(w,b){return w[1]-b[1]});var p={};for(a=0;a!=s;++a){if(r.l!==i[a][1]){var m=!0;if(a>0&&e)switch(e[i[a-1][0]].t){case 2:r.l+2===i[a][1]&&(r.l+=2,m=!1);break;case 80:r.l<=i[a][1]&&(r.l=i[a][1],m=!1);break;case 4108:r.l<=i[a][1]&&(r.l=i[a][1],m=!1);break}if((!e||a==0)&&r.l<=i[a][1]&&(m=!1,r.l=i[a][1]),m)throw new Error("Read Error: Expected address "+i[a][1]+" at "+r.l+" :"+a)}if(e){var x=e[i[a][0]];if(p[x.n]=FS(r,x.t,{raw:!0}),x.p==="version"&&(p[x.n]=String(p[x.n]>>16)+"."+("0000"+String(p[x.n]&65535)).slice(-4)),x.n=="CodePage")switch(p[x.n]){case 0:p[x.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:Uo(o=p[x.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+p[x.n])}}else if(i[a][0]===1){if(o=p.CodePage=FS(r,qj),Uo(o),l!==-1){var g=r.l;r.l=i[l][1],c=xI(r,o),r.l=g}}else if(i[a][0]===0){if(o===0){l=a,r.l=i[a+1][1];continue}c=xI(r,o)}else{var y=c[i[a][0]],v;switch(r[r.l]){case 65:r.l+=4,v=D7(r);break;case 30:r.l+=4,v=ER(r,r[r.l-4]).replace(/\u0000+$/,"");break;case 31:r.l+=4,v=ER(r,r[r.l-4]).replace(/\u0000+$/,"");break;case 3:r.l+=4,v=r.read_shift(4,"i");break;case 19:r.l+=4,v=r.read_shift(4);break;case 5:r.l+=4,v=r.read_shift(8,"f");break;case 11:r.l+=4,v=an(r,4);break;case 64:r.l+=4,v=Er(Jj(r));break;default:throw new Error("unparsed value: "+r[r.l])}p[y]=v}}return r.l=t+n,p}var M7=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function wue(r){switch(typeof r){case"boolean":return 11;case"number":return(r|0)==r?3:5;case"string":return 31;case"object":if(r instanceof Date)return 64;break}return-1}function wI(r,e,t){var n=fe(8),s=[],i=[],a=8,o=0,l=fe(8),c=fe(8);if(l.write_shift(4,2),l.write_shift(4,1200),c.write_shift(4,1),i.push(l),s.push(c),a+=8+l.length,!e){c=fe(8),c.write_shift(4,0),s.unshift(c);var u=[fe(4)];for(u[0].write_shift(4,r.length),o=0;o<r.length;++o){var f=r[o][0];for(l=fe(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);u.push(l)}l=Vn(u),i.unshift(l),a+=8+l.length}for(o=0;o<r.length;++o)if(!(e&&!e[r[o][0]])&&!(M7.indexOf(r[o][0])>-1||C7.indexOf(r[o][0])>-1)&&r[o][1]!=null){var p=r[o][1],m=0;if(e){m=+e[r[o][0]];var x=t[m];if(x.p=="version"&&typeof p=="string"){var g=p.split(".");p=(+g[0]<<16)+(+g[1]||0)}l=vI(x.t,p)}else{var y=wue(p);y==-1&&(y=31,p=String(p)),l=vI(y,p)}i.push(l),c=fe(8),c.write_shift(4,e?m:2+o),s.push(c),a+=8+l.length}var v=8*(i.length+1);for(o=0;o<i.length;++o)s[o].write_shift(4,v),v+=i[o].length;return n.write_shift(4,a),n.write_shift(4,i.length),Vn([n].concat(s).concat(i))}function bI(r,e,t){var n=r.content;if(!n)return{};cs(n,0);var s,i,a,o,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==Ke.utils.consts.HEADER_CLSID&&u!==t)throw new Error("Bad PropertySet CLSID "+u);if(s=n.read_shift(4),s!==1&&s!==2)throw new Error("Unrecognized #Sets: "+s);if(i=n.read_shift(16),o=n.read_shift(4),s===1&&o!==n.l)throw new Error("Length mismatch: "+o+" !== "+n.l);s===2&&(a=n.read_shift(16),l=n.read_shift(4));var f=yI(n,e),p={SystemIdentifier:c};for(var m in f)p[m]=f[m];if(p.FMTID=i,s===1)return p;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);var x;try{x=yI(n,null)}catch{}for(m in x)p[m]=x[m];return p.FMTID=[i,a],p}function _I(r,e,t,n,s,i){var a=fe(s?68:48),o=[a];a.write_shift(2,65534),a.write_shift(2,0),a.write_shift(4,842412599),a.write_shift(16,Ke.utils.consts.HEADER_CLSID,"hex"),a.write_shift(4,s?2:1),a.write_shift(16,e,"hex"),a.write_shift(4,s?68:48);var l=wI(r,t,n);if(o.push(l),s){var c=wI(s,null,null);a.write_shift(16,i,"hex"),a.write_shift(4,68+l.length),o.push(c)}return Vn(o)}function Hu(r,e){return r.read_shift(e),null}function bue(r,e){e||(e=fe(r));for(var t=0;t<r;++t)e.write_shift(1,0);return e}function _ue(r,e,t){for(var n=[],s=r.l+e;r.l<s;)n.push(t(r,s-r.l));if(s!==r.l)throw new Error("Slurp error");return n}function an(r,e){return r.read_shift(e)===1}function Qs(r,e){return e||(e=fe(2)),e.write_shift(2,+!!r),e}function yn(r){return r.read_shift(2,"u")}function Va(r,e){return e||(e=fe(2)),e.write_shift(2,r),e}function I7(r,e){return _ue(r,e,yn)}function kue(r){var e=r.read_shift(1),t=r.read_shift(1);return t===1?e:e===1}function L7(r,e,t){return t||(t=fe(2)),t.write_shift(1,e=="e"?+r:+!!r),t.write_shift(1,e=="e"?1:0),t}function t_(r,e,t){var n=r.read_shift(t&&t.biff>=12?2:1),s="sbcs-cont";if(t&&t.biff>=8,!t||t.biff==8){var i=r.read_shift(1);i&&(s="dbcs-cont")}else t.biff==12&&(s="wstr");t.biff>=2&&t.biff<=5&&(s="cpstr");var a=n?r.read_shift(n,s):"";return a}function Sue(r){var e=r.read_shift(2),t=r.read_shift(1),n=t&4,s=t&8,i=1+(t&1),a=0,o,l={};s&&(a=r.read_shift(2)),n&&(o=r.read_shift(4));var c=i==2?"dbcs-cont":"sbcs-cont",u=e===0?"":r.read_shift(e,c);return s&&(r.l+=4*a),n&&(r.l+=o),l.t=u,s||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function Eue(r){var e=r.t||"",t=fe(3);t.write_shift(2,e.length),t.write_shift(1,1);var n=fe(2*e.length);n.write_shift(2*e.length,e,"utf16le");var s=[t,n];return Vn(s)}function N0(r,e,t){var n;if(t){if(t.biff>=2&&t.biff<=5)return r.read_shift(e,"cpstr");if(t.biff>=12)return r.read_shift(e,"dbcs-cont")}var s=r.read_shift(1);return s===0?n=r.read_shift(e,"sbcs-cont"):n=r.read_shift(e,"dbcs-cont"),n}function r_(r,e,t){var n=r.read_shift(t&&t.biff==2?1:2);return n===0?(r.l++,""):N0(r,n,t)}function H0(r,e,t){if(t.biff>5)return r_(r,e,t);var n=r.read_shift(1);return n===0?(r.l++,""):r.read_shift(n,t.biff<=4||!r.lens?"cpstr":"sbcs-cont")}function B7(r,e,t){return t||(t=fe(3+2*r.length)),t.write_shift(2,r.length),t.write_shift(1,1),t.write_shift(31,r,"utf16le"),t}function Aue(r){var e=r.read_shift(1);r.l++;var t=r.read_shift(2);return r.l+=2,[e,t]}function Tue(r){var e=r.read_shift(4),t=r.l,n=!1;e>24&&(r.l+=e-24,r.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(n=!0),r.l=t);var s=r.read_shift((n?e-24:e)>>1,"utf16le").replace(ni,"");return n&&(r.l+=24),s}function Cue(r){for(var e=r.read_shift(2),t="";e-- >0;)t+="../";var n=r.read_shift(0,"lpstr-ansi");if(r.l+=2,r.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var s=r.read_shift(4);if(s===0)return t+n.replace(/\\/g,"/");var i=r.read_shift(4);if(r.read_shift(2)!=3)throw new Error("Bad FileMoniker");var a=r.read_shift(i>>1,"utf16le").replace(ni,"");return t+a}function Nue(r,e){var t=r.read_shift(16);switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return Tue(r);case"0303000000000000c000000000000046":return Cue(r);default:throw new Error("Unsupported Moniker "+t)}}function ak(r){var e=r.read_shift(4),t=e>0?r.read_shift(e,"utf16le").replace(ni,""):"";return t}function kI(r,e){e||(e=fe(6+r.length*2)),e.write_shift(4,1+r.length);for(var t=0;t<r.length;++t)e.write_shift(2,r.charCodeAt(t));return e.write_shift(2,0),e}function Pue(r,e){var t=r.l+e,n=r.read_shift(4);if(n!==2)throw new Error("Unrecognized streamVersion: "+n);var s=r.read_shift(2);r.l+=2;var i,a,o,l,c="",u,f;s&16&&(i=ak(r,t-r.l)),s&128&&(a=ak(r,t-r.l)),(s&257)===257&&(o=ak(r,t-r.l)),(s&257)===1&&(l=Nue(r,t-r.l)),s&8&&(c=ak(r,t-r.l)),s&32&&(u=r.read_shift(16)),s&64&&(f=Jj(r)),r.l=t;var p=a||o||l||"";p&&c&&(p+="#"+c),p||(p="#"+c),s&2&&p.charAt(0)=="/"&&p.charAt(1)!="/"&&(p="file://"+p);var m={Target:p};return u&&(m.guid=u),f&&(m.time=f),i&&(m.Tooltip=i),m}function Rue(r){var e=fe(512),t=0,n=r.Target;n.slice(0,7)=="file://"&&(n=n.slice(7));var s=n.indexOf("#"),i=s>-1?31:23;switch(n.charAt(0)){case"#":i=28;break;case".":i&=-3;break}e.write_shift(4,2),e.write_shift(4,i);var a=[8,6815827,6619237,4849780,83];for(t=0;t<a.length;++t)e.write_shift(4,a[t]);if(i==28)n=n.slice(1),kI(n,e);else if(i&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=s>-1?n.slice(0,s):n;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),i&8&&kI(s>
663-1?n.slice(s+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;n.slice(l*3,l*3+3)=="../"||n.slice(l*3,l*3+3)=="..\\";)++l;for(e.write_shift(2,l),e.write_shift(4,n.length-3*l+1),t=0;t<n.length-3*l;++t)e.write_shift(1,n.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 U7(r){var e=r.read_shift(1),t=r.read_shift(1),n=r.read_shift(1),s=r.read_shift(1);return[e,t,n,s]}function $7(r,e){var t=U7(r);return t[3]=0,t}function oc(r){var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(2);return{r:e,c:t,ixfe:n}}function P0(r,e,t,n){return n||(n=fe(6)),n.write_shift(2,r),n.write_shift(2,e),n.write_shift(2,t||0),n}function jue(r){var e=r.read_shift(2),t=r.read_shift(2);return r.l+=8,{type:e,flags:t}}function Oue(r,e,t){return e===0?"":H0(r,e,t)}function Fue(r,e,t){var n=t.biff>8?4:2,s=r.read_shift(n),i=r.read_shift(n,"i"),a=r.read_shift(n,"i");return[s,i,a]}function z7(r){var e=r.read_shift(2),t=Yj(r);return[e,t]}function Due(r,e,t){r.l+=4,e-=4;var n=r.l+e,s=t_(r,e,t),i=r.read_shift(2);if(n-=r.l,i!==n)throw new Error("Malformed AddinUdf: padding = "+n+" != "+i);return r.l+=i,s}function yA(r){var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(2),s=r.read_shift(2);return{s:{c:n,r:e},e:{c:s,r:t}}}function H7(r,e){return e||(e=fe(8)),e.write_shift(2,r.s.r),e.write_shift(2,r.e.r),e.write_shift(2,r.s.c),e.write_shift(2,r.e.c),e}function W7(r){var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(1),s=r.read_shift(1);return{s:{c:n,r:e},e:{c:s,r:t}}}var Mue=W7;function V7(r){r.l+=4;var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(2);return r.l+=12,[t,e,n]}function Iue(r){var e={};return r.l+=4,r.l+=16,e.fSharedNote=r.read_shift(2),r.l+=4,e}function Lue(r){var e={};return r.l+=4,r.cf=r.read_shift(2),e}function ws(r){r.l+=2,r.l+=r.read_shift(2)}var Bue={0:ws,4:ws,5:ws,6:ws,7:Lue,8:ws,9:ws,10:ws,11:ws,12:ws,13:Iue,14:ws,15:ws,16:ws,17:ws,18:ws,19:ws,20:ws,21:V7};function Uue(r,e){for(var t=r.l+e,n=[];r.l<t;){var s=r.read_shift(2);r.l-=2;try{n.push(Bue[s](r,t-r.l))}catch{return r.l=t,n}}return r.l!=t&&(r.l=t),n}function ok(r,e){var t={BIFFVer:0,dt:0};switch(t.BIFFVer=r.read_shift(2),e-=2,e>=2&&(t.dt=r.read_shift(2),r.l-=2),t.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(e>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer)}return r.read_shift(e),t}function Qj(r,e,t){var n=1536,s=16;switch(t.bookType){case"biff8":break;case"biff5":n=1280,s=8;break;case"biff4":n=4,s=6;break;case"biff3":n=3,s=6;break;case"biff2":n=2,s=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var i=fe(s);return i.write_shift(2,n),i.write_shift(2,e),s>4&&i.write_shift(2,29282),s>6&&i.write_shift(2,1997),s>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function $ue(r,e){return e===0||r.read_shift(2),1200}function zue(r,e,t){if(t.enc)return r.l+=e,"";var n=r.l,s=H0(r,0,t);return r.read_shift(e+n-r.l),s}function Hue(r,e){var t=!e||e.biff==8,n=fe(t?112:54);for(n.write_shift(e.biff==8?2:1,7),t&&n.write_shift(1,0),n.write_shift(4,859007059),n.write_shift(4,5458548|(t?0:536870912));n.l<n.length;)n.write_shift(1,t?0:32);return n}function Wue(r,e,t){var n=t&&t.biff==8||e==2?r.read_shift(2):(r.l+=e,0);return{fDialog:n&16,fBelow:n&64,fRight:n&128}}function Vue(r,e,t){var n=r.read_shift(4),s=r.read_shift(1)&3,i=r.read_shift(1);switch(i){case 0:i="Worksheet";break;case 1:i="Macrosheet";break;case 2:i="Chartsheet";break;case 6:i="VBAModule";break}var a=t_(r,0,t);return a.length===0&&(a="Sheet1"),{pos:n,hs:s,dt:i,name:a}}function Gue(r,e){var t=!e||e.biff>=8?2:1,n=fe(8+t*r.name.length);n.write_shift(4,r.pos),n.write_shift(1,r.hs||0),n.write_shift(1,r.dt),n.write_shift(1,r.name.length),e.biff>=8&&n.write_shift(1,1),n.write_shift(t*r.name.length,r.name,e.biff<8?"sbcs":"utf16le");var s=n.slice(0,n.l);
vendor: 11,208 bytes, line 663
663return s.l=n.l,s}function Kue(r,e){for(var t=r.l+e,n=r.read_shift(4),s=r.read_shift(4),i=[],a=0;a!=s&&r.l<t;++a)i.push(Sue(r));return i.Count=n,i.Unique=s,i}function Xue(r,e){var t=fe(8);t.write_shift(4,r.Count),t.write_shift(4,r.Unique);for(var n=[],s=0;s<r.length;++s)n[s]=Eue(r[s]);var i=Vn([t].concat(n));return i.parts=[t.length].concat(n.map(function(a){return a.length})),i}function Yue(r,e){var t={};return t.dsst=r.read_shift(2),r.l+=e-2,t}function que(r){var e={};e.r=r.read_shift(2),e.c=r.read_shift(2),e.cnt=r.read_shift(2)-e.c;var t=r.read_shift(2);r.l+=4;var n=r.read_shift(1);return r.l+=3,n&7&&(e.level=n&7),n&32&&(e.hidden=!0),n&64&&(e.hpt=t/20),e}function Zue(r){var e=jue(r);if(e.type!=2211)throw new Error("Invalid Future Record "+e.type);var t=r.read_shift(4);return t!==0}function Jue(r){return r.read_shift(2),r.read_shift(4)}function SI(r,e,t){var n=0;t&&t.biff==2||(n=r.read_shift(2));var s=r.read_shift(2);t&&t.biff==2&&(n=1-(s>>15),s&=32767);var i={Unsynced:n&1,DyZero:(n&2)>>1,ExAsc:(n&4)>>2,ExDsc:(n&8)>>3};return[i,s]}function Que(r){var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(2),s=r.read_shift(2),i=r.read_shift(2),a=r.read_shift(2),o=r.read_shift(2),l=r.read_shift(2),c=r.read_shift(2);return{Pos:[e,t],Dim:[n,s],Flags:i,CurTab:a,FirstTab:o,Selected:l,TabRatio:c}}function ede(){var r=fe(18);return r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,29280),r.write_shift(2,17600),r.write_shift(2,56),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,1),r.write_shift(2,500),r}function tde(r,e,t){if(t&&t.biff>=2&&t.biff<5)return{};var n=r.read_shift(2);return{RTL:n&64}}function rde(r){var e=fe(18),t=1718;return r&&r.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 nde(){}function sde(r,e,t){var n={dyHeight:r.read_shift(2),fl:r.read_shift(2)};switch(t&&t.biff||8){case 2:break;case 3:case 4:r.l+=2;break;default:r.l+=10;break}return n.name=t_(r,0,t),n}function ide(r,e){var t=r.name||"Arial",n=e&&e.biff==5,s=n?15+t.length:16+2*t.length,i=fe(s);return i.write_shift(2,(r.sz||12)*20),i.write_shift(4,0),i.write_shift(2,400),i.write_shift(4,0),i.write_shift(2,0),i.write_shift(1,t.length),n||i.write_shift(1,1),i.write_shift((n?1:2)*t.length,t,n?"sbcs":"utf16le"),i}function ade(r){var e=oc(r);return e.isst=r.read_shift(4),e}function ode(r,e,t,n){var s=fe(10);return P0(r,e,n,s),s.write_shift(4,t),s}function lde(r,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var n=r.l+e,s=oc(r);t.biff==2&&r.l++;var i=r_(r,n-r.l,t);return s.val=i,s}function cde(r,e,t,n,s){var i=!s||s.biff==8,a=fe(8+ +i+(1+i)*t.length);return P0(r,e,n,a),a.write_shift(2,t.length),i&&a.write_shift(1,1),a.write_shift((1+i)*t.length,t,i?"utf16le":"sbcs"),a}function ude(r,e,t){var n=r.read_shift(2),s=H0(r,0,t);return[n,s]}function dde(r,e,t,n){var s=t&&t.biff==5;n||(n=fe(s?3+e.length:5+2*e.length)),n.write_shift(2,r),n.write_shift(s?1:2,e.length),s||n.write_shift(1,1),n.write_shift((s?1:2)*e.length,e,s?"sbcs":"utf16le");var i=n.length>n.l?n.slice(0,n.l):n;return i.l==null&&(i.l=i.length),i}var hde=H0;function EI(r,e,t){var n=r.l+e,s=t.biff==8||!t.biff?4:2,i=r.read_shift(s),a=r.read_shift(s),o=r.read_shift(2),l=r.read_shift(2);return r.l=n,{s:{r:i,c:o},e:{r:a,c:l}}}function fde(r,e){var t=e.biff==8||!e.biff?4:2,n=fe(2*t+6);return n.write_shift(t,r.s.r),n.write_shift(t,r.e.r+1),n.write_shift(2,r.s.c),n.write_shift(2,r.e.c+1),n.write_shift(2,0),n}function pde(r){var e=r.read_shift(2),t=r.read_shift(2),n=z7(r);return{r:e,c:t,ixfe:n[0],rknum:n[1]}}function mde(r,e){for(var t=r.l+e-2,n=r.read_shift(2),s=r.read_shift(2),i=[];r.l<t;)i.push(z7(r));if(r.l!==t)throw new Error("MulRK read error");var a=r.read_shift(2);if(i.length!=a-s+1)throw new Error("MulRK length mismatch");return{r:n,c:s,C:a,rkrec:i}}function gde(r,e){for(var t=r.l+e-2,n=r.read_shift(2),s=r.read_shift(2),i=[];r.l<t;)i.push(r.read_shift(2));if(r.l!==t)throw new Error("MulBlank read error");var a=r.read_shift(2);if(i.length!=a-s+1)throw new Error("MulBlank length mismatch");return{r:n,c:s,C:a,ixfe:i}}function xde(r,e,t,n){var s={},i=r.read_shift(4),a=r.read_shift(4),o=r.read_shift(4),l=r.read_shift(2);return s.patternType=Zce[o>>26],n.cellStyles&&(s.alc=i&7,s.fWrap=i>>3&1,s.alcV=i>>4&7,s.fJustLast=i>>7&1,s.trot=i>>8&255,s.cIndent=i>>16&15,s.fShrinkToFit=i>>20&1,s.iReadOrder=i>>22&2,s.fAtrNum=i>>26&1,s.fAtrFnt=i>>27&1,s.fAtrAlc=i>>28&1,s.fAtrBdr=i>>29&1,s.fAtrPat=i>>30&1,s.fAtrProt=i>>31&1,s.dgLeft=a&15,s.dgRight=a>>4&15,s.dgTop=a>>8&15,s.dgBottom=a>>12&15,s.icvLeft=a>>16&127,s.icvRight=a>>23&127,s.grbitDiag=a>>30&3,s.icvTop=o&127,s.icvBottom=o>>7&127,s.icvDiag=o>>14&127,s.dgDiag=o>>21&15,s.icvFore=l&127,s.icvBack=l>>7&127,s.fsxButton=l>>14&1),s}function vde(r,e,t){var n={};return n.ifnt=r.read_shift(2),n.numFmtId=r.read_shift(2),n.flags=r.read_shift(2),n.fStyle=n.flags>>2&1,e-=6,n.data=xde(r,e,n.fStyle,t),n}function AI(r,e,t,n){var s=t&&t.biff==5;n||(n=fe(s?16:20)),n.write_shift(2,0),r.style?(n.write_shift(2,r.numFmtId||0),n.write_shift(2,65524)):(n.write_shift(2,r.numFmtId||0),n.write_shift(2,e<<4));var i=0;return r.numFmtId>0&&s&&(i|=1024),n.write_shift(4,i),n.write_shift(4,0),s||n.write_shift(4,0),n.write_shift(2,0),n}function yde(r){r.l+=4;var e=[r.read_shift(2),r.read_shift(2)];if(e[0]!==0&&e[0]--,e[1]!==0&&e[1]--,e[0]>7||e[1]>7)throw new Error("Bad Gutters: "+e.join("|"));return e}function wde(r){var e=fe(8);return e.write_shift(4,0),e.write_shift(2,0),e.write_shift(2,0),e}function TI(r,e,t){var n=oc(r);(t.biff==2||e==9)&&++r.l;var s=kue(r);return n.val=s,n.t=s===!0||s===!1?"b":"e",n}function bde(r,e,t,n,s,i){var a=fe(8);return P0(r,e,n,a),L7(t,i,a),a}function _de(r,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var n=oc(r),s=js(r);return n.val=s,n}function kde(r,e,t,n){var s=fe(14);return P0(r,e,n,s),C0(t,s),s}var CI=Oue;function Sde(r,e,t){var n=r.l+e,s=r.read_shift(2),i=r.read_shift(2);if(t.sbcch=i,i==1025||i==14849)return[i,s];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);for(var a=N0(r,i),o=[];n>r.l;)o.push(r_(r));return[i,s,a,o]}function NI(r,e,t){var n=r.read_shift(2),s,i={fBuiltIn:n&1,fWantAdvise:n>>>1&1,fWantPict:n>>>2&1,fOle:n>>>3&1,fOleLink:n>>>4&1,cf:n>>>5&1023,fIcon:n>>>15&1};return t.sbcch===14849&&(s=Due(r,e-2,t)),i.body=s||r.read_shift(e-2),typeof s=="string"&&(i.Name=s),i}var Ede=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function PI(r,e,t){var n=r.l+e,s=r.read_shift(2),i=r.read_shift(1),a=r.read_shift(1),o=r.read_shift(t&&t.biff==2?1:2),l=0;(!t||t.biff>=5)&&(t.biff!=5&&(r.l+=2),l=r.read_shift(2),t.biff==5&&(r.l+=2),r.l+=4);var c=N0(r,a,t);s&32&&(c=Ede[c.charCodeAt(0)]);var u=n-r.l;t&&t.biff==2&&--u;var f=n==r.l||o===0||!(u>0)?[]:U0e(r,u,t,o);return{chKey:i,Name:c,itab:l,rgce:f}}function G7(r,e,t){if(t.biff<8)return Ade(r,e,t);for(var n=[],s=r.l+e,i=r.read_shift(t.biff>8?4:2);i--!==0;)n.push(Fue(r,t.biff>8?12:6,t));if(r.l!=s)throw new Error("Bad ExternSheet: "+r.l+" != "+s);return n}function Ade(r,e,t){r[r.l+1]==3&&r[r.l]++;var n=t_(r,e,t);return n.charCodeAt(0)==3?n.slice(1):n}function Tde(r,e,t){if(t.biff<8){r.l+=e;return}var n=r.read_shift(2),s=r.read_shift(2),i=N0(r,n,t),a=N0(r,s,t);return[i,a]}function Cde(r,e,t){var n=W7(r);r.l++;var s=r.read_shift(1);return e-=8,[$0e(r,e,t),s,n]}function RI(r,e,t){var n=Mue(r);switch(t.biff){case 2:r.l++,e-=7;break;case 3:case 4:r.l+=2,e-=8;break;default:r.l+=6,e-=12}return[n,L0e(r,e,t)]}function Nde(r){var e=r.read_shift(4)!==0,t=r.read_shift(4)!==0,n=r.read_shift(4);return[e,t,n]}function Pde(r,e,t){if(!(t.biff<8)){var n=r.read_shift(2),s=r.read_shift(2),i=r.read_shift(2),a=r.read_shift(2),o=H0(r,0,t);return t.biff<8&&r.read_shift(1),[{r:n,c:s},o,a,i]}}function Rde(r,e,t){return Pde(r,e,t)}function jde(r,e){for(var t=[],n=r.read_shift(2);n--;)t.push(yA(r));return t}function Ode(r){var e=fe(2+r.length*8);e.write_shift(2,r.length);for(var t=0;t<r.length;++t)H7(r[t],e);return e}function Fde(r,e,t){if(t&&t.biff<8)return Mde(r,e,t);var n=V7(r),s=Uue(r,e-22,n[1]);return{cmo:n,ft:s}}var Dde={8:function(r,e){var t=r.l+e;r.l+=10;var n=r.read_shift(2);r.l+=4,r.l+=2,r.l+=2,r.l+=2,r.l+=4;var s=r.read_shift(1);return r.l+=s,r.l=t,{fmt:n}}};function Mde(r,e,t){r.l+=4;var n=r.read_shift(2),s=r.read_shift(2),i=r.read_shift(2);r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=2,r.l+=6,e-=36;var a=[];return a.push((Dde[n]||Ls)(r,e,t)),{cmo:[s,n,i],ft:a}}function Ide(r,e,t){var n=r.l,s="";try{r.l+=4;var i=(t.lastobj||{cmo:[0,0]}).cmo[1],a;[0,5,7,11,12,14].indexOf(i)==-1?r.l+=6:a=Aue(r,6,t);var o=r.read_shift(2);r.read_shift(2),yn(r,2);var l=r.read_shift(2);r.l+=l;for(var c=1;c<r.lens.length-1;++c){if(r.l-n!=r.lens[c])throw new Error("TxO: bad continue record");var u=r[r.l],f=N0(r,r.lens[c+1]-r.lens[c]-1);if(s+=f,s.length>=(u?o:2*o))break}if(s.length!==o&&s.length!==o*2)throw new Error("cchText: "+o+" != "+s.length);return r.l=n+e,{t:s}}catch{return r.l=n+e,{t:s}}}function Lde(r,e){var t=yA(r);r.l+=16;var n=Pue(r,e-24);return[t,n]}function Bde(r){var e=fe(24),t=zr(r[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 n="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),s=0;s<16;++s)e.write_shift(1,parseInt(n[s],16));return Vn([e,Rue(r[1])])}function Ude(r,e){r.read_shift(2);var t=yA(r),n=r.read_shift((e-10)/2,"dbcs-cont");return n=n.replace(ni,""),[t,n]}function $de(r){var e=r[1].Tooltip,t=fe(10+2*(e.length+1));t.write_shift(2,2048);var n=zr(r[0]);t.write_shift(2,n.r),t.write_shift(2,n.r),t.write_shift(2,n.c),t.write_shift(2,n.c);for(var s=0;s<e.length;++s)t.write_shift(2,e.charCodeAt(s));return t.write_shift(2,0),t}function zde(r){var e=[0,0],t;return t=r.read_shift(2),e[0]=mI[t]||t,t=r.read_shift(2),e[1]=mI[t]||t,e}function Hde(r){return r||(r=fe(4)),r.write_shift(2,1),r.write_shift(2,1),r}function Wde(r){for(var e=r.read_shift(2),t=[];e-- >0;)t.push($7(r));return t}function Vde(r){for(var e=r.read_shift(2),t=[];e-- >0;)t.push($7(r));return t}function Gde(r){r.l+=2;var e={cxfs:0,crc:0};return e.cxfs=r.read_shift(2),e.crc=r.read_shift(4),e}function K7(r,e,t){if(!t.cellStyles)return Ls(r,e);var n=t&&t.biff>=12?4:2,s=r.read_shift(n),i=r.read_shift(n),a=r.read_shift(n),o=r.read_shift(n),l=r.read_shift(2);n==2&&(r.l+=2);var c={s,e:i,w:a,ixfe:o,flags:l};return(t.biff>=5||!t.biff)&&(c.level=l>>8&7),c}function Kde(r,e){var t=fe(12);t.write_shift(2,e),t.write_shift(2,e),t.write_shift(2,r.width*256),t.write_shift(2,0);var n=0;return r.hidden&&(n|=1),t.write_shift(1,n),n=r.level||0,t.write_shift(1,n),t.write_shift(2,0),t}function Xde(r,e){var t={};return e<32||(r.l+=16,t.header=js(r),t.footer=js(r),r.l+=2),t}function Yde(r,e,t){var n={area:!1};if(t.biff!=5)return r.l+=e,n;var s=r.read_shift(1);return r.l+=3,s&16&&(n.area=!0),n}function qde(r){for(var e=fe(2*r),t=0;t<r;++t)e.write_shift(2,t+1);return e}var Zde=oc,Jde=I7,Qde=r_;function ehe(r){var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(4),s={fmt:e,env:t,len:n,data:r.slice(r.l,r.l+n)};return r.l+=n,s}
vendor: 7,671 bytes, line 663
663function the(r,e,t){t.biffguess&&t.biff==5&&(t.biff=2);var n=oc(r);++r.l;var s=H0(r,e-7,t);return n.t="str",n.val=s,n}function rhe(r){var e=oc(r);++r.l;var t=js(r);return e.t="n",e.val=t,e}function nhe(r,e,t){var n=fe(15);return a_(n,r,e),n.write_shift(8,t,"f"),n}function she(r){var e=oc(r);++r.l;var t=r.read_shift(2);return e.t="n",e.val=t,e}function ihe(r,e,t){var n=fe(9);return a_(n,r,e),n.write_shift(2,t),n}function ahe(r){var e=r.read_shift(1);return e===0?(r.l++,""):r.read_shift(e,"sbcs-cont")}function ohe(r,e){r.l+=6,r.l+=2,r.l+=1,r.l+=3,r.l+=1,r.l+=e-13}function lhe(r,e,t){var n=r.l+e,s=oc(r),i=r.read_shift(2),a=N0(r,i,t);return r.l=n,s.t="str",s.val=a,s}var che=[2,3,48,49,131,139,140,245],AR=function(){var r={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=gA({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=[],u=zh(1);switch(l.type){case"base64":u=ca(xa(o));break;case"binary":u=ca(o);break;case"buffer":case"array":u=o;break}cs(u,0);var f=u.read_shift(1),p=!!(f&136),m=!1,x=!1;switch(f){case 2:break;case 3:break;case 48:m=!0,p=!0;break;case 49:m=!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 g=0,y=521;f==2&&(g=u.read_shift(2)),u.l+=3,f!=2&&(g=u.read_shift(4)),g>1048576&&(g=1e6),f!=2&&(y=u.read_shift(2));var v=u.read_shift(2),w=l.codepage||1252;f!=2&&(u.l+=16,u.read_shift(1),u[u.l]!==0&&(w=r[u[u.l]]),u.l+=1,u.l+=2),x&&(u.l+=36);for(var b=[],_={},T=Math.min(u.length,f==2?521:y-10-(m?264:0)),A=x?32:11;u.l<T&&u[u.l]!=13;)switch(_={},_.name=sd.utils.decode(w,u.slice(u.l,u.l+A)).replace(/[\u0000\r\n].*$/g,""),u.l+=A,_.type=String.fromCharCode(u.read_shift(1)),f!=2&&!x&&(_.offset=u.read_shift(4)),_.len=u.read_shift(1),f==2&&(_.offset=u.read_shift(2)),_.dec=u.read_shift(1),_.name.length&&b.push(_),f!=2&&(u.l+=x?13:14),_.type){case"B":(!m||_.len!=8)&&l.WTF&&console.log("Skipping "+_.name+":"+_.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+_.name+":"+_.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: "+_.type)}if(u[u.l]!==13&&(u.l=y-1),u.read_shift(1)!==13)throw new Error("DBF Terminator not found "+u.l+" "+u[u.l]);u.l=y;var N=0,k=0;for(c[0]=[],k=0;k!=b.length;++k)c[0][k]=b[k].name;for(;g-- >0;){if(u[u.l]===42){u.l+=v;continue}for(++u.l,c[++N]=[],k=0,k=0;k!=b.length;++k){var E=u.slice(u.l,u.l+b[k].len);u.l+=b[k].len,cs(E,0);var P=sd.utils.decode(w,E);switch(b[k].type){case"C":P.trim().length&&(c[N][k]=P.replace(/\s+$/,""));break;case"D":P.length===8?c[N][k]=new Date(+P.slice(0,4),+P.slice(4,6)-1,+P.slice(6,8)):c[N][k]=P;break;case"F":c[N][k]=parseFloat(P.trim());break;case"+":case"I":c[N][k]=x?E.read_shift(-4,"i")^2147483648:E.read_shift(4,"i");break;case"L":switch(P.trim().toUpperCase()){case"Y":case"T":c[N][k]=!0;break;case"N":case"F":c[N][k]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+P+"|")}break;case"M":if(!p)throw new Error("DBF Unexpected MEMO for type "+f.toString(16));c[N][k]="##MEMO##"+(x?parseInt(P.trim(),10):E.read_shift(4));break;case"N":P=P.replace(/\u0000/g,"").trim(),P&&P!="."&&(c[N][k]=+P||0);break;case"@":c[N][k]=new Date(E.read_shift(-8,"f")-621356832e5);break;case"T":c[N][k]=new Date((E.read_shift(4)-2440588)*864e5+E.read_shift(4));break;case"Y":c[N][k]=E.read_shift(4,"i")/1e4+E.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":c[N][k]=-E.read_shift(-8,"f");break;case"B":if(m&&b[k].len==8){c[N][k]=E.read_shift(8,"f");break}case"G":case"P":E.l+=b[k].len;break;case"0":if(b[k].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+b[k].type)}}}if(f!=2&&u.l<u.length&&u[u.l++]!=26)throw new Error("DBF EOF Marker missing "+(u.l-1)+" of "+u.length+" "+u[u.l-1].toString(16));return l&&l.sheetRows&&(c=c.slice(0,l.sheetRows)),l.DBF=b,c}function n(o,l){var c=l||{};c.dateNF||(c.dateNF="yyyymmdd");var u=fv(t(o,c),c);return u["!cols"]=c.DBF.map(function(f){return{wch:f.len,DBF:f}}),delete c.DBF,u}function s(o,l){try{return ef(n(o,l),l)}catch(c){if(l&&l.WTF)throw c}return{SheetNames:[],Sheets:{}}}var i={B:8,C:250,L:1,D:8,"?":0,"":0};function a(o,l){var c=l||{};if(+c.codepage>=0&&Uo(+c.codepage),c.type=="string")throw new Error("Cannot write DBF to JS string");var u=Ti(),f=IS(o,{header:1,raw:!0,cellDates:!0}),p=f[0],m=f.slice(1),x=o["!cols"]||[],g=0,y=0,v=0,w=1;for(g=0;g<p.length;++g){if(((x[g]||{}).DBF||{}).name){p[g]=x[g].DBF.name,++v;continue}if(p[g]!=null){if(++v,typeof p[g]=="number"&&(p[g]=p[g].toString(10)),typeof p[g]!="string")throw new Error("DBF Invalid column name "+p[g]+" |"+typeof p[g]+"|");if(p.indexOf(p[g])!==g){for(y=0;y<1024;++y)if(p.indexOf(p[g]+"_"+y)==-1){p[g]+="_"+y;break}}}}var b=Ft(o["!ref"]),_=[],T=[],A=[];for(g=0;g<=b.e.c-b.s.c;++g){var N="",k="",E=0,P=[];for(y=0;y<m.length;++y)m[y][g]!=null&&P.push(m[y][g]);if(P.length==0||p[g]==null){_[g]="?";continue}for(y=0;y<P.length;++y){switch(typeof P[y]){case"number":k="B";break;case"string":k="C";break;case"boolean":k="L";break;case"object":k=P[y]instanceof Date?"D":"C";break;default:k="C"}E=Math.max(E,String(P[y]).length),N=N&&N!=k?"C":k}E>250&&(E=250),k=((x[g]||{}).DBF||{}).type,k=="C"&&x[g].DBF.len>E&&(E=x[g].DBF.len),N=="B"&&k=="N"&&(N="N",A[g]=x[g].DBF.dec,E=x[g].DBF.len),T[g]=N=="C"||k=="N"?E:i[N]||0,w+=T[g],_[g]=N}var O=u.next(32);for(O.write_shift(4,318902576),O.write_shift(4,m.length),O.write_shift(2,296+32*v),O.write_shift(2,w),g=0;g<4;++g)O.write_shift(4,0);for(O.write_shift(4,0|(+e[Mz]||3)<<8),g=0,y=0;g<p.length;++g)if(p[g]!=null){var D=u.next(32),H=(p[g].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);D.write_shift(1,H,"sbcs"),D.write_shift(1,_[g]=="?"?"C":_[g],"sbcs"),D.write_shift(4,y),D.write_shift(1,T[g]||i[_[g]]||0),D.write_shift(1,A[g]||0),D.write_shift(1,2),D.write_shift(4,0),D.write_shift(1,0),D.write_shift(4,0),D.write_shift(4,0),y+=T[g]||i[_[g]]||0}var B=u.next(264);for(B.write_shift(4,13),g=0;g<65;++g)B.write_shift(4,0);for(g=0;g<m.length;++g){var ee=u.next(w);for(ee.write_shift(1,0),y=0;y<p.length;++y)if(p[y]!=null)switch(_[y]){case"L":ee.write_shift(1,m[g][y]==null?63:m[g][y]?84:70);break;case"B":ee.write_shift(8,m[g][y]||0,"f");break;case"N":var X="0";for(typeof m[g][y]=="number"&&(X=m[g][y].toFixed(A[y]||0)),v=0;v<T[y]-X.length;++v)ee.write_shift(1,32);ee.write_shift(1,X,"sbcs");break;case"D":m[g][y]?(ee.write_shift(4,("0000"+m[g][y].getFullYear()).slice(-4),"sbcs"),ee.write_shift(2,("00"+(m[g][y].getMonth()+1)).slice(-2),"sbcs"),ee.write_shift(2,("00"+m[g][y].getDate()).slice(-2),"sbcs")):ee.write_shift(8,"00000000","sbcs");break;case"C":var W=String(m[g][y]!=null?m[g][y]:"").slice(0,T[y]);for(ee.write_shift(1,W,"sbcs"),v=0;v<T[y]-W.length;++v)ee.write_shift(1,32);break}}return u.next(1).write_shift(1,26),u.end()}return{to_workbook:s,to_sheet:n,from_sheet:a}}(),X7=function(){var r={AA:"Ã",BA:"Ã",CA:"Ã",DA:195,HA:"Ã",JA:197,AE:"Ã",BE:"Ã",CE:"Ã",HE:"Ã",AI:"Ã",BI:"Ã",C
663I:"Ã",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("+nn(r).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(p,m){var x=r[m];return typeof x=="number"?zM(x):x},n=function(p,m,x){var g=m.charCodeAt(0)-32<<4|x.charCodeAt(0)-48;return g==59?p:zM(g)};r["|"]=254;function s(p,m){switch(m.type){case"base64":return i(xa(p),m);case"binary":return i(p,m);case"buffer":return i(bt&&Buffer.isBuffer(p)?p.toString("binary"):Qh(p),m);case"array":return i(T0(p),m)}throw new Error("Unrecognized type "+m.type)}function i(p,m){var x=p.split(/[\n\r]+/),g=-1,y=-1,v=0,w=0,b=[],_=[],T=null,A={},N=[],k=[],E=[],P=0,O;for(+m.codepage>=0&&Uo(+m.codepage);v!==x.length;++v){P=0;
vendor: 5,712 bytes, lines 663-667
663var D=x[v].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(e,t),H=D.replace(/;;/g,"\0").split(";").map(function(U){return U.replace(/\u0000/g,";")}),B=H[0],ee;if(D.length>0)switch(B){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":H[1].charAt(0)=="P"&&_.push(D.slice(3).replace(/;;/g,";"));break;case"C":var X=!1,W=!1,Y=!1,F=!1,J=-1,ne=-1;for(w=1;w<H.length;++w)switch(H[w].charAt(0)){case"A":break;case"X":y=parseInt(H[w].slice(1))-1,W=!0;break;case"Y":for(g=parseInt(H[w].slice(1))-1,W||(y=0),O=b.length;O<=g;++O)b[O]=[];break;case"K":ee=H[w].slice(1),ee.charAt(0)==='"'?ee=ee.slice(1,ee.length-1):ee==="TRUE"?ee=!0:ee==="FALSE"?ee=!1:isNaN(Jo(ee))?isNaN(Xx(ee).getDate())||(ee=Er(ee)):(ee=Jo(ee),T!==null&&dv(T)&&(ee=vA(ee))),X=!0;break;case"E":F=!0;var I=Gm(H[w].slice(1),{r:g,c:y});b[g][y]=[b[g][y],I];break;case"S":Y=!0,b[g][y]=[b[g][y],"S5S"];break;case"G":break;case"R":J=parseInt(H[w].slice(1))-1;break;case"C":ne=parseInt(H[w].slice(1))-1;break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+D)}if(X&&(b[g][y]&&b[g][y].length==2?b[g][y][0]=ee:b[g][y]=ee,T=null),Y){if(F)throw new Error("SYLK shared formula cannot have own formula");var z=J>-1&&b[J][ne];if(!z||!z[1])throw new Error("SYLK shared formula cannot find base");b[g][y][1]=hH(z[1],{r:g-J,c:y-ne})}break;case"F":var M=0;for(w=1;w<H.length;++w)switch(H[w].charAt(0)){case"X":y=parseInt(H[w].slice(1))-1,++M;break;case"Y":for(g=parseInt(H[w].slice(1))-1,O=b.length;O<=g;++O)b[O]=[];break;case"M":P=parseInt(H[w].slice(1))/20;break;case"F":break;case"G":break;case"P":T=_[parseInt(H[w].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(E=H[w].slice(1).split(" "),O=parseInt(E[0],10);O<=parseInt(E[1],10);++O)P=parseInt(E[2],10),k[O-1]=P===0?{hidden:!0}:{wch:P},Hh(k[O-1]);break;case"C":y=parseInt(H[w].slice(1))-1,k[y]||(k[y]={});break;case"R":g=parseInt(H[w].slice(1))-1,N[g]||(N[g]={}),P>0?(N[g].hpt=P,N[g].hpx=qx(P)):P===0&&(N[g].hidden=!0);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+D)}M<1&&(T=null);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+D)}}return N.length>0&&(A["!rows"]=N),k.length>0&&(A["!cols"]=k),m&&m.sheetRows&&(b=b.slice(0,m.sheetRows)),[b,A]}function a(p,m){var x=s(p,m),g=x[0],y=x[1],v=fv(g,m);return nn(y).forEach(function(w){v[w]=y[w]}),v}function o(p,m){return ef(a(p,m),m)}function l(p,m,x,g){var y="C;Y"+(x+1)+";X"+(g+1)+";K";switch(p.t){case"n":y+=p.v||0,p.f&&!p.F&&(y+=";E"+iO(p.f,{r:x,c:g}));break;case"b":y+=p.v?"TRUE":"FALSE";break;case"e":y+=p.w||p.v;break;case"d":y+='"'+(p.w||p.v)+'"';break;case"s":y+='"'+p.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return y}function c(p,m){m.forEach(function(x,g){var y="F;W"+(g+1)+" "+(g+1)+" ";x.hidden?y+="0":(typeof x.width=="number"&&!x.wpx&&(x.wpx=L1(x.width)),typeof x.wpx=="number"&&!x.wch&&(x.wch=B1(x.wpx)),typeof x.wch=="number"&&(y+=Math.round(x.wch))),y.charAt(y.length-1)!=" "&&p.push(y)})}function u(p,m){m.forEach(function(x,g){var y="F;";x.hidden?y+="M0;":x.hpt?y+="M"+20*x.hpt+";":x.hpx&&(y+="M"+20*U1(x.hpx)+";"),y.length>2&&p.push(y+"R"+(g+1))})}function f(p,m){var x=["ID;PWXL;N;E"],g=[],y=Ft(p["!ref"]),v,w=Array.isArray(p),b=`\r 664`;x.push("P;PGeneral"),x.push("F;P0;DG0G8;M255"),p["!cols"]&&c(x,p["!cols"]),p["!rows"]&&u(x,p["!rows"]),x.push("B;Y"+(y.e.r-y.s.r+1)+";X"+(y.e.c-y.s.c+1)+";D"+[y.s.c,y.s.r,y.e.c,y.e.r].join(" "));for(var _=y.s.r;_<=y.e.r;++_)for(var T=y.s.c;T<=y.e.c;++T){var A=Qe({r:_,c:T});v=w?(p[_]||[])[T]:p[A],!(!v||v.v==null&&(!v.f||v.F))&&g.push(l(v,p,_,T))}return x.join(b)+b+g.join(b)+b+"E"+b}return{to_workbook:o,to_sheet:a,from_sheet:f}}(),Y7=function(){function r(i,a){switch(a.type){case"base64":return e(xa(i),a);case"binary":return e(i,a);case"buffer":return e(bt&&Buffer.isBuffer(i)?i.toString("binary"):Qh(i),a);case"array":return e(T0(i),a)}throw new Error("Unrecognized type "+a.type)}function e(i,a){for(var o=i.split(` 665`),l=-1,c=-1,u=0,f=[];u!==o.length;++u){if(o[u].trim()==="BOT"){f[++l]=[],c=0;continue}if(!(l<0)){var p=o[u].trim().split(","),m=p[0],x=p[1];++u;for(var g=o[u]||"";(g.match(/["]/g)||[]).length&1&&u<o.length-1;)g+=` 666`+o[++u];switch(g=g.trim(),+m){case-1:if(g==="BOT"){f[++l]=[],c=0;continue}else if(g!=="EOD")throw new Error("Unrecognized DIF special command "+g);break;case 0:g==="TRUE"?f[l][c]=!0:g==="FALSE"?f[l][c]=!1:isNaN(Jo(x))?isNaN(Xx(x).getDate())?f[l][c]=x:f[l][c]=Er(x):f[l][c]=Jo(x),++c;break;case 1:g=g.slice(1,g.length-1),g=g.replace(/""/g,'"'),g&&g.match(/^=".*"$/)&&(g=g.slice(2,-1)),f[l][c++]=g!==""?g:null;break}if(g==="EOD")break}}return a&&a.sheetRows&&(f=f.slice(0,a.sheetRows)),f}function t(i,a){return fv(r(i,a),a)}function n(i,a){return ef(t(i,a),a)}var s=function(){var i=function(l,c,u,f,p){l.push(c),l.push(u+","+f),l.push('"'+p.replace(/"/g,'""')+'"')},a=function(l,c,u,f){l.push(c+","+u),l.push(c==1?'"'+f.replace(/"/g,'""')+'"':f)};return function(l){var c=[],u=Ft(l["!ref"]),f,p=Array.isArray(l);i(c,"TABLE",0,1,"sheetjs"),i(c,"VECTORS",0,u.e.r-u.s.r+1,""),i(c,"TUPLES",0,u.e.c-u.s.c+1,""),i(c,"DATA",0,0,"");for(var m=u.s.r;m<=u.e.r;++m){a(c,-1,0,"BOT");for(var x=u.s.c;x<=u.e.c;++x){var g=Qe({r:m,c:x});if(f=p?(l[m]||[])[x]:l[g],!f){a(c,1,0,"");continue}switch(f.t){case"n":var y=f.w;!y&&f.v!=null&&(y=f.v),y==null?f.f&&!f.F?a(c,1,0,"="+f.f):a(c,1,0,""):a(c,0,y,"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=io(f.z||Je[14],Rn(Er(f.v)))),a(c,0,f.w,"V");break;default:a(c,1,0,"")}}}a(c,-1,0,"EOD");var v=`\r 667`,w=c.join(v);return w}}();return{to_workbook:n,to_sheet:t,from_sheet:s}}(),q7=function(){function r(f){return f.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n
vendor: 5,880 bytes, lines 667-677
667/g,` 668`)}function e(f){return f.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(f,p){for(var m=f.split(` 669`),x=-1,g=-1,y=0,v=[];y!==m.length;++y){var w=m[y].trim().split(":");if(w[0]==="cell"){var b=zr(w[1]);if(v.length<=b.r)for(x=v.length;x<=b.r;++x)v[x]||(v[x]=[]);switch(x=b.r,g=b.c,w[2]){case"t":v[x][g]=r(w[3]);break;case"v":v[x][g]=+w[3];break;case"vtf":var _=w[w.length-1];case"vtc":switch(w[3]){case"nl":v[x][g]=!!+w[4];break;default:v[x][g]=+w[4];break}w[2]=="vtf"&&(v[x][g]=[v[x][g],_])}}}return p&&p.sheetRows&&(v=v.slice(0,p.sheetRows)),v}function n(f,p){return fv(t(f,p),p)}function s(f,p){return ef(n(f,p),p)}var i=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(` 670`),a=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(` 671`)+` 672`,o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(` 673`),l="--SocialCalcSpreadsheetControlSave--";function c(f){if(!f||!f["!ref"])return"";for(var p=[],m=[],x,g="",y=Ci(f["!ref"]),v=Array.isArray(f),w=y.s.r;w<=y.e.r;++w)for(var b=y.s.c;b<=y.e.c;++b)if(g=Qe({r:w,c:b}),x=v?(f[w]||[])[b]:f[g],!(!x||x.v==null||x.t==="z")){switch(m=["cell",g,"t"],x.t){case"s":case"str":m.push(e(x.v));break;case"n":x.f?(m[2]="vtf",m[3]="n",m[4]=x.v,m[5]=e(x.f)):(m[2]="v",m[3]=x.v);break;case"b":m[2]="vt"+(x.f?"f":"c"),m[3]="nl",m[4]=x.v?"1":"0",m[5]=e(x.f||(x.v?"TRUE":"FALSE"));break;case"d":var _=Rn(Er(x.v));m[2]="vtc",m[3]="nd",m[4]=""+_,m[5]=x.w||io(x.z||Je[14],_);break;case"e":continue}p.push(m.join(":"))}return p.push("sheet:c:"+(y.e.c-y.s.c+1)+":r:"+(y.e.r-y.s.r+1)+":tvf:1"),p.push("valueformat:1:text-wiki"),p.join(` 674`)}function u(f){return[i,a,o,a,c(f),l].join(` 675`)}return{to_workbook:s,to_sheet:n,from_sheet:u}}(),Yx=function(){function r(u,f,p,m,x){x.raw?f[p][m]=u:u===""||(u==="TRUE"?f[p][m]=!0:u==="FALSE"?f[p][m]=!1:isNaN(Jo(u))?isNaN(Xx(u).getDate())?f[p][m]=u:f[p][m]=Er(u):f[p][m]=Jo(u))}function e(u,f){var p=f||{},m=[];if(!u||u.length===0)return m;for(var x=u.split(/[\r\n]/),g=x.length-1;g>=0&&x[g].length===0;)--g;for(var y=10,v=0,w=0;w<=g;++w)v=x[w].indexOf(" "),v==-1?v=x[w].length:v++,y=Math.max(y,v);for(w=0;w<=g;++w){m[w]=[];var b=0;for(r(x[w].slice(0,y).trim(),m,w,b,p),b=1;b<=(x[w].length-y)/10+1;++b)r(x[w].slice(y+(b-1)*10,y+b*10).trim(),m,w,b,p)}return p.sheetRows&&(m=m.slice(0,p.sheetRows)),m}var t={44:",",9:" ",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function s(u){for(var f={},p=!1,m=0,x=0;m<u.length;++m)(x=u.charCodeAt(m))==34?p=!p:!p&&x in t&&(f[x]=(f[x]||0)+1);x=[];for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&x.push([f[m],m]);if(!x.length){f=n;for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&x.push([f[m],m])}return x.sort(function(g,y){return g[0]-y[0]||n[g[1]]-n[y[1]]}),t[x.pop()[1]]||44}function i(u,f){var p=f||{},m="",x=p.dense?[]:{},g={s:{c:0,r:0},e:{c:0,r:0}};u.slice(0,4)=="sep="?u.charCodeAt(5)==13&&u.charCodeAt(6)==10?(m=u.charAt(4),u=u.slice(7)):u.charCodeAt(5)==13||u.charCodeAt(5)==10?(m=u.charAt(4),u=u.slice(6)):m=s(u.slice(0,1024)):p&&p.FS?m=p.FS:m=s(u.slice(0,1024));var y=0,v=0,w=0,b=0,_=0,T=m.charCodeAt(0),A=!1,N=0,k=u.charCodeAt(0);u=u.replace(/\r\n/mg,` 676`);var E=p.dateNF!=null?Yle(p.dateNF):null;function P(){var O=u.slice(b,_),D={};if(O.charAt(0)=='"'&&O.charAt(O.length-1)=='"'&&(O=O.slice(1,-1).replace(/""/g,'"')),O.length===0)D.t="z";else if(p.raw)D.t="s",D.v=O;else if(O.trim().length===0)D.t="s",D.v=O;else if(O.charCodeAt(0)==61)O.charCodeAt(1)==34&&O.charCodeAt(O.length-1)==34?(D.t="s",D.v=O.slice(2,-1).replace(/""/g,'"')):Spe(O)?(D.t="n",D.f=O.slice(1)):(D.t="s",D.v=O);else if(O=="TRUE")D.t="b",D.v=!0;else if(O=="FALSE")D.t="b",D.v=!1;else if(!isNaN(w=Jo(O)))D.t="n",p.cellText!==!1&&(D.w=O),D.v=w;else if(!isNaN(Xx(O).getDate())||E&&O.match(E)){D.z=p.dateNF||Je[14];var H=0;E&&O.match(E)&&(O=qle(O,p.dateNF,O.match(E)||[]),H=1),p.cellDates?(D.t="d",D.v=Er(O,H)):(D.t="n",D.v=Rn(Er(O,H))),p.cellText!==!1&&(D.w=io(D.z,D.v instanceof Date?Rn(D.v):D.v)),p.cellNF||delete D.z}else D.t="s",D.v=O;if(D.t=="z"||(p.dense?(x[y]||(x[y]=[]),x[y][v]=D):x[Qe({c:v,r:y})]=D),b=_+1,k=u.charCodeAt(b),g.e.c<v&&(g.e.c=v),g.e.r<y&&(g.e.r=y),N==T)++v;else if(v=0,++y,p.sheetRows&&p.sheetRows<=y)return!0}e:for(;_<u.length;++_)switch(N=u.charCodeAt(_)){case 34:k===34&&(A=!A);break;case T:case 10:case 13:if(!A&&P())break e;break}return _-b>0&&P(),x["!ref"]=gt(g),x}function a(u,f){return!(f&&f.PRN)||f.FS||u.slice(0,4)=="sep="||u.indexOf(" ")>=0||u.indexOf(",")>=0||u.indexOf(";")>=0?i(u,f):fv(e(u,f),f)}function o(u,f){var p="",m=f.type=="string"?[0,0,0,0]:fO(u,f);switch(f.type){case"base64":p=xa(u);break;case"binary":p=u;break;case"buffer":f.codepage==65001?p=u.toString("utf8"):f.codepage&&typeof sd<"u"?p=sd.utils.decode(f.codepage,u):p=bt&&Buffer.isBuffer(u)?u.toString("binary"):Qh(u);break;case"array":p=T0(u);break;case"string":p=u;break;default:throw new Error("Unrecognized type "+f.type)}return m[0]==239&&m[1]==187&&m[2]==191?p=lr(p.slice(3)):f.type!="string"&&f.type!="buffer"&&f.codepage==65001?p=lr(p):f.type=="binary"&&typeof sd<"u"&&f.codepage&&(p=sd.utils.decode(f.codepage,sd.utils.encode(28591,p))),p.slice(0,19)=="socialcalc:version:"?q7.to_sheet(f.type=="string"?p:lr(p),f):a(p,f)}function l(u,f){return ef(o(u,f),f)}function c(u){for(var f=[],p=Ft(u["!ref"]),m,x=Array.isArray(u),g=p.s.r;g<=p.e.r;++g){for(var y=[],v=p.s.c;v<=p.e.c;++v){var w=Qe({r:g,c:v});if(m=x?(u[g]||[])[v]:u[w],!m||m.v==null){y.push(" ");continue}for(var b=(m.w||(Cu(m),m.w)||"").slice(0,10);b.length<10;)b+=" ";y.push(b+(v===0?" ":""))}f.push(y.join(""))}return f.join(` 677`)}return{to_workbook:l,to_sheet:o,from_sheet:c}}();function uhe(r,e){var t=e||{},n=!!t.WTF;t.WTF=!0;try{var s=X7.to_workbook(r,t);return t.WTF=n,s}catch(i){if(t.WTF=n,!i.message.match(/SYLK bad record ID/)&&n)throw i;return Yx.to_workbook(r,e)}}
vendor: 4,551 bytes, line 677
677var h0=function(){function r(I,z,M){if(I){cs(I,I.l||0);for(var U=M.Enum||J;I.l<I.length;){var te=I.read_shift(2),re=U[te]||U[65535],se=I.read_shift(2),ie=I.l+se,ae=re.f&&re.f(I,se,M);if(I.l=ie,z(ae,re,te))return}}}function e(I,z){switch(z.type){case"base64":return t(ca(xa(I)),z);case"binary":return t(ca(I),z);case"buffer":case"array":return t(I,z)}throw"Unsupported type "+z.type}function t(I,z){if(!I)return I;var M=z||{},U=M.dense?[]:{},te="Sheet1",re="",se=0,ie={},ae=[],ge=[],G={s:{r:0,c:0},e:{r:0,c:0}},Ue=M.sheetRows||0;if(I[2]==0&&(I[3]==8||I[3]==9)&&I.length>=16&&I[14]==5&&I[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(I[2]==2)M.Enum=J,r(I,function(we,Me,at){switch(at){case 0:M.vers=we,we>=4096&&(M.qpro=!0);break;case 6:G=we;break;case 204:we&&(re=we);break;case 222:re=we;break;case 15:case 51:M.qpro||(we[1].v=we[1].v.slice(1));case 13:case 14:case 16:at==14&&(we[2]&112)==112&&(we[2]&15)>1&&(we[2]&15)<15&&(we[1].z=M.dateNF||Je[14],M.cellDates&&(we[1].t="d",we[1].v=vA(we[1].v))),M.qpro&&we[3]>se&&(U["!ref"]=gt(G),ie[te]=U,ae.push(te),U=M.dense?[]:{},G={s:{r:0,c:0},e:{r:0,c:0}},se=we[3],te=re||"Sheet"+(se+1),re="");var Tr=M.dense?(U[we[0].r]||[])[we[0].c]:U[Qe(we[0])];if(Tr){Tr.t=we[1].t,Tr.v=we[1].v,we[1].z!=null&&(Tr.z=we[1].z),we[1].f!=null&&(Tr.f=we[1].f);break}M.dense?(U[we[0].r]||(U[we[0].r]=[]),U[we[0].r][we[0].c]=we[1]):U[Qe(we[0])]=we[1];break}},M);else if(I[2]==26||I[2]==14)M.Enum=ne,I[2]==14&&(M.qpro=!0,I.l=0),r(I,function(we,Me,at){switch(at){case 204:te=we;break;case 22:we[1].v=we[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(we[3]>se&&(U["!ref"]=gt(G),ie[te]=U,ae.push(te),U=M.dense?[]:{},G={s:{r:0,c:0},e:{r:0,c:0}},se=we[3],te="Sheet"+(se+1)),Ue>0&&we[0].r>=Ue)break;M.dense?(U[we[0].r]||(U[we[0].r]=[]),U[we[0].r][we[0].c]=we[1]):U[Qe(we[0])]=we[1],G.e.c<we[0].c&&(G.e.c=we[0].c),G.e.r<we[0].r&&(G.e.r=we[0].r);break;case 27:we[14e3]&&(ge[we[14e3][0]]=we[14e3][1]);break;case 1537:ge[we[0]]=we[1],we[0]==se&&(te=we[1]);break}},M);else throw new Error("Unrecognized LOTUS BOF "+I[2]);if(U["!ref"]=gt(G),ie[re||te]=U,ae.push(re||te),!ge.length)return{SheetNames:ae,Sheets:ie};for(var Re={},He=[],Te=0;Te<ge.length;++Te)ie[ae[Te]]?(He.push(ge[Te]||ae[Te]),Re[ge[Te]]=ie[ge[Te]]||ie[ae[Te]]):(He.push(ge[Te]),Re[ge[Te]]={"!ref":"A1"});return{SheetNames:He,Sheets:Re}}function n(I,z){var M=z||{};if(+M.codepage>=0&&Uo(+M.codepage),M.type=="string")throw new Error("Cannot write WK1 to JS string");var U=Ti(),te=Ft(I["!ref"]),re=Array.isArray(I),se=[];Ae(U,0,i(1030)),Ae(U,6,l(te));for(var ie=Math.min(te.e.r,8191),ae=te.s.r;ae<=ie;++ae)for(var ge=hn(ae),G=te.s.c;G<=te.e.c;++G){ae===te.s.r&&(se[G]=$r(G));var Ue=se[G]+ge,Re=re?(I[ae]||[])[G]:I[Ue];if(!(!Re||Re.t=="z"))if(Re.t=="n")(Re.v|0)==Re.v&&Re.v>=-32768&&Re.v<=32767?Ae(U,13,m(ae,G,Re.v)):Ae(U,14,g(ae,G,Re.v));else{var He=Cu(Re);Ae(U,15,f(ae,G,He.slice(0,239)))}}return Ae(U,1),U.end()}function s(I,z){var M=z||{};if(+M.codepage>=0&&Uo(+M.codepage),M.type=="string")throw new Error("Cannot write WK3 to JS string");var U=Ti();Ae(U,0,a(I));for(var te=0,re=0;te<I.SheetNames.length;++te)(I.Sheets[I.SheetNames[te]]||{})["!ref"]&&Ae(U,27,F(I.SheetNames[te],re++));var se=0;for(te=0;te<I.SheetNames.length;++te){var ie=I.Sheets[I.SheetNames[te]];if(!(!ie||!ie["!ref"])){for(var ae=Ft(ie["!ref"]),ge=Array.isArray(ie),G=[],Ue=Math.min(ae.e.r,8191),Re=ae.s.r;Re<=Ue;++Re)for(var He=hn(Re),Te=ae.s.c;Te<=ae.e.c;++Te){Re===ae.s.r&&(G[Te]=$r(Te));var we=G[Te]+He,Me=ge?(ie[Re]||[])[Te]:ie[we];if(!(!Me||Me.t=="z"))if(Me.t=="n")Ae(U,23,P(Re,Te,se,Me.v));else{var at=Cu(Me);Ae(U,22,N(Re,Te,se,at.slice(0,239)))}}++se}}return Ae(U,1),U.end()}function i(I){var z=fe(2);return z.write_shift(2,I),z}function a(I){var z=fe(26);z.write_shift(2,4096),z.write_shift(2,4),z.write_shift(4,0);for(var M=0,U=0,te=0,re=0;re<I.SheetNames.length;++re){var se=I.SheetNames[re],ie=I.Sheets[se];if(!(!ie||!ie["!ref"])){++te;var ae=Ci(ie["!ref"]);M<ae.e.r&&(M=ae.e.r),U<ae.e.c&&(U=ae.e.c)}}return M>8191&&(M=8191),z.write_shift(2,M),z.write_shift(1,te),z.write_shift(1,U),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(I,z,M){var U={s:{c:0,r:0},e:{c:0,r:0}};return z==8&&M.qpro?(U.s.c=I.read_shift(1),I.l++,U.s.r=I.read_shift(2),U.e.c=I.read_shift(1),I.l++,U.e.r=I.read_shift(2),U):(U.s.c=I.read_shift(2),U.s.r=I.read_shift(2),z==12&&M.qpro&&(I.l+=2),U.e.c=I.read_shift(2),U.e.r=I.read_shift(2),z==12&&M.qpro&&(I.l+=2),U.s.c==65535&&(U.s.c=U.e.c=U.s.r=U.e.r=0),U)}
vendor: 5,149 bytes, line 677
677function l(I){var z=fe(8);return z.write_shift(2,I.s.c),z.write_shift(2,I.s.r),z.write_shift(2,I.e.c),z.write_shift(2,I.e.r),z}function c(I,z,M){var U=[{c:0,r:0},{t:"n",v:0},0,0];return M.qpro&&M.vers!=20768?(U[0].c=I.read_shift(1),U[3]=I.read_shift(1),U[0].r=I.read_shift(2),I.l+=2):(U[2]=I.read_shift(1),U[0].c=I.read_shift(2),U[0].r=I.read_shift(2)),U}function u(I,z,M){var U=I.l+z,te=c(I,z,M);if(te[1].t="s",M.vers==20768){I.l++;var re=I.read_shift(1);return te[1].v=I.read_shift(re,"utf8"),te}return M.qpro&&I.l++,te[1].v=I.read_shift(U-I.l,"cstr"),te}function f(I,z,M){var U=fe(7+M.length);U.write_shift(1,255),U.write_shift(2,z),U.write_shift(2,I),U.write_shift(1,39);for(var te=0;te<U.length;++te){var re=M.charCodeAt(te);U.write_shift(1,re>=128?95:re)}return U.write_shift(1,0),U}function p(I,z,M){var U=c(I,z,M);return U[1].v=I.read_shift(2,"i"),U}function m(I,z,M){var U=fe(7);return U.write_shift(1,255),U.write_shift(2,z),U.write_shift(2,I),U.write_shift(2,M,"i"),U}function x(I,z,M){var U=c(I,z,M);return U[1].v=I.read_shift(8,"f"),U}function g(I,z,M){var U=fe(13);return U.write_shift(1,255),U.write_shift(2,z),U.write_shift(2,I),U.write_shift(8,M,"f"),U}function y(I,z,M){var U=I.l+z,te=c(I,z,M);if(te[1].v=I.read_shift(8,"f"),M.qpro)I.l=U;else{var re=I.read_shift(2);_(I.slice(I.l,I.l+re),te),I.l+=re}return te}function v(I,z,M){var U=z&32768;return z&=-32769,z=(U?I:0)+(z>=8192?z-16384:z),(U?"":"$")+(M?$r(z):hn(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]},b=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function _(I,z){cs(I,0);for(var M=[],U=0,te="",re="",se="",ie="";I.l<I.length;){var ae=I[I.l++];switch(ae){case 0:M.push(I.read_shift(8,"f"));break;case 1:re=v(z[0].c,I.read_shift(2),!0),te=v(z[0].r,I.read_shift(2),!1),M.push(re+te);break;case 2:{var ge=v(z[0].c,I.read_shift(2),!0),G=v(z[0].r,I.read_shift(2),!1);re=v(z[0].c,I.read_shift(2),!0),te=v(z[0].r,I.read_shift(2),!1),M.push(ge+G+":"+re+te)}break;case 3:if(I.l<I.length){console.error("WK1 premature formula end");return}break;case 4:M.push("("+M.pop()+")");break;case 5:M.push(I.read_shift(2));break;case 6:{for(var Ue="";ae=I[I.l++];)Ue+=String.fromCharCode(ae);M.push('"'+Ue.replace(/"/g,'""')+'"')}break;case 8:M.push("-"+M.pop());break;case 23:M.push("+"+M.pop());break;case 22:M.push("NOT("+M.pop()+")");break;case 20:case 21:ie=M.pop(),se=M.pop(),M.push(["AND","OR"][ae-20]+"("+se+","+ie+")");break;default:if(ae<32&&b[ae])ie=M.pop(),se=M.pop(),M.push(se+b[ae]+ie);else if(w[ae]){if(U=w[ae][1],U==69&&(U=I[I.l++]),U>M.length){console.error("WK1 bad formula parse 0x"+ae.toString(16)+":|"+M.join("|")+"|");return}var Re=M.slice(-U);M.length-=U,M.push(w[ae][0]+"("+Re.join(",")+")")}else return ae<=7?console.error("WK1 invalid opcode "+ae.toString(16)):ae<=24?console.error("WK1 unsupported op "+ae.toString(16)):ae<=30?console.error("WK1 invalid opcode "+ae.toString(16)):ae<=115?console.error("WK1 unsupported function opcode "+ae.toString(16)):console.error("WK1 unrecognized opcode "+ae.toString(16))}}M.length==1?z[1].f=""+M[0]:console.error("WK1 bad formula parse |"+M.join("|")+"|")}function T(I){var z=[{c:0,r:0},{t:"n",v:0},0];return z[0].r=I.read_shift(2),z[3]=I[I.l++],z[0].c=I[I.l++],z}function A(I,z){var M=T(I);return M[1].t="s",M[1].v=I.read_shift(z-4,"cstr"),M}function N(I,z,M,U){var te=fe(6+U.length);te.write_shift(2,I),te.write_shift(1,M),te.write_shift(1,z),te.write_shift(1,39);for(var re=0;re<U.length;++re){var se=U.charCodeAt(re);te.write_shift(1,se>=128?95:se)}return te.write_shift(1,0),te}function k(I,z){var M=T(I);M[1].v=I.read_shift(2);var U=M[1].v>>1;if(M[1].v&1)switch(U&7){case 0:U=(U>>3)*5e3;break;case 1:U=(U>>3)*500;break;case 2:U=(U>>3)/20;break;case 3:U=(U>>3)/200;break;case 4:U=(U>>3)/2e3;break;case 5:U=(U>>3)/2e4;break;case 6:U=(U>>3)/16;break;case 7:U=(U>>3)/64;break}return M[1].v=U,M}function E(I,z){var M=T(I),U=I.read_shift(4),te=I.read_shift(4),re=I.read_shift(2);if(re==65535)return U===0&&te===3221225472?(M[1].t="e",M[1].v=15):U===0&&te===3489660928?(M[1].t="e",M[1].v=42):M[1].v=0,M;var se=re&32768;return re=(re&32767)-16446,M[1].v=(1-se*2)*(te*Math.pow(2,re+32)+U*Math.pow(2,re)),M}function P(I,z,M,U){var te=fe(14);if(te.write_shift(2,I),te.write_shift(1,M),te.write_shift(1,z),U==0)return te.write_shift(4,0),te.write_shift(4,0),te.write_shift(2,65535),te;var re=0,se=0,ie=0,ae=0;return U<0&&(re=1,U=-U),se=Math.log2(U)|0,U/=Math.pow(2,se-31),ae=U>>>0,ae&2147483648||(U/=2,++se,ae=U>>>0),U-=ae,ae|=2147483648,ae>>>=0,U*=Math.pow(2,32),ie=U>>>0,te.write_shift(4,ie),te.write_shift(4,ae),se+=16383+(re?32768:0),te.write_shift(2,se),te}function O(I,z){var M=E(I);return I.l+=z-14,M}function D(I,z){var M=T(I),U=I.read_shift(4);return M[1].v=U>>6,M}function H(I,z){var M=T(I),U=I.read_shift(8,"f");return M[1].v=U,M}function B(I,z){var M=H(I);return I.l+=z-10,M}function ee(I,z){return I[I.l+z-1]==0?I.read_shift(z,"cstr"):""}function X(I,z){var M=I[I.l++];M>z-1&&(M=z-1);for(var U="";U.length<M;)U+=String.fromCharCode(I[I.l++]);return U}
vendor: 4,972 bytes, line 677
677function W(I,z,M){if(!(!M.qpro||z<21)){var U=I.read_shift(1);I.l+=17,I.l+=1,I.l+=2;var te=I.read_shift(z-21,"cstr");return[U,te]}}function Y(I,z){for(var M={},U=I.l+z;I.l<U;){var te=I.read_shift(2);if(te==14e3){for(M[te]=[0,""],M[te][0]=I.read_shift(2);I[I.l];)M[te][1]+=String.fromCharCode(I[I.l]),I.l++;I.l++}}return M}function F(I,z){var M=fe(5+I.length);M.write_shift(2,14e3),M.write_shift(2,z);for(var U=0;U<I.length;++U){var te=I.charCodeAt(U);M[M.l++]=te>127?95:te}return M[M.l++]=0,M}var J={0:{n:"BOF",f:yn},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:u},16:{n:"FORMULA",f:y},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:u},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:ee},222:{n:"SHEETNAMELP",f:X},65535:{n:""}},ne={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:A},23:{n:"NUMBER17",f:E},24:{n:"NUMBER18",f:k},25:{n:"FORMULA19",f:O},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Y},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:D},38:{n:"??"},39:{n:"NUMBER27",f:H},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:ee},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:W},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:n,book_to_wk3:s,to_workbook:e}}();function dhe(r){var e={},t=r.match(Bs),n=0,s=!1;if(t)for(;n!=t.length;++n){var i=rt(t[n]);switch(i[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!i.val)break;case"<shadow>":case"<shadow/>":e.shadow=1;break;case"</shadow>":break;case"<charset":if(i.val=="1")break;e.cp=Pj[parseInt(i.val,10)];break;case"<outline":if(!i.val)break;case"<outline>":case"<outline/>":e.outline=1;break;case"</outline>":break;case"<rFont":e.name=i.val;break;case"<sz":e.sz=i.val;break;case"<strike":if(!i.val)break;case"<strike>":case"<strike/>":e.strike=1;break;case"</strike>":break;case"<u":if(!i.val)break;switch(i.val){case"double":e.uval="double";break;case"singleAccounting":e.uval="single-accounting";break;case"doubleAccounting":e.uval="double-accounting";break}case"<u>":case"<u/>":e.u=1;break;case"</u>":break;case"<b":if(i.val=="0")break;case"<b>":case"<b/>":e.b=1;break;case"</b>":break;case"<i":if(i.val=="0")break;case"<i>":case"<i/>":e.i=1;break;case"</i>":break;case"<color":i.rgb&&(e.color=i.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":e.family=i.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":e.valign=i.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;
vendor: 6,255 bytes, line 677
677default:if(i[0].charCodeAt(1)!==47&&!s)throw new Error("Unrecognized rich format "+i[0])}}return e}var hhe=function(){var r=O1("t"),e=O1("rPr");function t(i){var a=i.match(r);if(!a)return{t:"s",v:""};var o={t:"s",v:Rt(a[1])},l=i.match(e);return l&&(o.s=dhe(l[1])),o}var n=/<(?:\w+:)?r>/g,s=/<\/(?:\w+:)?r>/;return function(a){return a.replace(n,"").split(s).map(t).filter(function(o){return o.v})}}(),fhe=function(){var e=/(\r\n|\n)/g;function t(s,i,a){var o=[];s.u&&o.push("text-decoration: underline;"),s.uval&&o.push("text-underline-style:"+s.uval+";"),s.sz&&o.push("font-size:"+s.sz+"pt;"),s.outline&&o.push("text-effect: outline;"),s.shadow&&o.push("text-shadow: auto;"),i.push('<span style="'+o.join("")+'">'),s.b&&(i.push("<b>"),a.push("</b>")),s.i&&(i.push("<i>"),a.push("</i>")),s.strike&&(i.push("<s>"),a.push("</s>"));var l=s.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(i.push("<"+l+">"),a.push("</"+l+">")),a.push("</span>"),s}function n(s){var i=[[],s.v,[]];return s.v?(s.s&&t(s.s,i[0],i[2]),i[0].join("")+i[1].replace(e,"<br/>")+i[2].join("")):""}return function(i){return i.map(n).join("")}}(),phe=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,mhe=/<(?:\w+:)?r>/,ghe=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function eO(r,e){var t=e?e.cellHTML:!0,n={};return r?(r.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=Rt(lr(r.slice(r.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=lr(r),t&&(n.h=Uj(n.t))):r.match(mhe)&&(n.r=lr(r),n.t=Rt(lr((r.replace(ghe,"").match(phe)||[]).join("").replace(Bs,""))),t&&(n.h=fhe(hhe(n.r)))),n):{t:""}}var xhe=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,vhe=/<(?:\w+:)?(?:si|sstItem)>/g,yhe=/<\/(?:\w+:)?(?:si|sstItem)>/;function whe(r,e){var t=[],n="";if(!r)return t;var s=r.match(xhe);if(s){n=s[2].replace(vhe,"").split(yhe);for(var i=0;i!=n.length;++i){var a=eO(n[i].trim(),e);a!=null&&(t[t.length]=a)}s=rt(s[1]),t.Count=s.count,t.Unique=s.uniqueCount}return t}var bhe=/^\s|\s$|[\t\n\r]/;function Z7(r,e){if(!e.bookSST)return"";var t=[fn];t[t.length]=Ee("sst",null,{xmlns:L0[0],count:r.Count,uniqueCount:r.Unique});for(var n=0;n!=r.length;++n)if(r[n]!=null){var s=r[n],i="<si>";s.r?i+=s.r:(i+="<t",s.t||(s.t=""),s.t.match(bhe)&&(i+=' xml:space="preserve"'),i+=">"+Qt(s.t)+"</t>"),i+="</si>",t[t.length]=i}return t.length>2&&(t[t.length]="</sst>",t[1]=t[1].replace("/>",">")),t.join("")}function _he(r){return[r.read_shift(4),r.read_shift(4)]}function khe(r,e){var t=[],n=!1;return Mu(r,function(i,a,o){switch(o){case 159:t.Count=i[0],t.Unique=i[1];break;case 19:t.push(i);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(a.T,!n||e.WTF)throw new Error("Unexpected record 0x"+o.toString(16))}}),t}function She(r,e){return e||(e=fe(8)),e.write_shift(4,r.Count),e.write_shift(4,r.Unique),e}var Ehe=Dce;function Ahe(r){var e=Ti();xe(e,159,She(r));for(var t=0;t<r.length;++t)xe(e,19,Ehe(r[t]));return xe(e,160),e.end()}function J7(r){for(var e=[],t=r.split(""),n=0;n<t.length;++n)e[n]=t[n].charCodeAt(0);return e}function pu(r,e){var t={};return t.Major=r.read_shift(2),t.Minor=r.read_shift(2),e>=4&&(r.l+=e-4),t}function The(r){var e={};return e.id=r.read_shift(0,"lpp4"),e.R=pu(r,4),e.U=pu(r,4),e.W=pu(r,4),e}function Che(r){for(var e=r.read_shift(4),t=r.l+e-4,n={},s=r.read_shift(4),i=[];s-- >0;)i.push({t:r.read_shift(4),v:r.read_shift(0,"lpp4")});if(n.name=r.read_shift(0,"lpp4"),n.comps=i,r.l!=t)throw new Error("Bad DataSpaceMapEntry: "+r.l+" != "+t);return n}function Nhe(r){var e=[];r.l+=4;for(var t=r.read_shift(4);t-- >0;)e.push(Che(r));return e}function Phe(r){var e=[];r.l+=4;for(var t=r.read_shift(4);t-- >0;)e.push(r.read_shift(0,"lpp4"));return e}function Rhe(r){var e={};return r.read_shift(4),r.l+=4,e.id=r.read_shift(0,"lpp4"),e.name=r.read_shift(0,"lpp4"),e.R=pu(r,4),e.U=pu(r,4),e.W=pu(r,4),e}function jhe(r){var e=Rhe(r);if(e.ename=r.read_shift(0,"8lpp4"),e.blksz=r.read_shift(4),e.cmode=r.read_shift(4),r.read_shift(4)!=4)throw new Error("Bad !Primary record");return e}function Q7(r,e){var t=r.l+e,n={};n.Flags=r.read_shift(4)&63,r.l+=4,n.AlgID=r.read_shift(4);var s=!1;switch(n.AlgID){case 26126:case 26127:case 26128:s=n.Flags==36;break;case 26625:s=n.Flags==4;break;case 0:s=n.Flags==16||n.Flags==4||n.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!s)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=r.read_shift(4),n.KeySize=r.read_shift(4),n.ProviderType=r.read_shift(4),r.l+=8,n.CSPName=r.read_shift(t-r.l>>1,"utf16le"),r.l=t,n}function eH(r,e){var t={},n=r.l+e;return r.l+=4,t.Salt=r.slice(r.l,r.l+16),r.l+=16,t.Verifier=r.slice(r.l,r.l+16),r.l+=16,r.read_shift(4),t.VerifierHash=r.slice(r.l,n),r.l=n,t}function Ohe(r){var e=pu(r);switch(e.Minor){case 2:return[e.Minor,Fhe(r)];case 3:return[e.Minor,Dhe()];case 4:return[e.Minor,Mhe(r)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+e.Minor)}function Fhe(r){var e=r.read_shift(4);if((e&63)!=36)throw new Error("EncryptionInfo mismatch");var t=r.read_shift(4),n=Q7(r,t),s=eH(r,r.length-r.l);return{t:"Std",h:n,v:s}}function Dhe(){throw new Error("File is password-protected: ECMA-376 Extensible")}function Mhe(r){var e=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];r.l+=4;var t=r.read_shift(r.length-r.l,"utf8"),n={};return t.replace(Bs,function(i){var a=rt(i);switch(ac(a[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":e.forEach(function(o){n[o]=a[o]});break;case"<dataIntegrity":n.encryptedHmacKey=a.encryptedHmacKey,n.encryptedHmacValue=a.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":n.uri=a.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":n.encs.push(a);break;default:throw a[0]}}),n}function Ihe(r,e){var t={},n=t.EncryptionVersionInfo=pu(r,4);if(e-=4,n.Minor!=2)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);t.Flags=r.read_shift(4),e-=4;var s=r.read_shift(4);return e-=4,t.EncryptionHeader=Q7(r,s),e-=s,t.EncryptionVerifier=eH(r,e),t}function Lhe(r){var e={},t=e.EncryptionVersionInfo=pu(r,4);
vendor: 3,460 bytes, line 677
677if(t.Major!=1||t.Minor!=1)throw"unrecognized version code "+t.Major+" : "+t.Minor;return e.Salt=r.read_shift(16),e.EncryptedVerifier=r.read_shift(16),e.EncryptedVerifierHash=r.read_shift(16),e}function tO(r){var e=0,t,n=J7(r),s=n.length+1,i,a,o,l,c;for(t=zh(s),t[0]=n.length,i=1;i!=s;++i)t[i]=n[i-1];for(i=s-1;i>=0;--i)a=t[i],o=e&16384?1:0,l=e<<1&32767,c=o|l,e=c^a;return e^52811}var tH=function(){var r=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],e=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(a){return(a/2|a*128)&255},s=function(a,o){return n(a^o)},i=function(a){for(var o=e[a.length-1],l=104,c=a.length-1;c>=0;--c)for(var u=a[c],f=0;f!=7;++f)u&64&&(o^=t[l]),u*=2,--l;return o};return function(a){for(var o=J7(a),l=i(o),c=o.length,u=zh(16),f=0;f!=16;++f)u[f]=0;var p,m,x;for((c&1)===1&&(p=l>>8,u[c]=s(r[0],p),--c,p=l&255,m=o[o.length-1],u[c]=s(m,p));c>0;)--c,p=l>>8,u[c]=s(o[c],p),--c,p=l&255,u[c]=s(o[c],p);for(c=15,x=15-o.length;x>0;)p=l>>8,u[c]=s(r[x],p),--c,--x,p=l&255,u[c]=s(o[c],p),--c,--x;return u}}(),Bhe=function(r,e,t,n,s){s||(s=e),n||(n=tH(r));var i,a;for(i=0;i!=e.length;++i)a=e[i],a^=n[t],a=(a>>5|a<<3)&255,s[i]=a,++t;return[s,t,n]},Uhe=function(r){var e=0,t=tH(r);return function(n){var s=Bhe("",n,e,t);return e=s[1],s[0]}};function $he(r,e,t,n){var s={key:yn(r),verificationBytes:yn(r)};return t.password&&(s.verifier=tO(t.password)),n.valid=s.verificationBytes===s.verifier,n.valid&&(n.insitu=Uhe(t.password)),s}function zhe(r,e,t){var n=t||{};return n.Info=r.read_shift(2),r.l-=2,n.Info===1?n.Data=Lhe(r):n.Data=Ihe(r,e),n}function Hhe(r,e,t){var n={Type:t.biff>=8?r.read_shift(2):0};return n.Type?zhe(r,e-2,n):$he(r,t.biff>=8?e:e-2,t,n),n}var rH=function(){function r(s,i){switch(i.type){case"base64":return e(xa(s),i);case"binary":return e(s,i);case"buffer":return e(bt&&Buffer.isBuffer(s)?s.toString("binary"):Qh(s),i);case"array":return e(T0(s),i)}throw new Error("Unrecognized type "+i.type)}function e(s,i){var a=i||{},o=a.dense?[]:{},l=s.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(u,f){Array.isArray(o)&&(o[f]=[]);for(var p=/\\\w+\b/g,m=0,x,g=-1;x=p.exec(u);){switch(x[0]){case"\\cell":var y=u.slice(m,p.lastIndex-x[0].length);if(y[0]==" "&&(y=y.slice(1)),++g,y.length){var v={v:y,t:"s"};Array.isArray(o)?o[f][g]=v:o[Qe({r:f,c:g})]=v}break}m=p.lastIndex}g>c.e.c&&(c.e.c=g)}),o["!ref"]=gt(c),o}function t(s,i){return ef(r(s,i),i)}function n(s){for(var i=["{\\rtf1\\ansi"],a=Ft(s["!ref"]),o,l=Array.isArray(s),c=a.s.r;c<=a.e.r;++c){i.push("\\trowd\\trautofit1");for(var u=a.s.c;u<=a.e.c;++u)i.push("\\cellx"+(u+1));for(i.push("\\pard\\intbl"),u=a.s.c;u<=a.e.c;++u){var f=Qe({r:c,c:u});o=l?(s[c]||[])[u]:s[f],!(!o||o.v==null&&(!o.f||o.F))&&(i.push(" "+(o.w||(Cu(o
677),o.w))),i.push("\\cell"))}i.push("\\pard\\intbl\\row")}return i.join("")+"}"}return{to_workbook:t,to_sheet:r,from_sheet:n}}();function Whe(r){var e=r.slice(r[0]==="#"?1:0).slice(0,6);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function I1(r){for(var e=0,t=1;e!=3;++e)t=t*256+(r[e]>255?255:r[e]<0?0:r[e]);return t.toString(16).toUpperCase().slice(1)}function Vhe(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,s=Math.max(e,t,n),i=Math.min(e,t,n),a=s-i;if(a===0)return[0,0,e];var o=0,l=0,c=s+i;switch(l=a/(c>1?2-c:c),s){case e:o=((t-n)/a+6)%6;break;case t:o=(n-e)/a+2;break;case n:o=(e-t)/a+4;break}return[o/6,l,c/2]}function Ghe(r){var e=r[0],t=r[1],n=r[2],s=t*2*(n<.5?n:1-n),i=n-s/2,a=[i,i,i],o=6*e,l;if(t!==0)switch(o|0){case 0:case 6:l=s*o,a[0]+=s,a[1]+=l;break;case 1:l=s*(2-o),a[0]+=l,a[1]+=s;break;case 2:l=s*(o-2),a[1]+=s,a[2]+=l;break;case 3:l=s*(4-o),a[1]+=l,a[2]+=s;break;case 4:l=s*(o-4),a[2]+=s,a[0]+=l;break;case 5:l=s*(6-o),a[2]+=l,a[0]+=s;break}for(var c=0;c!=3;++c)a[c]=Math.round(a[c]*255);return a}function DS(r,e){if(e===0)return r;var t=Vhe(Whe(r));return e<0?t[2]=t[2]*(1+e):t[2]=1-(1-t[2])*(1-e),I1(Ghe(t))}var nH=6,Khe=15,Xhe=1,Rs=nH;function L1(r){return Math.floor((r+Math.round(128/Rs)/256)*Rs)}function B1(r){return Math.floor((r-5)/Rs*100+.5)/100}function MS(r){return Math.round((r*Rs+5)/Rs*256)/256}function KT(r){return MS(B1(L1(r)))}function rO(r){var e=Math.abs(r-KT(r)),t=Rs;if(e>.005)for(Rs=Xhe;Rs<Khe;++Rs)Math.abs(r-KT(r))<=e&&(e=Math.abs(r-KT(r)),t=Rs);Rs=t}function Hh(r){r.width?(r.wpx=L1(r.width),r.wch=B1(r.wpx),r.MDW=Rs):r.wpx?(r.wch=B1(r.wpx),r.width=MS(r.wch),r.MDW=Rs):typeof r.wch=="number"&&(r.width=MS(r.wch),r.wpx=L1(r.width),r.MDW=Rs),r.customWidth&&delete r.customWidth}var Yhe=96,sH=Yhe;function U1(r){return r*96/sH}function qx(r){return r*sH/96}var qhe={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function Zhe(r,e,t,n){e.Borders=[];var s={},i=!1;(r[0].match(Bs)||[]).forEach(function(a){var o=rt(a);switch(ac(o[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":s={},o.diagonalUp&&(s.diagonalUp=_r(o.diagonalUp)),o.diagonalDown&&(s.diagonalDown=_r(o.diagonalDown)),e.Borders.push(s);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+o[0]+" in borders")}})}function Jhe(r,e,t,n){e.Fills=[];var s={},i=!1;(r[0].match(Bs)||[]).forEach(function(a){var o=rt(a);switch(ac(o[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":s={},e.Fills.push(s);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":e.Fills.push(s),s={};break;case"<patternFill":case"<patternFill>":o.patternType&&(s.patternType=o.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":s.bgColor||(s.bgColor={}),o.indexed&&(s.bgColor.indexed=parseInt(o.indexed,10)),o.theme&&(s.bgColor.theme=parseInt(o.theme,10)),o.tint&&(s.bgColor.tint=parseFloat(o.tint)),o.rgb&&(s.bgColor.rgb=o.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":s.fgColor||(s.fgColor={}),o.theme&&(s.fgColor.theme=parseInt(o.theme,10)),o.tint&&(s.fgColor.tint=parseFloat(o.tint)),o.rgb!=null&&(s.fgColor.rgb=o.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fills")}})}function Qhe(r,e,t,n){e.Fonts=[];var s={},i=!1;
vendor: 7,054 bytes, line 677
677(r[0].match(Bs)||[]).forEach(function(a){var o=rt(a);switch(ac(o[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":e.Fonts.push(s),s={};break;case"<name":o.val&&(s.name=lr(o.val));break;case"<name/>":case"</name>":break;case"<b":s.bold=o.val?_r(o.val):1;break;case"<b/>":s.bold=1;break;case"<i":s.italic=o.val?_r(o.val):1;break;case"<i/>":s.italic=1;break;case"<u":switch(o.val){case"none":s.underline=0;break;case"single":s.underline=1;break;case"double":s.underline=2;break;case"singleAccounting":s.underline=33;break;case"doubleAccounting":s.underline=34;break}break;case"<u/>":s.underline=1;break;case"<strike":s.strike=o.val?_r(o.val):1;break;case"<strike/>":s.strike=1;break;case"<outline":s.outline=o.val?_r(o.val):1;break;case"<outline/>":s.outline=1;break;case"<shadow":s.shadow=o.val?_r(o.val):1;break;case"<shadow/>":s.shadow=1;break;case"<condense":s.condense=o.val?_r(o.val):1;break;case"<condense/>":s.condense=1;break;case"<extend":s.extend=o.val?_r(o.val):1;break;case"<extend/>":s.extend=1;break;case"<sz":o.val&&(s.sz=+o.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":o.val&&(s.vertAlign=o.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":o.val&&(s.family=parseInt(o.val,10));break;case"<family/>":case"</family>":break;case"<scheme":o.val&&(s.scheme=o.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(o.val=="1")break;o.codepage=Pj[parseInt(o.val,10)];break;case"<color":if(s.color||(s.color={}),o.auto&&(s.color.auto=_r(o.auto)),o.rgb)s.color.rgb=o.rgb.slice(-6);else if(o.indexed){s.color.index=parseInt(o.indexed,10);var l=u0[s.color.index];s.color.index==81&&(l=u0[1]),l||(l=u0[1]),s.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else o.theme&&(s.color.theme=parseInt(o.theme,10),o.tint&&(s.color.tint=parseFloat(o.tint)),o.theme&&t.themeElements&&t.themeElements.clrScheme&&(s.color.rgb=DS(t.themeElements.clrScheme[s.color.theme].rgb,s.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(n&&n.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fonts")}})}function efe(r,e,t){e.NumberFmt=[];for(var n=nn(Je),s=0;s<n.length;++s)e.NumberFmt[n[s]]=Je[n[s]];var i=r[0].match(Bs);if(i)for(s=0;s<i.length;++s){var a=rt(i[s]);switch(ac(a[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var o=Rt(lr(a.formatCode)),l=parseInt(a.numFmtId,10);if(e.NumberFmt[l]=o,l>0){if(l>392){for(l=392;l>60&&e.NumberFmt[l]!=null;--l);e.NumberFmt[l]=o}fu(o,l)}}break;case"</numFmt>":break;default:if(t.WTF)throw new Error("unrecognized "+a[0]+" in numFmts")}}}function tfe(r){var e=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var n=t[0];n<=t[1];++n)r[n]!=null&&(e[e.length]=Ee("numFmt",null,{numFmtId:n,formatCode:Qt(r[n])}))}),e.length===1?"":(e[e.length]="</numFmts>",e[0]=Ee("numFmts",null,{count:e.length-2}).replace("/>",">"),e.join(""))}var lk=["numFmtId","fillId","fontId","borderId","xfId"],ck=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function rfe(r,e,t){e.CellXf=[];var n,s=!1;(r[0].match(Bs)||[]).forEach(function(i){var a=rt(i),o=0;switch(ac(a[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(n=a,delete n[0],o=0;o<lk.length;++o)n[lk[o]]&&(n[lk[o]]=parseInt(n[lk[o]],10));for(o=0;o<ck.length;++o)n[ck[o]]&&(n[ck[o]]=_r(n[ck[o]]));if(e.NumberFmt&&n.numFmtId>392){for(o=392;o>60;--o)if(e.NumberFmt[n.numFmtId]==e.NumberFmt[o]){n.numFmtId=o;break}}e.CellXf.push(n);break;case"</xf>":break;case"<alignment":case"<alignment/>":var l={};a.vertical&&(l.vertical=a.vertical),a.horizontal&&(l.horizontal=a.horizontal),a.textRotation!=null&&(l.textRotation=a.textRotation),a.indent&&(l.indent=a.indent),a.wrapText&&(l.wrapText=_r(a.wrapText)),n.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(t&&t.WTF&&!s)throw new Error("unrecognized "+a[0]+" in cellXfs")}})}function nfe(r){var e=[];return e[e.length]=Ee("cellXfs",null),r.forEach(function(t){e[e.length]=Ee("xf",null,t)}),e[e.length]="</cellXfs>",e.length===2?"":(e[0]=Ee("cellXfs",null,{count:e.length-2}).replace("/>",">"),e.join(""))}var sfe=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,n=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,s=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,i=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(o,l,c){var u={};if(!o)return u;o=o.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var f;return(f=o.match(e))&&efe(f,u,c),(f=o.match(s))&&Qhe(f,u,l,c),(f=o.match(n))&&Jhe(f,u,l,c),(f=o.match(i))&&Zhe(f,u,l,c),(f=o.match(t))&&rfe(f,u,c),u}}();function iH(r,e){var t=[fn,Ee("styleSheet",null,{xmlns:L0[0],"xmlns:vt":Tn.vt})],n;return r.SSF&&(n=tfe(r.SSF))!=null&&(t[t.length]=n),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>',(n=nfe(e.cellXfs))&&(t[t.length]=n),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 ife(r,e){var t=r.read_shift(2),n=Fs(r);return[t,n]}function afe(r,e,t){t||(t=fe(6+4*e.length)),t.write_shift(2,r),Gn(e,t);var n=t.length>t.l?t.slice(0,t.l):t;return t.l==null&&(t.l=t.length),n}function ofe(r,e,t){var n={};n.sz=r.read_shift(2)/20;var s=zce(r);s.fItalic&&(n.italic=1),s.fCondense&&(n.condense=1),s.fExtend&&(n.extend=1),s.fShadow&&(n.shadow=1),s.fOutline&&(n.outline=1),s.fStrikeout&&(n.strike=1);var i=r.read_shift(2);switch(i===700&&(n.bold=1),r.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var a=r.read_shift(1);a!=0&&(n.underline=a);var o=r.read_shift(1);o>0&&(n.family=o);var l=r.read_shift(1);switch(l>0&&(n.charset=l),r.l++,n.color=$ce(r),r.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=Fs(r),n}
vendor: 4,109 bytes, line 677
677function lfe(r,e){e||(e=fe(25+4*32)),e.write_shift(2,r.sz*20),Hce(r,e),e.write_shift(2,r.bold?700:400);var t=0;r.vertAlign=="superscript"?t=1:r.vertAlign=="subscript"&&(t=2),e.write_shift(2,t),e.write_shift(1,r.underline||0),e.write_shift(1,r.family||0),e.write_shift(1,r.charset||0),e.write_shift(1,0),jS(r.color,e);var n=0;return r.scheme=="major"&&(n=1),r.scheme=="minor"&&(n=2),e.write_shift(1,n),Gn(r.name,e),e.length>e.l?e.slice(0,e.l):e}var cfe=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],XT,ufe=Ls;function jI(r,e){e||(e=fe(4*3+8*7+16*1)),XT||(XT=gA(cfe));var t=XT[r.patternType];t==null&&(t=40),e.write_shift(4,t);var n=0;if(t!=40)for(jS({auto:1},e),jS({auto:1},e);n<12;++n)e.write_shift(4,0);else{for(;n<4;++n)e.write_shift(4,0);for(;n<12;++n)e.write_shift(4,0)}return e.length>e.l?e.slice(0,e.l):e}function dfe(r,e){var t=r.l+e,n=r.read_shift(2),s=r.read_shift(2);return r.l=t,{ixfe:n,numFmtId:s}}function aH(r,e,t){t||(t=fe(16)),t.write_shift(2,e||0),t.write_shift(2,r.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 n=0;return t.write_shift(1,n),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(1,0),t}function Iv(r,e){return e||(e=fe(10)),e.write_shift(1,0),e.write_shift(1,0),e.write_shift(4,0),e.write_shift(4,0),e}var hfe=Ls;function ffe(r,e){return e||(e=fe(51)),e.write_shift(1,0),Iv(null,e),Iv(null,e),Iv(null,e),Iv(null,e),Iv(null,e),e.length>e.l?e.slice(0,e.l):e}function pfe(r,e){return e||(e=fe(12+4*10)),e.write_shift(4,r.xfId),e.write_shift(2,1),e.write_shift(1,+r.builtinId),e.write_shift(1,0),RS(r.name||"",e),e.length>e.l?e.slice(0,e.l):e}function mfe(r,e,t){var n=fe(2052);return n.write_shift(4,r),RS(e,n),RS(t,n),n.length>n.l?n.slice(0,n.l):n}function gfe(r,e,t){var n={};n.NumberFmt=[];for(var s in Je)n.NumberFmt[s]=Je[s];n.CellXf=[],n.Fonts=[];var i=[],a=!1;return Mu(r,function(l,c,u){switch(u){case 44:n.NumberFmt[l[0]]=l[1],fu(l[1],l[0]);break;case 43:n.Fonts.push(l),l.color.theme!=null&&e&&e.themeElements&&e.themeElements.clrScheme&&(l.color.rgb=DS(e.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:i[i.length-1]==617&&n.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:a=!0;break;case 36:a=!1;break;case 37:i.push(u),a=!0;break;case 38:i.pop(),a=!1;break;default:if(c.T>0)i.push(u);else if(c.T<0)i.pop();else if(!a||t.WTF&&i[i.length-1]!=37)throw new Error("Unexpected record 0x"+u.toString(16))}}),n}function xfe(r,e){if(e){var t=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var s=n[0];s<=n[1];++s)e[s]!=null&&++t}),t!=0&&(xe(r,615,Qo(t)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var s=n[0];s<=n[1];++s)e[s]!=null&&xe(r,44,afe(s,e[s]))}),xe(r,616))}}function vfe(r){var e=1;xe(r,611,Qo(e)),xe(r,43,lfe({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"})),xe(r,612)}function yfe(r){var e=2;xe(r,603,Qo(e)),xe(r,45,jI({patternType:"none"})),xe(r,45,jI({patternType:"gray125"})),xe(r,604)}function wfe(r){var e=1;xe(r,613,Qo(e)),xe(r,46,ffe()),xe(r,614)}function bfe(r){var e=1;xe(r,626,Qo(e)),xe(r,47,aH({numFmtId:0,fontId:0,fillId:0,borderId:0},65535)),xe(r,627)}function _fe(r,e){xe(r,617,Qo(e.length)),e.forEach(function(t){xe(r,47,aH(t,0))}),xe(r,618)}function kfe(r){var e=1;xe(r,619,Qo(e)),xe(r,48,pfe({xfId:0,builtinId:0,name:"Normal"})),xe(r,620)}function Sfe(r){var e=0;xe(r,505,Qo(e)),xe(r,506)}function Efe(r){var e=0;xe(r,508,mfe(e,"TableStyleMedium9","PivotStyleMedium4")),xe(r,509)}function Afe(r,e){var t=Ti();return xe(t,278),xfe(t,r.SSF),vfe(t),yfe(t),wfe(t),bfe(t),_fe(t,e.cellXfs),kfe(t),Sfe(t),Efe(t),xe(t,279),t.end()}var Tfe=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];
vendor: 4,127 bytes, line 677
677function Cfe(r,e,t){e.themeElements.clrScheme=[];var n={};(r[0].match(Bs)||[]).forEach(function(s){var i=rt(s);switch(i[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=i.val;break;case"<a:sysClr":n.rgb=i.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":i[0].charAt(1)==="/"?(e.themeElements.clrScheme[Tfe.indexOf(i[0])]=n,n={}):n.name=i[0].slice(3,i[0].length-1);break;default:if(t&&t.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}})}function Nfe(){}function Pfe(){}var Rfe=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,jfe=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,Ofe=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function Ffe(r,e,t){e.themeElements={};var n;[["clrScheme",Rfe,Cfe],["fontScheme",jfe,Nfe],["fmtScheme",Ofe,Pfe]].forEach(function(s){if(!(n=r.match(s[1])))throw new Error(s[0]+" not found in themeElements");s[2](n,e,t)})}var Dfe=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function oH(r,e){(!r||r.length===0)&&(r=nO());var t,n={};if(!(t=r.match(Dfe)))throw new Error("themeElements not found in theme");return Ffe(t[0],n,e),n.raw=r,n}function nO(r,e){if(e&&e.themeXLSX)return e.themeXLSX;if(r&&typeof r.raw=="string")return r.raw;var t=[fn];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"/>
677',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>
677",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 Mfe(r,e,t){var n=r.l+e,s=r.read_shift(4);if(s!==124226){if(!t.cellStyles){r.l=n;return}var i=r.slice(r.l);r.l=n;var a;try{a=Qz(i,{type:"array"})}catch{return}var o=ua(a,"theme/theme/theme1.xml",!0);if(o)return oH(o,t)}}function Ife(r){return r.read_shift(4)}function Lfe(r){var e={};switch(e.xclrType=r.read_shift(2),e.nTintShade=r.read_shift(2),e.xclrType){case 0:r.l+=4;break;case 1:e.xclrValue=Bfe(r,4);break;case 2:e.xclrValue=U7(r);break;case 3:e.xclrValue=Ife(r);break;case 4:r.l+=4;break}return r.l+=8,e}function Bfe(r,e){return Ls(r,e)}function Ufe(r,e){return Ls(r,e)}function $fe(r){var e=r.read_shift(2),t=r.read_shift(2)-4,n=[e];switch(e){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=Lfe(r);break;case 6:n[1]=Ufe(r,t);break;case 14:case 15:n[1]=r.read_shift(t===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+e+" "+t)}return n}function zfe(r,e){var t=r.l+e;r.l+=2;var n=r.read_shift(2);r.l+=2;for(var s=r.read_shift(2),i=[];s-- >0;)i.push($fe(r,t-r.l));return{ixfe:n,ext:i}}function Hfe(r,e){e.forEach(function(t){switch(t[0]){}})}function Wfe(r,e){return{flags:r.read_shift(4),version:r.read_shift(4),name:Fs(r)}}function Vfe(r){var e=fe(12+2*r.name.length);return e.write_shift(4,r.flags),e.write_shift(4,r.version),Gn(r.name,e),e.slice(0,e.l)}function Gfe(r){for(var e=[],t=r.read_shift(4);t-- >0;)e.push([r.read_shift(4),r.read_shift(4)]);return e}function Kfe(r){var e=fe(4+8*r.length);e.write_shift(4,r.length);for(var t=0;t<r.length;++t)e.write_shift(4,r[t][0]),e.write_shift(4,r[t][1]);return e}function Xfe(r,e){var t=fe(8+2*e.length);return t.write_shift(4,r),Gn(e,t),t.slice(0,t.l)}function Yfe(r){return r.l+=4,r.read_shift(4)!=0}function qfe(r,e){var t=fe(8);return t.write_shift(4,r),t.write_shift(4,1),t}function Zfe(r,e,t){var n={Types:[],Cell:[],Value:[]},s=t||{},i=[],a=!1,o=2;return Mu(r,function(l,c,u){switch(u){case 335:n.Types.push({name:l.name});break;case 51:l.forEach(function(f){o==1?n.Cell.push({type:n.Types[f[0]-1].name,index:f[1]}):o==0&&n.Value.push({type:n.Types[f[0]-1].name,index:f[1]})});break;case 337:o=l?1:0;break;case 338:o=2;break;case 35:i.push(u),a=!0;break;case 36:i.pop(),a=!1;break;default:if(!c.T){if(!a||s.WTF&&i[i.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}}),n}function Jfe(){var r=Ti();
vendor: 4,096 bytes, lines 677-695
677return xe(r,332),xe(r,334,Qo(1)),xe(r,335,Vfe({name:"XLDAPR",version:12e4,flags:3496657072})),xe(r,336),xe(r,339,Xfe(1,"XLDAPR")),xe(r,52),xe(r,35,Qo(514)),xe(r,4096,Qo(0)),xe(r,4097,Va(1)),xe(r,36),xe(r,53),xe(r,340),xe(r,337,qfe(1)),xe(r,51,Kfe([[1,0]])),xe(r,338),xe(r,333),r.end()}function Qfe(r,e,t){var n={Types:[],Cell:[],Value:[]};if(!r)return n;var s=!1,i=2,a;return r.replace(Bs,function(o){var l=rt(o);switch(ac(l[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":n.Types.push({name:l.name});break;case"</metadataType>":break;case"<futureMetadata":for(var c=0;c<n.Types.length;++c)n.Types[c].name==l.name&&(a=n.Types[c]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":i==1?n.Cell.push({type:n.Types[l.t-1].name,index:+l.v}):i==0&&n.Value.push({type:n.Types[l.t-1].name,index:+l.v});break;case"</rc>":break;case"<cellMetadata":i=1;break;case"</cellMetadata>":i=2;break;case"<valueMetadata":i=0;break;case"</valueMetadata>":i=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;case"<rvb":if(!a)break;a.offsets||(a.offsets=[]),a.offsets.push(+l.i);break;default:if(!s&&t.WTF)throw new Error("unrecognized "+l[0]+" in metadata")}return o}),n}function lH(){var r=[fn];return r.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"> 678 <metadataTypes count="1"> 679 <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"/> 680 </metadataTypes> 681 <futureMetadata name="XLDAPR" count="1"> 682 <bk> 683 <extLst> 684 <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"> 685 <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/> 686 </ext> 687 </extLst> 688 </bk> 689 </futureMetadata> 690 <cellMetadata count="1"> 691 <bk> 692 <rc t="1" v="0"/> 693 </bk> 694 </cellMetadata> 695</metadata>`),r.join("")}function epe(r){var e=[];if(!r)return e;var t=1;return(r.match(Bs)||[]).forEach(function(n){var s=rt(n);switch(s[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete s[0],s.i?t=s.i:s.i=t,e.push(s);break}}),e}function tpe(r){var e={};e.i=r.read_shift(4);var t={};t.r=r.read_shift(4),t.c=r.read_shift(4),e.r=Qe(t);var n=r.read_shift(1);return n&2&&(e.l="1"),n&8&&(e.a="1"),e}function rpe(r,e,t){var n=[];return Mu(r,function(i,a,o){switch(o){case 63:n.push(i);break;default:if(!a.T)throw new Error("Unexpected record 0x"+o.toString(16))}}),n}function npe(r,e,t,n){if(!r)return r;var s=n||{},i=!1;Mu(r,function(o,l,c){switch(c){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:i=!0;break;case 36:i=!1;break;default:if(!l.T){if(!i||s.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}},s)}function spe(r,e){if(!r)return"??";var t=(r.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return e["!id"][t].Target}var Pm=1024;function cH(r,e){for(var t=[21600,21600],n=["m0,0l0",t[1],t[0],t[1],t[0],"0xe"].join(","),s=[Ee("xml",null,{"xmlns:v":ia.v,"xmlns:o":ia.o,"xmlns:x":ia.x,"xmlns:mv":ia.mv}).replace(/\/>/,">"),Ee("o:shapelayout",Ee("o:idmap",null,{"v:ext":"edit",data:r}),{"v:ext":"edit"}),Ee("v:shapetype",[Ee("v:stroke",null,{joinstyle:"miter"}),Ee("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:t.join(","),path:n})];Pm<r*1e3;)Pm+=1e3;return e.forEach(function(i){var a=zr(i[0]),o={color2:"#BEFF82",type:"gradient"};o.type=="gradient"&&(o.angle="-180");var l=o.type=="gradient"?Ee("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,c=Ee("v:fill",l,o),u={on:"t",obscured:"t"};
vendor: 5,685 bytes, lines 695-703
695++Pm,s=s.concat(["<v:shape"+F1({id:"_x0000_s"+Pm,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(i[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",c,Ee("v:shadow",null,u),Ee("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",us("x:Anchor",[a.c+1,0,a.r+1,0,a.c+3,20,a.r+5,20].join(",")),us("x:AutoFill","False"),us("x:Row",String(a.r)),us("x:Column",String(a.c)),i[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),s.push("</xml>"),s.join("")}function OI(r,e,t,n){var s=Array.isArray(r),i;e.forEach(function(a){var o=zr(a.ref);if(s?(r[o.r]||(r[o.r]=[]),i=r[o.r][o.c]):i=r[a.ref],!i){i={t:"z"},s?r[o.r][o.c]=i:r[a.ref]=i;var l=Ft(r["!ref"]||"BDWGO1000001:A1");l.s.r>o.r&&(l.s.r=o.r),l.e.r<o.r&&(l.e.r=o.r),l.s.c>o.c&&(l.s.c=o.c),l.e.c<o.c&&(l.e.c=o.c);var c=gt(l);c!==r["!ref"]&&(r["!ref"]=c)}i.c||(i.c=[]);var u={a:a.author,t:a.t,r:a.r,T:t};a.h&&(u.h=a.h);for(var f=i.c.length-1;f>=0;--f){if(!t&&i.c[f].T)return;t&&!i.c[f].T&&i.c.splice(f,1)}if(t&&n){for(f=0;f<n.length;++f)if(u.a==n[f].id){u.a=n[f].name||u.a;break}}i.c.push(u)})}function ipe(r,e){if(r.match(/<(?:\w+:)?comments *\/>/))return[];var t=[],n=[],s=r.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);s&&s[1]&&s[1].split(/<\/\w*:?author>/).forEach(function(a){if(!(a===""||a.trim()==="")){var o=a.match(/<(?:\w+:)?author[^>]*>(.*)/);o&&t.push(o[1])}});var i=r.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return i&&i[1]&&i[1].split(/<\/\w*:?comment>/).forEach(function(a){if(!(a===""||a.trim()==="")){var o=a.match(/<(?:\w+:)?comment[^>]*>/);if(o){var l=rt(o[0]),c={author:l.authorId&&t[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},u=zr(l.ref);if(!(e.sheetRows&&e.sheetRows<=u.r)){var f=a.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),p=!!f&&!!f[1]&&eO(f[1])||{r:"",t:"",h:""};c.r=p.r,p.r=="<t></t>"&&(p.t=p.h=""),c.t=(p.t||"").replace(/\r\n/g,` 696`).replace(/\r/g,` 697`),e.cellHTML&&(c.h=p.h),n.push(c)}}}}),n}function uH(r){var e=[fn,Ee("comments",null,{xmlns:L0[0]})],t=[];return e.push("<authors>"),r.forEach(function(n){n[1].forEach(function(s){var i=Qt(s.a);t.indexOf(i)==-1&&(t.push(i),e.push("<author>"+i+"</author>")),s.T&&s.ID&&t.indexOf("tc="+s.ID)==-1&&(t.push("tc="+s.ID),e.push("<author>tc="+s.ID+"</author>"))})}),t.length==0&&(t.push("SheetJ5"),e.push("<author>SheetJ5</author>")),e.push("</authors>"),e.push("<commentList>"),r.forEach(function(n){var s=0,i=[];if(n[1][0]&&n[1][0].T&&n[1][0].ID?s=t.indexOf("tc="+n[1][0].ID):n[1].forEach(function(l){l.a&&(s=t.indexOf(Qt(l.a))),i.push(l.t||"")}),e.push('<comment ref="'+n[0]+'" authorId="'+s+'"><text>'),i.length<=1)e.push(us("t",Qt(i[0]||"")));else{for(var a=`Comment: 698 `+i[0]+` 699`,o=1;o<i.length;++o)a+=`Reply: 700 `+i[o]+` 701`;e.push(us("t",Qt(a)))}e.push("</text></comment>")}),e.push("</commentList>"),e.length>2&&(e[e.length]="</comments>",e[1]=e[1].replace("/>",">")),e.join("")}function ape(r,e){var t=[],n=!1,s={},i=0;return r.replace(Bs,function(o,l){var c=rt(o);switch(ac(c[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":s={author:c.personId,guid:c.id,ref:c.ref,T:1};break;case"</threadedComment>":s.t!=null&&t.push(s);break;case"<text>":case"<text":i=l+o.length;break;case"</text>":s.t=r.slice(i,l).replace(/\r\n/g,` 702`).replace(/\r/g,` 703`);break;case"<mentions":case"<mentions>":n=!0;break;case"</mentions>":n=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+c[0]+" in threaded comments")}return o}),t}function ope(r,e,t){var n=[fn,Ee("ThreadedComments",null,{xmlns:Tn.TCMNT}).replace(/[\/]>/,">")];return r.forEach(function(s){var i="";(s[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:s[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+t.tcid++).slice(-12)+"}"};o==0?i=l.id:l.parentId=i,a.ID=l.id,a.a&&(l.personId="{54EE7950-7262-4200-6969-"+("000000000000"+e.indexOf(a.a)).slice(-12)+"}"),n.push(Ee("threadedComment",us("text",a.t||""),l))})}),n.push("</ThreadedComments>"),n.join("")}function lpe(r,e){var t=[],n=!1;return r.replace(Bs,function(i){var a=rt(i);switch(ac(a[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":t.push({name:a.displayname,id:a.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+a[0]+" in threaded comments")}return i}),t}function cpe(r){var e=[fn,Ee("personList",null,{xmlns:Tn.TCMNT,"xmlns:x":L0[0]}).replace(/[\/]>/,">")];return r.forEach(function(t,n){e.push(Ee("person",null,{displayName:t,id:"{54EE7950-7262-4200-6969-"+("000000000000"+n).slice(-12)+"}",userId:t,providerId:"None"}))}),e.push("</personList>"),e.join("")}function upe(r){var e={};e.iauthor=r.read_shift(4);var t=z0(r);return e.rfx=t.s,e.ref=Qe(t.s),r.l+=16,e}function dpe(r,e){return e==null&&(e=fe(36)),e.write_shift(4,r[1].iauthor),pv(r[0],e),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e}var hpe=Fs;function fpe(r){return Gn(r.slice(0,54))}function ppe(r,e){var t=[],n=[],s={},i=!1;return Mu(r,function(o,l,c){switch(c){case 632:n.push(o);break;case 635:s=o;break;case 637:s.t=o.t,s.h=o.h,s.r=o.r;break;case 636:if(s.author=n[s.iauthor],delete s.iauthor,e.sheetRows&&s.rfx&&e.sheetRows<=s.rfx.r)break;
703s.t||(s.t=""),delete s.rfx,t.push(s);break;case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!i||e.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}}),t}function mpe(r){var e=Ti(),t=[];return xe(e,628),xe(e,630),r.forEach(function(n){n[1].forEach(function(s){t.indexOf(s.a)>-1||(t.push(s.a.slice(0,54)),xe(e,632,fpe(s.a)))})}),xe(e,631),xe(e,633),r.forEach(function(n){n[1].forEach(function(s){s.iauthor=t.indexOf(s.a);var i={s:zr(n[0]),e:zr(n[0])};xe(e,635,dpe([i,s])),s.t&&s.t.length>0&&xe(e,637,Ice(s)),xe(e,636),delete s.iauthor})}),xe(e,634),xe(e,629),e.end()}var gpe="application/vnd.ms-office.vbaProject";function xpe(r){var e=Ke.utils.cfb_new({root:"R"});return r.FullPaths.forEach(function(t,n){if(!(t.slice(-1)==="/"||!t.match(/_VBA_PROJECT_CUR/))){var s=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");Ke.utils.cfb_add(e,s,r.FileIndex[n].content)}}),Ke.write(e)}function vpe(r,e){e.FullPaths.forEach(function(t,n){if(n!=0){var s=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");s.slice(-1)!=="/"&&Ke.utils.cfb_add(r,s,e.FileIndex[n].content)}})}var dH=["xlsb","xlsm","xlam","biff8","xla"];function ype(){return{"!type":"dialog"}}function wpe(){return{"!type":"dialog"}}function bpe(){return{"!type":"macro"}}function _pe(){return{"!type":"macro"}}
703var Gm=function(){var r=/(^|[^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(n,s,i,a){var o=!1,l=!1;i.length==0?l=!0:i.charAt(0)=="["&&(l=!0,i=i.slice(1,-1)),a.length==0?o=!0:a.charAt(0)=="["&&(o=!0,a=a.slice(1,-1));var c=i.length>0?parseInt(i,10)|0:0,u=a.length>0?parseInt(a,10)|0:0;return o?u+=e.c:--u,l?c+=e.r:--c,s+(o?"":"$")+$r(u)+(l?"":"$")+hn(c)}return function(s,i){return e=i,s.replace(r,t)}}(),sO=/(^|[^._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,iO=function(){return function(e,t){return e.replace(sO,function(n,s,i,a,o,l){var c=Vj(a)-(i?0:t.c),u=Wj(l)-(o?0:t.r),f=u==0?"":o?u+1:"["+u+"]",p=c==0?"":i?c+1:"["+c+"]";return s+"R"+f+"C"+p})}}();function hH(r,e){return r.replace(sO,function(t,n,s,i,a,o){return n+(s=="$"?s+i:$r(Vj(i)+e.c))+(a=="$"?a+o:hn(Wj(o)+e.r))})}function kpe(r,e,t){var n=Ci(e),s=n.s,i=zr(t),a={r:i.r-s.r,c:i.c-s.c};return hH(r,a)}function Spe(r){return r.length!=1}function FI(r){return r.replace(/_xlfn\./g,"")}function mn(r){r.l+=1}function Wh(r,e){var t=r.read_shift(2);return[t&16383,t>>14&1,t>>15&1]}function fH(r,e,t){var n=2;if(t){if(t.biff>=2&&t.biff<=5)return pH(r);
vendor: 1,331 bytes, line 703
703t.biff==12&&(n=4)}var s=r.read_shift(n),i=r.read_shift(n),a=Wh(r),o=Wh(r);return{s:{r:s,c:a[0],cRel:a[1],rRel:a[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function pH(r){var e=Wh(r),t=Wh(r),n=r.read_shift(1),s=r.read_shift(1);return{s:{r:e[0],c:n,cRel:e[1],rRel:e[2]},e:{r:t[0],c:s,cRel:t[1],rRel:t[2]}}}function Epe(r,e,t){if(t.biff<8)return pH(r);var n=r.read_shift(t.biff==12?4:2),s=r.read_shift(t.biff==12?4:2),i=Wh(r),a=Wh(r);return{s:{r:n,c:i[0],cRel:i[1],rRel:i[2]},e:{r:s,c:a[0],cRel:a[1],rRel:a[2]}}}function mH(r,e,t){if(t&&t.biff>=2&&t.biff<=5)return Ape(r);var n=r.read_shift(t&&t.biff==12?4:2),s=Wh(r);return{r:n,c:s[0],cRel:s[1],rRel:s[2]}}function Ape(r){var e=Wh(r),t=r.read_shift(1);return{r:e[0],c:t,cRel:e[1],rRel:e[2]}}function Tpe(r){var e=r.read_shift(2),t=r.read_shift(2);return{r:e,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function Cpe(r,e,t){var n=t&&t.biff?t.biff:8;if(n>=2&&n<=5)return Npe(r);var s=r.read_shift(n>=12?4:2),i=r.read_shift(2),a=(i&16384)>>14,o=(i&32768)>>15;if(i&=16383,o==1)for(;s>524287;)s-=1048576;if(a==1)for(;i>8191;)i=i-16384;return{r:s,c:i,cRel:a,rRel:o}}function Npe(r){var e=r.read_shift(2),t=r.read_shift(1),n=(e&32768)>>15,s=(e&16384)>>14;return e&=16383,n==1&&e>=8192&&(e=e-16384),s==1&&t>=128&&(t=t-256),{r:e,c:t,cRel:s,rRel:n}}function Ppe(r,e,t){var n=(r[r.l++]&96)>>
7035,s=fH(r,t.biff>=2&&t.biff<=5?6:8,t);return[n,s]}function Rpe(r,e,t){var n=(r[r.l++]&96)>>5,s=r.read_shift(2,"i"),i=8;if(t)switch(t.biff){case 5:r.l+=12,i=6;break;case 12:i=12;break}var a=fH(r,i,t);return[n,s,a]}function jpe(r,e,t){var n=(r[r.l++]&96)>>5;return r.l+=t&&t.biff>8?12:t.biff<8?6:8,[n]}function Ope(r,e,t){var n=(r[r.l++]&96)>>5,s=r.read_shift(2),i=8;if(t)switch(t.biff){case 5:r.l+=12,i=6;break;case 12:i=12;break}return r.l+=i,[n,s]}function Fpe(r,e,t){var n=(r[r.l++]&96)>>5,s=Epe(r,e-1,t);return[n,s]}function Dpe(r,e,t){var n=(r[r.l++]&96)>>5;return r.l+=t.biff==2?6:t.biff==12?14:7,[n]}function DI(r){var e=r[r.l+1]&1,t=1;return r.l+=4,[e,t]}function Mpe(r,e,t){r.l+=2;for(var n=r.read_shift(t&&t.biff==2?1:2),s=[],i=0;i<=n;++i)s.push(r.read_shift(t&&t.biff==2?1:2));return s}function Ipe(r,e,t){var n=r[r.l+1]&255?1:0;return r.l+=2,[n,r.read_shift(t&&t.biff==2?1:2)]}function Lpe(r,e,t){var n=r[r.l+1]&255?1:0;return r.l+=2,[n,r.read_shift(t&&t.biff==2?1:2)]}function Bpe(r){var e=r[r.l+1]&255?1:0;return r.l+=2,[e,r.read_shift(2)]}function Upe(r,e,t){var n=r[r.l+1]&255?1:0;return r.l+=t&&t.biff==2?3:4,[n]}function gH(r){var e=r.read_shift(1),t=r.read_shift(1);return[e,t]}function $pe(r){return r.read_shift(2),gH(r)}function zpe(r){return r.read_shift(2),gH(r)}function Hpe(r,e,t){var n=(r[r.l]&96)>>5;r.l+=1;var s=mH(r,0,t);return[n,s]}function Wpe(r,e,t){var n=(r[r.l]&96)>>5;r.l+=1;var s=Cpe(r,0,t);return[n,s]}function Vpe(r,e,t){var n=(r[r.l]&96)>>5;r.l+=1;var s=r.read_shift(2);t&&t.biff==5&&(r.l+=12);var i=mH(r,0,t);return[n,s,i]}function Gpe(r,e,t){var n=(r[r.l]&96)>>5;r.l+=1;var s=r.read_shift(t&&t.biff<=3?1:2);return[Y0e[s],yH[s],n]}function Kpe(r,e,t){var n=r[r.l++],s=r.read_shift(1),i=t&&t.biff<=3?[n==88?-1:0,r.read_shift(1)]:Xpe(r);return[s,(i[0]===0?yH:X0e)[i[1]]]}function Xpe(r){return[r[r.l+1]>>7,r.read_shift(2)&32767]}function Ype(r,e,t){r.l+=t&&t.biff==2?3:4}function qpe(r,e,t){if(r.l++,t&&t.biff==12)return[r.read_shift(4,"i"),0];var n=r.read_shift(2),s=r.read_shift(t&&t.biff==2?1:2);return[n,s]}function Zpe(r){return r.l++,Iu[r.read_shift(1)]}function Jpe(r){return r.l++,r.read_shift(2)}function Qpe(r){return r.l++,r.read_shift(1)!==0}function e0e(r){return r.l++,js(r)}function t0e(r,e,t){return r.l++,t_(r,e-1,t)}function r0e(r,e){var t=[r.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]=an(r,1)?"TRUE":"FALSE",e!=12&&(r.l+=7);break;case 37:case 16:t[1]=Iu[r[r.l]],r.l+=e==12?4:8;break;case 0:r.l+=8;break;case 1:t[1]=js(r);break;case 2:t[1]=H0(r,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function n0e(r,e,t){for(var n=r.read_shift(t.biff==12?4:2),s=[],i=0;i!=n;++i)s.push((t.biff==12?z0:yA)(r));return s}function s0e(r,e,t){var n=0,s=0;t.biff==12?(n=r.read_shift(4),s=r.read_shift(4)):(s=1+r.read_shift(1),n=1+r.read_shift(2)),t.biff>=2&&t.biff<8&&(--n,--s==0&&(s=256));for(var i=0,a=[];i!=n&&(a[i]=[]);++i)for(var o=0;o!=s;++o)a[i][o]=r0e(r,t.biff);return a}function i0e(r,e,t){var n=r.read_shift(1)>>>5&3,s=!t||t.biff>=8?4:2,i=r.read_shift(s);switch(t.biff){case 2:r.l+=5;break;case 3:case 4:r.l+=8;break;case 5:r.l+=12;break}return[n,0,i]}function a0e(r,e,t){if(t.biff==5)return o0e(r);var n=r.read_shift(1)>>>5&3,s=r.read_shift(2),i=r.read_shift(4);return[n,s,i]}function o0e(r){var e=r.read_shift(1)>>>5&3,t=r.read_shift(2,"i");r.l+=8;var n=r.read_shift(2);return r.l+=12,[e,t,n]}function l0e(r,e,t){var n=r.read_shift(1)>>>5&3;r.l+=t&&t.biff==2?3:4;var s=r.read_shift(t&&t.biff==2?1:2);return[n,s]}function c0e(r,e,t){var n=r.read_shift(1)>>>5&3,s=r.read_shift(t&&t.biff==2?1:2);return[n,s]}function u0e(r,e,t){var n=r.read_shift(1)>>>5&3;return r.l+=4,t.biff<8&&r.l--,t.biff==12&&(r.l+=2),[n]}function d0e(r,e,t){var n=(r[r.l++]&96)>>5,s=r.read_shift(2),i=4;if(t)switch(t.biff){case 5:i=15;break;case 12:i=6;break}return r.l+=i,[n,s]}var h0e=Ls,f0e=Ls,p0e=Ls;function n_(r,e,t){return r.l+=2,[Tpe(r)]}function aO(r){return r.l+=6,[]}var m0e=n_,g0e=aO,x0e=aO,v0e=n_;function xH(r){return r.l+=2,[yn(r),r.read_shift(2)&1]}var y0e=n_,w0e=xH,b0e=aO,_0e=n_,k0e=n_,S0e=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function E0e(r){r.l+=2;var e=r.read_shift(2),t=r.read_shift(2),n=r.read_shift(4),s=r.read_shift(2),i=r.read_shift(2),a=S0e[t>>2&31];return{ixti:e,coltype:t&3,rt:a,idx:n,c:s,C:i}}function A0e(r){return r.l+=2,[r.read_shift(4)]}function T0e(r,e,t){return r.l+=5,r.l+=2,r.l+=t.biff==2?1:4,["PTGSHEET"]}function C0e(r,e,t){return r.l+=t.biff==2?4:5,["PTGENDSHEET"]}function N0e(r){var e=r.read_shift(1)>>>5&3,t=r.read_shift(2);return[e,t]}function P0e(r){var e=r.read_shift(1)>>>5&3,t=r.read_shift(2);return[e,t]}function R0e(r){return r.l+=4,[0,0]}var MI={1:{n:"PtgExp",f:qpe},2:{n:"PtgTbl",f:p0e},3:{n:"PtgAdd",f:mn},4:{n:"PtgSub",f:mn},5:{n:"PtgMul",f:mn},6:{n:"PtgDiv",f:mn},7:{n:"PtgPower",f:mn},8:{n:"PtgConcat",f:mn},9:{n:"PtgLt",f:mn},10:{n:"PtgLe",f:mn},11:{n:"PtgEq",f:mn},12:{n:"PtgGe",f:mn},13:{n:"PtgGt",f:mn},14:{n:"PtgNe",f:mn},15:{n:"PtgIsect",f:mn},16:{n:"PtgUnion",f:mn},17:{n:"PtgRange",f:mn},18:{n:"PtgUplus",f:mn},19:{n:"PtgUminus",f:mn},20:{n:"PtgPercent",f:mn},21:{n:"PtgParen",f:mn},22:{n:"PtgMissArg",f:mn},23:{n:"PtgStr",f:t0e},26:{n:"PtgSheet",f:T0e},27:{n:"PtgEndSheet",f:C0e},28:{n:"PtgErr",f:Zpe},29:{n:"PtgBool",f:Qpe},30:{n:"PtgInt",f:Jpe},31:{n:"PtgNum",f:e0e},32:{n:"PtgArray",f:Dpe}
vendor: 9,509 bytes, line 703
703,33:{n:"PtgFunc",f:Gpe},34:{n:"PtgFuncVar",f:Kpe},35:{n:"PtgName",f:i0e},36:{n:"PtgRef",f:Hpe},37:{n:"PtgArea",f:Ppe},38:{n:"PtgMemArea",f:l0e},39:{n:"PtgMemErr",f:h0e},40:{n:"PtgMemNoMem",f:f0e},41:{n:"PtgMemFunc",f:c0e},42:{n:"PtgRefErr",f:u0e},43:{n:"PtgAreaErr",f:jpe},44:{n:"PtgRefN",f:Wpe},45:{n:"PtgAreaN",f:Fpe},46:{n:"PtgMemAreaN",f:N0e},47:{n:"PtgMemNoMemN",f:P0e},57:{n:"PtgNameX",f:a0e},58:{n:"PtgRef3d",f:Vpe},59:{n:"PtgArea3d",f:Rpe},60:{n:"PtgRefErr3d",f:d0e},61:{n:"PtgAreaErr3d",f:Ope},255:{}},j0e={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},O0e={1:{n:"PtgElfLel",f:xH},2:{n:"PtgElfRw",f:_0e},3:{n:"PtgElfCol",f:m0e},6:{n:"PtgElfRwV",f:k0e},7:{n:"PtgElfColV",f:v0e},10:{n:"PtgElfRadical",f:y0e},11:{n:"PtgElfRadicalS",f:b0e},13:{n:"PtgElfColS",f:g0e},15:{n:"PtgElfColSV",f:x0e},16:{n:"PtgElfRadicalLel",f:w0e},25:{n:"PtgList",f:E0e},29:{n:"PtgSxName",f:A0e},255:{}},F0e={0:{n:"PtgAttrNoop",f:R0e},1:{n:"PtgAttrSemi",f:Upe},2:{n:"PtgAttrIf",f:Lpe},4:{n:"PtgAttrChoose",f:Mpe},8:{n:"PtgAttrGoto",f:Ipe},16:{n:"PtgAttrSum",f:Ype},32:{n:"PtgAttrBaxcel",f:DI},33:{n:"PtgAttrBaxcel",f:DI},64:{n:"PtgAttrSpace",f:$pe},65:{n:"PtgAttrSpaceSemi",f:zpe},128:{n:"PtgAttrIfError",f:Bpe},255:{}};function s_(r,e,t,n){if(n.biff<8)return Ls(r,e);for(var s=r.l+e,i=[],a=0;a!==t.length;++a)switch(t[a][0]){case"PtgArray":t[a][1]=s0e(r,0,n),i.push(t[a][1]);break;case"PtgMemArea":t[a][2]=n0e(r,t[a][1],n),i.push(t[a][2]);break;case"PtgExp":n&&n.biff==12&&(t[a][1][1]=r.read_shift(4),i.push(t[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[a][0]}return e=s-r.l,e!==0&&i.push(Ls(r,e)),i}function i_(r,e,t){for(var n=r.l+e,s,i,a=[];n!=r.l;)e=n-r.l,i=r[r.l],s=MI[i]||MI[j0e[i]],(i===24||i===25)&&(s=(i===24?O0e:F0e)[r[r.l+1]]),!s||!s.f?Ls(r,e):a.push([s.n,s.f(r,e,t)]);return a}function D0e(r){for(var e=[],t=0;t<r.length;++t){for(var n=r[t],s=[],i=0;i<n.length;++i){var a=n[i];if(a)switch(a[0]){case 2:s.push('"'+a[1].replace(/"/g,'""')+'"');break;default:s.push(a[1])}else s.push("")}e.push(s.join(","))}return e.join(";")}var M0e={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function I0e(r,e){if(!r&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(r)?"'"+r+"'":r}function vH(r,e,t){if(!r)return"SH33TJSERR0";if(t.biff>8&&(!r.XTI||!r.XTI[e]))return r.SheetNames[e];if(!r.XTI)return"SH33TJSERR6";var n=r.XTI[e];if(t.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":r.XTI[e-1];if(!n)return"SH33TJSERR1";var s="";if(t.biff>8)switch(r[n[0]][0]){case 357:return s=n[1]==-1?"#REF":r.SheetNames[n[1]],n[1]==n[2]?s:s+":"+r.SheetNames[n[2]];case 358:return t.SID!=null?r.SheetNames[t.SID]:"SH33TJSSAME"+r[n[0]][0];case 355:default:return"SH33TJSSRC"+r[n[0]][0]}switch(r[n[0]][0][0]){case 1025:return s=n[1]==-1?"#REF":r.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?s:s+":"+r.SheetNames[n[2]];case 14849:return r[n[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return r[n[0]][0][3]?(s=n[1]==-1?"#REF":r[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?s:s+":"+r[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function II(r,e,t){var n=vH(r,e,t);return n=="#REF"?n:I0e(n,t)}function Ns(r,e,t,n,s){var i=s&&s.biff||8,a={s:{c:0,r:0},e:{c:0,r:0}},o=[],l,c,u,f=0,p=0,m,x="";if(!r[0]||!r[0][0])return"";for(var g=-1,y="",v=0,w=r[0].length;v<w;++v){var b=r[0][v];switch(b[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(),g>=0){switch(r[0][g][1][0]){case 0:y=tn(" ",r[0][g][1][1]);break;case 1:y=tn("\r",r[0][g][1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+r[0][g][1][0])}c=c+y,g=-1}o.push(c+M0e[b[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":u=Fy(b[1][1],a,s),o.push(Dy(u,i));break;case"PtgRefN":u=t?Fy(b[1][1],t,s):b[1][1],o.push(Dy(u,i));break;case"PtgRef3d":f=b[1][1],u=Fy(b[1][2],a,s),x=II(n,f,s),o.push(x+"!"+Dy(u,i));break;case"PtgFunc":case"PtgFuncVar":var _=b[1][0],T=b[1][1];_||(_=0),_&=127;var A=_==0?[]:o.slice(-_);o.length-=_,T==="User"&&(T=A.shift()),o.push(T+"("+A.join(",")+")");break;case"PtgBool":o.push(b[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(b[1]);break;case"PtgNum":o.push(String(b[1]));break;case"PtgStr":o.push('"'+b[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(b[1]);break;case"PtgAreaN":m=hI(b[1][1],t?{s:t}:a,s),o.push(WT(m,s));break;case"PtgArea":m=hI(b[1][1],a,s),o.push(WT(m,s));break;case"PtgArea3d":f=b[1][1],m=b[1][2],x=II(n,f,s),o.push(x+"!"+WT(m,s));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":p=b[1][2];var N=(n.names||[])[p-1]||(n[0]||[])[p],k=N?N.Name:"SH33TJSNAME"+String(p);k&&k.slice(0,6)=="_xlfn."&&!s.xlfn&&(k=k.slice(6)),o.push(k);break;case"PtgNameX":var E=b[1][1];p=b[1][2];var P;if(s.biff<=5)E<0&&(E=-E),n[E]&&(P=n[E][p]);else{var O="";if(((n[E]||[])[0]||[])[0]==14849||(((n[E]||[])[0]||[])[0]==1025?n[E][p]&&n[E][p].itab>0&&(O=n.SheetNames[n[E][p].itab-1]+"!"):O=n.SheetNames[p-1]+"!"),n[E]&&n[E][p])O+=n[E][p].Name;else if(n[0]&&n[0][p])O+=n[0][p].Name;else{var D=(vH(n,E,s)||"").split(";;");D[p-1]?O=D[p-1]:O+="SH33TJSERRX"}o.push(O);break}P||(P={Name:"SH33TJSERRY"}),o.push(P.Name);break;case"PtgParen":var H="(",B=")";if(g>=0){switch(y="",r[0][g][1][0]){case 2:H=tn(" ",r[0][g][1][1])+H;break;case 3:H=tn("\r",r[0][g][1][1])+H;break;case 4:B=tn(" ",r[0][g][1][1])+B;break;case 5:B=tn("\r",r[0][g][1][1])+B;break;default:if(s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+r[0][g][1][0])}g=-1}o.push(H+o.pop()+B);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":u={c:b[1][1],r:b[1][0]};var ee={c:t.c,r:t.r};if(n.sharedf[Qe(u)]){var X=n.sharedf[Qe(u)];o.push(Ns(X,a,ee,n,s))}else{var W=!1;for(l=0;l!=n.arrayf.length;++l)if(c=n.arrayf[l],!(u.c<c[0].s.c||u.c>c[0].e.c)&&!(u.r<c[0].s.r||u.r>c[0].e.r)){o.push(Ns(c[1],a,ee,n,s)),W=!0;break}W||o.push(b[1])}break;case"PtgArray":o.push("{"+D0e(b[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":g=v;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"+b[1].idx+"[#"+b[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(b));default:throw new Error("Unrecognized Formula Token: "+String(b))}var Y=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(s.biff!=3&&g>=0&&Y.indexOf(r[0][v][0])==-1){b=r[0][g];var F=!0;switch(b[1][0]){case 4:F=!1;case 0:y=tn(" ",b[1][1]);break;case 5:F=!1;case 1:y=tn("\r",b[1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+b[1][0])}o.push((F?y:"")+o.pop()+(F?"":y)),g=-1}}if(o.length>1&&s.WTF)throw new Error("bad formula stack");return o[0]}function L0e(r,e,t){var n=r.l+e,s=t.biff==2?1:2,i,a=r.read_shift(s);if(a==65535)return[[],Ls(r,e-2)];var o=i_(r,a,t);return e!==a+s&&(i=s_(r,e-a-s,o,t)),r.l=n,[o,i]}function B0e(r,e,t){var n=r.l+e,s=t.biff==2?1:2,i,a=r.read_shift(s);if(a==65535)return[[],Ls(r,e-2)];var o=i_(r,a,t);return e!==a+s&&(i=s_(r,e-a-s,o,t)),r.l=n,[o,i]}function U0e(r,e,t,n){var s=r.l+e,i=i_(r,n,t),a;return s!==r.l&&(a=s_(r,s-r.l,i,t)),[i,a]}function $0e(r,e,t){var n=r.l+e,s,i=r.read_shift(2),a=i_(r,i,t);return i==65535?[[],Ls(r,e-2)]:(e!==i+2&&(s=s_(r,n-i-2,a,t)),[a,s])}function z0e(r){var e;if(uu(r,r.l+6)!==65535)return[js(r),"n"];switch(r[r.l]){case 0:return r.l+=8,["String","s"];case 1:return e=r[r.l+2]===1,r.l+=8,[e,"b"];case 2:return e=r[r.l+2],r.l+=8,[e,"e"];case 3:return r.l+=8,["","s"]}return[]}function H0e(r){if(r==null){var e=fe(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 r=="number")return C0(r);return C0(0)}function YT(r,e,t){var n=r.l+e,s=oc(r);t.biff==2&&++r.l;var i=z0e(r),a=r.read_shift(1);t.biff!=2&&(r.read_shift(1),t.biff>=5&&r.read_shift(4));var o=B0e(r,n-r.l,t);return{cell:s,val:i[0],formula:o,shared:a>>3&1,tt:i[1]}}function W0e(r,e,t,n,s){var i=P0(e,t,s),a=H0e(r.v),o=fe(6),l=33;o.write_shift(2,l),o.write_shift(4,0);for(var c=fe(r.bf.length),u=0;u<r.bf.length;++u)c[u]=r.bf[u];var f=Vn([i,a,o,c]);return f}function wA(r,e,t){var n=r.read_shift(4),s=i_(r,n,t),i=r.read_shift(4),a=i>0?s_(r,i,s,t):null;return[s,a]}var V0e=wA,bA=wA,G0e=wA,K0e=wA,X0e
vendor: 7,369 bytes, line 703
703={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"}
703,yH={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
vendor: 6,643 bytes, line 703
703:"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"},Y0e={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 LI(r){return r.slice(0,3)=="of:"&&(r=r.slice(3)),r.charCodeAt(0)==61&&(r=r.slice(1),r.charCodeAt(0)==61&&(r=r.slice(1))),r=r.replace(/COM\.MICROSOFT\./g,""),r=r.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,t){return t.replace(/\./g,"")}),r=r.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),r.replace(/[;~]/g,",").replace(/\|/g,";")}function q0e(r){var e="of:="+r.replace(sO,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return e.replace(/;/g,"|").replace(/,/g,";")}function qT(r){var e=r.split(":"),t=e[0].split(".")[0];return[t,e[0].split(".")[1]+(e.length>1?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}function Z0e(r){return r.replace(/\./,"!")}var Iy={},Km={},Ly=typeof Map<"u";function oO(r,e,t){var n=0,s=r.length;if(t){if(Ly?t.has(e):Object.prototype.hasOwnProperty.call(t,e)){for(var i=Ly?t.get(e):t[e];n<i.length;++n)if(r[i[n]].t===e)return r.Count++,i[n]}}else for(;n<s;++n)if(r[n].t===e)return r.Count++,n;return r[s]={t:e},r.Count++,r.Unique++,t&&(Ly?(t.has(e)||t.set(e,[]),t.get(e).push(s)):(Object.prototype.hasOwnProperty.call(t,e)||(t[e]=[]),t[e].push(s))),s}function _A(r,e){var t={min:r+1,max:r+1},n=-1;return e.MDW&&(Rs=e.MDW),e.width!=null?t.customWidth=1:e.wpx!=null?n=B1(e.wpx):e.wch!=null&&(n=e.wch),n>-1?(t.width=MS(n),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 f0(r,e){if(r){var t=[.7,.7,.75,.75,.3,.3];e=="xlml"&&(t=[1,1,1,1,.5,.5]),r.left==null&&(r.left=t[0]),r.right==null&&(r.right=t[1]),r.top==null&&(r.top=t[2]),r.bottom==null&&(r.bottom=t[3]),r.header==null&&(r.header=t[4]),r.footer==null&&(r.footer=t[5])}}function tf(r,e,t){var n=t.revssf[e.z!=null?e.z:"General"],s=60,i=r.length;if(n==null&&t.ssf){for(;s<392;++s)if(t.ssf[s]==null){fu(e.z,s),t.ssf[s]=e.z,t.revssf[e.z]=n=s;break}}for(s=0;s!=i;++s)if(r[s].numFmtId===n)return s;return r[i]={numFmtId:n,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function wH(r,e,t,n,s,i){try{n.cellNF&&(r.z=Je[e])}catch(o){if(n.WTF)throw o}if(!(r.t==="z"&&!n.cellStyles)){if(r.t==="d"&&typeof r.v=="string"&&(r.v=Er(r.v)),(!n||n.cellText!==!1)&&r.t!=="z")try{if(Je[e]==null&&fu(Xle[e]||"General",e),r.t==="e")r.w=r.w||Iu[r.v];
vendor: 5,548 bytes, line 703
703else if(e===0)if(r.t==="n")(r.v|0)===r.v?r.w=r.v.toString(10):r.w=j1(r.v);else if(r.t==="d"){var a=Rn(r.v);(a|0)===a?r.w=a.toString(10):r.w=j1(a)}else{if(r.v===void 0)return"";r.w=A0(r.v,Km)}else r.t==="d"?r.w=io(e,Rn(r.v),Km):r.w=io(e,r.v,Km)}catch(o){if(n.WTF)throw o}if(n.cellStyles&&t!=null)try{r.s=i.Fills[t],r.s.fgColor&&r.s.fgColor.theme&&!r.s.fgColor.rgb&&(r.s.fgColor.rgb=DS(s.themeElements.clrScheme[r.s.fgColor.theme].rgb,r.s.fgColor.tint||0),n.WTF&&(r.s.fgColor.raw_rgb=s.themeElements.clrScheme[r.s.fgColor.theme].rgb)),r.s.bgColor&&r.s.bgColor.theme&&(r.s.bgColor.rgb=DS(s.themeElements.clrScheme[r.s.bgColor.theme].rgb,r.s.bgColor.tint||0),n.WTF&&(r.s.bgColor.raw_rgb=s.themeElements.clrScheme[r.s.bgColor.theme].rgb))}catch(o){if(n.WTF&&i.Fills)throw o}}}function J0e(r,e,t){if(r&&r["!ref"]){var n=Ft(r["!ref"]);if(n.e.c<n.s.c||n.e.r<n.s.r)throw new Error("Bad range ("+t+"): "+r["!ref"])}}function Q0e(r,e){var t=Ft(e);t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0&&(r["!ref"]=gt(t))}var eme=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,tme=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,rme=/<(?:\w:)?hyperlink [^>]*>/mg,nme=/"(\w*:\w*)"/,sme=/<(?:\w:)?col\b[^>]*[\/]?>/g,ime=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,ame=/<(?:\w:)?pageMargins[^>]*\/>/g,bH=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,ome=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,lme=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function cme(r,e,t,n,s,i,a){if(!r)return r;n||(n={"!id":{}});var o=e.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",f=r.match(tme);f?(c=r.slice(0,f.index),u=r.slice(f.index+f[0].length)):c=u=r;var p=c.match(bH);p?lO(p[0],o,s,t):(p=c.match(ome))&&dme(p[0],p[1]||"",o,s,t);var m=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(m>0){var x=c.slice(m,m+50).match(nme);x&&Q0e(o,x[1])}var g=c.match(lme);g&&g[1]&&Sme(g[1],s);var y=[];if(e.cellStyles){var v=c.match(sme);v&&yme(y,v)}f&&Tme(f[1],o,e,l,i,a);var w=u.match(ime);w&&(o["!autofilter"]=bme(w[0]));var b=[],_=u.match(eme);if(_)for(m=0;m!=_.length;++m)b[m]=Ft(_[m].slice(_[m].indexOf('"')+1));var T=u.match(rme);T&&gme(o,T,n);var A=u.match(ame);if(A&&(o["!margins"]=xme(rt(A[0]))),!o["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(o["!ref"]=gt(l)),e.sheetRows>0&&o["!ref"]){var N=Ft(o["!ref"]);e.sheetRows<=+N.e.r&&(N.e.r=e.sheetRows-1,N.e.r>l.e.r&&(N.e.r=l.e.r),N.e.r<N.s.r&&(N.s.r=N.e.r),N.e.c>l.e.c&&(N.e.c=l.e.c),N.e.c<N.s.c&&(N.s.c=N.e.c),o["!fullref"]=o["!ref"],o["!ref"]=gt(N))}return y.length>0&&(o["!cols"]=y),b.length>0&&(o["!merges"]=b),o}function ume(r){if(r.length===0)return"";for(var e='<mergeCells count="'+r.length+'">',t=0;t!=r.length;++t)e+='<mergeCell ref="'+gt(r[t])+'"/>';return e+"</mergeCells>"}function lO(r,e,t,n){var s=rt(r);t.Sheets[n]||(t.Sheets[n]={}),s.codeName&&(t.Sheets[n].CodeName=Rt(lr(s.codeName)))}function dme(r,e,t,n,s){lO(r.slice(0,r.indexOf(">")),t,n,s)}function hme(r,e,t,n,s){var i=!1,a={},o=null;if(n.bookType!=="xlsx"&&e.vbaraw){var l=e.SheetNames[t];try{e.Workbook&&(l=e.Workbook.Sheets[t].CodeName||l)}catch{}i=!0,a.codeName=Kl(Qt(l))}if(r&&r["!outline"]){var c={summaryBelow:1,summaryRight:1};r["!outline"].above&&(c.summaryBelow=0),r["!outline"].left&&(c.summaryRight=0),o=(o||"")+Ee("outlinePr",null,c)}!i&&!o||(s[s.length]=Ee("sheetPr",o,a))}var fme=["objects","scenarios","selectLockedCells","selectUnlockedCells"],pme=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function mme(r){var e={sheet:1};return fme.forEach(function(t){r[t]!=null&&r[t]&&(e[t]="1")}),pme.forEach(function(t){r[t]!=null&&!r[t]&&(e[t]="0")}),r.password&&(e.password=tO(r.password).toString(16).toUpperCase()),Ee("sheetProtection",null,e)}function gme(r,e,t){for(var n=Array.isArray(r),s=0;s!=e.length;++s){var i=rt(lr(e[s]),!0);if(!i.ref)return;var a=((t||{})["!id"]||[])[i.id];a?(i.Target=a.Target,i.location&&(i.Target+="#"+Rt(i.location))):(i.Target="#"+Rt(i.location),a={Target:i.Target,TargetMode:"Internal"}),i.Rel=a,i.tooltip&&(i.Tooltip=i.tooltip,delete i.tooltip);for(var o=Ft(i.ref),l=o.s.r;l<=o.e.r;++l)for(var c=o.s.c;c<=o.e.c;++c){var u=Qe({c,r:l});n?(r[l]||(r[l]=[]),r[l][c]||(r[l][c]={t:"z",v:void 0}),r[l][c].l=i):(r[u]||(r[u]={t:"z",v:void 0}),r[u].l=i)}}}function xme(r){var e={};return["left","right","top","bottom","header","footer"].forEach(function(t){r[t]&&(e[t]=parseFloat(r[t]))}),e}function vme(r){return f0(r),Ee("pageMargins",null,r)}function yme(r,e){for(var t=!1,n=0;n!=e.length;++n){var s=rt(e[n],!0);s.hidden&&(s.hidden=_r(s.hidden));var i=parseInt(s.min,10)-1,a=parseInt(s.max,10)-1;for(s.outlineLevel&&(s.level=+s.outlineLevel||0),delete s.min,delete s.max,s.width=+s.width,!t&&s.width&&(t=!0,rO(s.width)),Hh(s);i<=a;)r[i++]=Ar(s)}}function wme(r,e){for(var t=["<cols>"],n,s=0;s!=e.length;++s)(n=e[s])&&(t[t.length]=Ee("col",null,_A(s,n)));return t[t.length]="</cols>",t.join("")}function bme(r){var e={ref:(r.match(/ref="([^"]*)"/)||[])[1]};return e}function _me(r,e,t,n){var s=typeof r.ref=="string"?r.ref:gt(r.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var i=t.Workbook.Names,a=Ci(s);a.s.r==a.e.r&&(a.e.r=Ci(e["!ref"]).e.r,s=gt(a));for(var o=0;o<i.length;++o){var l=i[o];if(l.Name=="_xlnm._FilterDatabase"&&l.Sheet==n){l.Ref="'"+t.SheetNames[n]+"'!"+s;break}}return o==i.length&&i.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+t.SheetNames[n]+"'!"+s}),Ee("autoFilter",null,{ref:s})}
vendor: 18,853 bytes, lines 703-704
703var kme=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function Sme(r,e){e.Views||(e.Views=[{}]),(r.match(kme)||[]).forEach(function(t,n){var s=rt(t);e.Views[n]||(e.Views[n]={}),+s.zoomScale&&(e.Views[n].zoom=+s.zoomScale),_r(s.rightToLeft)&&(e.Views[n].RTL=!0)})}function Eme(r,e,t,n){var s={workbookViewId:"0"};return(((n||{}).Workbook||{}).Views||[])[0]&&(s.rightToLeft=n.Workbook.Views[0].RTL?"1":"0"),Ee("sheetViews",Ee("sheetView",null,s),{})}function Ame(r,e,t,n){if(r.c&&t["!comments"].push([e,r.c]),r.v===void 0&&typeof r.f!="string"||r.t==="z"&&!r.f)return"";var s="",i=r.t,a=r.v;if(r.t!=="z")switch(r.t){case"b":s=r.v?"1":"0";break;case"n":s=""+r.v;break;case"e":s=Iu[r.v];break;case"d":n&&n.cellDates?s=Er(r.v,-1).toISOString():(r=Ar(r),r.t="n",s=""+(r.v=Rn(Er(r.v)))),typeof r.z>"u"&&(r.z=Je[14]);break;default:s=r.v;break}var o=us("v",Qt(s)),l={r:e},c=tf(n.cellXfs,r,n);switch(c!==0&&(l.s=c),r.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(r.v==null){delete r.t;break}if(r.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(n&&n.bookSST){o=us("v",""+oO(n.Strings,r.v,n.revStrings)),l.t="s";break}l.t="str";break}if(r.t!=i&&(r.t=i,r.v=a),typeof r.f=="string"&&r.f){var u=r.F&&r.F.slice(0,e.length)==e?{t:"array",ref:r.F}:null;o=Ee("f",Qt(r.f),u)+(r.v!=null?o:"")}return r.l&&t["!links"].push([e,r.l]),r.D&&(l.cm=1),Ee("c",o,l)}var Tme=function(){var r=/<(?:\w+:)?c[ \/>]/,e=/<\/(?:\w+:)?row>/,t=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,s=/ref=["']([^"']*)["']/,i=O1("v"),a=O1("f");return function(l,c,u,f,p,m){for(var x=0,g="",y=[],v=[],w=0,b=0,_=0,T="",A,N,k=0,E=0,P,O,D=0,H=0,B=Array.isArray(m.CellXf),ee,X=[],W=[],Y=Array.isArray(c),F=[],J={},ne=!1,I=!!u.sheetStubs,z=l.split(e),M=0,U=z.length;M!=U;++M){g=z[M].trim();var te=g.length;if(te!==0){var re=0;e:for(x=0;x<te;++x)switch(g[x]){case">":if(g[x-1]!="/"){++x;break e}if(u&&u.cellStyles){if(N=rt(g.slice(re,x),!0),k=N.r!=null?parseInt(N.r,10):k+1,E=-1,u.sheetRows&&u.sheetRows<k)continue;J={},ne=!1,N.ht&&(ne=!0,J.hpt=parseFloat(N.ht),J.hpx=qx(J.hpt)),N.hidden=="1"&&(ne=!0,J.hidden=!0),N.outlineLevel!=null&&(ne=!0,J.level=+N.outlineLevel),ne&&(F[k-1]=J)}break;case"<":re=x;break}if(re>=x)break;if(N=rt(g.slice(re,x),!0),k=N.r!=null?parseInt(N.r,10):k+1,E=-1,!(u.sheetRows&&u.sheetRows<k)){f.s.r>k-1&&(f.s.r=k-1),f.e.r<k-1&&(f.e.r=k-1),u&&u.cellStyles&&(J={},ne=!1,N.ht&&(ne=!0,J.hpt=parseFloat(N.ht),J.hpx=qx(J.hpt)),N.hidden=="1"&&(ne=!0,J.hidden=!0),N.outlineLevel!=null&&(ne=!0,J.level=+N.outlineLevel),ne&&(F[k-1]=J)),y=g.slice(x).split(r);for(var se=0;se!=y.length&&y[se].trim().charAt(0)=="<";++se);for(y=y.slice(se),x=0;x!=y.length;++x)if(g=y[x].trim(),g.length!==0){if(v=g.match(t),w=x,b=0,_=0,g="<c "+(g.slice(0,1)=="<"?">":"")+g,v!=null&&v.length===2){for(w=0,T=v[1],b=0;b!=T.length&&!((_=T.charCodeAt(b)-64)<1||_>26);++b)w=26*w+_;--w,E=w}else++E;for(b=0;b!=g.length&&g.charCodeAt(b)!==62;++b);if(++b,N=rt(g.slice(0,b),!0),N.r||(N.r=Qe({r:k-1,c:E})),T=g.slice(b),A={t:""},(v=T.match(i))!=null&&v[1]!==""&&(A.v=Rt(v[1])),u.cellFormula){if((v=T.match(a))!=null&&v[1]!==""){if(A.f=Rt(lr(v[1])).replace(/\r\n/g,` 704`),u.xlfn||(A.f=FI(A.f)),v[0].indexOf('t="array"')>-1)A.F=(T.match(s)||[])[1],A.F.indexOf(":")>-1&&X.push([Ft(A.F),A.F]);else if(v[0].indexOf('t="shared"')>-1){O=rt(v[0]);var ie=Rt(lr(v[1]));u.xlfn||(ie=FI(ie)),W[parseInt(O.si,10)]=[O,ie,N.r]}}else(v=T.match(/<f[^>]*\/>/))&&(O=rt(v[0]),W[O.si]&&(A.f=kpe(W[O.si][1],W[O.si][2],N.r)));var ae=zr(N.r);for(b=0;b<X.length;++b)ae.r>=X[b][0].s.r&&ae.r<=X[b][0].e.r&&ae.c>=X[b][0].s.c&&ae.c<=X[b][0].e.c&&(A.F=X[b][1])}if(N.t==null&&A.v===void 0)if(A.f||A.F)A.v=0,A.t="n";else if(I)A.t="z";else continue;else A.t=N.t||"n";switch(f.s.c>E&&(f.s.c=E),f.e.c<E&&(f.e.c=E),A.t){case"n":if(A.v==""||A.v==null){if(!I)continue;A.t="z"}else A.v=parseFloat(A.v);break;case"s":if(typeof A.v>"u"){if(!I)continue;A.t="z"}else P=Iy[parseInt(A.v,10)],A.v=P.t,A.r=P.r,u.cellHTML&&(A.h=P.h);break;case"str":A.t="s",A.v=A.v!=null?lr(A.v):"",u.cellHTML&&(A.h=Uj(A.v));break;case"inlineStr":v=T.match(n),A.t="s",v!=null&&(P=eO(v[1]))?(A.v=P.t,u.cellHTML&&(A.h=P.h)):A.v="";break;case"b":A.v=_r(A.v);break;case"d":u.cellDates?A.v=Er(A.v,1):(A.v=Rn(Er(A.v,1)),A.t="n");break;case"e":(!u||u.cellText!==!1)&&(A.w=A.v),A.v=k7[A.v];break}if(D=H=0,ee=null,B&&N.s!==void 0&&(ee=m.CellXf[N.s],ee!=null&&(ee.numFmtId!=null&&(D=ee.numFmtId),u.cellStyles&&ee.fillId!=null&&(H=ee.fillId))),wH(A,D,H,u,p,m),u.cellDates&&B&&A.t=="n"&&dv(Je[D])&&(A.t="d",A.v=vA(A.v)),N.cm&&u.xlmeta){var ge=(u.xlmeta.Cell||[])[+N.cm-1];ge&&ge.type=="XLDAPR"&&(A.D=!0)}if(Y){var G=zr(N.r);c[G.r]||(c[G.r]=[]),c[G.r][G.c]=A}else c[N.r]=A}}}}F.length>0&&(c["!rows"]=F)}}();function Cme(r,e,t,n){var s=[],i=[],a=Ft(r["!ref"]),o="",l,c="",u=[],f=0,p=0,m=r["!rows"],x=Array.isArray(r),g={r:c},y,v=-1;for(p=a.s.c;p<=a.e.c;++p)u[p]=$r(p);for(f=a.s.r;f<=a.e.r;++f){for(i=[],c=hn(f),p=a.s.c;p<=a.e.c;++p){l=u[p]+c;var w=x?(r[f]||[])[p]:r[l];w!==void 0&&(o=Ame(w,l,r,e))!=null&&i.push(o)}(i.length>0||m&&m[f])&&(g={r:c},m&&m[f]&&(y=m[f],y.hidden&&(g.hidden=1),v=-1,y.hpx?v=U1(y.hpx):y.hpt&&(v=y.hpt),v>-1&&(g.ht=v,g.customHeight=1),y.level&&(g.outlineLevel=y.level)),s[s.length]=Ee("row",i.join(""),g))}if(m)for(;f<m.length;++f)m&&m[f]&&(g={r:f+1},y=m[f],y.hidden&&(g.hidden=1),v=-1,y.hpx?v=U1(y.hpx):y.hpt&&(v=y.hpt),v>-1&&(g.ht=v,g.customHeight=1),y.level&&(g.outlineLevel=y.level),s[s.length]=Ee("row","",g));return s.join("")}function _H(r,e,t,n){var s=[fn,Ee("worksheet",null,{xmlns:L0[0],"xmlns:r":Tn.r})],i=t.SheetNames[r],a=0,o="",l=t.Sheets[i];l==null&&(l={});var c=l["!ref"]||"A1",u=Ft(c);if(u.e.c>16383||u.e.r>1048575){if(e.WTF)throw new Error("Range "+c+" exceeds format limit A1:XFD1048576");u.e.c=Math.min(u.e.c,16383),u.e.r=Math.min(u.e.c,1048575),c=gt(u)}n||(n={}),l["!comments"]=[];var f=[];hme(l,t,r,e,s),s[s.length]=Ee("dimension",null,{ref:c}),s[s.length]=Eme(l,e,r,t),e.sheetFormat&&(s[s.length]=Ee("sheetFormatPr",null,{defaultRowHeight:e.sheetFormat.defaultRowHeight||"16",baseColWidth:e.sheetFormat.baseColWidth||"10",outlineLevelRow:e.sheetFormat.outlineLevelRow||"7"})),l["!cols"]!=null&&l["!cols"].length>0&&(s[s.length]=wme(l,l["!cols"])),s[a=s.length]="<sheetData/>",l["!links"]=[],l["!ref"]!=null&&(o=Cme(l,e),o.length>0&&(s[s.length]=o)),s.length>a+1&&(s[s.length]="</sheetData>",s[a]=s[a].replace("/>",">")),l["!protect"]&&(s[s.length]=mme(l["!protect"])),l["!autofilter"]!=null&&(s[s.length]=_me(l["!autofilter"],l,t,r)),l["!merges"]!=null&&l["!merges"].length>0&&(s[s.length]=ume(l["!merges"]));var p=-1,m,x=-1;return l["!links"].length>0&&(s[s.length]="<hyperlinks>",l["!links"].forEach(function(g){g[1].Target&&(m={ref:g[0]},g[1].Target.charAt(0)!="#"&&(x=qt(n,-1,Qt(g[1].Target).replace(/#.*$/,""),kt.HLINK),m["r:id"]="rId"+x),(p=g[1].Target.indexOf("#"))>-1&&(m.location=Qt(g[1].Target.slice(p+1))),g[1].Tooltip&&(m.tooltip=Qt(g[1].Tooltip)),s[s.length]=Ee("hyperlink",null,m))}),s[s.length]="</hyperlinks>"),delete l["!links"],l["!margins"]!=null&&(s[s.length]=vme(l["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&(s[s.length]=us("ignoredErrors",Ee("ignoredError",null,{numberStoredAsText:1,sqref:c}))),f.length>0&&(x=qt(n,-1,"../drawings/drawing"+(r+1)+".xml",kt.DRAW),s[s.length]=Ee("drawing",null,{"r:id":"rId"+x}),l["!drawing"]=f),l["!comments"].length>0&&(x=qt(n,-1,"../drawings/vmlDrawing"+(r+1)+".vml",kt.VML),s[s.length]=Ee("legacyDrawing",null,{"r:id":"rId"+x}),l["!legacy"]=x),s.length>1&&(s[s.length]="</worksheet>",s[1]=s[1].replace("/>",">")),s.join("")}function Nme(r,e){var t={},n=r.l+e;t.r=r.read_shift(4),r.l+=4;var s=r.read_shift(2);r.l+=1;var i=r.read_shift(1);return r.l=n,i&7&&(t.level=i&7),i&16&&(t.hidden=!0),i&32&&(t.hpt=s/20),t}function Pme(r,e,t){var n=fe(145),s=(t["!rows"]||[])[r]||{};n.write_shift(4,r),n.write_shift(4,0);var i=320;s.hpx?i=U1(s.hpx)*20:s.hpt&&(i=s.hpt*20),n.write_shift(2,i),n.write_shift(1,0);var a=0;s.level&&(a|=s.level),s.hidden&&(a|=16),(s.hpx||s.hpt)&&(a|=32),n.write_shift(1,a),n.write_shift(1,0);var o=0,l=n.l;n.l+=4;for(var c={r,c:0},u=0;u<16;++u)if(!(e.s.c>u+1<<10||e.e.c<u<<10)){for(var f=-1,p=-1,m=u<<10;m<u+1<<10;++m){c.c=m;var x=Array.isArray(t)?(t[c.r]||[])[c.c]:t[Qe(c)];x&&(f<0&&(f=m),p=m)}f<0||(++o,n.write_shift(4,f),n.write_shift(4,p))}var g=n.l;return n.l=l,n.write_shift(4,o),n.l=g,n.length>n.l?n.slice(0,n.l):n}function Rme(r,e,t,n){var s=Pme(n,t,e);(s.length>17||(e["!rows"]||[])[n])&&xe(r,0,s)}var jme=z0,Ome=pv;function Fme(){}function Dme(r,e){var t={},n=r[r.l];return++r.l,t.above=!(n&64),t.left=!(n&128),r.l+=18,t.name=Lce(r),t}function Mme(r,e,t){t==null&&(t=fe(84+4*r.length));var n=192;e&&(e.above&&(n&=-65),e.left&&(n&=-129)),t.write_shift(1,n);for(var s=1;s<3;++s)t.write_shift(1,0);return jS({auto:1},t),t.write_shift(-4,-1),t.write_shift(-4,-1),v7(r,t),t.slice(0,t.l)}function Ime(r){var e=lo(r);return[e]}function Lme(r,e,t){return t==null&&(t=fe(8)),B0(e,t)}function Bme(r){var e=U0(r);return[e]}function Ume(r,e,t){return t==null&&(t=fe(4)),$0(e,t)}function $me(r){var e=lo(r),t=r.read_shift(1);return[e,t,"b"]}function zme(r,e,t){return t==null&&(t=fe(9)),B0(e,t),t.write_shift(1,r.v?1:0),t}function Hme(r){var e=U0(r),t=r.read_shift(1);return[e,t,"b"]}function Wme(r,e,t){return t==null&&(t=fe(5)),$0(e,t),t.write_shift(1,r.v?1:0),t}function Vme(r){var e=lo(r),t=r.read_shift(1);return[e,t,"e"]}function Gme(r,e,t){return t==null&&(t=fe(9)),B0(e,t),t.write_shift(1,r.v),t}function Kme(r){var e=U0(r),t=r.read_shift(1);return[e,t,"e"]}function Xme(r,e,t){return t==null&&(t=fe(8)),$0(e,t),t.write_shift(1,r.v),t.write_shift(2,0),t.write_shift(1,0),t}function Yme(r){var e=lo(r),t=r.read_shift(4);return[e,t,"s"]}function qme(r,e,t){return t==null&&(t=fe(12)),B0(e,t),t.write_shift(4,e.v),t}function Zme(r){var e=U0(r),t=r.read_shift(4);return[e,t,"s"]}function Jme(r,e,t){return t==null&&(t=fe(8)),$0(e,t),t.write_shift(4,e.v),t}function Qme(r){var e=lo(r),t=js(r);return[e,t,"n"]}function ege(r,e,t){return t==null&&(t=fe(16)),B0(e,t),C0(r.v,t),t}function kH(r){var e=U0(r),t=js(r);return[e,t,"n"]}function tge(r,e,t){return t==null&&(t=fe(12)),$0(e,t),C0(r.v,t),t}function rge(r){var e=lo(r),t=Yj(r);return[e,t,"n"]}function nge(r,e,t){return t==null&&(t=fe(12)),B0(e,t),y7(r.v,t),t}function sge(r){var e=U0(r),t=Yj(r);return[e,t,"n"]}function ige(r,e,t){return t==null&&(t=fe(8)),$0(e,t),y7(r.v,t),t}function age(r){var e=lo(r),t=Gj(r);return[e,t,"is"]}function oge(r){var e=lo(r),t=Fs(r);return[e,t,"str"]}function lge(r,e,t){return t==null&&(t=fe(12+4*r.v.length)),B0(e,t),Gn(r.v,t),t.length>t.l?t.slice(0,t.l):t}function cge(r){var e=U0(r),t=Fs(r);return[e,t,"str"]}function uge(r,e,t){return t==null&&(t=fe(8+4*r.v.length)),$0(e,t),Gn(r.v,t),t.length>t.l?t.slice(0,t.l):t}function dge(r,e,t){var n=r.l+e,s=lo(r);s.r=t["!row"];var i=r.read_shift(1),a=[s,i,"b"];if(t.cellFormula){r.l+=2;var o=bA(r,n-r.l,t);a[3]=Ns(o,null,s,t.supbooks,t)}else r.l=n;return a}function hge(r,e,t){var n=r.l+e,s=lo(r);s.r=t["!row"];var i=r.read_shift(1),a=[s,i,"e"];if(t.cellFormula){r.l+=2;var o=bA(r,n-r.l,t);a[3]=Ns(o,null,s,t.supbooks,t)}else r.l=n;return a}function fge(r,e,t){var n=r.l+e,s=lo(r);s.r=t["!row"];var i=js(r),a=[s,i,"n"];if(t.cellFormula){r.l+=2;var o=bA(r,n-r.l,t);a[3]=Ns(o,null,s,t.supbooks,t)}else r.l=n;return a}function pge(r,e,t){var n=r.l+e,s=lo(r);s.r=t["!row"];var i=Fs(r),a=[s,i,"str"];if(t.cellFormula){r.l+=2;var o=bA(r,n-r.l,t);a[3]=Ns(o,null,s,t.supbooks,t)}else r.l=n;return a}var mge=z0,gge=pv;function xge(r,e){return e==null&&(e=fe(4)),e.write_shift(4,r),e}function vge(r,e){var t=r.l+e,n=z0(r),s=Kj(r),i=Fs(r),a=Fs(r),o=Fs(r);r.l=t;var l={rfx:n,relId:s,loc:i,display:o};return a&&(l.Tooltip=a),l}function yge(r,e){var t=fe(50+4*(r[1].Target.length+(r[1].Tooltip||"").length));pv({s:zr(r[0]),e:zr(r[0])},t),Xj("rId"+e,t);var n=r[1].Target.indexOf("#"),s=n==-1?"":r[1].Target.slice(n+1);return Gn(s||"",t),Gn(r[1].Tooltip||"",t),Gn("",t),t.slice(0,t.l)}function wge(){}function bge(r,e,t){var n=r.l+e,s=w7(r),i=r.read_shift(1),a=[s];if(a[2]=i,t.cellFormula){var o=V0e(r,n-r.l,t);a[1]=o}else r.l=n;return a}function _ge(r,e,t){var n=r.l+e,s=z0(r),i=[s];if(t.cellFormula){var a=K0e(r,n-r.l,t);i[1]=a,r.l=n}else r.l=n;return i}function kge(r,e,t){t==null&&(t=fe(18));var n=_A(r,e);t.write_shift(-4,r),t.write_shift(-4,r),t.write_shift(4,(n.width||10)*256),t.write_shift(4,0);var s=0;return e.hidden&&(s|=1),typeof n.width=="number"&&(s|=2),e.level&&(s|=e.level<<8),t.write_shift(2,s),t}var SH=["left","right","top","bottom","header","footer"];function Sge(r){var e={};return SH.forEach(function(t){e[t]=js(r)}),e}function Ege(r,e){return e==null&&(e=fe(6*8)),f0(r),SH.forEach(function(t){C0(r[t],e)}),e}function Age(r){var e=r.read_shift(2);return r.l+=28,{RTL:e&32}}function Tge(r,e,t){t==null&&(t=fe(30));var n=924;return(((e||{}).Views||[])[0]||{}).RTL&&(n|=32),t.write_shift(2,n),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 Cge(r){var e=fe(24);return e.write_shift(4,4),e.write_shift(4,1),pv(r,e),e}function Nge(r,e){return e==null&&(e=fe(16*4+2)),e.write_shift(2,r.password?tO(r.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,r[t[0]]!=null&&!r[t[0]]?1:0):e.write_shift(4,r[t[0]]!=null&&r[t[0]]?0:1)}),e}function Pge(){}function Rge(){}function jge(r,e,t,n,s,i,a){if(!r)return r;var o=e||{};n||(n={"!id":{}});var l=o.dense?[]:{},c,u={s:{r:2e6,c:2e6},e:{r:0,c:0}},f=!1,p=!1,m,x,g,y,v,w,b,_,T,A=[];o.biff=12,o["!row"]=0;var N=0,k=!1,E=[],P={},O=o.supbooks||s.supbooks||[[]];if(O.sharedf=P,O.arrayf=E,O.SheetNames=s.SheetNames||s.Sheets.map(function(Y){return Y.name}),!o.supbooks&&(o.supbooks=O,s.Names))for(var D=0;D<s.Names.length;++D)O[0][D+1]=s.Names[D];var H=[],B=[],ee=!1;$1[16]={n:"BrtShortReal",f:kH};var X;if(Mu(r,function(F,J,ne){if(!p)switch(ne){case 148:c=F;break;case 0:m=F,o.sheetRows&&o.sheetRows<=m.r&&(p=!0),_=hn(y=m.r),o["!row"]=m.r,(F.hidden||F.hpt||F.level!=null)&&(F.hpt&&(F.hpx=qx(F.hpt)),B[F.r]=F);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(x={t:F[2]},F[2]){case"n":x.v=F[1];break;case"s":b=Iy[F[1]],x.v=b.t,x.r=b.r;break;case"b":x.v=!!F[1];break;case"e":x.v=F[1],o.cellText!==!1&&(x.w=Iu[x.v]);break;case"str":x.t="s",x.v=F[1];break;case"is":x.t="s",x.v=F[1].t;break}if((g=a.CellXf[F[0].iStyleRef])&&wH(x,g.numFmtId,null,o,i,a),v=F[0].c==-1?v+1:F[0].c,o.dense?(l[y]||(l[y]=[]),l[y][v]=x):l[$r(v)+_]=x,o.cellFormula){for(k=!1,N=0;N<E.length;++N){var I=E[N];m.r>=I[0].s.r&&m.r<=I[0].e.r&&v>=I[0].s.c&&v<=I[0].e.c&&(x.F=gt(I[0]),k=!0)}!k&&F.length>3&&(x.f=F[3])}if(u.s.r>m.r&&(u.s.r=m.r),u.s.c>v&&(u.s.c=v),u.e.r<m.r&&(u.e.r=m.r),u.e.c<v&&(u.e.c=v),o.cellDates&&g&&x.t=="n"&&dv(Je[g.numFmtId])){var z=Tf(x.v);z&&(x.t="d",x.v=new Date(z.y,z.m-1,z.d,z.H,z.M,z.S,z.u))}X&&(X.type=="XLDAPR"&&(x.D=!0),X=void 0);break;case 1:case 12:if(!o.sheetStubs||f)break;x={t:"z",v:void 0},v=F[0].c==-1?v+1:F[0].c,o.dense?(l[y]||(l[y]=[]),l[y][v]=x):l[$r(v)+_]=x,u.s.r>m.r&&(u.s.r=m.r),u.s.c>v&&(u.s.c=v),u.e.r<m.r&&(u.e.r=m.r),u.e.c<v&&(u.e.c=v),X&&(X.type=="XLDAPR"&&(x.D=!0),X=void 0);break;case 176:A.push(F);break;case 49:X=((o.xlmeta||{}).Cell||[])[F-1];break;case 494:var M=n["!id"][F.relId];for(M?(F.Target=M.Target,F.loc&&(F.Target+="#"+F.loc),F.Rel=M):F.relId==""&&(F.Target="#"+F.loc),y=F.rfx.s.r;y<=F.rfx.e.r;++y)for(v=F.rfx.s.c;v<=F.rfx.e.c;++v)o.dense?(l[y]||(l[y]=[]),l[y][v]||(l[y][v]={t:"z",v:void 0}),l[y][v].l=F):(w=Qe({c:v,r:y}),l[w]||(l[w]={t:"z",v:void 0}),l[w].l=F);break;case 426:if(!o.cellFormula)break;E.push(F),T=o.dense?l[y][v]:l[$r(v)+_],T.f=Ns(F[1],u,{r:m.r,c:v},O,o),T.F=gt(F[0]);break;case 427:if(!o.cellFormula)break;P[Qe(F[0].s)]=F[1],T=o.dense?l[y][v]:l[$r(v)+_],T.f=Ns(F[1],u,{r:m.r,c:v},O,o);break;case 60:if(!o.cellStyles)break;for(;F.e>=F.s;)H[F.e--]={width:F.w/256,hidden:!!(F.flags&1),level:F.level},ee||(ee=!0,rO(F.w/256)),Hh(H[F.e+1]);break;case 161:l["!autofilter"]={ref:gt(F)};break;case 476:l["!margins"]=F;break;case 147:s.Sheets[t]||(s.Sheets[t]={}),F.name&&(s.Sheets[t].CodeName=F.name),(F.above||F.left)&&(l["!outline"]={above:F.above,left:F.left});break;case 137:s.Views||(s.Views=[{}]),s.Views[0]||(s.Views[0]={}),F.RTL&&(s.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:f=!0;break;case 36:f=!1;break;case 37:f=!0;break;case 38:f=!1;break;default:if(!J.T){if(!f||o.WTF)throw new Error("Unexpected record 0x"+ne.toString(16))}}},o),delete o.supbooks,delete o["!row"],!l["!ref"]&&(u.s.r<2e6||c&&(c.e.r>0||c.e.c>0||c.s.r>0||c.s.c>0))&&(l["!ref"]=gt(c||u)),o.sheetRows&&l["!ref"]){var W=Ft(l["!ref"]);o.sheetRows<=+W.e.r&&(W.e.r=o.sheetRows-1,W.e.r>u.e.r&&(W.e.r=u.e.r),W.e.r<W.s.r&&(W.s.r=W.e.r),W.e.c>u.e.c&&(W.e.c=u.e.c),W.e.c<W.s.c&&(W.s.c=W.e.c),l["!fullref"]=l["!ref"],l["!ref"]=gt(W))}return A.length>0&&(l["!merges"]=A),H.length>0&&(l["!cols"]=H),B.length>0&&(l["!rows"]=B),l}function Oge(r,e,t,n,s,i,a){if(e.v===void 0)return!1;var o="";switch(e.t){case"b":o=e.v?"1":"0";break;case"d":e=Ar(e),e.z=e.z||Je[14],e.v=Rn(Er(e.v)),e.t="n";break;case"n":case"e":o=""+e.v;break;default:o=e.v;break}var l={r:t,c:n};switch(l.s=tf(s.cellXfs,e,s),e.l&&i["!links"].push([Qe(l),e.l]),e.c&&i["!comments"].push([Qe(l),e.c]),e.t){case"s":case"str":return s.bookSST?(o=oO(s.Strings,e.v,s.revStrings),l.t="s",l.v=o,a?xe(r,18,Jme(e,l)):xe(r,7,qme(e,l))):(l.t="str",a?xe(r,17,uge(e,l)):xe(r,6,lge(e,l))),!0;case"n":return e.v==(e.v|0)&&e.v>-1e3&&e.v<1e3?a?xe(r,13,ige(e,l)):xe(r,2,nge(e,l)):a?xe(r,16,tge(e,l)):xe(r,5,ege(e,l)),!0;case"b":return l.t="b",a?xe(r,15,Wme(e,l)):xe(r,4,zme(e,l)),!0;case"e":return l.t="e",a?xe(r,14,Xme(e,l)):xe(r,3,Gme(e,l)),!0}return a?xe(r,12,Ume(e,l)):xe(r,1,Lme(e,l)),!0}function Fge(r,e,t,n){var s=Ft(e["!ref"]||"A1"),i,a="",o=[];xe(r,145);var l=Array.isArray(e),c=s.e.r;e["!rows"]&&(c=Math.max(s.e.r,e["!rows"].length-1));for(var u=s.s.r;u<=c;
704++u){a=hn(u),Rme(r,e,s,u);var f=!1;if(u<=s.e.r)for(var p=s.s.c;p<=s.e.c;++p){u===s.s.r&&(o[p]=$r(p)),i=o[p]+a;var m=l?(e[u]||[])[p]:e[i];if(!m){f=!1;continue}f=Oge(r,m,u,p,n,e,f)}}xe(r,146)}function Dge(r,e){!e||!e["!merges"]||(xe(r,177,xge(e["!merges"].length)),e["!merges"].forEach(function(t){xe(r,176,gge(t))}),xe(r,178))}function Mge(r,e){!e||!e["!cols"]||(xe(r,390),e["!cols"].forEach(function(t,n){t&&xe(r,60,kge(n,t))}),xe(r,391))}function Ige(r,e){!e||!e["!ref"]||(xe(r,648),xe(r,649,Cge(Ft(e["!ref"]))),xe(r,650))}function Lge(r,e,t){e["!links"].forEach(function(n){if(n[1].Target){var s=qt(t,-1,n[1].Target.replace(/#.*$/,""),kt.HLINK);xe(r,494,yge(n,s))}}),delete e["!links"]}function Bge(r,e,t,n){if(e["!comments"].length>0){var s=qt(n,-1,"../drawings/vmlDrawing"+(t+1)+".vml",kt.VML);xe(r,551,Xj("rId"+s)),e["!legacy"]=s}}function Uge(r,e,t,n){if(e["!autofilter"]){var s=e["!autofilter"],i=typeof s.ref=="string"?s.ref:gt(s.ref);t.Workbook||(t.Workbook={Sheets:[]}),t.Workbook.Names||(t.Workbook.Names=[]);var a=t.Workbook.Names,o=Ci(i);o.s.r==o.e.r&&(o.e.r=Ci(e["!ref"]).e.r,i=gt(o));for(var l=0;l<a.length;++l){var c=a[l];if(c.Name=="_xlnm._FilterDatabase"&&c.Sheet==n){c.Ref="'"+t.SheetNames[n]+"'!"+i;break}}l==a.length&&a.push({Name:"_xlnm._FilterDatabase",Sheet:n,Ref:"'"+t.SheetNames[n]+"'!"+i}),xe(r,161,pv(Ft(i))),xe(r,162)}}function $ge(r,e,t){xe(r,133),xe(r,137,Tge(e,t)),xe(r,138),xe(r,134)}function zge(r,e){e["!protect"]&&xe(r,535,Nge(e["!protect"]))}function Hge(r,e,t,n){var s=Ti(),i=t.SheetNames[r],a=t.Sheets[i]||{},o=i;try{t&&t.Workbook&&(o=t.Workbook.Sheets[r].CodeName||o)}catch{}var l=Ft(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"]=[],xe(s,129),(t.vbaraw||a["!outline"])&&xe(s,147,Mme(o,a["!outline"])),xe(s,148,Ome(l)),$ge(s,a,t.Workbook),Mge(s,a),Fge(s,a,r,e),zge(s,a),Uge(s,a,t,r),Dge(s,a),Lge(s,a,n),a["!margins"]&&xe(s,476,Ege(a["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&Ige(s,a),Bge(s,a,r,n),xe(s,130),s.end()}function Wge(r){var e=[],t=r.match(/^<c:numCache>/),n;(r.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(i){var a=i.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);a&&(e[+a[1]]=t?+a[2]:a[2])});var s=Rt((r.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(r.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(i){n=i.replace(/<.*?>/g,"")}),[e,s,n]}function Vge(r,e,t,n,s,i){var a=i||{"!type":"chart"};if(!r)return i;var o=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(r.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(f){var p=Wge(f);u.s.r=u.s.c=0,u.e.c=o,c=$r(o),p[0].forEach(function(m,x){a[c+hn(x)]={t:"n",v:m,z:p[1]},l=x}),u.e.r<l&&(u.e.r=l),++o}),o>0&&(a["!ref"]=gt(u)),a}function Gge(r,e,t,n,s){if(!r)return r;n||(n={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},a,o=r.match(bH);return o&&lO(o[0],i,s,t),(a=r.match(/drawing r:id="(.*?)"/))&&(i["!rel"]=a[1]),n["!id"][i["!rel"]]&&(i["!drawel"]=n["!id"][i["!rel"]]),i}function Kge(r,e){r.l+=10;var t=Fs(r);return{name:t}}function Xge(r,e,t,n,s){if(!r)return r;n||(n={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},a=!1;return Mu(r,function(l,c,u){switch(u){case 550:i["!rel"]=l;break;case 651:s.Sheets[t]||(s.Sheets[t]={}),l.name&&(s.Sheets[t].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:a=!0;break;case 36:a=!1;break;case 37:break;case 38:break;default:if(!(c.T>0)){if(!(c.T<0)){if(!a||e.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}},e),n["!id"][i["!rel"]]&&(i["!drawel"]=n["!id"][i["!rel"]]),i}var cO=[["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"],["showBorder
704UnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],Yge=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],qge=[],Zge=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function BI(r,e){for(var t=0;t!=r.length;++t)for(var n=r[t],s=0;s!=e.length;++s){var i=e[s];if(n[i[0]]==null)n[i[0]]=i[1];else switch(i[2]){case"bool":typeof n[i[0]]=="string"&&(n[i[0]]=_r(n[i[0]]));break;case"int":typeof n[i[0]]=="string"&&(n[i[0]]=parseInt(n[i[0]],10));break}}}function UI(r,e){for(var t=0;t!=e.length;++t){var n=e[t];if(r[n[0]]==null)r[n[0]]=n[1];else switch(n[2]){case"bool":typeof r[n[0]]=="string"&&(r[n[0]]=_r(r[n[0]]));break;case"int":typeof r[n[0]]=="string"&&(r[n[0]]=parseInt(r[n[0]],10));break}}}function EH(r){UI(r.WBProps,cO),UI(r.CalcPr,Zge),BI(r.WBView,Yge),BI(r.Sheets,qge),Km.date1904=_r(r.WBProps.date1904)}function Jge(r){return!r.Workbook||!r.Workbook.WBProps?"false":_r(r.Workbook.WBProps.date1904)?"true":"false"}var Qge="][*?/\\".split("");function AH(r,e){if(r.length>31)throw new Error("Sheet names cannot exceed 31 chars");var t=!0;return Qge.forEach(function(n){if(r.indexOf(n)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),t}function exe(r,e,t){r.forEach(function(n,s){AH(n);for(var i=0;i<s;++i)if(n==r[i])throw new Error("Duplicate Sheet Name: "+n);if(t){var a=e&&e[s]&&e[s].CodeName||n;if(a.charCodeAt(0)==95&&a.length>22)throw new Error("Bad Code Name: Worksheet"+a)}})}function txe(r){if(!r||!r.SheetNames||!r.Sheets)throw new Error("Invalid Workbook");if(!r.SheetNames.length)throw new Error("Workbook is empty");var e=r.Workbook&&r.Workbook.Sheets||[];exe(r.SheetNames,e,!!r.vbaraw);for(var t=0;t<r.SheetNames.length;++t)J0e(r.Sheets[r.SheetNames[t]],r.SheetNames[t],t)}var rxe=/<\w+:workbook/;function nxe(r,e){if(!r)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,s="xmlns",i={},a=0;if(r.replace(Bs,function(l,c){var u=rt(l);switch(ac(u[0])){case"<?xml":break;case"<workbook":l.match(rxe)&&(s="xmlns"+l.match(/<(\w+):/)[1]),t.xmlns=u[s];break;case"</workbook>":break;case"<fileVersion":delete u[0],t.AppVersion=u;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":cO.forEach(function(f){if(u[f[0]]!=null)switch(f[2]){case"bool":t.WBProps[f[0]]=_r(u[f[0]]);break;case"int":t.WBProps[f[0]]=parseInt(u[f[0]],10);break;default:t.WBProps[f[0]]=u[f[0]]}}),u.codeName&&(t.WBProps.CodeName=lr(u.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete u[0],t.WBView.push(u);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(u.state){case"hidden":u.Hidden=1;break;case"veryHidden":u.Hidden=2;break;default:u.Hidden=0}delete u.state,u.name=Rt(lr(u.name)),delete u[0],t.Sheets.push(u);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":n=!0;break;case"</definedNames>":n=!1;break;case"<definedName":i={},i.Name=lr(u.name),u.comment&&(i.Comment=u.comment),u.localSheetId&&(i.Sheet=+u.localSheetId),_r(u.hidden||"0")&&(i.Hidden=!0),a=c+l.length;break;case"</definedName>":i.Ref=Rt(lr(r.slice(a,c))),t.Names.push(i);break;case"<definedName/>":break;case"<calcPr":delete u[0],t.CalcPr=u;break;case"<calcPr/>":delete u[0],t.CalcPr=u;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</AlternateContent>":n=!1;break;case"<revisionPtr":break;default:if(!n&&e.WTF)throw new Error("unrecognized "+u[0]+" in workbook")}return l}),L0.indexOf(t.xmlns)===-1)throw new Error("Unknown Namespace: "+t.xmlns);return EH(t),t}function TH(r){var e=[fn];e[e.length]=Ee("workbook",null,{xmlns:L0[0],"xmlns:r":Tn.r});var t=r.Workbook&&(r.Workbook.Names||[]).length>0,n={codeName:"ThisWorkbook"};r.Workbook&&r.Workbook.WBProps&&(cO.forEach(function(o){r.Workbook.WBProps[o[0]]!=null&&r.Workbook.WBProps[o[0]]!=o[1]&&(n[o[0]]=r.Workbook.WBProps[o[0]])}),r.Workbook.WBProps.CodeName&&(n.codeName=r.Workbook.WBProps.CodeName,delete n.CodeName)),e[e.length]=Ee("workbookPr",null,n);var s=r.Workbook&&r.Workbook.Sheets||[],i=0;if(s&&s[0]&&s[0].Hidden){for(e[e.length]="<bookViews>",i=0;i!=r.SheetNames.length&&!(!s[i]||!s[i].Hidden);++i);i==r.SheetNames.length&&(i=0),e[e.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',e[e.length]="</bookViews>"}for(e[e.length]="<sheets>",i=0;i!=r.SheetNames.length;++i){var a={name:Qt(r.SheetNames[i].slice(0,31))};if(a.sheetId=""+(i+1),a["r:id"]="rId"+(i+1),s[i])switch(s[i].Hidden){case 1:a.state="hidden";break;case 2:a.state="veryHidden";break}e[e.length]=Ee("sheet",null,a)}return e[e.length]="</sheets>",t&&(e[e.length]="<definedNames>
704",r.Workbook&&r.Workbook.Names&&r.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]=Ee("definedName",Qt(o.Ref),l))}),e[e.length]="</definedNames>"),e.length>2&&(e[e.length]="</workbook>",e[1]=e[1].replace("/>",">")),e.join("")}function sxe(r,e){var t={};return t.Hidden=r.read_shift(4),t.iTabID=r.read_shift(4),t.strRelID=wR(r),t.name=Fs(r),t}function ixe(r,e){return e||(e=fe(127)),e.write_shift(4,r.Hidden),e.write_shift(4,r.iTabID),Xj(r.strRelID,e),Gn(r.name.slice(0,31),e),e.length>e.l?e.slice(0,e.l):e}function axe(r,e){var t={},n=r.read_shift(4);t.defaultThemeVersion=r.read_shift(4);var s=e>8?Fs(r):"";return s.length>0&&(t.CodeName=s),t.autoCompressPictures=!!(n&65536),t.backupFile=!!(n&64),t.checkCompatibility=!!(n&4096),t.date1904=!!(n&1),t.filterPrivacy=!!(n&8),t.hidePivotFieldList=!!(n&1024),t.promptedSolutions=!!(n&16),t.publishItems=!!(n&2048),t.refreshAllConnections=!!(n&262144),t.saveExternalLinkValues=!!(n&128),t.showBorderUnselectedTables=!!(n&4),t.showInkAnnotation=!!(n&32),t.showObjects=["all","placeholders","none"][n>>13&3],t.showPivotChartFilter=!!(n&32768),t.updateLinks=["userSet","never","always"][n>>8&3],t}function oxe(r,e){e||(e=fe(72));var t=0;return r&&r.filterPrivacy&&(t|=8),e.write_shift(4,t),e.write_shift(4,0),v7(r&&r.CodeName||"ThisWorkbook",e),e.slice(0,e.l)}function lxe(r,e){var t={};return r.read_shift(4),t.ArchID=r.read_shift(4),r.l+=e-8,t}function cxe(r,e,t){var n=r.l+e;r.l+=4,r.l+=1;var s=r.read_shift(4),i=Bce(r),a=G0e(r,0,t),o=Kj(r);r.l=n;var l={Name:i,Ptg:a};return s<268435455&&(l.Sheet=s),o&&(l.Comment=o),l}function uxe(r,e){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],s=!1;e||(e={}),e.biff=12;var i=[],a=[[]];return a.SheetNames=[],a.XTI=[],$1[16]={n:"BrtFRTArchID$",f:lxe},Mu(r,function(l,c,u){switch(u){case 156:a.SheetNames.push(l.name),t.Sheets.push(l);break;case 153:t.WBProps=l;break;case 39:l.Sheet!=null&&(e.SID=l.Sheet),l.Ref=Ns(l.Ptg,null,null,a,e),delete e.SID,delete l.Ptg,i.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:a[0].length?a.push([u,l]):a[0]=[u,l],a[a.length-1].XTI=[];break;case 362:a.length===0&&(a[0]=[],a[0].XTI=[]),a[a.length-1].XTI=a[a.length-1].XTI.concat(l),a.XTI=a.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:n.push(u),s=!0;break;case 36:n.pop(),s=!1;break;case 37:n.push(u),s=!0;break;case 38:n.pop(),s=!1;break;case 16:break;default:if(!c.T){if(!s||e.WTF&&n[n.length-1]!=37&&n[n.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}},e),EH(t),t.Names=i,t.supbooks=a,t}function dxe(r,e){xe(r,143);for(var t=0;t!=e.SheetNames.length;++t){var n=e.Workbook&&e.Workbook.Sheets&&e.Workbook.Sheets[t]&&e.Workbook.Sheets[t].Hidden||0,s={Hidden:n,iTabID:t+1,strRelID:"rId"+(t+1),name:e.SheetNames[t]};xe(r,156,ixe(s))}xe(r,144)}function hxe(r,e){e||(e=fe(127));for(var t=0;t!=4;++t)e.write_shift(4,0);return Gn("SheetJS",e),Gn(ES.version,e),Gn(ES.version,e),Gn("7262",e),e.length>e.l?e.slice(0,e.l):e}function fxe(r,e){e||(e=fe(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,r),e.write_shift(4,r);var t=120;return e.write_shift(1,t),e.length>e.l?e.slice(0,e.l):e}function pxe(r,e){if(!(!e.Workbook||!e.Workbook.Sheets)){for(var t=e.Workbook.Sheets,n=0,s=-1,i=-1;n<t.length;++n)!t[n]||!t[n].Hidden&&s==-1?s=n:t[n].Hidden==1&&i==-1&&(i=n);i>s||(xe(r,135),xe(r,158,fxe(s)),xe(r,136))}}function mxe(r,e){var t=Ti();return xe(t,131),xe(t,128,hxe()),xe(t,153,oxe(r.Workbook&&r.Workbook.WBProps||null)),pxe(t,r),dxe(t,r),xe(t,132),t.end()}function gxe(r,e,t){return e.slice(-4)===".bin"?uxe(r,t):nxe(r,t)}function xxe(r,e,t,n,s,i,a,o){return e.slice(-4)===".bin"?jge(r,n,t,s,i,a,o):cme
vendor: 13,017 bytes, lines 704-706
704(r,n,t,s,i,a,o)}function vxe(r,e,t,n,s,i,a,o){return e.slice(-4)===".bin"?Xge(r,n,t,s,i):Gge(r,n,t,s,i)}function yxe(r,e,t,n,s,i,a,o){return e.slice(-4)===".bin"?bpe():_pe()}function wxe(r,e,t,n,s,i,a,o){return e.slice(-4)===".bin"?ype():wpe()}function bxe(r,e,t,n){return e.slice(-4)===".bin"?gfe(r,t,n):sfe(r,t,n)}function _xe(r,e,t){return oH(r,t)}function kxe(r,e,t){return e.slice(-4)===".bin"?khe(r,t):whe(r,t)}function Sxe(r,e,t){return e.slice(-4)===".bin"?ppe(r,t):ipe(r,t)}function Exe(r,e,t){return e.slice(-4)===".bin"?rpe(r):epe(r)}function Axe(r,e,t,n){return t.slice(-4)===".bin"?npe(r,e,t,n):void 0}function Txe(r,e,t){return e.slice(-4)===".bin"?Zfe(r,e,t):Qfe(r,e,t)}function Cxe(r,e,t){return(e.slice(-4)===".bin"?mxe:TH)(r)}function Nxe(r,e,t,n,s){return(e.slice(-4)===".bin"?Hge:_H)(r,t,n,s)}function Pxe(r,e,t){return(e.slice(-4)===".bin"?Afe:iH)(r,t)}function Rxe(r,e,t){return(e.slice(-4)===".bin"?Ahe:Z7)(r,t)}function jxe(r,e,t){return(e.slice(-4)===".bin"?mpe:uH)(r)}function Oxe(r){return(r.slice(-4)===".bin"?Jfe:lH)()}var CH=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,NH=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function ho(r,e){var t=r.split(/\s+/),n=[];if(n[0]=t[0],t.length===1)return n;var s=r.match(CH),i,a,o,l;if(s)for(l=0;l!=s.length;++l)i=s[l].match(NH),(a=i[1].indexOf(":"))===-1?n[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(a+1),n[o]=i[2].slice(1,i[2].length-1));return n}function Fxe(r){var e=r.split(/\s+/),t={};if(e.length===1)return t;var n=r.match(CH),s,i,a,o;if(n)for(o=0;o!=n.length;++o)s=n[o].match(NH),(i=s[1].indexOf(":"))===-1?t[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?a="xmlns"+s[1].slice(6):a=s[1].slice(i+1),t[a]=s[2].slice(1,s[2].length-1));return t}var By;function Dxe(r,e){var t=By[r]||Rt(r);return t==="General"?A0(e):io(t,e)}function Mxe(r,e,t,n){var s=n;switch((t[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":s=_r(n);break;case"i2":case"int":s=parseInt(n,10);break;case"r4":case"float":s=parseFloat(n);break;case"date":case"dateTime.tz":s=Er(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+t[0])}r[Rt(e)]=s}function Ixe(r,e,t){if(r.t!=="z"){if(!t||t.cellText!==!1)try{r.t==="e"?r.w=r.w||Iu[r.v]:e==="General"?r.t==="n"?(r.v|0)===r.v?r.w=r.v.toString(10):r.w=j1(r.v):r.w=A0(r.v):r.w=Dxe(e||"General",r.v)}catch(i){if(t.WTF)throw i}try{var n=By[e]||e||"General";if(t.cellNF&&(r.z=n),t.cellDates&&r.t=="n"&&dv(n)){var s=Tf(r.v);s&&(r.t="d",r.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}catch(i){if(t.WTF)throw i}}}function Lxe(r,e,t){if(t.cellStyles&&e.Interior){var n=e.Interior;n.Pattern&&(n.patternType=qhe[n.Pattern]||n.Pattern)}r[e.ID]=e}function Bxe(r,e,t,n,s,i,a,o,l,c){var u="General",f=n.StyleID,p={};c=c||{};var m=[],x=0;for(f===void 0&&o&&(f=o.StyleID),f===void 0&&a&&(f=a.StyleID);i[f]!==void 0&&(i[f].nf&&(u=i[f].nf),i[f].Interior&&m.push(i[f].Interior),!!i[f].Parent);)f=i[f].Parent;switch(t.Type){case"Boolean":n.t="b",n.v=_r(r);break;case"String":n.t="s",n.r=nI(Rt(r)),n.v=r.indexOf("<")>-1?Rt(e||r).replace(/<.*?>/g,""):n.r;break;case"DateTime":r.slice(-1)!="Z"&&(r+="Z"),n.v=(Er(r)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),n.v!==n.v?n.v=Rt(r):n.v<60&&(n.v=n.v-1),(!u||u=="General")&&(u="yyyy-mm-dd");case"Number":n.v===void 0&&(n.v=+r),n.t||(n.t="n");break;case"Error":n.t="e",n.v=k7[r],c.cellText!==!1&&(n.w=r);break;default:r==""&&e==""?n.t="z":(n.t="s",n.v=nI(e||r));break}if(Ixe(n,u,c),c.cellFormula!==!1)if(n.Formula){var g=Rt(n.Formula);g.charCodeAt(0)==61&&(g=g.slice(1)),n.f=Gm(g,s),delete n.Formula,n.ArrayRange=="RC"?n.F=Gm("RC:RC",s):n.ArrayRange&&(n.F=Gm(n.ArrayRange,s),l.push([Ft(n.F),n.F]))}else for(x=0;x<l.length;++x)s.r>=l[x][0].s.r&&s.r<=l[x][0].e.r&&s.c>=l[x][0].s.c&&s.c<=l[x][0].e.c&&(n.F=l[x][1]);c.cellStyles&&(m.forEach(function(y){!p.patternType&&y.patternType&&(p.patternType=y.patternType)}),n.s=p),n.StyleID!==void 0&&(n.ixfe=n.StyleID)}function Uxe(r){r.t=r.v||"",r.t=r.t.replace(/\r\n/g,` 705`).replace(/\r/g,` 706`),r.v=r.w=r.ixfe=void 0}function ZT(r,e){var t=e||{};hv();var n=py($j(r));(t.type=="binary"||t.type=="array"||t.type=="base64")&&(n=lr(n));var s=n.slice(0,1024).toLowerCase(),i=!1;if(s=s.replace(/".*?"/g,""),(s.indexOf(">")&1023)>Math.min(s.indexOf(",")&1023,s.indexOf(";")&1023)){var a=Ar(t);return a.type="string",Yx.to_workbook(n,a)}if(s.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Me){s.indexOf("<"+Me)>=0&&(i=!0)}),i)return Eve(n,t);By={"General Number":"General","General Date":Je[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":Je[15],"Short Date":Je[14],"Long Time":Je[19],"Medium Time":Je[18],"Short Time":Je[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:Je[2],Standard:Je[4],Percent:Je[10],Scientific:Je[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var o,l=[],c,u={},f=[],p=t.dense?[]:{},m="",x={},g={},y=ho('<Data ss:Type="String">'),v=0,w=0,b=0,_={s:{r:2e6,c:2e6},e:{r:0,c:0}},T={},A={},N="",k=0,E=[],P={},O={},D=0,H=[],B=[],ee={},X=[],W,Y=!1,F=[],J=[],ne={},I=0,z=0,M={Sheets:[],WBProps:{date1904:!1}},U={};D1.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"");for(var te="";o=D1.exec(n);)switch(o[3]=(te=o[3]).toLowerCase()){case"data":if(te=="data"){if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break}if(l[l.length-1][1])break;o[1]==="/"?Bxe(n.slice(v,o.index),N,y,l[l.length-1][0]=="comment"?ee:x,{c:w,r:b},T,X[w],g,F,t):(N="",y=ho(o[0]),v=o.index+o[0].length);break;case"cell":if(o[1]==="/")if(B.length>0&&(x.c=B),(!t.sheetRows||t.sheetRows>b)&&x.v!==void 0&&(t.dense?(p[b]||(p[b]=[]),p[b][w]=x):p[$r(w)+hn(b)]=x),x.HRef&&(x.l={Target:Rt(x.HRef)},x.HRefScreenTip&&(x.l.Tooltip=x.HRefScreenTip),delete x.HRef,delete x.HRefScreenTip),(x.MergeAcross||x.MergeDown)&&(I=w+(parseInt(x.MergeAcross,10)|0),z=b+(parseInt(x.MergeDown,10)|0),E.push({s:{c:w,r:b},e:{c:I,r:z}})),!t.sheetStubs)x.MergeAcross?w=I+1:++w;else if(x.MergeAcross||x.MergeDown){for(var re=w;re<=I;++re)for(var se=b;se<=z;++se)(re>w||se>b)&&(t.dense?(p[se]||(p[se]=[]),p[se][re]={t:"z"}):p[$r(re)+hn(se)]={t:"z"});w=I+1}else++w;else x=Fxe(o[0]),x.Index&&(w=+x.Index-1),w<_.s.c&&(_.s.c=w),w>_.e.c&&(_.e.c=w),o[0].slice(-2)==="/>"&&++w,B=[];break;case"row":o[1]==="/"||o[0].slice(-2)==="/>"?(b<_.s.r&&(_.s.r=b),b>_.e.r&&(_.e.r=b),o[0].slice(-2)==="/>"&&(g=ho(o[0]),g.Index&&(b=+g.Index-1)),w=0,++b):(g=ho(o[0]),g.Index&&(b=+g.Index-1),ne={},(g.AutoFitHeight=="0"||g.Height)&&(ne.hpx=parseInt(g.Height,10),ne.hpt=U1(ne.hpx),J[b]=ne),g.Hidden=="1"&&(ne.hidden=!0,J[b]=ne));break;case"worksheet":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"));f.push(m),_.s.r<=_.e.r&&_.s.c<=_.e.c&&(p["!ref"]=gt(_),t.sheetRows&&t.sheetRows<=_.e.r&&(p["!fullref"]=p["!ref"],_.e.r=t.sheetRows-1,p["!ref"]=gt(_))),E.length&&(p["!merges"]=E),X.length>0&&(p["!cols"]=X),J.length>0&&(p["!rows"]=J),u[m]=p}else _={s:{r:2e6,c:2e6},e:{r:0,c:0}},b=w=0,l.push([o[3],!1]),c=ho(o[0]),m=Rt(c.Name),p=t.dense?[]:{},E=[],F=[],J=[],U={name:m,Hidden:0},M.Sheets.push(U);break;case"table":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else{if(o[0].slice(-2)=="/>")break;l.push([o[3],!1]),X=[],Y=!1}break;case"style":o[1]==="/"?Lxe(T,A,t):A=ho(o[0]);break;case"numberformat":A.nf=Rt(ho(o[0]).Format||"General"),By[A.nf]&&(A.nf=By[A.nf]);for(var ie=0;ie!=392&&Je[ie]!=A.nf;++ie);if(ie==392){for(ie=57;ie!=392;++ie)if(Je[ie]==null){fu(A.nf,ie);break}}break;case"column":if(l[l.length-1][0]!=="table")break;if(W=ho(o[0]),W.Hidden&&(W.hidden=!0,delete W.Hidden),W.Width&&(W.wpx=parseInt(W.Width,10)),!Y&&W.wpx>10){Y=!0,Rs=nH;for(var ae=0;ae<X.length;++ae)X[ae]&&Hh(X[ae])}Y&&Hh(W),X[W.Index-1||X.length]=W;for(var ge=0;ge<+W.Span;++ge)X[X.length]=Ar(W);break;case"namedrange":if(o[1]==="/")break;M.Names||(M.Names=[]);var G=rt(o[0]),Ue={Name:G.Name,Ref:Gm(G.RefersTo.slice(1),{r:0,c:0})};M.Sheets.length>0&&(Ue.Sheet=M.Sheets.length-1),M.Names.push(Ue);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(o[0].slice(-2)==="/>")break;o[1]==="/"?N+=n.slice(k,o.index):k=o.index+o[0].length;break;case"interior":if(!t.cellStyles)break;A.Interior=ho(o[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(o[0].slice(-2)==="/>")break;o[1]==="/"?uue(P,te,n.slice(D,o.index)):D=o.index+o[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else l.push([o[3],!1]);break;case"comment":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"));Uxe(ee),B.push(ee)}else l.push([o[3],!1]),c=ho(o[0]),ee={a:c.Author};break;case"autofilter":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/"){var Re=ho(o[0]);p["!autofilter"]={ref:Gm(Re.Range).replace(/\$/g,"")},l.push([o[3],!0])}break;case"name":break;case"datavalidation":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(o[1]==="/"){if((c=l.pop())[0]!==o[3])throw new Error("Bad state: "+c.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break;case"null":break;default:if(l.length==0&&o[3]=="document"||l.length==0&&o[3]=="uof")return VI(n,t);var He=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(o[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:He=!1}break;case"componentoptions":switch(o[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:He=!1}break;case"excelworkbook":switch(o[3]){case"date1904":M.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:He=!1}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:He=!1}break;case"worksheetoptions":switch(o[3]){case"visible":if(o[0].slice(-2)!=="/>")if(o[1]==="/")switch(n.slice(D,o.index)){case"SheetHidden":U.Hidden=1;break;case"SheetVeryHidden":U.Hidden=2;break}else D=o.index+o[0].length;break;case"header":p["!margins"]||f0(p["!margins"]={},"xlml"),isNaN(+rt(o[0]).Margin)||(p["!margins"].header=+rt(o[0]).Margin);break;case"footer":p["!margins"]||f0(p["!margins"]={},"xlml"),isNaN(+rt(o[0]).Margin)||(p["!margins"].footer=+rt(o[0]).Margin);break;case"pagemargins":var Te=rt(o[0]);p["!margins"]||f0(p["!margins"]={},"xlml"),isNaN(+Te.Top)||(p["!margins"].top=+Te.Top),isNaN(+Te.Left)||(p["!margins"].left=+Te.Left),isNaN(+Te.Right)||(p["!margins"].right=+Te.Right),isNaN(+Te.Bottom)||(p["!margins"].bottom=+Te.Bottom);break;
706case"displayrighttoleft":M.Views||(M.Views=[]),M.Views[0]||(M.Views[0]={}),M.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":p["!outline"]||(p["!outline"]={}),p["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:He=!1}break;case"pivottable":case"pivotcache":switch(o[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:He=!1}break;case"pagebreaks":switch(o[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:He=!1}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:He=!1}break;case"querytable":switch(o[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:He=!1}break;case"datavalidation":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;
vendor: 4,593 bytes, line 706
706case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:He=!1}break;case"sorting":case"conditionalformatting":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:He=!1}break;case"mapinfo":case"schema":case"data":switch(o[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:He=!1}break;case"smarttags":break;default:He=!1;break}if(He||o[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+o[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(o[0].slice(-2)==="/>")break;o[1]==="/"?Mxe(O,te,H,n.slice(D,o.index)):(H=o,D=o.index+o[0].length);break}if(t.WTF)throw"Unrecognized tag: "+o[3]+"|"+l.join("|")}var we={};return!t.bookSheets&&!t.bookProps&&(we.Sheets=u),we.SheetNames=f,we.Workbook=M,we.SSF=Ar(Je),we.Props=P,we.Custprops=O,we}function TR(r,e){switch(dO(e=e||{}),e.type||"base64"){case"base64":return ZT(xa(r),e);case"binary":case"buffer":case"file":return ZT(r,e);case"array":return ZT(Qh(r),e)}}function $xe(r,e){var t=[];return r.Props&&t.push(due(r.Props,e)),r.Custprops&&t.push(hue(r.Props,r.Custprops)),t.join("")}function zxe(){return""}function Hxe(r,e){var t=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return e.cellXfs.forEach(function(n,s){var i=[];i.push(Ee("NumberFormat",null,{"ss:Format":Qt(Je[n.numFmtId])}));var a={"ss:ID":"s"+(21+s)};t.push(Ee("Style",i.join(""),a))}),Ee("Styles",t.join(""))}function PH(r){return Ee("NamedRange",null,{"ss:Name":r.Name,"ss:RefersTo":"="+iO(r.Ref,{r:0,c:0})})}function Wxe(r){if(!((r||{}).Workbook||{}).Names)return"";for(var e=r.Workbook.Names,t=[],n=0;n<e.length;++n){var s=e[n];s.Sheet==null&&(s.Name.match(/^_xlfn\./)||t.push(PH(s)))}return Ee("Names",t.join(""))}function Vxe(r,e,t,n){if(!r||!((n||{}).Workbook||{}).Names)return"";for(var s=n.Workbook.Names,i=[],a=0;a<s.length;++a){var o=s[a];o.Sheet==t&&(o.Name.match(/^_xlfn\./)||i.push(PH(o)))}return i.join("")}function Gxe(r,e,t,n){if(!r)return"";var s=[];if(r["!margins"]&&(s.push("<PageSetup>"),r["!margins"].header&&s.push(Ee("Header",null,{"x:Margin":r["!margins"].header})),r["!margins"].footer&&s.push(Ee("Footer",null,{"x:Margin":r["!margins"].footer})),s.push(Ee("PageMargins",null,{"x:Bottom":r["!margins"].bottom||"0.75","x:Left":r["!margins"].left||"0.7","x:Right":r["!margins"].right||"0.7","x:Top":r["!margins"].top||"0.75"})),s.push("</PageSetup>")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[t])if(n.Workbook.Sheets[t].Hidden)s.push(Ee("Visible",n.Workbook.Sheets[t].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<t&&!(n.Workbook.Sheets[i]&&!n.Workbook.Sheets[i].Hidden);++i);i==t&&s.push("<Selected/>")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&s.push("<DisplayRightToLeft/>"),r["!protect"]&&(s.push(us("ProtectContents","True")),r["!protect"].objects&&s.push(us("ProtectObjects","True")),r["!protect"].scenarios&&s.push(us("ProtectScenarios","True")),r["!protect"].selectLockedCells!=null&&!r["!protect"].selectLockedCells?s.push(us("EnableSelection","NoSelection")):r["!protect"].selectUnlockedCells!=null&&!r["!protect"].selectUnlockedCells&&s.push(us("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEac
vendor: 2,663 bytes, line 706
706h(function(a){r["!protect"][a[0]]&&s.push("<"+a[1]+"/>")})),s.length==0?"":Ee("WorksheetOptions",s.join(""),{xmlns:ia.x})}function Kxe(r){return r.map(function(e){var t=pce(e.t||""),n=Ee("ss:Data",t,{xmlns:"http://www.w3.org/TR/REC-html40"});return Ee("Comment",n,{"ss:Author":e.a})}).join("")}function Xxe(r,e,t,n,s,i,a){if(!r||r.v==null&&r.f==null)return"";var o={};if(r.f&&(o["ss:Formula"]="="+Qt(iO(r.f,a))),r.F&&r.F.slice(0,e.length)==e){var l=zr(r.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(r.l&&r.l.Target&&(o["ss:HRef"]=Qt(r.l.Target),r.l.Tooltip&&(o["x:HRefScreenTip"]=Qt(r.l.Tooltip))),t["!merges"])for(var c=t["!merges"],u=0;u!=c.length;++u)c[u].s.c!=a.c||c[u].s.r!=a.r||(c[u].e.c>c[u].s.c&&(o["ss:MergeAcross"]=c[u].e.c-c[u].s.c),c[u].e.r>c[u].s.r&&(o["ss:MergeDown"]=c[u].e.r-c[u].s.r));var f="",p="";switch(r.t){case"z":if(!n.sheetStubs)return"";break;case"n":f="Number",p=String(r.v);break;case"b":f="Boolean",p=r.v?"1":"0";break;case"e":f="Error",p=Iu[r.v];break;case"d":f="DateTime",p=new Date(r.v).toISOString(),r.z==null&&(r.z=r.z||Je[14]);break;case"s":f="String",p=fce(r.v||"");break}var m=tf(n.cellXfs,r,n);o["ss:StyleID"]="s"+(21+m),o["ss:Index"]=a.c+1;var x=r.v!=null?p:"",g=r.t=="z"?"":'<Data ss:Type="'+f+'">'+x+"</Data>";return(r.c||[]).length>0&&(g+=Kxe(r.c)),Ee("Cell",g,o)}function Yxe(r,e){var t='<Row ss:Index="'+(r+1)+'"';return e&&(e.hpt&&!e.hpx&&(e.hpx=qx(e.hpt)),e.hpx&&(t+=' ss:AutoFitHeight="0" ss:Height="'+e.hpx+'"'),e.hidden&&(t+=' ss:Hidden="1"')),t+">"}function qxe(r,e,t,n){if(!r["!ref"])return"";var s=Ft(r["!ref"]),i=r["!merges"]||[],a=0,o=[];r["!cols"]&&r["!cols"].forEach(function(y,v){Hh(y);var w=!!y.width,b=_A(v,y),_={"ss:Index":v+1};w&&(_["ss:Width"]=L1(b.width)),y.hidden&&(_["ss:Hidden"]="1"),o.push(Ee("Column",null,_))});for(var l=Array.isArray(r),c=s.s.r;c<=s.e.r;++c){for(var u=[Yxe(c,(r["!rows"]||[])[c])],f=s.s.c;f<=s.e.c;++f){var p=!1;for(a=0;a!=i.length;++a)if(!(i[a].s.c>f)&&!(i[a].s.r>c)&&!(i[a].e.c<f)&&!(i[a].e.r<c)){(i[a].s.c!=f||i[a].s.r!=c)&&(p=!0);break}if(!p){var m={r:c,c:f},x=Qe(m),g=l?(r[c]||[])[f]:r[x];u.push(Xxe(g,x,r,e,t,n,m))}}u.push("</Row>"),u.length>2&&o.push(u.join(""))}return o.join("")}function Zxe(r,e,t){var n=[],s=t.SheetNames[r],i=t.Sheets[s],a=i?Vxe(i,e,r,t):"";return a.length>0&&n.push("<Names>"+a+"</Names>"),a=i?qxe(i,e,r,t):"",a.length>0&&n.push("<Table>"+a+"</Table>"),n.push(Gxe(i,e,r,t)),n.join("")}function Jxe(r,e){e||(e={}),r.SSF||(r.SSF=Ar(Je)),r.SSF&&(hv(),mA(r.SSF),e.revssf=xA(r.SSF),e.revssf[r.SSF[65535]]=0,e.ssf=r.SSF,e.cellXfs=[],tf(e.cellXfs,{},{revssf:{General:0}}));var t=[];
vendor: 7,358 bytes, line 706
706t.push($xe(r,e)),t.push(zxe()),t.push(""),t.push("");for(var n=0;n<r.SheetNames.length;++n)t.push(Ee("Worksheet",Zxe(n,e,r),{"ss:Name":Qt(r.SheetNames[n])}));return t[2]=Hxe(r,e),t[3]=Wxe(r),fn+Ee("Workbook",t.join(""),{xmlns:ia.ss,"xmlns:o":ia.o,"xmlns:x":ia.x,"xmlns:ss":ia.ss,"xmlns:dt":ia.dt,"xmlns:html":ia.html})}function Qxe(r){var e={},t=r.content;if(t.l=28,e.AnsiUserType=t.read_shift(0,"lpstr-ansi"),e.AnsiClipboardFormat=Wce(t),t.length-t.l<=4)return e;var n=t.read_shift(4);if(n==0||n>40||(t.l-=4,e.Reserved1=t.read_shift(0,"lpstr-ansi"),t.length-t.l<=4)||(n=t.read_shift(4),n!==1907505652)||(e.UnicodeClipboardFormat=Vce(t),n=t.read_shift(4),n==0||n>40))return e;t.l-=4,e.Reserved2=t.read_shift(0,"lpwstr")}var eve=[60,1084,2066,2165,2175];function tve(r,e,t,n,s){var i=n,a=[],o=t.slice(t.l,t.l+i);if(s&&s.enc&&s.enc.insitu&&o.length>0)switch(r){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:s.enc.insitu(o)}a.push(o),t.l+=i;for(var l=uu(t,t.l),c=CR[l],u=0;c!=null&&eve.indexOf(l)>-1;)i=uu(t,t.l+2),u=t.l+4,l==2066?u+=4:(l==2165||l==2175)&&(u+=12),o=t.slice(u,t.l+4+i),a.push(o),t.l+=4+i,c=CR[l=uu(t,t.l)];var f=Vn(a);cs(f,0);var p=0;f.lens=[];for(var m=0;m<a.length;++m)f.lens.push(p),p+=a[m].length;if(f.length<n)throw"XLS Record 0x"+r.toString(16)+" Truncated: "+f.length+" < "+n;return e.f(f,f.length,s)}function ul(r,e,t){if(r.t!=="z"&&r.XF){var n=0;try{n=r.z||r.XF.numFmtId||0,e.cellNF&&(r.z=Je[n])}catch(i){if(e.WTF)throw i}if(!e||e.cellText!==!1)try{r.t==="e"?r.w=r.w||Iu[r.v]:n===0||n=="General"?r.t==="n"?(r.v|0)===r.v?r.w=r.v.toString(10):r.w=j1(r.v):r.w=A0(r.v):r.w=io(n,r.v,{date1904:!!t,dateNF:e&&e.dateNF})}catch(i){if(e.WTF)throw i}if(e.cellDates&&n&&r.t=="n"&&dv(Je[n]||String(n))){var s=Tf(r.v);s&&(r.t="d",r.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}}function uk(r,e,t){return{v:r,ixfe:e,t}}function rve(r,e){var t={opts:{}},n={},s=e.dense?[]:{},i={},a={},o=null,l=[],c="",u={},f,p="",m,x,g,y,v={},w=[],b,_,T=[],A=[],N={Sheets:[],WBProps:{date1904:!1},Views:[{}]},k={},E=function(it){return it<8?u0[it]:it<64&&A[it-8]||u0[it]},P=function(it,$t,dr){var Gt=$t.XF.data;if(!(!Gt||!Gt.patternType||!dr||!dr.cellStyles)){$t.s={},$t.s.patternType=Gt.patternType;var Yn;(Yn=I1(E(Gt.icvFore)))&&($t.s.fgColor={rgb:Yn}),(Yn=I1(E(Gt.icvBack)))&&($t.s.bgColor={rgb:Yn})}},O=function(it,$t,dr){if(!(ne>1)&&!(dr.sheetRows&&it.r>=dr.sheetRows)){if(dr.cellStyles&&$t.XF&&$t.XF.data&&P(it,$t,dr),delete $t.ixfe,delete $t.XF,f=it,p=Qe(it),(!a||!a.s||!a.e)&&(a={s:{r:0,c:0},e:{r:0,c:0}}),it.r<a.s.r&&(a.s.r=it.r),it.c<a.s.c&&(a.s.c=it.c),it.r+1>a.e.r&&(a.e.r=it.r+1),it.c+1>a.e.c&&(a.e.c=it.c+1),dr.cellFormula&&$t.f){for(var Gt=0;Gt<w.length;++Gt)if(!(w[Gt][0].s.c>it.c||w[Gt][0].s.r>it.r)&&!(w[Gt][0].e.c<it.c||w[Gt][0].e.r<it.r)){$t.F=gt(w[Gt][0]),(w[Gt][0].s.c!=it.c||w[Gt][0].s.r!=it.r)&&delete $t.f,$t.f&&($t.f=""+Ns(w[Gt][1],a,it,F,D));break}}dr.dense?(s[it.r]||(s[it.r]=[]),s[it.r][it.c]=$t):s[p]=$t}},D={enc:!1,sbcch:0,snames:[],sharedf:v,arrayf:w,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!e&&!!e.cellStyles,WTF:!!e&&!!e.wtf};e.password&&(D.password=e.password);var H,B=[],ee=[],X=[],W=[],Y=!1,F=[];F.SheetNames=D.snames,F.sharedf=D.sharedf,F.arrayf=D.arrayf,F.names=[],F.XTI=[];var J=0,ne=0,I=0,z=[],M=[],U;D.codepage=1200,Uo(1200);for(var te=!1;r.l<r.length-1;){var re=r.l,se=r.read_shift(2);if(se===0&&J===10)break;var ie=r.l===r.length?0:r.read_shift(2),ae=CR[se];if(ae&&ae.f){if(e.bookSheets&&J===133&&se!==133)break;if(J=se,ae.r===2||ae.r==12){var ge=r.read_shift(2);if(ie-=2,!D.enc&&ge!==se&&((ge&255)<<8|ge>>8)!==se)throw new Error("rt mismatch: "+ge+"!="+se);ae.r==12&&(r.l+=10,ie-=10)}var G={};if(se===10?G=ae.f(r,ie,D):G=tve(se,ae,r,ie,D),ne==0&&[9,521,1033,2057].indexOf(J)===-1)continue;switch(se){case 34:t.opts.Date1904=N.WBProps.date1904=G;break;case 134:t.opts.WriteProtect=!0;break;case 47:if(D.enc||(r.l=0),D.enc=G,!e.password)throw new Error("File is password-protected");if(G.valid==null)throw new Error("Encryption scheme unsupported");if(!G.valid)throw new Error("Password is incorrect");break;case 92:D.lastuser=G;break;case 66:var Ue=Number(G);switch(Ue){case 21010:Ue=1200;break;case 32768:Ue=1e4;break;case 32769:Ue=1252;break}Uo(D.codepage=Ue),te=!0;break;case 317:D.rrtabid=G;break;case 25:D.winlocked=G;break;case 439:t.opts.RefreshAll=G;break;case 12:t.opts.CalcCount=G;break;case 16:t.opts.CalcDelta=G;break;case 17:t.opts.CalcIter=G;break;case 13:t.opts.CalcMode=G;break;case 14:t.opts.CalcPrecision=G;break;case 95:t.opts.CalcSaveRecalc=G;break;case 15:D.CalcRefMode=G;break;case 2211:t.opts.FullCalc=G;break;case 129:G.fDialog&&(s["!type"]="dialog"),G.fBelow||((s["!outline"]||(s["!outline"]={})).above=!0),G.fRight||((s["!outline"]||(s["!outline"]={})).left=!0);break;case 224:T.push(G);break;case 430:F.push([G]),F[F.length-1].XTI=[];break;case 35:case 547:F[F.length-1].push(G);break;case 24:case 536:U={Name:G.Name,Ref:Ns(G.rgce,a,null,F,D)},G.itab>0&&(U.Sheet=G.itab-1),F.names.push(U),F[0]||(F[0]=[],F[0].XTI=[]),F[F.length-1].push(G),G.Name=="_xlnm._FilterDatabase"&&G.itab>0&&G.rgce&&G.rgce[0]&&G.rgce[0][0]&&G.rgce[0][0][0]=="PtgArea3d"&&(M[G.itab-1]={ref:gt(G.rgce[0][0][1][2])});break;case 22:D.ExternCount=G;break;case 23:F.length==0&&(F[0]=[],F[0].XTI=[]),F[F.length-1].XTI=F[F.length-1].XTI.concat(G),F.XTI=F.XTI.concat(G);break;case 2196:if(D.biff<8)break;U!=null&&(U.Comment=G[1]);break;case 18:s["!protect"]=G;break;case 19:G!==0&&D.WTF&&console.error("Password verifier: "+G);break;case 133:i[G.pos]=G,D.snames.push(G.name);break;case 10:{if(--ne)break;if(a.e){if(a.e.r>0&&a.e.c>0){if(a.e.r--,a.e.c--,s["!ref"]=gt(a),e.sheetRows&&e.sheetRows<=a.e.r){var Re=a.e.r;a.e.r=e.sheetRows-1,s["!fullref"]=s["!ref"],s["!ref"]=gt(a),a.e.r=Re}a.e.r++,a.e.c++}B.length>0&&(s["!merges"]=B),ee.length>0&&(s["!objects"]=ee),X.length>0&&(s["!cols"]=X),W.length>0&&(s["!rows"]=W),N.Sheets.push(k)}c===""?u=s:n[c]=s,s=e.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(D.biff===8&&(D.biff={9:2,521:3,1033:4}[se]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[G.BIFFVer]||8),D.biffguess=G.BIFFVer==0,G.BIFFVer==0&&G.dt==4096&&(D.biff=5,te=!0,Uo(D.codepage=28591)),D.biff==8&&G.BIFFVer==0&&G.dt==16&&(D.biff=2),ne++)break;if(s=e.dense?[]:{},D.biff<8&&!te&&(te=!0,Uo(D.codepage=e.codepage||1252)),D.biff<5||G.BIFFVer==0&&G.dt==4096){c===""&&(c="Sheet1"),a={s:{r:0,c:0},e:{r:0,c:0}};var He={pos:r.l-ie,name:c};i[He.pos]=He,D.snames.push(c)}else c=(i[re]||{name:""}).name;G.dt==32&&(s["!type"]="chart"),G.dt==64&&(s["!type"]="macro"),B=[],ee=[],D.arrayf=w=[],X=[],W=[],Y=!1,k={Hidden:(i[re]||{hs:0}).hs,name:c}}break;case 515:case 3:case 2:s["!type"]=="chart"&&(e.dense?(s[G.r]||[])[G.c]:s[Qe({c:G.c,r:G.r})])&&++G.c,b={ixfe:G.ixfe,XF:T[G.ixfe]||{},v:G.val,t:"n"},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e);break;case 5:case 517:b={ixfe:G.ixfe,XF:T[G.ixfe],v:G.val,t:G.t},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e);break;case 638:b={ixfe:G.ixfe,XF:T[G.ixfe],v:G.rknum,t:"n"},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e);break;case 189:for(var Te=G.c;Te<=G.C;++Te){var we=G.rkrec[Te-G.c][0];b={ixfe:we,XF:T[we],v:G.rkrec[Te-G.c][1],t:"n"},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:Te,r:G.r},b,e)}
vendor: 19,799 bytes, line 706
706break;case 6:case 518:case 1030:{if(G.val=="String"){o=G;break}if(b=uk(G.val,G.cell.ixfe,G.tt),b.XF=T[b.ixfe],e.cellFormula){var Me=G.formula;if(Me&&Me[0]&&Me[0][0]&&Me[0][0][0]=="PtgExp"){var at=Me[0][0][1][0],Tr=Me[0][0][1][1],pe=Qe({r:at,c:Tr});v[pe]?b.f=""+Ns(G.formula,a,G.cell,F,D):b.F=((e.dense?(s[at]||[])[Tr]:s[pe])||{}).F}else b.f=""+Ns(G.formula,a,G.cell,F,D)}I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O(G.cell,b,e),o=G}break;case 7:case 519:if(o)o.val=G,b=uk(G,o.cell.ixfe,"s"),b.XF=T[b.ixfe],e.cellFormula&&(b.f=""+Ns(o.formula,a,o.cell,F,D)),I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O(o.cell,b,e),o=null;else throw new Error("String record expects Formula");break;case 33:case 545:{w.push(G);var je=Qe(G[0].s);if(m=e.dense?(s[G[0].s.r]||[])[G[0].s.c]:s[je],e.cellFormula&&m){if(!o||!je||!m)break;m.f=""+Ns(G[1],a,G[0],F,D),m.F=gt(G[0])}}break;case 1212:{if(!e.cellFormula)break;if(p){if(!o)break;v[Qe(o.cell)]=G[0],m=e.dense?(s[o.cell.r]||[])[o.cell.c]:s[Qe(o.cell)],(m||{}).f=""+Ns(G[0],a,f,F,D)}}break;case 253:b=uk(l[G.isst].t,G.ixfe,"s"),l[G.isst].h&&(b.h=l[G.isst].h),b.XF=T[b.ixfe],I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e);break;case 513:e.sheetStubs&&(b={ixfe:G.ixfe,XF:T[G.ixfe],t:"z"},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e));break;case 190:if(e.sheetStubs)for(var nt=G.c;nt<=G.C;++nt){var tt=G.ixfe[nt-G.c];b={ixfe:tt,XF:T[tt],t:"z"},I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:nt,r:G.r},b,e)}break;case 214:case 516:case 4:b=uk(G.val,G.ixfe,"s"),b.XF=T[b.ixfe],I>0&&(b.z=z[b.ixfe>>8&63]),ul(b,e,t.opts.Date1904),O({c:G.c,r:G.r},b,e);break;case 0:case 512:ne===1&&(a=G);break;case 252:l=G;break;case 1054:if(D.biff==4){z[I++]=G[1];for(var Nt=0;Nt<I+163&&Je[Nt]!=G[1];++Nt);Nt>=163&&fu(G[1],I+163)}else fu(G[1],G[0]);break;case 30:{z[I++]=G;for(var ht=0;ht<I+163&&Je[ht]!=G;++ht);ht>=163&&fu(G,I+163)}break;case 229:B=B.concat(G);break;case 93:ee[G.cmo[0]]=D.lastobj=G;break;case 438:D.lastobj.TxO=G;break;case 127:D.lastobj.ImData=G;break;case 440:for(y=G[0].s.r;y<=G[0].e.r;++y)for(g=G[0].s.c;g<=G[0].e.c;++g)m=e.dense?(s[y]||[])[g]:s[Qe({c:g,r:y})],m&&(m.l=G[1]);break;case 2048:for(y=G[0].s.r;y<=G[0].e.r;++y)for(g=G[0].s.c;g<=G[0].e.c;++g)m=e.dense?(s[y]||[])[g]:s[Qe({c:g,r:y})],m&&m.l&&(m.l.Tooltip=G[1]);break;case 28:{if(D.biff<=5&&D.biff>=2)break;m=e.dense?(s[G[0].r]||[])[G[0].c]:s[Qe(G[0])];var Et=ee[G[2]];m||(e.dense?(s[G[0].r]||(s[G[0].r]=[]),m=s[G[0].r][G[0].c]={t:"z"}):m=s[Qe(G[0])]={t:"z"},a.e.r=Math.max(a.e.r,G[0].r),a.s.r=Math.min(a.s.r,G[0].r),a.e.c=Math.max(a.e.c,G[0].c),a.s.c=Math.min(a.s.c,G[0].c)),m.c||(m.c=[]),x={a:G[1],t:Et.TxO.t},m.c.push(x)}break;case 2173:Hfe(T[G.ixfe],G.ext);break;case 125:{if(!D.cellStyles)break;for(;G.e>=G.s;)X[G.e--]={width:G.w/256,level:G.level||0,hidden:!!(G.flags&1)},Y||(Y=!0,rO(G.w/256)),Hh(X[G.e+1])}break;case 520:{var cr={};G.level!=null&&(W[G.r]=cr,cr.level=G.level),G.hidden&&(W[G.r]=cr,cr.hidden=!0),G.hpt&&(W[G.r]=cr,cr.hpt=G.hpt,cr.hpx=qx(G.hpt))}break;case 38:case 39:case 40:case 41:s["!margins"]||f0(s["!margins"]={}),s["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[se]]=G;break;case 161:s["!margins"]||f0(s["!margins"]={}),s["!margins"].header=G.header,s["!margins"].footer=G.footer;break;case 574:G.RTL&&(N.Views[0].RTL=!0);break;case 146:A=G;break;case 2198:H=G;break;case 140:_=G;break;case 442:c?k.CodeName=G||k.name:N.WBProps.CodeName=G||"ThisWorkbook";break}}else ae||console.error("Missing Info for XLS Record 0x"+se.toString(16)),r.l+=ie}return t.SheetNames=nn(i).sort(function(gs,it){return Number(gs)-Number(it)}).map(function(gs){return i[gs].name}),e.bookSheets||(t.Sheets=n),!t.SheetNames.length&&u["!ref"]?(t.SheetNames.push("Sheet1"),t.Sheets&&(t.Sheets.Sheet1=u)):t.Preamble=u,t.Sheets&&M.forEach(function(gs,it){t.Sheets[t.SheetNames[it]]["!autofilter"]=gs}),t.Strings=l,t.SSF=Ar(Je),D.enc&&(t.Encryption=D.enc),H&&(t.Themes=H),t.Metadata={},_!==void 0&&(t.Metadata.Country=_),F.names.length>0&&(N.Names=F.names),t.Workbook=N,t}var Uy={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function nve(r,e,t){var n=Ke.find(r,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var s=bI(n,bR,Uy.DSI);for(var i in s)e[i]=s[i]}catch(c){if(t.WTF)throw c}var a=Ke.find(r,"/!SummaryInformation");if(a&&a.size>0)try{var o=bI(a,_R,Uy.SI);for(var l in o)e[l]==null&&(e[l]=o[l])}catch(c){if(t.WTF)throw c}e.HeadingPairs&&e.TitlesOfParts&&(N7(e.HeadingPairs,e.TitlesOfParts,e,t),delete e.HeadingPairs,delete e.TitlesOfParts)}function sve(r,e){var t=[],n=[],s=[],i=0,a,o=ZM(bR,"n"),l=ZM(_R,"n");if(r.Props)for(a=nn(r.Props),i=0;i<a.length;++i)(Object.prototype.hasOwnProperty.call(o,a[i])?t:Object.prototype.hasOwnProperty.call(l,a[i])?n:s).push([a[i],r.Props[a[i]]]);if(r.Custprops)for(a=nn(r.Custprops),i=0;i<a.length;++i)Object.prototype.hasOwnProperty.call(r.Props||{},a[i])||(Object.prototype.hasOwnProperty.call(o,a[i])?t:Object.prototype.hasOwnProperty.call(l,a[i])?n:s).push([a[i],r.Custprops[a[i]]]);var c=[];for(i=0;i<s.length;++i)M7.indexOf(s[i][0])>-1||C7.indexOf(s[i][0])>-1||s[i][1]!=null&&c.push(s[i]);n.length&&Ke.utils.cfb_add(e,"/�SummaryInformation",_I(n,Uy.SI,l,_R)),(t.length||c.length)&&Ke.utils.cfb_add(e,"/�DocumentSummaryInformation",_I(t,Uy.DSI,o,bR,c.length?c:null,Uy.UDI))}function RH(r,e){e||(e={}),dO(e),jj(),e.codepage&&Rj(e.codepage);var t,n;if(r.FullPaths){if(Ke.find(r,"/encryption"))throw new Error("File is password-protected");t=Ke.find(r,"!CompObj"),n=Ke.find(r,"/Workbook")||Ke.find(r,"/Book")}else{switch(e.type){case"base64":r=ca(xa(r));break;case"binary":r=ca(r);break;case"buffer":break;case"array":Array.isArray(r)||(r=Array.prototype.slice.call(r));break}cs(r,0),n={content:r}}var s,i;if(t&&Qxe(t),e.bookProps&&!e.bookSheets)s={};else{var a=bt?"buffer":"array";if(n&&n.content)s=rve(n.content,e);else if((i=Ke.find(r,"PerfectOffice_MAIN"))&&i.content)s=h0.to_workbook(i.content,(e.type=a,e));else if((i=Ke.find(r,"NativeContent_MAIN"))&&i.content)s=h0.to_workbook(i.content,(e.type=a,e));else throw(i=Ke.find(r,"MN0"))&&i.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");e.bookVBA&&r.FullPaths&&Ke.find(r,"/_VBA_PROJECT_CUR/VBA/dir")&&(s.vbaraw=xpe(r))}var o={};return r.FullPaths&&nve(r,o,e),s.Props=s.Custprops=o,e.bookFiles&&(s.cfb=r),s}function ive(r,e){var t=e||{},n=Ke.utils.cfb_new({root:"R"}),s="/Workbook";switch(t.bookType||"xls"){case"xls":t.bookType="biff8";case"xla":t.bookType||(t.bookType="xla");case"biff8":s="/Workbook",t.biff=8;break;case"biff5":s="/Book",t.biff=5;break;default:throw new Error("invalid type "+t.bookType+" for XLS CFB")}return Ke.utils.cfb_add(n,s,jH(r,t)),t.biff==8&&(r.Props||r.Custprops)&&sve(r,n),t.biff==8&&r.vbaraw&&vpe(n,Ke.read(r.vbaraw,{type:typeof r.vbaraw=="string"?"binary":"buffer"})),n}var $1={0:{f:Nme},1:{f:Ime},2:{f:rge},3:{f:Vme},4:{f:$me},5:{f:Qme},6:{f:oge},7:{f:Yme},8:{f:pge},9:{f:fge},10:{f:dge},11:{f:hge},12:{f:Bme},13:{f:sge},14:{f:Kme},15:{f:Hme},16:{f:kH},17:{f:cge},18:{f:Zme},19:{f:Gj},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:cxe},40:{},42:{},43:{f:ofe},44:{f:ife},45:{f:ufe},46:{f:hfe},47:{f:dfe},48:{},49:{f:jce},50:{},51:{f:Gfe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:K7},62:{f:age},63:{f:tpe},64:{f:Pge},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Ls,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Age},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:Dme},148:{f:jme,p:16},151:{f:wge},152:{},153:{f:axe},154:{},155:{},156:{f:sxe},157:{},158:{},159:{T:1,f:_he},160:{T:-1},161:{T:1,f:z0},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:mge},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:Wfe},336:{T:-1},337:{f:Yfe,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:wR},357:{},358:{},359:{},360:{T:1},361:{},362:{f:G7},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:bge},427:{f:_ge},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:Sge},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:Fme},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:vge},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:wR},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:hpe},633:{T:1},634:{T:-1},635:{T:1,f:upe},636:{T:-1},637:{f:Mce},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:Kge},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:Rge},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:""}},CR={6:{f:YT},10:{f:Hu},12:{f:yn},13:{f:yn},14:{f:an},15:{f:an},16:{f:js},17:{f:an},18:{f:an},19:{f:yn},20:{f:CI},21:{f:CI},23:{f:G7},24:{f:PI},25:{f:an},26:{},27:{},28:{f:Rde},29:{},34:{f:an},35:{f:NI},38:{f:js},39:{f:js},40:{f:js},41:{f:js},42:{f:an},43:{f:an},47:{f:Hhe},49:{f:sde},51:{f:yn},60:{},61:{f:Que},64:{f:an},65:{f:nde},66:{f:yn},77:{},80:{},81:{},82:{},85:{f:yn},89:{},90:{},91:{},92:{f:zue},93:{f:Fde},94:{},95:{f:an},96:{},97:{},99:{f:an},125:{f:K7},128:{f:yde},129:{f:Wue},130:{f:yn},131:{f:an},132:{f:an},133:{f:Vue},134:{},140:{f:zde},141:{f:yn},144:{},146:{f:Vde},151:{},152:{},153:{},154:{},155:{},156:{f:yn},157:{},158:{},160:{f:Jde},161:{f:Xde},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:mde},190:{f:gde},193:{f:Hu},197:{},198:{},199:{},200:{},201:{},202:{f:an},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:yn},220:{},221:{f:an},222:{},224:{f:vde},225:{f:$ue},226:{f:Hu},227:{},229:{f:jde},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:Kue},253:{f:ade},255:{f:Yue},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:I7},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:an},353:{f:Hu},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Sde},431:{f:an},432:{},433:{},434:{},437:{},438:{f:Ide},439:{f:an},440:{f:Lde},441:{},442:{f:r_},443:{},444:{f:yn},445:{},446:{},448:{f:Hu},449:{f:Jue,r:2},450:{f:Hu},512:{f:EI},513:{f:Zde},515:{f:_de},516:{f:lde},517:{f:TI},519:{f:Qde},520:{f:que},523:{},545:{f:RI},549:{f:SI},566:{},574:{f:tde},638:{f:pde},659:{},1048:{},1054:{f:ude},1084:{},1212:{f:Cde},2048:{f:Ude},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:ok},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:Hu},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:Gde,r:12},2173:{f:zfe,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:an,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:Tde,r:12},2197:{},2198:{f:Mfe,r:12},2199:{},2200:{},2201:{},2202:{f:Nde,r:12},2203:{f:Hu},2204:{},2205:{},2206:{},2207:{},2211:{f:Zue},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:yn},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:Yde},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:Wde},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:EI},1:{},2:{f:she},3:{f:rhe},4:{f:the},5:{f:TI},7:{f:ahe},8:{},9:{f:ok},11:{},22:{f:yn},30:{f:hde},31:{},32:{},33:{f:RI},36:{},37:{f:SI},50:{f:ohe},62:{},52:{},67:{},68:{f:yn},69:{},86:{},126:{},127:{f:ehe},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:lhe},223:{},234:{},354:{},421:{},518:{f:YT},521:{f:ok},536:{f:PI},547:{f:NI},561:{},579:{},1030:{f:YT},1033:{f:ok},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function Ae(r,e,t,n){var s=e;if(!isNaN(s)){var i=n||(t||[]).length||0,a=r.next(4);a.write_shift(2,s),a.write_shift(2,i),i>0&&Hj(t)&&r.push(t)}}function ave(r,e,t,n){var s=(t||[]).length||0;if(s<=8224)return Ae(r,e,t,s);var i=e;if(!isNaN(i)){for(var a=t.parts||[],o=0,l=0,c=0;c+(a[o]||8224)<=8224;)c+=a[o]||8224,o++;var u=r.next(4);for(u.write_shift(2,i),u.write_shift(2,c),r.push(t.slice(l,l+c)),l+=c;l<s;){for(u=r.next(4),u.write_shift(2,60),c=0;c+(a[o]||8224)<=8224;)c+=a[o]||8224,o++;u.write_shift(2,c),r.push(t.slice(l,l+c)),l+=c}}}function a_(r,e,t){return r||(r=fe(7)),r.write_shift(2,e),r.write_shift(2,t),r.write_shift(2,0),r.write_shift(1,0),r}function ove(r,e,t,n){var s=fe(9);
vendor: 1,862 bytes, line 706
706return a_(s,r,e),L7(t,n||"b",s),s}function lve(r,e,t){var n=fe(8+2*t.length);return a_(n,r,e),n.write_shift(1,t.length),n.write_shift(t.length,t,"sbcs"),n.l<n.length?n.slice(0,n.l):n}function cve(r,e,t,n){if(e.v!=null)switch(e.t){case"d":case"n":var s=e.t=="d"?Rn(Er(e.v)):e.v;s==(s|0)&&s>=0&&s<65536?Ae(r,2,ihe(t,n,s)):Ae(r,3,nhe(t,n,s));return;case"b":case"e":Ae(r,5,ove(t,n,e.v,e.t));return;case"s":case"str":Ae(r,4,lve(t,n,(e.v||"").slice(0,255)));return}Ae(r,1,a_(null,t,n))}function uve(r,e,t,n){var s=Array.isArray(e),i=Ft(e["!ref"]||"A1"),a,o="",l=[];if(i.e.c>255||i.e.r>16383){if(n.WTF)throw new Error("Range "+(e["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255),i.e.r=Math.min(i.e.c,16383),a=gt(i)}for(var c=i.s.r;c<=i.e.r;++c){o=hn(c);for(var u=i.s.c;u<=i.e.c;++u){c===i.s.r&&(l[u]=$r(u)),a=l[u]+o;var f=s?(e[c]||[])[u]:e[a];f&&cve(r,f,c,u)}}}function dve(r,e){for(var t=e||{},n=Ti(),s=0,i=0;i<r.SheetNames.length;++i)r.SheetNames[i]==t.sheet&&(s=i);if(s==0&&t.sheet&&r.SheetNames[0]!=t.sheet)throw new Error("Sheet not found: "+t.sheet);return Ae(n,t.biff==4?1033:t.biff==3?521:9,Qj(r,16,t)),uve(n,r.Sheets[r.SheetNames[s]],s,t),Ae(n,10),n.end()}function hve(r,e,t){Ae(r,49,ide({sz:12,color:{theme:1},name:"Arial",family:2,scheme:"minor"},t))}function fve(r,e,t){e&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var s=n[0];s<=n[1];++s)e[s]!=null&&Ae(r,1054,dde(s,e[s],t))})}function pve(r,e){var t=fe(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),Ae(r,2151,t),t=fe(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),H7(Ft(e["!ref"]||"A1"),t),t.write_shift(4,4),Ae(r,2152,t)}function mve(r,e){for(var t=0;t<16;
vendor: 5,598 bytes, line 706
706++t)Ae(r,224,AI({numFmtId:0,style:!0},0,e));e.cellXfs.forEach(function(n){Ae(r,224,AI(n,0,e))})}function gve(r,e){for(var t=0;t<e["!links"].length;++t){var n=e["!links"][t];Ae(r,440,Bde(n)),n[1].Tooltip&&Ae(r,2048,$de(n))}delete e["!links"]}function xve(r,e){if(e){var t=0;e.forEach(function(n,s){++t<=256&&n&&Ae(r,125,Kde(_A(s,n),s))})}}function vve(r,e,t,n,s){var i=16+tf(s.cellXfs,e,s);if(e.v==null&&!e.bf){Ae(r,513,P0(t,n,i));return}if(e.bf)Ae(r,6,W0e(e,t,n,s,i));else switch(e.t){case"d":case"n":var a=e.t=="d"?Rn(Er(e.v)):e.v;Ae(r,515,kde(t,n,a,i));break;case"b":case"e":Ae(r,517,bde(t,n,e.v,i,s,e.t));break;case"s":case"str":if(s.bookSST){var o=oO(s.Strings,e.v,s.revStrings);Ae(r,253,ode(t,n,o,i))}else Ae(r,516,cde(t,n,(e.v||"").slice(0,255),i,s));break;default:Ae(r,513,P0(t,n,i))}}function yve(r,e,t){var n=Ti(),s=t.SheetNames[r],i=t.Sheets[s]||{},a=(t||{}).Workbook||{},o=(a.Sheets||[])[r]||{},l=Array.isArray(i),c=e.biff==8,u,f="",p=[],m=Ft(i["!ref"]||"A1"),x=c?65536:16384;if(m.e.c>255||m.e.r>=x){if(e.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");m.e.c=Math.min(m.e.c,255),m.e.r=Math.min(m.e.c,x-1)}Ae(n,2057,Qj(t,16,e)),Ae(n,13,Va(1)),Ae(n,12,Va(100)),Ae(n,15,Qs(!0)),Ae(n,17,Qs(!1)),Ae(n,16,C0(.001)),Ae(n,95,Qs(!0)),Ae(n,42,Qs(!1)),Ae(n,43,Qs(!1)),Ae(n,130,Va(1)),Ae(n,128,wde()),Ae(n,131,Qs(!1)),Ae(n,132,Qs(!1)),c&&xve(n,i["!cols"]),Ae(n,512,fde(m,e)),c&&(i["!links"]=[]);for(var g=m.s.r;g<=m.e.r;++g){f=hn(g);for(var y=m.s.c;y<=m.e.c;++y){g===m.s.r&&(p[y]=$r(y)),u=p[y]+f;var v=l?(i[g]||[])[y]:i[u];v&&(vve(n,v,g,y,e),c&&v.l&&i["!links"].push([u,v.l]))}}var w=o.CodeName||o.name||s;return c&&Ae(n,574,rde((a.Views||[])[0])),c&&(i["!merges"]||[]).length&&Ae(n,229,Ode(i["!merges"])),c&&gve(n,i),Ae(n,442,B7(w)),c&&pve(n,i),Ae(n,10),n.end()}function wve(r,e,t){var n=Ti(),s=(r||{}).Workbook||{},i=s.Sheets||[],a=s.WBProps||{},o=t.biff==8,l=t.biff==5;if(Ae(n,2057,Qj(r,5,t)),t.bookType=="xla"&&Ae(n,135),Ae(n,225,o?Va(1200):null),Ae(n,193,bue(2)),l&&Ae(n,191),l&&Ae(n,192),Ae(n,226),Ae(n,92,Hue("SheetJS",t)),Ae(n,66,Va(o?1200:1252)),o&&Ae(n,353,Va(0)),o&&Ae(n,448),Ae(n,317,qde(r.SheetNames.length)),o&&r.vbaraw&&Ae(n,211),o&&r.vbaraw){var c=a.CodeName||"ThisWorkbook";Ae(n,442,B7(c))}Ae(n,156,Va(17)),Ae(n,25,Qs(!1)),Ae(n,18,Qs(!1)),Ae(n,19,Va(0)),o&&Ae(n,431,Qs(!1)),o&&Ae(n,444,Va(0)),Ae(n,61,ede()),Ae(n,64,Qs(!1)),Ae(n,141,Va(0)),Ae(n,34,Qs(Jge(r)=="true")),Ae(n,14,Qs(!0)),o&&Ae(n,439,Qs(!1)),Ae(n,218,Va(0)),hve(n,r,t),fve(n,r.SSF,t),mve(n,t),o&&Ae(n,352,Qs(!1));var u=n.end(),f=Ti();o&&Ae(f,140,Hde()),o&&t.Strings&&ave(f,252,Xue(t.Strings)),Ae(f,10);var p=f.end(),m=Ti(),x=0,g=0;for(g=0;g<r.SheetNames.length;++g)x+=(o?12:11)+(o?2:1)*r.SheetNames[g].length;var y=u.length+x+p.length;for(g=0;g<r.SheetNames.length;++g){var v=i[g]||{};Ae(m,133,Gue({pos:y,hs:v.Hidden||0,dt:0,name:r.SheetNames[g]},t)),y+=e[g].length}var w=m.end();if(x!=w.length)throw new Error("BS8 "+x+" != "+w.length);var b=[];return u.length&&b.push(u),w.length&&b.push(w),p.length&&b.push(p),Vn(b)}function bve(r,e){var t=e||{},n=[];r&&!r.SSF&&(r.SSF=Ar(Je)),r&&r.SSF&&(hv(),mA(r.SSF),t.revssf=xA(r.SSF),t.revssf[r.SSF[65535]]=0,t.ssf=r.SSF),t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,hO(t),t.cellXfs=[],tf(t.cellXfs,{},{revssf:{General:0}}),r.Props||(r.Props={});for(var s=0;s<r.SheetNames.length;++s)n[n.length]=yve(s,t,r);return n.unshift(wve(r,n,t)),Vn(n)}function jH(r,e){for(var t=0;t<=r.SheetNames.length;++t){var n=r.Sheets[r.SheetNames[t]];if(!(!n||!n["!ref"])){var s=Ci(n["!ref"]);s.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+r.SheetNames[t]+"' extends beyond column IV (255). Data may be lost.")}}var i=e||{};switch(i.biff||2){case 8:case 5:return bve(r,e);case 4:case 3:case 2:return dve(r,e)}throw new Error("invalid type "+i.bookType+" for BIFF")}function $I(r,e){var t=e||{},n=t.dense?[]:{};r=r.replace(/<!--.*?-->/g,"");var s=r.match(/<table/i);if(!s)throw new Error("Invalid HTML: could not find <table>");var i=r.match(/<\/table/i),a=s.index,o=i&&i.index||r.length,l=ice(r.slice(a,o),/(:?<tr[^>]*>)/i,"<tr>"),c=-1,u=0,f=0,p=0,m={s:{r:1e7,c:1e7},e:{r:0,c:0}},x=[];for(a=0;a<l.length;++a){var g=l[a].trim(),y=g.slice(0,3).toLowerCase();if(y=="<tr"){if(++c,t.sheetRows&&t.sheetRows<=c){--c;break}u=0;continue}if(!(y!="<td"&&y!="<th")){var v=g.split(/<\/t[dh]>/i);for(o=0;o<v.length;++o){var w=v[o].trim();if(w.match(/<t[dh]/i)){for(var b=w,_=0;b.charAt(0)=="<"&&(_=b.indexOf(">"))>-1;)b=b.slice(_+1);for(var T=0;T<x.length;++T){var A=x[T];A.s.c==u&&A.s.r<c&&c<=A.e.r&&(u=A.e.c+1,T=-1)}var N=rt(w.slice(0,w.indexOf(">")));p=N.colspan?+N.colspan:1,((f=+N.rowspan)>1||p>1)&&x.push({s:{r:c,c:u},e:{r:c+(f||1)-1,c:u+p-1}});var k=N.t||N["data-t"]||"";if(!b.length){u+=p;continue}if(b=r7(b),m.s.r>c&&(m.s.r=c),m.e.r<c&&(m.e.r=c),m.s.c>u&&(m.s.c=u),m.e.c<u&&(m.e.c=u),!b.length){u+=p;continue}var E={t:"s",v:b};t.raw||!b.trim().length||k=="s"||(b==="TRUE"?E={t:"b",v:!0}:b==="FALSE"?E={t:"b",v:!1}:isNaN(Jo(b))?isNaN(Xx(b).getDate())||(E={t:"d",v:Er(b)},t.cellDates||(E={t:"n",v:Rn(E.v)}),E.z=t.dateNF||Je[14]):E={t:"n",v:Jo(b)}),t.dense?(n[c]||(n[c]=[]),n[c][u]=E):n[Qe({r:c,c:u})]=E,u+=p}}}}return n["!ref"]=gt(m),x.length&&(n["!merges"]=x),n}function _ve(r,e,t,n){for(var s=r["!merges"]||[],i=[],a=e.s.c;a<=e.e.c;++a){for(var o=0,l=0,c=0;c<s.length;++c)if(!(s[c].s.r>t||s[c].s.c>a)&&!(s[c].e.r<t||s[c].e.c<a)){if(s[c].s.r<t||s[c].s.c<a){o=-1;break}o=s[c].e.r-s[c].s.r+1,l=s[c].e.c-s[c].s.c+1;break}if(!(o<0)){var u=Qe({r:t,c:a}),f=n.dense?(r[t]||[])[a]:r[u],p=f&&f.v!=null&&(f.h||Uj(f.w||(Cu(f),f.w)||""))||"",m={};o>
vendor: 14,401 bytes, lines 706-708
7061&&(m.rowspan=o),l>1&&(m.colspan=l),n.editable?p='<span contenteditable="true">'+p+"</span>":f&&(m["data-t"]=f&&f.t||"z",f.v!=null&&(m["data-v"]=f.v),f.z!=null&&(m["data-z"]=f.z),f.l&&(f.l.Target||"#").charAt(0)!="#"&&(p='<a href="'+f.l.Target+'">'+p+"</a>")),m.id=(n.id||"sjs")+"-"+u,i.push(Ee("td",p,m))}}var x="<tr>";return x+i.join("")+"</tr>"}var kve='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',Sve="</body></html>";function Eve(r,e){var t=r.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!t||t.length==0)throw new Error("Invalid HTML: could not find <table>");if(t.length==1)return ef($I(t[0],e),e);var n=mO();return t.forEach(function(s,i){gO(n,$I(s,e),"Sheet"+(i+1))}),n}function Ave(r,e,t){var n=[];return n.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}function OH(r,e){var t=e||{},n=t.header!=null?t.header:kve,s=t.footer!=null?t.footer:Sve,i=[n],a=Ci(r["!ref"]);t.dense=Array.isArray(r),i.push(Ave(r,a,t));for(var o=a.s.r;o<=a.e.r;++o)i.push(_ve(r,a,o,t));return i.push("</table>"+s),i.join("")}function FH(r,e,t){var n=t||{},s=0,i=0;if(n.origin!=null)if(typeof n.origin=="number")s=n.origin;else{var a=typeof n.origin=="string"?zr(n.origin):n.origin;s=a.r,i=a.c}var o=e.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,o.length),c={s:{r:0,c:0},e:{r:s,c:i}};if(r["!ref"]){var u=Ci(r["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),s==-1&&(c.e.r=s=u.e.r+1)}var f=[],p=0,m=r["!rows"]||(r["!rows"]=[]),x=0,g=0,y=0,v=0,w=0,b=0;for(r["!cols"]||(r["!cols"]=[]);x<o.length&&g<l;++x){var _=o[x];if(zI(_)){if(n.display)continue;m[g]={hidden:!0}}var T=_.children;for(y=v=0;y<T.length;++y){var A=T[y];if(!(n.display&&zI(A))){var N=A.hasAttribute("data-v")?A.getAttribute("data-v"):A.hasAttribute("v")?A.getAttribute("v"):r7(A.innerHTML),k=A.getAttribute("data-z")||A.getAttribute("z");for(p=0;p<f.length;++p){var E=f[p];E.s.c==v+i&&E.s.r<g+s&&g+s<=E.e.r&&(v=E.e.c+1-i,p=-1)}b=+A.getAttribute("colspan")||1,((w=+A.getAttribute("rowspan")||1)>1||b>1)&&f.push({s:{r:g+s,c:v+i},e:{r:g+s+(w||1)-1,c:v+i+(b||1)-1}});var P={t:"s",v:N},O=A.getAttribute("data-t")||A.getAttribute("t")||"";N!=null&&(N.length==0?P.t=O||"z":n.raw||N.trim().length==0||O=="s"||(N==="TRUE"?P={t:"b",v:!0}:N==="FALSE"?P={t:"b",v:!1}:isNaN(Jo(N))?isNaN(Xx(N).getDate())||(P={t:"d",v:Er(N)},n.cellDates||(P={t:"n",v:Rn(P.v)}),P.z=n.dateNF||Je[14]):P={t:"n",v:Jo(N)})),P.z===void 0&&k!=null&&(P.z=k);var D="",H=A.getElementsByTagName("A");if(H&&H.length)for(var B=0;B<H.length&&!(H[B].hasAttribute("href")&&(D=H[B].getAttribute("href"),D.charAt(0)!="#"));++B);D&&D.charAt(0)!="#"&&(P.l={Target:D}),n.dense?(r[g+s]||(r[g+s]=[]),r[g+s][v+i]=P):r[Qe({c:v+i,r:g+s})]=P,c.e.c<v+i&&(c.e.c=v+i),v+=b}}++g}return f.length&&(r["!merges"]=(r["!merges"]||[]).concat(f)),c.e.r=Math.max(c.e.r,g-1+s),r["!ref"]=gt(c),g>=l&&(r["!fullref"]=gt((c.e.r=o.length-x+g-1+s,c))),r}function DH(r,e){var t=e||{},n=t.dense?[]:{};return FH(n,r,e)}function Tve(r,e){return ef(DH(r,e),e)}function zI(r){var e="",t=Cve(r);return t&&(e=t(r).getPropertyValue("display")),e||(e=r.style&&r.style.display),e==="none"}function Cve(r){return r.ownerDocument.defaultView&&typeof r.ownerDocument.defaultView.getComputedStyle=="function"?r.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function Nve(r){var e=r.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(n,s){return Array(parseInt(s,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,` 707`),t=Rt(e.replace(/<[^>]*>/g,""));return[t]}var HI={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function MH(r,e){var t=e||{},n=$j(r),s=[],i,a,o={name:""},l="",c=0,u,f,p={},m=[],x=t.dense?[]:{},g,y,v={value:""},w="",b=0,_=[],T=-1,A=-1,N={s:{r:1e6,c:1e7},e:{r:0,c:0}},k=0,E={},P=[],O={},D=0,H=0,B=[],ee=1,X=1,W=[],Y={Names:[]},F={},J=["",""],ne=[],I={},z="",M=0,U=!1,te=!1,re=0;for(D1.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");g=D1.exec(n);)switch(g[3]=g[3].replace(/_.*$/,"")){case"table":case"å·¥ä½è¡¨":g[1]==="/"?(N.e.c>=N.s.c&&N.e.r>=N.s.r?x["!ref"]=gt(N):x["!ref"]="A1:A1",t.sheetRows>0&&t.sheetRows<=N.e.r&&(x["!fullref"]=x["!ref"],N.e.r=t.sheetRows-1,x["!ref"]=gt(N)),P.length&&(x["!merges"]=P),B.length&&(x["!rows"]=B),u.name=u.åç§°||u.name,typeof JSON<"u"&&JSON.stringify(u),m.push(u.name),p[u.name]=x,te=!1):g[0].charAt(g[0].length-2)!=="/"&&(u=rt(g[0],!1),T=A=-1,N.s.r=N.s.c=1e7,N.e.r=N.e.c=0,x=t.dense?[]:{},P=[],B=[],te=!0);break;case"table-row-group":g[1]==="/"?--k:++k;break;case"table-row":case"è¡":if(g[1]==="/"){T+=ee,ee=1;break}if(f=rt(g[0],!1),f.è¡å·?T=f.è¡å·-1:T==-1&&(T=0),ee=+f["number-rows-repeated"]||1,ee<10)for(re=0;re<ee;++re)k>0&&(B[T+re]={level:k});A=-1;break;case"covered-table-cell":g[1]!=="/"&&++A,t.sheetStubs&&(t.dense?(x[T]||(x[T]=[]),x[T][A]={t:"z"}):x[Qe({r:T,c:A})]={t:"z"}),w="",_=[];break;case"table-cell":case"æ°æ®":if(g[0].charAt(g[0].length-2)==="/")++A,v=rt(g[0],!1),X=parseInt(v["number-columns-repeated"]||"1",10),y={t:"z",v:null},v.formula&&t.cellFormula!=!1&&(y.f=LI(Rt(v.formula))),(v.æ°æ®ç±»å||v["value-type"])=="string"&&(y.t="s",y.v=Rt(v["string-value"]||""),t.dense?(x[T]||(x[T]=[]),x[T][A]=y):x[Qe({r:T,c:A})]=y),A+=X-1;else if(g[1]!=="/"){++A,w="",b=0,_=[],X=1;var se=ee?T+ee-1:T;if(A>N.e.c&&(N.e.c=A),A<N.s.c&&(N.s.c=A),T<N.s.r&&(N.s.r=T),se>N.e.r&&(N.e.r=se),v=rt(g[0],!1),ne=[],I={},y={t:v.æ°æ®ç±»å||v["value-type"],v:null},t.cellFormula)if(v.formula&&(v.formula=Rt(v.formula)),v["number-matrix-columns-spanned"]&&v["number-matrix-rows-spanned"]&&(D=parseInt(v["number-matrix-rows-spanned"],10)||0,H=parseInt(v["number-matrix-columns-spanned"],10)||0,O={s:{r:T,c:A},e:{r:T+D-1,c:A+H-1}},y.F=gt(O),W.push([O,y.F])),v.formula)y.f=LI(v.formula);else for(re=0;re<W.length;++re)T>=W[re][0].s.r&&T<=W[re][0].e.r&&A>=W[re][0].s.c&&A<=W[re][0].e.c&&(y.F=W[re][1]);switch((v["number-columns-spanned"]||v["number-rows-spanned"])&&(D=parseInt(v["number-rows-spanned"],10)||0,H=parseInt(v["number-columns-spanned"],10)||0,O={s:{r:T,c:A},e:{r:T+D-1,c:A+H-1}},P.push(O)),v["number-columns-repeated"]&&(X=parseInt(v["number-columns-repeated"],10)),y.t){case"boolean":y.t="b",y.v=_r(v["boolean-value"]);break;case"float":y.t="n",y.v=parseFloat(v.value);break;case"percentage":y.t="n",y.v=parseFloat(v.value);break;case"currency":y.t="n",y.v=parseFloat(v.value);break;case"date":y.t="d",y.v=Er(v["date-value"]),t.cellDates||(y.t="n",y.v=Rn(y.v)),y.z="m/d/yy";break;case"time":y.t="n",y.v=rce(v["time-value"])/86400,t.cellDates&&(y.t="d",y.v=vA(y.v)),y.z="HH:MM:SS";break;case"number":y.t="n",y.v=parseFloat(v.æ°æ®æ°å¼);break;default:if(y.t==="string"||y.t==="text"||!y.t)y.t="s",v["string-value"]!=null&&(w=Rt(v["string-value"]),_=[]);else throw new Error("Unsupported value type "+y.t)}}else{if(U=!1,y.t==="s"&&(y.v=w||"",_.length&&(y.R=_),U=b==0),F.Target&&(y.l=F),ne.length>0&&(y.c=ne,ne=[]),w&&t.cellText!==!1&&(y.w=w),U&&(y.t="z",delete y.v),(!U||t.sheetStubs)&&!(t.sheetRows&&t.sheetRows<=T))for(var ie=0;ie<ee;++ie){if(X=parseInt(v["number-columns-repeated"]||"1",10),t.dense)for(x[T+ie]||(x[T+ie]=[]),x[T+ie][A]=ie==0?y:Ar(y);--X>0;)x[T+ie][A+X]=Ar(y);else for(x[Qe({r:T+ie,c:A})]=y;--X>0;)x[Qe({r:T+ie,c:A+X})]=Ar(y);N.e.c<=A&&(N.e.c=A)}X=parseInt(v["number-columns-repeated"]||"1",10),A+=X-1,X=0,y={},w="",_=[]}F={};break;case"document":case"document-content":case"çµåè¡¨æ ¼ææ¡£":case"spreadsheet":case"主ä½":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(g[1]==="/"){if((i=s.pop())[0]!==g[3])throw"Bad state: "+i}else g[0].charAt(g[0].length-2)!=="/"&&s.push([g[3],!0]);break;case"annotation":if(g[1]==="/"){if((i=s.pop())[0]!==g[3])throw"Bad state: "+i;I.t=w,_.length&&(I.R=_),I.a=z,ne.push(I)}else g[0].charAt(g[0].length-2)!=="/"&&s.push([g[3],!1]);z="",M=0,w="",b=0,_=[];break;case"creator":g[1]==="/"?z=n.slice(M,g.index):M=g.index+g[0].length;break;case"meta":case"å æ°æ®":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(g[1]==="/"){if((i=s.pop())[0]!==g[3])throw"Bad state: "+i}else g[0].charAt(g[0].length-2)!=="/"&&s.push([g[3],!1]);w="",b=0,_=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(g[1]==="/"){if(E[o.name]=l,(i=s.pop())[0]!==g[3])throw"Bad state: "+i}else g[0].charAt(g[0].length-2)!=="/"&&(l="",o=rt(g[0],!1),s.push([g[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(s[s.length-1][0]){case"time-style":case"date-style":a=rt(g[0],!1),l+=HI[g[3]][a.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(s[s.length-1][0]){case"time-style":case"date-style":a=rt(g[0],!1),l+=HI[g[3]][a.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(g[0].slice(-2)==="/>")break;if(g[1]==="/")switch(s[s.length-1][0]){case"number-style":case"date-style":case"time-style":l+=n.slice(c,g.index);break}else c=g.index+g[0].length;break;case"named-range":a=rt(g[0],!1),J=qT(a["cell-range-address"]);var ae={Name:a.name,Ref:J[0]+"!"+J[1]};te&&(ae.Sheet=m.length),Y.Names.push(ae);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"çµåè¡¨æ ¼":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"ææ¬ä¸²":if(["master-styles"].indexOf(s[s.length-1][0])>-1)break;if(g[1]==="/"&&(!v||!v["string-value"])){var ge=Nve(n.slice(b,g.index));w=(w.length>0?w+` 708`:"")+ge[0]}else rt(g[0],!1),b=g.index+g[0].length;break;case"s":break;case"database-range":if(g[1]==="/")break;try{J=qT(rt(g[0])["target-range-address"]),p[J[0]]["!autofilter"]={ref:J[1]}}catch{}break;case"date":break;case"object":break;case"title":case"æ é¢":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(g[1]!=="/"){if(F=rt(g[0],!1),!F.href)break;F.Target=Rt(F.href),delete F.href,F.Target.charAt(0)=="#"&&F.Target.indexOf(".")>-1?(J=qT(F.Target.slice(1)),F.Target="#"+J[0]+"!"+J[1]):F.Target.match(/^\.\.[\\\/]/)&&(F.Target=F.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(g[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"å:":break;default:if(t.WTF)throw new Error(g)}}var G={Sheets:p,SheetNames:m,Workbook:Y};return t.bookSheets&&delete G.Sheets,G}function WI(r,e){e=e||{},Na(r,"META-INF/manifest.xml")&&rue(vn(r,"META-INF/manifest.xml"),e);var t=ua(r,"content.xml");if(!t)throw new Error("Missing content.xml in ODS / UOF file");var n=MH(lr(t),e);return Na(r,"meta.xml")&&(n.Props=A7(vn(r,"meta.xml"))),n}function VI(r,e){return MH(r,e)}var Pve=function(){var r=["<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 "+F1({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office
708: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"})+">"+r+"</office:document-styles>";return function(){return fn+e}}(),GI=function(){var r=function(i){return Qt(i).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 /> 709`,t=` <table:covered-table-cell/> 710`,n=function(i,a,o){var l=[];l.push(' <table:table table:name="'+Qt(a.SheetNames[o])+`" table:style-name="ta1"> 711`);var c=0,u=0,f=Ci(i["!ref"]||"A1"),p=i["!merges"]||[],m=0,x=Array.isArray(i);if(i["!cols"])for(u=0;u<=f.e.c;++u)l.push(" <table:table-column"+(i["!cols"][u]?' table:style-name="co'+i["!cols"][u].ods+'"':"")+`></table:table-column> 712`);var g="",y=i["!rows"]||[];for(c=0;c<f.s.r;++c)g=y[c]?' table:style-name="ro'+y[c].ods+'"':"",l.push(" <table:table-row"+g+`></table:table-row> 713`);for(;c<=f.e.r;++c){for(g=y[c]?' table:style-name="ro'+y[c].ods+'"':"",l.push(" <table:table-row"+g+`> 714`),u=0;u<f.s.c;++u)l.push(e);for(;u<=f.e.c;++u){var v=!1,w={},b="";for(m=0;m!=p.length;++m)if(!(p[m].s.c>u)&&!(p[m].s.r>c)&&!(p[m].e.c<u)&&!(p[m].e.r<c)){(p[m].s.c!=u||p[m].s.r!=c)&&(v=!0),w["table:number-columns-spanned"]=p[m].e.c-p[m].s.c+1,w["table:number-rows-spanned"]=p[m].e.r-p[m].s.r+1;break}if(v){l.push(t);continue}var _=Qe({r:c,c:u}),T=x?(i[c]||[])[u]:i[_];if(T&&T.f&&(w["table:formula"]=Qt(q0e(T.f)),T.F&&T.F.slice(0,_.length)==_)){var A=Ci(T.F);w["table:number-matrix-columns-spanned"]=A.e.c-A.s.c+1,w["table:number-matrix-rows-spanned"]=A.e.r-A.s.r+1}if(!T){l.push(e);continue}switch(T.t){case"b":b=T.v?"TRUE":"FALSE",w["office:value-type"]="boolean",w["office:boolean-value"]=T.v?"true":"false";break;case"n":b=T.w||String(T.v||0),w["office:value-type"]="float",w["office:value"]=T.v||0;break;case"s":case"str":b=T.v==null?"":T.v,w["office:value-type"]="string";break;case"d":b=T.w||Er(T.v).toISOString(),w["office:value-type"]="date",w["office:date-value"]=Er(T.v).toISOString(),w["table:style-name"]="ce1";break;default:l.push(e);continue}var N=r(b);if(T.l&&T.l.Target){var k=T.l.Target;k=k.charAt(0)=="#"?"#"+Z0e(k.slice(1)):k,k.charAt(0)!="#"&&!k.match(/^\w+:/)&&(k="../"+k),N=Ee("text:a",N,{"xlink:href":k.replace(/&/g,"&")})}l.push(" "+Ee("table:table-cell",Ee("text:p",N,{}),w)+` 715`)}l.push(` </table:table-row> 716`)}return l.push(` </table:table> 717`),l.join("")},s=function(i,a){i.push(` <office:automatic-styles> 718`),i.push(` <number:date-style style:name="N37" number:automatic-order="true"> 719`),i.push(` <number:month number:style="long"/> 720`),i.push(` <number:text>/</number:text> 721`),i.push(` <number:day number:style="long"/> 722`),i.push(` <number:text>/</number:text> 723`),i.push(` <number:year/> 724`),i.push(` </number:date-style> 725`);var o=0;a.SheetNames.map(function(c){return a.Sheets[c]}).forEach(function(c){if(c&&c["!cols"]){for(var u=0;u<c["!cols"].length;++u)if(c["!cols"][u]){var f=c["!cols"][u];if(f.width==null&&f.wpx==null&&f.wch==null)continue;Hh(f),f.ods=o;var p=c["!cols"][u].wpx+"px";i.push(' <style:style style:name="co'+o+`" style:family="table-column"> 726`),i.push(' <style:table-column-properties fo:break-before="auto" style:column-width="'+p+`"/> 727`),i.push(` </style:style> 728`),++o}}});var l=0;a.SheetNames.map(function(c){return a.Sheets[c]}).forEach(function(c){if(c&&c["!rows"]){for(var u=0;u<c["!rows"].length;++u)if(c["!rows"][u]){c["!rows"][u].ods=l;var f=c["!rows"][u].hpx+"px";i.push(' <style:style style:name="ro'+l+`" style:family="table-row"> 729`),i.push(' <style:table-row-properties fo:break-before="auto" style:row-height="'+f+`"/> 730`),i.push(` </style:style> 731`),++l}}}),i.push(` <style:style style:name="ta1" style:family="table" style:master-page-name="mp1"> 732`),i.push(` <style:table-properties table:display="true" style:writing-mode="lr-tb"/> 733`),i.push(` </style:style> 734`),i.push(` <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/> 735`),i.push(` </office:automatic-styles> 736`)};return function(a,o){var l=[fn],c=F1({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office
736: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"}),u=F1({"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+u+`> 737`),l.push(E7().replace(/office:document-meta/g,"office:meta"))):l.push("<office:document-content"+c+`> 738`),s(l,a),l.push(` <office:body> 739`),l.push(` <office:spreadsheet> 740`);for(var f=0;f!=a.SheetNames.length;++f)l.push(n(a.Sheets[a.SheetNames[f]],a,f));return l.push(` </office:spreadsheet> 741`),l.push(` </office:body> 742`),o.bookType=="fods"?l.push("</office:document>"):l.push("</office:document-content>"),l.join("")}}();function IH(r,e){if(e.bookType=="fods")return GI(r,e);var t=Ij(),n="",s=[],i=[];return n="mimetype",vt(t,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",vt(t,n,GI(r,e)),s.push([n,"text/xml"]),i.push([n,"ContentFile"]),n="styles.xml",vt(t,n,Pve(r,e)),s.push([n,"text/xml"]),i.push([n,"StylesFile"]),n="meta.xml",vt(t,n,fn+E7()),s.push([n,"text/xml"]),i.push([n,"MetadataFile"]),n="manifest.rdf",vt(t,n,iue(i)),s.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",vt(t,n,nue(s)),t}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function R0(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function NR(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):lr(Qh(r))}function Rve(r){return typeof TextEncoder<"u"?new TextEncoder().encode(r):ca(Kl(r))}function jve(r,e){e:for(var t=0;t<=r.length-e.length;++t){for(var n=0;n<e.length;++n)if(r[t+n]!=e[n])continue e;return!0}return!1}function Vh(r){var e=r.reduce(function(s,i){return s+i.length},0),t=new Uint8Array(e),n=0;return r.forEach(function(s){t.set(s,n),n+=s.length}),t}function KI(r){return r-=r>>1&1431655765,r=(r&858993459)+(r>>2&858993459),(r+(r>>4)&252645135)*16843009>>>24}function Ove(r,e){for(var t=(r[e+15]&127)<<7|r[e+14]>>1,n=r[e+14]&1,s=e+13;s>=e;--s)n=n*256+r[s];return(r[e+15]&128?-n:n)*Math.pow(10,t-6176)}function Fve(r,e,t){var n=Math.floor(t==0?0:Math.LOG10E*Math.log(Math.abs(t)))+6176-20,s=t/Math.pow(10,n-6176);r[e+15]|=n>>7,r[e+14]|=(n&127)<<1;for(var i=0;s>=1;++i,s/=256)r[e+i]=s&255;r[e+15]|=t>=0?0:128}function z1(r,e){var t=e?e[0]:0,n=r[t]&127;e:if(r[t++]>=128&&(n|=(r[t]&127)<<7,r[t++]<128||(n|=(r[t]&127)<<14,r[t++]<128)||(n|=(r[t]&127)<<21,r[t++]<128)||(n+=(r[t]&127)*Math.pow(2,28),++t,r[t++]<128)||(n+=(r[t]&127)*Math.pow(2,35),++t,r[t++]<128)||(n+=(r[t]&127)*Math.pow(2,42),++t,r[t++]<128)))break e;return e&&(e[0]=t),n}function Yt(r){var e=new Uint8Array(7);e[0]=r&127;var t=1;e:if(r>127){if(e[t-1]|=128,e[t]=r>>7&127,++t,r<=16383||(e[t-1]|=128,e[t]=r>>14&127,++t,r<=2097151)||(e[t-1]|=128,e[t]=r>>21&127,++t,r<=268435455)||(e[t-1]|=128,e[t]=r/256>>>21&127,++t,r<=34359738367)||(e[t-1]|=128,e[t]=r/65536>>>21&127,++t,r<=4398046511103))break e;e[t-1]|=128,e[t]=r/16777216>>>21&127,++t}return e.slice(0,t)}function rn(r){var e=0,t=r[e]&127;e:if(r[e++]>=128){if(t|=(r[e]&127)<<7,r[e++]<128||(t|=(r[e]&127)<<14,r[e++]<128)||(t|=(r[e]&127)<<21,r[e++]<128))break e;t|=(r[e]&127)<<28}return t}function Mt(r){for(var e=[],t=[0];t[0]<r.length;){var n=t[0],s=z1(r,t),i=s&7;s=Math.floor(s/8);var a=0,o;if(s==0)break;switch(i){case 0:{for(var l=t[0];r[t[0]++]>=128;);
742o=r.slice(l,t[0])}break;case 5:a=4,o=r.slice(t[0],t[0]+a),t[0]+=a;break;case 1:a=8,o=r.slice(t[0],t[0]+a),t[0]+=a;break;case 2:a=z1(r,t),o=r.slice(t[0],t[0]+a),t[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(i," for Field ").concat(s," at offset ").concat(n))}var c={data:o,type:i};e[s]==null?e[s]=[c]:e[s].push(c)}return e}function Jn(r){var e=[];return r.forEach(function(t,n){t.forEach(function(s){s.data&&(e.push(Yt(n*8+s.type)),s.type==2&&e.push(Yt(s.data.length)),e.push(s.data))})}),Vh(e)}function uO(r,e){return(r==null?void 0:r.map(function(t){return e(t.data)}))||[]}function Ta(r){for(var e,t=[],n=[0];n[0]<r.length;){var s=z1(r,n),i=Mt(r.slice(n[0],n[0]+s));n[0]+=s;var a={id:rn(i[1][0].data),messages:[]};i[2].forEach(function(o){var l=Mt(o.data),c=rn(l[3][0].data);a.messages.push({meta:l,data:r.slice(n[0],n[0]+c)}),n[0]+=c}),(e=i[3])!=null&&e[0]&&(a.merge=rn(i[3][0].data)>>>0>0),t.push(a)}return t}function rm(r){var e=[];return r.forEach(function(t){var n=[];n[1]=[{data:Yt(t.id),type:0}],n[2]=[],t.merge!=null&&(n[3]=[{data:Yt(+!!t.merge),type:0}]);var s=[];t.messages.forEach(function(a){s.push(a.data),a.meta[3]=[{type:0,data:Yt(a.data.length)}],n[2].push({data:Jn(a.meta),type:2})});var i=Jn(n);
vendor: 7,073 bytes, line 742
742e.push(Yt(i.length)),e.push(i),s.forEach(function(a){return e.push(a)})}),Vh(e)}function Dve(r,e){if(r!=0)throw new Error("Unexpected Snappy chunk type ".concat(r));for(var t=[0],n=z1(e,t),s=[];t[0]<e.length;){var i=e[t[0]]&3;if(i==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}s.push(e.slice(t[0],t[0]+a)),t[0]+=a;continue}else{var l=0,c=0;if(i==1?(c=(e[t[0]]>>2&7)+4,l=(e[t[0]++]&224)<<3,l|=e[t[0]++]):(c=(e[t[0]++]>>2)+1,i==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)),s=[Vh(s)],l==0)throw new Error("Invalid offset 0");if(l>s[0].length)throw new Error("Invalid offset beyond length");if(c>=l)for(s.push(s[0].slice(-l)),c-=l;c>=s[s.length-1].length;)s.push(s[s.length-1]),c-=s[s.length-1].length;s.push(s[0].slice(-l,-l+c))}}var u=Vh(s);if(u.length!=n)throw new Error("Unexpected length: ".concat(u.length," != ").concat(n));return u}function Ca(r){for(var e=[],t=0;t<r.length;){var n=r[t++],s=r[t]|r[t+1]<<8|r[t+2]<<16;t+=3,e.push(Dve(n,r.slice(t,t+s))),t+=s}if(t!==r.length)throw new Error("data is not a valid framed stream!");return Vh(e)}function nm(r){for(var e=[],t=0;t<r.length;){var n=Math.min(r.length-t,268435455),s=new Uint8Array(4);e.push(s);var i=Yt(n),a=i.length;e.push(i),n<=60?(a++,e.push(new Uint8Array([n-1<<2]))):n<=256?(a+=2,e.push(new Uint8Array([240,n-1&255]))):n<=65536?(a+=3,e.push(new Uint8Array([244,n-1&255,n-1>>8&255]))):n<=16777216?(a+=4,e.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,e.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),e.push(r.slice(t,t+n)),a+=n,s[0]=0,s[1]=a&255,s[2]=a>>8&255,s[3]=a>>16&255,t+=n}return Vh(e)}function Mve(r,e,t,n){var s=R0(r),i=s.getUint32(4,!0),a=(n>1?12:8)+KI(i&(n>1?3470:398))*4,o=-1,l=-1,c=NaN,u=new Date(2001,0,1);i&512&&(o=s.getUint32(a,!0),a+=4),a+=KI(i&(n>1?12288:4096))*4,i&16&&(l=s.getUint32(a,!0),a+=4),i&32&&(c=s.getFloat64(a,!0),a+=8),i&64&&(u.setTime(u.getTime()+s.getFloat64(a,!0)*1e3),a+=8);var f;switch(r[2]){case 0:break;case 2:f={t:"n",v:c};break;case 3:f={t:"s",v:e[l]};break;case 5:f={t:"d",v:u};break;case 6:f={t:"b",v:c>0};break;case 7:f={t:"n",v:c/86400};break;case 8:f={t:"e",v:0};break;case 9:if(o>-1)f={t:"s",v:t[o]};else if(l>-1)f={t:"s",v:e[l]};else if(!isNaN(c))f={t:"n",v:c};else throw new Error("Unsupported cell type ".concat(r.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(r.slice(0,4)))}return f}function Ive(r,e,t){var n=R0(r),s=n.getUint32(8,!0),i=12,a=-1,o=-1,l=NaN,c=NaN,u=new Date(2001,0,1);s&1&&(l=Ove(r,i),i+=16),s&2&&(c=n.getFloat64(i,!0),i+=8),s&4&&(u.setTime(u.getTime()+n.getFloat64(i,!0)*1e3),i+=8),s&8&&(o=n.getUint32(i,!0),i+=4),s&16&&(a=n.getUint32(i,!0),i+=4);var f;switch(r[1]){case 0:break;case 2:f={t:"n",v:l};break;case 3:f={t:"s",v:e[o]};break;case 5:f={t:"d",v:u};break;case 6:f={t:"b",v:c>0};break;case 7:f={t:"n",v:c/86400};break;case 8:f={t:"e",v:0};break;case 9:if(a>-1)f={t:"s",v:t[a]};else throw new Error("Unsupported cell type ".concat(r[1]," : ").concat(s&31," : ").concat(r.slice(0,4)));break;case 10:f={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(r[1]," : ").concat(s&31," : ").concat(r.slice(0,4)))}return f}function JT(r,e){var t=new Uint8Array(32),n=R0(t),s=12,i=0;switch(t[0]=5,r.t){case"n":t[1]=2,Fve(t,s,r.v),i|=1,s+=16;break;case"b":t[1]=6,n.setFloat64(s,r.v?1:0,!0),i|=2,s+=8;break;case"s":if(e.indexOf(r.v)==-1)throw new Error("Value ".concat(r.v," missing from SST!"));t[1]=3,n.setUint32(s,e.indexOf(r.v),!0),i|=8,s+=4;break;default:throw"unsupported cell type "+r.t}return n.setUint32(8,i,!0),t.slice(0,s)}function QT(r,e){var t=new Uint8Array(32),n=R0(t),s=12,i=0;switch(t[0]=3,r.t){case"n":t[2]=2,n.setFloat64(s,r.v,!0),i|=32,s+=8;break;case"b":t[2]=6,n.setFloat64(s,r.v?1:0,!0),i|=32,s+=8;break;case"s":if(e.indexOf(r.v)==-1)throw new Error("Value ".concat(r.v," missing from SST!"));t[2]=3,n.setUint32(s,e.indexOf(r.v),!0),i|=16,s+=4;break;default:throw"unsupported cell type "+r.t}return n.setUint32(4,i,!0),t.slice(0,s)}function Lve(r,e,t){switch(r[0]){case 0:case 1:case 2:case 3:return Mve(r,e,t,r[0]);case 5:return Ive(r,e,t);default:throw new Error("Unsupported payload version ".concat(r[0]))}}function Cs(r){var e=Mt(r);return z1(e[1][0].data)}function XI(r,e){var t=Mt(e.data),n=rn(t[1][0].data),s=t[3],i=[];return(s||[]).forEach(function(a){var o=Mt(a.data),l=rn(o[1][0].data)>>>0;switch(n){case 1:i[l]=NR(o[3][0].data);break;case 8:{var c=r[Cs(o[9][0].data)][0],u=Mt(c.data),f=r[Cs(u[1][0].data)][0],p=rn(f.meta[1][0].data);if(p!=2001)throw new Error("2000 unexpected reference to ".concat(p));var m=Mt(f.data);i[l]=m[3].map(function(x){return NR(x.data)}).join("")}break}}),i}function Bve(r,e){var t,n,s,i,a,o,l,c,u,f,p,m,x,g,y=Mt(r),v=rn(y[1][0].data)>>>0,w=rn(y[2][0].data)>>>0,b=((n=(t=y[8])==null?void 0:t[0])==null?void 0:n.data)&&rn(y[8][0].data)>0||!1,_,T;if((i=(s=y[7])==null?void 0:s[0])!=null&&i.data&&e!=0)_=(o=(a=y[7])==null?void 0:a[0])==null?void 0:o.data,T=(c=(l=y[6])==null?void 0:l[0])==null?void 0:c.data;else if((f=(u=y[4])==null?void 0:u[0])!=null&&f.data&&e!=1)_=(m=(p=y[4])==null?void 0:p[0])==null?void 0:m.data,T=(g=(x=y[3])==null?void 0:x[0])==null?void 0:g.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var A=b?4:1,N=R0(_),k=[],E=0;E<_.length/2;++E){var P=N.getUint16(E*2,!0);P<65535&&k.push([E,P])}if(k.length!=w)throw"Expected ".concat(w," cells, found ").concat(k.length);var O=[];for(E=0;E<k.length-1;++E)O[k[E][0]]=T.subarray(k[E][1]*A,k[E+1][1]*A);return k.length>=1&&(O[k[k.length-1][0]]=T.subarray(k[k.length-1][1]*A)),{R:v,cells:O}}function Uve(r,e){var t,n=Mt(e.data),s=(t=n==null?void 0:n[7])!=null&&t[0]?rn(n[7][0].data)>>>0>0?1:0:-1,i=uO(n[5],function(a){return Bve(a,s)});return{nrows:rn(n[4][0].data)>>>0,data:i.reduce(function(a,o){return a[o.R]||(a[o.R]=[]),o.cells.forEach(function(l,c){if(a[o.R][c])throw new Error("Duplicate cell r=".concat(o.R," c=").concat(c));a[o.R][c]=l}),a},[])}}function $ve(r,e,t){var n,s=Mt(e.data),i={s:{r:0,c:0},e:{r:0,c:0}};if(i.e.r=(rn(s[6][0].data)>>>0)-1,i.e.r<0)throw new Error("Invalid row varint ".concat(s[6][0].data));if(i.e.c=(rn(s[7][0].data)>>>0)-1,i.e.c<0)throw new Error("Invalid col varint ".concat(s[7][0].data));t["!ref"]=gt(i);var a=Mt(s[4][0].data),o=XI(r,r[Cs(a[4][0].data)][0]),l=(n=a[17])!=null&&n[0]?XI(r,r[Cs(a[17][0].data)][0]):[],c=Mt(a[3][0].data),u=0;c[1].forEach(function(f){var p=Mt(f.data),m=r[Cs(p[2][0].data)][0],x=rn(m.meta[1][0].data);if(x!=6002)throw new Error("6001 unexpected reference to ".concat(x));var g=Uve(r,m);g.data.forEach(function(y,v){y.forEach(function(w,b){var _=Qe({r:u+v,c:b}),T=Lve(w,o,l);T&&(t[_]=T)})}),u+=g.nrows})}function zve(r,e){var t=Mt(e.data),n={"!ref":"A1"},s=r[Cs(t[2][0].data)],i=rn(s[0].meta[1][0].data);if(i!=6001)throw new Error("6000 unexpected reference to ".concat(i));return $ve(r,s[0],n),n}function Hve(r,e){var t,n=Mt(e.data),s={name:(t=n[1])!=null&&t[0]?N
742R(n[1][0].data):"",sheets:[]},i=uO(n[2],Cs);return i.forEach(function(a){r[a].forEach(function(o){var l=rn(o.meta[1][0].data);l==6e3&&s.sheets.push(zve(r,o))})}),s}function Wve(r,e){var t=mO(),n=Mt(e.data),s=uO(n[1],Cs);if(s.forEach(function(i){r[i].forEach(function(a){var o=rn(a.meta[1][0].data);if(o==2){var l=Hve(r,a);l.sheets.forEach(function(c,u){gO(t,c,u==0?l.name:l.name+"_"+u,!0)})}})}),t.SheetNames.length==0)throw new Error("Empty NUMBERS file");return t}function eC(r){var e,t,n,s,i={},a=[];if(r.FullPaths.forEach(function(l){if(l.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),r.FileIndex.forEach(function(l){if(l.name.match(/\.iwa$/)){var c;try{c=Ca(l.content)}catch(f){return console.log("?? "+l.content.length+" "+(f.message||f))}var u;try{u=Ta(c)}catch(f){return console.log("## "+(f.message||f))}u.forEach(function(f){i[f.id]=f.messages,a.push(f.id)})}}),!a.length)throw new Error("File has no messages");var o=((s=(n=(t=(e=i==null?void 0:i[1])==null?void 0:e[0])==null?void 0:t.meta)==null?void 0:n[1])==null?void 0:s[0].data)&&rn(i[1][0].meta[1][0].data)==1&&i[1][0];if(o||a.forEach(function(l){i[l].forEach(function(c){var u=rn(c.meta[1][0].data)>>>0;if(u==1)if(!o)o=c;else throw new Error("Document has multiple roots")})}),!o)throw new Error("Cannot find Document root");return Wve(i,o)}function Vve(r,e,t){var n,s,i,a;if(!((n=r[6])!=null&&n[0])||!((s=r[7])!=null&&s[0]))throw"Mutation only works on post-BNC storages!";var o=((a=(i=r[8])==null?void 0:i[0])==null?void 0:a.data)&&rn(r[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var l=0,c=R0(r[7][0].data),u=0,f=[],p=R0(r[4][0].data),m=0,x=[],g=0;g<e.length;++g){if(e[g]==null){c.setUint16(g*2,65535,!0),p.setUint16(g*2,65535);continue}c.setUint16(g*2,u,!0),p.setUint16(g*2,m,!0);var y,v;switch(typeof e[g]){case"string":y=JT({t:"s",v:e[g]},t),v=QT({t:"s",v:e[g]},t);break;case"number":y=JT({t:"n",v:e[g]},t),v=QT({t:"n",v:e[g]},t);break;case"boolean":y=JT({t:"b",v:e[g]},t),v=QT({t:"b",v:e[g]},t);break;default:throw new Error("Unsupported value "+e[g])}f.push(y),u+=y.length,x.push(v),m+=v.length,++l}for(r[2][0].data=Yt(l);g<r[7][0].data.length/2;++g)c.setUint16(g*2,65535,!0),p.setUint16(g*2,65535,!0);return r[6][0].data=Vh(f),r[3][0].data=Vh(x),l}
742function Gve(r,e){if(!e||!e.numbers)throw new Error("Must pass a `numbers` option -- check the README");var t=r.Sheets[r.SheetNames[0]];r.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var n=Ci(t["!ref"]);n.s.r=n.s.c=0;var s=!1;n.e.c>9&&(s=!0,n.e.c=9),n.e.r>49&&(s=!0,n.e.r=49),s&&console.error("The Numbers writer is currently limited to ".concat(gt(n)));var i=IS(t,{range:n,header:1}),a=["~Sh33tJ5~"];i.forEach(function(z){return z.forEach(function(M){typeof M=="string"&&a.push(M)})});var o={},l=[],c=Ke.read(e.numbers,{type:"base64"});c.FileIndex.map(function(z,M){return[z,c.FullPaths[M]]}).forEach(function(z){var M=z[0],U=z[1];if(M.type==2&&M.name.match(/\.iwa/)){var te=M.content,re=Ca(te),se=Ta(re);se.forEach(function(ie){l.push(ie.id),o[ie.id]={deps:[],location:U,type:rn(ie.messages[0].meta[1][0].data)}})}}),l.sort(function(z,M){return z-M});var u=l.filter(function(z){return z>1}).map(function(z){return[z,Yt(z)]});c.FileIndex.map(function(z,M){return[z,c.FullPaths[M]]}).forEach(function(z){var M=z[0];if(z[1],!!M.name.match(/\.iwa/)){var U=Ta(Ca(M.content));U.forEach(function(te){te.messages.forEach(function(re){u.forEach(function(se){te.messages.some(function(ie){return rn(ie.meta[1][0].data)!=11006&&jve(ie.data,se[1])})&&o[se[0]].deps.push(te.id)})})})}});for(var f=Ke.find(c,o[1].location),p=Ta(Ca(f.content)),m,x=0;x<p.length;++x){var g=p[x];g.id==1&&(m=g)}var y=Cs(Mt(m.messages[0].data)[1][0].data);for(f=Ke.find(c,o[y].location),p=Ta(Ca(f.content)),x=0;x<p.length;++x)g=p[x],g.id==y&&(m=g);for(y=Cs(Mt(m.messages[0].data)[2][0].data),f=Ke.find(c,o[y].location),p=Ta(Ca(f.content)),x=0;x<p.length;++x)g=p[x],g.id==y&&(m=g);for(y=Cs(Mt(m.messages[0].data)[2][0].data),f=Ke.find(c,o[y].location),p=Ta(Ca(f.content)),x=0;x<p.length;++x)g=p[x],g.id==y&&(m=g);var v=Mt(m.messages[0].data);{v[6][0].data=Yt(n.e.r+1),v[7][0].data=Yt(n.e.c+1);var w=Cs(v[46][0].data),b=Ke.find(c,o[w].location),_=Ta(Ca(b.content));{for(var T=0;T<_.length&&_[T].id!=w;++T);if(_[T].id!=w)throw"Bad ColumnRowUIDMapArchive";var A=Mt(_[T].messages[0].data);A[1]=[],A[2]=[],A[3]=[];for(var N=0;N<=n.e.c;++N){var k=[];k[1]=k[2]=[{type:0,data:Yt(N+420690)}],A[1].push({type:2,data:Jn(k)}),A[2].push({type:0,data:Yt(N)}),A[3].push({type:0,data:Yt(N)})}A[4]=[],A[5]=[],A[6]=[];for(var E=0;E<=n.e.r;++E)k=[],k[1]=k[2]=[{type:0,data:Yt(E+726270)}],A[4].push({type:2,data:Jn(k)}),A[5].push({type:0,data:Yt(E)}),A[6].push({type:0,data:Yt(E)});_[T].messages[0].data=Jn(A)}b.content=nm(rm(_)),b.size=b.content.length,delete v[46];var P=Mt(v[4][0].data);{P[7][0].data=Yt(n.e.r+1);var O=Mt(P[1][0].data),D=Cs(O[2][0].data);b=Ke.find(c,o[D].location),_=Ta(Ca(b.content));{if(_[0].id!=D)throw"Bad HeaderStorageBucket";var H=Mt(_[0].messages[0].data);for(E=0;E<i.length;++E){var B=Mt(H[2][0].data);B[1][0].data=Yt(E),B[4][0].data=Yt(i[E].length),H[2][E]={type:H[2][0].type,data:Jn(B)}}_[0].messages[0].data=Jn(H)}b.content=nm(rm(_)),b.size=b.content.length;var ee=Cs(P[2][0].data);b=Ke.find(c,o[ee].location),_=Ta(Ca(b.content));{if(_[0].id!=ee)throw"Bad HeaderStorageBucket";for(H=Mt(_[0].messages[0].data),N=0;N<=n.e.c;++N)B=Mt(H[2][0].data),B[1][0].data=Yt(N),B[4][0].data=Yt(n.e.r+1),H[2][N]={type:H[2][0].type,data:Jn(B)};_[0].messages[0].data=Jn(H)}b.content=nm(rm(_)),b.size=b.content.length;var X=Cs(P[4][0].data);(function(){for(var z=Ke.find(c,o[X].location),M=Ta(Ca(z.content)),U,te=0;te<M.length;++te){var re=M[te];re.id==X&&(U=re)}var se=Mt(U.messages[0].data);{se[3]=[];var ie=[];a.forEach(function(G,Ue){ie[1]=[{type:0,data:Yt(Ue)}],ie[2]=[{type:0,data:Yt(1)}],ie[3]=[{type:2,data:Rve(G)}],se[3].push({type:2,data:Jn(ie)})})}U.messages[0].data=Jn(se);var ae=rm(M),ge=nm(ae);z.content=ge,z.size=z.content.length})();var W=Mt(P[3][0].data);{var Y=W[1][0];delete W[2];var F=Mt(Y.data);{var J=Cs(F[2][0].data);(function(){for(var z=Ke.find(c,o[J].location),M=Ta(Ca(z.content)),U,te=0;te<M.length;++te){var re=M[te];re.id==J&&(U=re)}var se=Mt(U.messages[0].data);{delete se[6],delete W[7];var ie=new Uint8Array(se[5][0].data);se[5]=[];for(var ae=0,ge=0;ge<=n.e.r;++ge){var G=Mt(ie);ae+=Vve(G,i[ge],a),G[1][0].data=Yt(ge),se[5].push({data:Jn(G),type:2})}se[1]=[{type:0,data:Yt(n.e.c+1)}],se[2]=[{type:0,data:Yt(n.e.r+1)}],se[3]=[{type:0,data:Yt(ae)}],se[4]=[{type:0,data:Yt(n.e.r+1)}]}U.messages[0].data=Jn(se);var Ue=rm(M),Re=nm(Ue);z.content=Re,z.size=z.content.length})()}Y.data=Jn(F)}P[3][0].data=Jn(W)}v[4][0].data=Jn(P)}m.messages[0].data=Jn(v);var ne=rm(p),I=nm(ne);return f.content=I,f.size=f.content.length,c}function LH(r){return function(t){for(var n=0;n!=r.length;++n){var s=r[n];t[s[0]]===void 0&&(t[s[0]]=s[1]),s[2]==="n"&&(t[s[0]]=Number(t[s[0]]))}}}function dO(r){LH([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0
vendor: 9,183 bytes, line 742
742],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(r)}function hO(r){LH([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(r)}function Kve(r){return kt.WS.indexOf(r)>-1?"sheet":r==kt.CS?"chart":r==kt.DS?"dialog":r==kt.MS?"macro":r&&r.length?r:"sheet"}function Xve(r,e){if(!r)return 0;try{r=e.map(function(n){return n.id||(n.id=n.strRelID),[n.name,r["!id"][n.id].Target,Kve(r["!id"][n.id].Type)]})}catch{return null}return!r||r.length===0?null:r}function Yve(r,e,t,n,s,i,a,o,l,c,u,f){try{i[n]=My(ua(r,t,!0),e);var p=vn(r,e),m;switch(o){case"sheet":m=xxe(p,e,s,l,i[n],c,u,f);break;case"chart":if(m=vxe(p,e,s,l,i[n],c,u,f),!m||!m["!drawel"])break;var x=gy(m["!drawel"].Target,e),g=M1(x),y=spe(ua(r,x,!0),My(ua(r,g,!0),x)),v=gy(y,x),w=M1(v);m=Vge(ua(r,v,!0),v,l,My(ua(r,w,!0),v),c,m);break;case"macro":m=yxe(p,e,s,l,i[n],c,u,f);break;case"dialog":m=wxe(p,e,s,l,i[n],c,u,f);break;default:throw new Error("Unrecognized sheet type "+o)}a[n]=m;var b=[];i&&i[n]&&nn(i[n]).forEach(function(_){var T="";if(i[n][_].Type==kt.CMNT){T=gy(i[n][_].Target,e);var A=Sxe(vn(r,T,!0),T,l);if(!A||!A.length)return;OI(m,A,!1)}i[n][_].Type==kt.TCMNT&&(T=gy(i[n][_].Target,e),b=b.concat(ape(vn(r,T,!0),l)))}),b&&b.length&&OI(m,b,!0,l.people||[])}catch(_){if(l.WTF)throw _}}function Sa(r){return r.charAt(0)=="/"?r.slice(1):r}function qve(r,e){if(hv(),e=e||{},dO(e),Na(r,"META-INF/manifest.xml")||Na(r,"objectdata.xml"))return WI(r,e);if(Na(r,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof eC<"u"){if(r.FileIndex)return eC(r);var t=Ke.utils.cfb_new();return eI(r).forEach(function(B){vt(t,B,oce(r,B))}),eC(t)}throw new Error("Unsupported NUMBERS file")}if(!Na(r,"[Content_Types].xml"))throw Na(r,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):Na(r,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var n=eI(r),s=eue(ua(r,"[Content_Types].xml")),i=!1,a,o;if(s.workbooks.length===0&&(o="xl/workbook.xml",vn(r,o,!0)&&s.workbooks.push(o)),s.workbooks.length===0){if(o="xl/workbook.bin",!vn(r,o,!0))throw new Error("Could not find workbook");s.workbooks.push(o),i=!0}s.workbooks[0].slice(-3)=="bin"&&(i=!0);var l={},c={};if(!e.bookSheets&&!e.bookProps){if(Iy=[],s.sst)try{Iy=kxe(vn(r,Sa(s.sst)),s.sst,e)}catch(B){if(e.WTF)throw B}e.cellStyles&&s.themes.length&&(l=_xe(ua(r,s.themes[0].replace(/^\//,""),!0)||"",s.themes[0],e)),s.style&&(c=bxe(vn(r,Sa(s.style)),s.style,l,e))}s.links.map(function(B){try{var ee=My(ua(r,M1(Sa(B))),B);return Axe(vn(r,Sa(B)),ee,B,e)}catch{}});var u=gxe(vn(r,Sa(s.workbooks[0])),s.workbooks[0],e),f={},p="";s.coreprops.length&&(p=vn(r,Sa(s.coreprops[0]),!0),p&&(f=A7(p)),s.extprops.length!==0&&(p=vn(r,Sa(s.extprops[0]),!0),p&&oue(p,f,e)));var m={};(!e.bookSheets||e.bookProps)&&s.custprops.length!==0&&(p=ua(r,Sa(s.custprops[0]),!0),p&&(m=cue(p,e)));var x={};if((e.bookSheets||e.bookProps)&&(u.Sheets?a=u.Sheets.map(function(ee){return ee.name}):f.Worksheets&&f.SheetNames.length>0&&(a=f.SheetNames),e.bookProps&&(x.Props=f,x.Custprops=m),e.bookSheets&&typeof a<"u"&&(x.SheetNames=a),e.bookSheets?x.SheetNames:e.bookProps))return x;a={};var g={};e.bookDeps&&s.calcchain&&(g=Exe(vn(r,Sa(s.calcchain)),s.calcchain));var y=0,v={},w,b;{var _=u.Sheets;f.Worksheets=_.length,f.SheetNames=[];for(var T=0;T!=_.length;++T)f.SheetNames[T]=_[T].name}var A=i?"bin":"xml",N=s.workbooks[0].lastIndexOf("/"),k=(s.workbooks[0].slice(0,N+1)+"_rels/"+s.workbooks[0].slice(N+1)+".rels").replace(/^\//,"");Na(r,k)||(k="xl/_rels/workbook."+A+".rels");var E=My(ua(r,k,!0),k.replace(/_rels.*/,"s5s"));(s.metadata||[]).length>=1&&(e.xlmeta=Txe(vn(r,Sa(s.metadata[0])),s.metadata[0],e)),(s.people||[]).length>=1&&(e.people=lpe(vn(r,Sa(s.people[0])),e)),E&&(E=Xve(E,u.Sheets));var P=vn(r,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=f.Worksheets;++y){var O="sheet";if(E&&E[y]?(w="xl/"+E[y][1].replace(/[\/]?xl\//,""),Na(r,w)||(w=E[y][1]),Na(r,w)||(w=k.replace(/_rels\/.*$/,"")+E[y][1]),O=E[y][2]):(w="xl/worksheets/sheet"+(y+1-P)+"."+A,w=w.replace(/sheet0\./,"sheet.")),b=w.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(y!=e.sheets)continue e;break;case"string":if(f.SheetNames[y].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var D=!1,H=0;H!=e.sheets.length;++H)typeof e.sheets[H]=="number"&&e.sheets[H]==y&&(D=1),typeof e.sheets[H]=="string"&&e.sheets[H].toLowerCase()==f.SheetNames[y].toLowerCase()&&(D=1);if(!D)continue e}}Yve(r,w,b,f.SheetNames[y],y,v,a,O,e,u,l,c)}return x={Directory:s,Workbook:u,Props:f,Custprops:m,Deps:g,Sheets:a,SheetNames:f.SheetNames,Strings:Iy,Styles:c,Themes:l,SSF:Ar(Je)},e&&e.bookFiles&&(r.files?(x.keys=n,x.files=r.files):(x.keys=[],x.files={},r.FullPaths.forEach(function(B,ee){B=B.replace(/^Root Entry[\/]/,""),x.keys.push(B),x.files[B]=r.FileIndex[ee]}))),e&&e.bookVBA&&(s.vba.length>0?x.vbaraw=vn(r,Sa(s.vba[0]),!0):s.defaults&&s.defaults.bin===gpe&&(x.vbaraw=vn(r,"xl/vbaProject.bin",!0))),x}function Zve(r,e){var t=e||{},n="Workbook",s=Ke.find(r,n);try{if(n="/!DataSpaces/Version",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(The(s.content),n="/!DataSpaces/DataSpaceMap",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);var i=Nhe(s.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=Phe(s.content);if(a.length!=1||a[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);jhe(s.content)}catch{}if(n="/EncryptionInfo",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=Ohe(s.content);if(n="/EncryptedPackage",s=Ke.find(r,n),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(o[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(o[1],s.content,t.password||"",t);if(o[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(o[1],s.content,t.password||"",t);throw new Error("File is password-protected")}function Jve(r,e){return e.bookType=="ods"?IH(r,e):e.bookType=="numbers"?Gve(r,e):e.bookType=="xlsb"?Qve(r,e):eye(r,e)}function Qve(r,e){Pm=1024,r&&!r.SSF&&(r.SSF=Ar(Je)),r&&r.SSF&&(hv(),mA(r.SSF),e.revssf=xA(r.SSF),e.revssf[r.SSF[65535]]=0,e.ssf=r.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,Ly?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var t=e.bookType=="xlsb"?"bin":"xml",n=dH.indexOf(e.bookType)>-1,s=Zj();hO(e=e||{});var i=Ij(),a="",o=0;if(e.cellXfs=[],tf(e.cellXfs,{},{revssf:{General:0}}),r.Props||(r.Props={}),a="docProps/core.xml",vt(i,a,T7(r.Props,e)),s.coreprops.push(a),qt(e.rels,2,a,kt.CORE_PROPS),a="docProps/app.xml",!(r.Props&&r.Props.SheetNames))if(!r.Workbook||!r.Workbook.Sheets)r.Props.SheetNames=r.SheetNames;else{for(var l=[],c=0;c<r.SheetNames.length;++c)(r.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(r.SheetNames[c]);r.Props.SheetNames=l}for(r.Props.Worksheets=r.Props.SheetNames.length,vt(i,a,P7(r.Props)),s.extprops.push(a),qt(e.rels,3,a,kt.EXT_PROPS),r.Custprops!==r.Props&&nn(r.Custprops||{}).length>0&&(a="docProps/custom.xml",vt(i,a,R7(r.Custprops)),s.custprops.push(a),qt(e.rels,4,a,kt.CUST_PROPS)),o=1;o<=r.SheetNames.length;++o){var u={"!id":{}},f=r.Sheets[r.SheetNames[o-1]],p=(f||{})["!type"]||"sheet";switch(p){case"chart":default:a="xl/worksheets/sheet"+o+"."+t,vt(i,a,Nxe(o-1,a,e,r,u)),s.sheets.push(a),qt(e.wbrels,-1,"worksheets/sheet"+o+"."+t,kt.WS[0])}if(f){var m=f["!comments"],x=!1,g="";m&&m.length>0&&(g="xl/comments"+o+"."+t,vt(i,g,jxe(m,g)),s.comments.push(g),qt(u,-1,"../comments"+o+"."+t,kt.CMNT),x=!0),f["!legacy"]&&x&&vt(i,"xl/drawings/vmlDrawing"+o+".vml",cH(o,f["!comments"])),delete f["!comments"],delete f["!legacy"]}u["!id"].rId1&&vt(i,M1(a),Vm(u))}return e.Strings!=null&&e.Strings.length>0&&(a="xl/sharedStrings."+t,vt(i,a,Rxe(e.Strings,a,e)),s.strs.push(a),qt(e.wbrels,-1,"sharedStrings."+t,kt.SST)),a="xl/workbook."+t,vt(i,a,Cxe(r,a)),s.workbooks.push(a),qt(e.rels,1,a,kt.WB),a="xl/theme/theme1.xml",vt(i,a,nO(r.Themes,e)),s.themes.push(a),qt(e.wbrels,-1,"theme/theme1.xml",kt.THEME),a="xl/styles."+t,vt(i,a,Pxe(r,a,e)),s.styles.push(a),qt(e.wbrels,-1,"styles."+t,kt.STY),r.vbaraw&&n&&(a="xl/vbaProject.bin",vt(i,a,r.vbaraw),s.vba.push(a),qt(e.wbrels,-1,"vbaProject.bin",kt.VBA)),a="xl/metadata."+t,vt(i,a,Oxe(a)),s.metadata.push(a),qt(e.wbrels,-1,"metadata."+t,kt.XLMETA),vt(i,"[Content_Types].xml",S7(s,e)),vt(i,"_rels/.rels",Vm(e.rels)),vt(i,"xl/_rels/workbook."+t+".rels",Vm(e.wbrels)),delete e.revssf,delete e.ssf,i}
vendor: 7,568 bytes, line 742
742function eye(r,e){Pm=1024,r&&!r.SSF&&(r.SSF=Ar(Je)),r&&r.SSF&&(hv(),mA(r.SSF),e.revssf=xA(r.SSF),e.revssf[r.SSF[65535]]=0,e.ssf=r.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,Ly?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var t="xml",n=dH.indexOf(e.bookType)>-1,s=Zj();hO(e=e||{});var i=Ij(),a="",o=0;if(e.cellXfs=[],tf(e.cellXfs,{},{revssf:{General:0}}),r.Props||(r.Props={}),a="docProps/core.xml",vt(i,a,T7(r.Props,e)),s.coreprops.push(a),qt(e.rels,2,a,kt.CORE_PROPS),a="docProps/app.xml",!(r.Props&&r.Props.SheetNames))if(!r.Workbook||!r.Workbook.Sheets)r.Props.SheetNames=r.SheetNames;else{for(var l=[],c=0;c<r.SheetNames.length;++c)(r.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(r.SheetNames[c]);r.Props.SheetNames=l}r.Props.Worksheets=r.Props.SheetNames.length,vt(i,a,P7(r.Props)),s.extprops.push(a),qt(e.rels,3,a,kt.EXT_PROPS),r.Custprops!==r.Props&&nn(r.Custprops||{}).length>0&&(a="docProps/custom.xml",vt(i,a,R7(r.Custprops)),s.custprops.push(a),qt(e.rels,4,a,kt.CUST_PROPS));var u=["SheetJ5"];for(e.tcid=0,o=1;o<=r.SheetNames.length;++o){var f={"!id":{}},p=r.Sheets[r.SheetNames[o-1]],m=(p||{})["!type"]||"sheet";switch(m){case"chart":default:a="xl/worksheets/sheet"+o+"."+t,vt(i,a,_H(o-1,e,r,f)),s.sheets.push(a),qt(e.wbrels,-1,"worksheets/sheet"+o+"."+t,kt.WS[0])}if(p){var x=p["!comments"],g=!1,y="";if(x&&x.length>0){var v=!1;x.forEach(function(w){w[1].forEach(function(b){b.T==!0&&(v=!0)})}),v&&(y="xl/threadedComments/threadedComment"+o+"."+t,vt(i,y,ope(x,u,e)),s.threadedcomments.push(y),qt(f,-1,"../threadedComments/threadedComment"+o+"."+t,kt.TCMNT)),y="xl/comments"+o+"."+t,vt(i,y,uH(x)),s.comments.push(y),qt(f,-1,"../comments"+o+"."+t,kt.CMNT),g=!0}p["!legacy"]&&g&&vt(i,"xl/drawings/vmlDrawing"+o+".vml",cH(o,p["!comments"])),delete p["!comments"],delete p["!legacy"]}f["!id"].rId1&&vt(i,M1(a),Vm(f))}return e.Strings!=null&&e.Strings.length>0&&(a="xl/sharedStrings."+t,vt(i,a,Z7(e.Strings,e)),s.strs.push(a),qt(e.wbrels,-1,"sharedStrings."+t,kt.SST)),a="xl/workbook."+t,vt(i,a,TH(r)),s.workbooks.push(a),qt(e.rels,1,a,kt.WB),a="xl/theme/theme1.xml",vt(i,a,nO(r.Themes,e)),s.themes.push(a),qt(e.wbrels,-1,"theme/theme1.xml",kt.THEME),a="xl/styles."+t,vt(i,a,iH(r,e)),s.styles.push(a),qt(e.wbrels,-1,"styles."+t,kt.STY),r.vbaraw&&n&&(a="xl/vbaProject.bin",vt(i,a,r.vbaraw),s.vba.push(a),qt(e.wbrels,-1,"vbaProject.bin",kt.VBA)),a="xl/metadata."+t,vt(i,a,lH()),s.metadata.push(a),qt(e.wbrels,-1,"metadata."+t,kt.XLMETA),u.length>1&&(a="xl/persons/person.xml",vt(i,a,cpe(u)),s.people.push(a),qt(e.wbrels,-1,"persons/person.xml",kt.PEOPLE)),vt(i,"[Content_Types].xml",S7(s,e)),vt(i,"_rels/.rels",Vm(e.rels)),vt(i,"xl/_rels/workbook."+t+".rels",Vm(e.wbrels)),delete e.revssf,delete e.ssf,i}function fO(r,e){var t="";switch((e||{}).type||"base64"){case"buffer":return[r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]];case"base64":t=xa(r.slice(0,12));break;case"binary":t=r;break;case"array":return[r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[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 tye(r,e){return Ke.find(r,"EncryptedPackage")?Zve(r,e):RH(r,e)}function rye(r,e){var t,n=r,s=e||{};return s.type||(s.type=bt&&Buffer.isBuffer(r)?"buffer":"base64"),t=Qz(n,s),qve(t,s)}function BH(r,e){var t=0;e:for(;t<r.length;)switch(r.charCodeAt(t)){case 10:case 13:case 32:++t;break;case 60:return TR(r.slice(t),e);default:break e}return Yx.to_workbook(r,e)}function nye(r,e){var t="",n=fO(r,e);switch(e.type){case"base64":t=xa(r);break;case"binary":t=r;break;case"buffer":t=r.toString("binary");break;case"array":t=T0(r);break;default:throw new Error("Unrecognized type "+e.type)}return n[0]==239&&n[1]==187&&n[2]==191&&(t=lr(t)),e.type="binary",BH(t,e)}function sye(r,e){var t=r;return e.type=="base64"&&(t=xa(t)),t=sd.utils.decode(1200,t.slice(2),"str"),e.type="binary",BH(t,e)}function iye(r){return r.match(/[^\x00-\x7F]/)?Kl(r):r}function tC(r,e,t,n){return n?(t.type="string",Yx.to_workbook(r,t)):Yx.to_workbook(e,t)}function j0(r,e){jj();var t=e||{};if(typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer)return j0(new Uint8Array(r),(t=Ar(t),t.type="array",t));typeof Uint8Array<"u"&&r instanceof Uint8Array&&!t.type&&(t.type=typeof Deno<"u"?"buffer":"array");var n=r,s=[0,0,0,0],i=!1;if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),Km={},t.dateNF&&(Km.dateNF=t.dateNF),t.type||(t.type=bt&&Buffer.isBuffer(r)?"buffer":"base64"),t.type=="file"&&(t.type=bt?"buffer":"binary",n=Qle(r),typeof Uint8Array<"u"&&!bt&&(t.type="array")),t.type=="string"&&(i=!0,t.type="binary",t.codepage=65001,n=iye(r)),t.type=="array"&&typeof Uint8Array<"u"&&r instanceof Uint8Array&&typeof ArrayBuffer<"u"){var a=new ArrayBuffer(3),o=new Uint8Array(a);if(o.foo="bar",!o.foo)return t=Ar(t),t.type="array",j0(Oj(n),t)}switch((s=fO(n,t))[0]){case 208:if(s[1]===207&&s[2]===17&&s[3]===224&&s[4]===161&&s[5]===177&&s[6]===26&&s[7]===225)return tye(Ke.read(n,t),t);break;case 9:if(s[1]<=8)return RH(n,t);break;case 60:return TR(n,t);case 73:if(s[1]===73&&s[2]===42&&s[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(s[1]===68)return uhe(n,t);break;case 84:if(s[1]===65&&s[2]===66&&s[3]===76)return Y7.to_workbook(n,t);break;case 80:return s[1]===75&&s[2]<9&&s[3]<9?rye(n,t):tC(r,n,t,i);case 239:return s[3]===60?TR(n,t):tC(r,n,t,i);case 255:if(s[1]===254)return sye(n,t);if(s[1]===0&&s[2]===2&&s[3]===0)return h0.to_workbook(n,t);break;case 0:if(s[1]===0&&(s[2]>=2&&s[3]===0||s[2]===0&&(s[3]===8||s[3]===9)))return h0.to_workbook(n,t);break;case 3:case 131:case 139:case 140:return AR.to_workbook(n,t);case 123:if(s[1]===92&&s[2]===114&&s[3]===116)return rH.to_workbook(n,t);break;case 10:case 13:case 32:return nye(n,t);case 137:if(s[1]===80&&s[2]===78&&s[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return che.indexOf(s[0])>-1&&s[2]<=12&&s[3]<=31?AR.to_workbook(n,t):tC(r,n,t,i)}function UH(r,e){switch(e.type){case"base64":case"binary":break;case"buffer":case"array":e.type="";break;case"file":return Qb(e.file,Ke.write(r,{type:bt?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");default:throw new Error("Unrecognized type "+e.type)}return Ke.write(r,e)}function aye(r,e){var t=Ar(e||{}),n=Jve(r,t);return oye(n,t)}function oye(r,e){var t={},n=bt?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(e.compression&&(t.compression="DEFLATE"),e.password)t.type=n;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=n;break;default:throw new Error("Unrecognized type "+e.type)}var s=r.FullPaths?Ke.write(r,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[t.type]||t.type,compression:!!e.compression}):r.generate(t);if(typeof Deno<"u"&&typeof s=="string"){if(e.type=="binary"||e.type=="base64")return s;s=new Uint8Array(pA(s))}return e.password&&typeof encrypt_agile<"u"?UH(encrypt_agile(s,e.password),e):e.type==="file"?Qb(e.file,s):e.type=="string"?lr(s):s}function lye(r,e){var t=e||{},n=ive(r,t);return UH(n,t)}function fl(r,e,t){t||(t="");var n=t+r;switch(e.type){case"base64":return R1(Kl(n));case"binary":return Kl(n);case"string":return r;case"file":return Qb(e.file,n,"utf8");case"buffer":return bt?Du(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):fl(n,{type:"binary"}
vendor: 5,012 bytes, line 742
742).split("").map(function(s){return s.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function cye(r,e){switch(e.type){case"base64":return R1(r);case"binary":return r;case"string":return r;case"file":return Qb(e.file,r,"binary");case"buffer":return bt?Du(r,"binary"):r.split("").map(function(t){return t.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function dk(r,e){switch(e.type){case"string":case"base64":case"binary":for(var t="",n=0;n<r.length;++n)t+=String.fromCharCode(r[n]);return e.type=="base64"?R1(t):e.type=="string"?lr(t):t;case"file":return Qb(e.file,r);case"buffer":return r;default:throw new Error("Unrecognized type "+e.type)}}function $H(r,e){jj(),txe(r);var t=Ar(e||{});if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),t.type=="array"){t.type="binary";var n=$H(r,t);return t.type="array",pA(n)}var s=0;if(t.sheet&&(typeof t.sheet=="number"?s=t.sheet:s=r.SheetNames.indexOf(t.sheet),!r.SheetNames[s]))throw new Error("Sheet not found: "+t.sheet+" : "+typeof t.sheet);switch(t.bookType||"xlsb"){case"xml":case"xlml":return fl(Jxe(r,t),t);case"slk":case"sylk":return fl(X7.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"htm":case"html":return fl(OH(r.Sheets[r.SheetNames[s]],t),t);case"txt":return cye(HH(r.Sheets[r.SheetNames[s]],t),t);case"csv":return fl(pO(r.Sheets[r.SheetNames[s]],t),t,"\uFEFF");case"dif":return fl(Y7.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"dbf":return dk(AR.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"prn":return fl(Yx.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"rtf":return fl(rH.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"eth":return fl(q7.from_sheet(r.Sheets[r.SheetNames[s]],t),t);case"fods":return fl(IH(r,t),t);case"wk1":return dk(h0.sheet_to_wk1(r.Sheets[r.SheetNames[s]],t),t);case"wk3":return dk(h0.book_to_wk3(r,t),t);case"biff2":t.biff||(t.biff=2);case"biff3":t.biff||(t.biff=3);case"biff4":return t.biff||(t.biff=4),dk(jH(r,t),t);case"biff5":t.biff||(t.biff=5);case"biff8":case"xla":case"xls":return t.biff||(t.biff=8),lye(r,t);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return aye(r,t);default:throw new Error("Unrecognized bookType |"+t.bookType+"|")}}function uye(r){if(!r.bookType){var e={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},t=r.file.slice(r.file.lastIndexOf(".")).toLowerCase();t.match(/^\.[a-z]+$/)&&(r.bookType=t.slice(1)),r.bookType=e[r.bookType]||r.bookType}}function zH(r,e,t){var n={};return n.type="file",n.file=e,uye(n),$H(r,n)}function dye(r,e,t,n,s,i,a,o){var l=hn(t),c=o.defval,u=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),f=!0,p=s===1?[]:{};if(s!==1)if(Object.defineProperty)try{Object.defineProperty(p,"__rowNum__",{value:t,enumerable:!1})}catch{p.__rowNum__=t}else p.__rowNum__=t;if(!a||r[t])for(var m=e.s.c;m<=e.e.c;++m){var x=a?r[t][m]:r[n[m]+l];if(x===void 0||x.t===void 0){if(c===void 0)continue;i[m]!=null&&(p[i[m]]=c);continue}var g=x.v;switch(x.t){case"z":if(g==null)break;continue;case"e":g=g==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+x.t)}if(i[m]!=null){if(g==null)if(x.t=="e"&&g===null)p[i[m]]=null;else if(c!==void 0)p[i[m]]=c;else if(u&&g===null)p[i[m]]=null;else continue;else p[i[m]]=u&&(x.t!=="n"||x.t==="n"&&o.rawNumbers!==!1)?g:Cu(x,g,o);g!=null&&(f=!1)}}return{row:p,isempty:f}}function IS(r,e){if(r==null||r["!ref"]==null)return[];var t={t:"n",v:0},n=0,s=1,i=[],a=0,o="",l={s:{r:0,c:0},e:{r:0,c:0}},c=e||{},u=c.range!=null?c.range:r["!ref"];switch(c.header===1?n=1:c.header==="A"?n=2:Array.isArray(c.header)?n=3:c.header==null&&(n=0),typeof u){case"string":l=Ft(u);break;case"number":l=Ft(r["!ref"]),l.s.r=u;break;default:l=u}n>0&&(s=0);var f=hn(l.s.r),p=[],m=[],x=0,g=0,y=Array.isArray(r),v=l.s.r,w=0,b={};y&&!r[v]&&(r[v]=[]);var _=c.skipHidden&&r["!cols"]||[],T=c.skipHidden&&r["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(_[w]||{}).hidden)switch(p[w]=$r(w),t=y?r[v][w]:r[p[w]+f],n){case 1:i[w]=w-l.s.c;break;case 2:i[w]=p[w];break;case 3:i[w]=c.header[w-l.s.c];break;default:if(t==null&&(t={w:"__EMPTY",t:"s"}),o=a=Cu(t,null,c),g=b[a]||0,!g)b[a]=1;else{do o=a+"_"+g++;while(b[o]);b[a]=g,b[o]=1}i[w]=o}for(v=l.s.r+s;v<=l.e.r;++v)if(!(T[v]||{}).hidden){var A=dye(r,l,v,p,n,i,y,c);(A.isempty===!1||(n===1?c.blankrows!==!1:c.blankrows))&&(m[x++]=A.row)}return m.length=x,m}var YI=/"/g;function hye(r,e,t,n,s,i,a,o){for(var l=!0,c=[],u="",f=hn(t),p=e.s.c;p<=e.e.c;++p)if(n[p]){var m=o.dense?(r[t]||[])[p]:r[n[p]+f];if(m==null)u="";else if(m.v!=null){l=!1,u=""+(o.rawNumbers&&m.t=="n"?m.v:Cu(m,null,o));for(var x=0,g=0;x!==u.length;++x)if((g=u.charCodeAt(x))===s||g===i||g===34||o.forceQuotes){u='"'+u.replace(YI,'""')+'"';break}u=="ID"&&(u='"ID"')}else m.f!=null&&!m.F?(l=!1,u="="+m.f,u.indexOf(",")>=0&&(u='"'+u.replace(YI,'""')+'"')):u="";c.push(u)}return o.blankrows===!1&&l?null:c.join(a)}function pO(r,e){var t=[],n=e??{};if(r==null||r["!ref"]==null)return"";var s=Ft(r["!ref"]),i=n.FS!==void 0?n.FS:",",a=i.charCodeAt(0),o=n.RS!==void 0?n.RS:`
743`,l=o.charCodeAt(0),c=new RegExp((i=="|"?"\\|":i)+"+$"),u="",f=[];n.dense=Array.isArray(r);for(var p=n.skipHidden&&r["!cols"]||[],m=n.skipHidden&&r["!rows"]||[],x=s.s.c;x<=s.e.c;++x)(p[x]||{}).hidden||(f[x]=$r(x));for(var g=0,y=s.s.r;y<=s.e.r;++y)(m[y]||{}).hidden||(u=hye(r,s,y,f,a,l,i,n),u!=null&&(n.strip&&(u=u.replace(c,"")),(u||n.blankrows!==!1)&&t.push((g++?o:"")+u)));return delete n.dense,t.join("")}function HH(r,e){e||(e={}),e.FS=" ",e.RS=` 744`;var t=pO(r,e);return t}function fye(r){var e="",t,n="";if(r==null||r["!ref"]==null)return[];var s=Ft(r["!ref"]),i="",a=[],o,l=[],c=Array.isArray(r);for(o=s.s.c;o<=s.e.c;++o)a[o]=$r(o);for(var u=s.s.r;u<=s.e.r;++u)for(i=hn(u),o=s.s.c;o<=s.e.c;++o)if(e=a[o]+i,t=c?(r[u]||[])[o]:r[e],n="",t!==void 0){if(t.F!=null){if(e=t.F,!t.f)continue;n=t.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(t.f!=null)n=t.f;else{if(t.t=="z")continue;if(t.t=="n"&&t.v!=null)n=""+t.v;else if(t.t=="b")n=t.v?"TRUE":"FALSE";else if(t.w!==void 0)n="'"+t.w;else{if(t.v===void 0)continue;t.t=="s"?n="'"+t.v:n=""+t.v}}l[l.length]=e+"="+n}return l}function WH(r,e,t){var n=t||{},s=+!n.skipHeader,i=r||{},a=0,o=0;if(i&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?zr(n.origin):n.origin;a=l.r,o=l.c}var c,u={s:{c:0,r:0},e:{c:o,r:a+e.length-1+s}};if(i["!ref"]){var f=Ft(i["!ref"]);u.e.c=Math.max(u.e.c,f.e.c),u.e.r=Math.max(u.e.r,f.e.r),a==-1&&(a=f.e.r+1,u.e.r=a+e.length-1+s)}else a==-1&&(a=0,u.e.r=e.length-1+s);var p=n.header||[],m=0;e.forEach(function(g,y){nn(g).forEach(function(v){(m=p.indexOf(v))==-1&&(p[m=p.length]=v);var w=g[v],b="z",_="",T=Qe({c:o+m,r:a+y+s});c=H1(i,T),w&&typeof w=="object"&&!(w instanceof Date)?i[T]=w:(typeof w=="number"?b="n":typeof w=="boolean"?b="b":typeof w=="string"?b="s":w instanceof Date?(b="d",n.cellDates||(b="n",w=Rn(w)),_=n.dateNF||Je[14]):w===null&&n.nullError&&(b="e",w=0),c?(c.t=b,c.v=w,delete c.w,delete c.R,_&&(c.z=_)):i[T]=c={t:b,v:w},_&&(c.z=_))})}),u.e.c=Math.max(u.e.c,o+p.length-1);var x=hn(a);if(s)for(m=0;m<p.length;++m)i[$r(m+o)+x]={t:"s",v:p[m]};return i["!ref"]=gt(u),i}function pye(r,e){return WH(null,r,e)}function H1(r,e,t){if(typeof e=="string"){if(Array.isArray(r)){var n=zr(e);return r[n.r]||(r[n.r]=[]),r[n.r][n.c]||(r[n.r][n.c]={t:"z"})}return r[e]||(r[e]={t:"z"})}return typeof e!="number"?H1(r,Qe(e)):H1(r,Qe({r:e,c:t||0}))}function mye(r,e){if(typeof e=="number"){if(e>=0&&r.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var t=r.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 mO(){return{SheetNames:[],Sheets:{}}}function gO(r,e,t,n){var s=1;if(!t)for(;s<=65535&&r.SheetNames.indexOf(t="Sheet"+s)!=-1;++s,t=void 0);if(!t||r.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&r.SheetNames.indexOf(t)>=0){var i=t.match(/(^.*?)(\d+)$/);s=i&&+i[2]||0;var a=i&&i[1]||t;for(++s;s<=65535&&r.SheetNames.indexOf(t=a+s)!=-1;++s);}if(AH(t),r.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return r.SheetNames.push(t),r.Sheets[t]=e,t}function gye(r,e,t){r.Workbook||(r.Workbook={}),r.Workbook.Sheets||(r.Workbook.Sheets=[]);var n=mye(r,e);switch(r.Workbook.Sheets[n]||(r.Workbook.Sheets[n]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}r.Workbook.Sheets[n].Hidden=t}function xye(r,e){return r.z=e,r}function VH(r,e,t){return e?(r.l={Target:e},t&&(r.l.Tooltip=t)):delete r.l,r}function vye(r,e,t){return VH(r,"#"+e,t)}function yye(r,e,t){r.c||(r.c=[]),r.c.push({t:e,a:t||"SheetJS"})}function wye(r,e,t,n){for(var s=typeof e!="string"?e:Ft(e),i=typeof e=="string"?e:gt(e),a=s.s.r;a<=s.e.r;++a)for(var o=s.s.c;o<=s.e.c;++o){var l=H1(r,a,o);l.t="n",l.F=i,delete l.v,a==s.s.r&&o==s.s.c&&(l.f=t,n&&(l.D=!0))}return r}var zo={encode_col:$r,encode_row:hn,encode_cell:Qe,encode_range:gt,decode_col:Vj,decode_row:Wj,split_cell:Rce,decode_cell:zr,decode_range:Ci,format_cell:Cu,sheet_add_aoa:x7,sheet_add_json:WH,sheet_add_dom:FH,aoa_to_sheet:fv,json_to_sheet:pye,table_to_sheet:DH,table_to_book:Tve,sheet_to_csv:pO,sheet_to_txt:HH,sheet_to_json:IS,sheet_to_html:OH,sheet_to_formulae:fye,sheet_to_row_object_array:IS,sheet_get_cell:H1,book_new:mO,book_append_sheet:gO,book_set_sheet_visibility:gye,cell_set_number_format:xye,cell_set_hyperlink:VH,cell_set_internal_link:vye,cell_add_comment:yye,sheet_set_array_formula:wye,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function bye(r){const e=S.useRef({value:r,previous:r});return S.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}var kA="Switch",[_ye,y1e]=sv(kA),[kye,Sye]=_ye(kA),GH=S.forwardRef((r,e)=>{const{__scopeSwitch:t,name:n,checked:s,defaultChecked:i,required:a,disabled:o,value:l="on",onCheckedChange:c,form:u,...f}=r,[p,m]=S.useState(null),x=ms(e,b=>m(b)),g=S.useRef(!1),y=p?u||!!p.closest("form"):!0,[v,w]=B4({prop:s,defaultProp:i??!1,onChange:c,caller:kA});return d.jsxs(kye,{scope:t,checked:v,disabled:o,children:[d.jsx(sn.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":qH(v),"data-disabled":o?"":void 0,disabled:o,value:l,...f,ref:x,onClick:kr(r.onClick,b=>{w(_=>!_),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&d.jsx(YH,{control:p,bubbles:!g.current,name:n,value:l,checked:v,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});GH.displayName=kA;var KH="SwitchThumb",XH=S.forwardRef((r,e)=>{const{__scopeSwitch:t,...n}=r,s=Sye(KH,t);return d.jsx(sn.span,{"data-state":qH(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:e})});XH.displayName=KH;var Eye="SwitchBubbleInput",YH=S.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:n=!0,...s},i)=>{const a=S.useRef(null),o=ms(a,i),l=bye(t),c=o6(e);return S.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==t&&m){const x=new Event("click",{bubbles:n});m.call(u,t),u.dispatchEvent(x)}},[l,t,n]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:o,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});YH.displayName=Eye;function qH(r){return r?"checked":"unchecked"}var ZH=GH,Aye=XH;const xO=S.forwardRef(({className:r,...e},t)=>d.jsx(ZH,{className:Is("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",r),...e,ref:t,children:d.jsx(Aye,{className:Is("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
744));xO.displayName=ZH.displayName;const Tye=["image/webp","image/png","image/jpeg","image/jpg"],Cye=2*1024*1024,Nye=500*1024,JH=1200,QH=675,qI=JH/QH,Pye=.08;function Rye({call:r}){const[e,t]=S.useState("ads");return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card overflow-hidden",children:[d.jsxs("div",{className:"flex border-b border-border",children:[d.jsxs("button",{onClick:()=>t("ads"),className:`flex-1 px-4 py-3 text-sm font-bold flex items-center justify-center gap-2 ${e==="ads"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent/30"}`,children:[d.jsx(Lx,{className:"w-4 h-4"})," Marketing & Werbung"]}),d.jsxs("button",{onClick:()=>t("push"),className:`flex-1 px-4 py-3 text-sm font-bold flex items-center justify-center gap-2 ${e==="push"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent/30"}`,children:[d.jsx(y0,{className:"w-4 h-4"})," Allgemeine Push-Nachrichten"]})]}),d.jsx("div",{className:"p-4",children:e==="ads"?d.jsx(jye,{call:r}):d.jsx(Oye,{call:r})})]})}function rC(r){return r?Array.from(new Set(String(r).split(/[,;\s]+/).map(e=>{var t;return Number((t=e.match(/\d+/))==null?void 0:t[0])}).filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t):[]}function ZI({codes:r,selected:e,onChange:t,label:n}){const[s,i]=S.useState(!1),a=r.length>0&&e.length===r.length;function o(l){t(e.includes(l)?e.filter(c=>c!==l):[...e,l].sort((c,u)=>c-u))}return d.jsxs("div",{className:"grid gap-2",children:[d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:e.length?e.map(l=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 text-primary text-[11px] font-bold px-2 py-0.5",children:[l,d.jsx("button",{type:"button",onClick:()=>o(l),"aria-label":`Code ${l} entfernen`,children:d.jsx(Xn,{className:"w-3 h-3"})})]},l)):d.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Alle / Allgemeine Werbung"})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",onClick:()=>i(l=>!l),className:"text-xs font-bold rounded-lg border border-input px-2 py-1.5",children:s?"Auswahl schlieÃen":"Codes auswählen"}),d.jsx("button",{type:"button",onClick:()=>t(a?[]:r),className:"text-xs font-bold rounded-lg bg-muted px-2 py-1.5",children:a?"Keine":"Alle"})]}),s&&d.jsxs("div",{className:"max-h-52 overflow-auto rounded-xl border border-border p-2 grid gap-1",children:[r.map(l=>d.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer px-1 py-0.5 rounded hover:bg-accent/30",children:[d.jsx("input",{type:"checkbox",checked:e.includes(l),onChange:()=>o(l)}),d.jsx("span",{className:"font-bold w-8",children:l}),d.jsx("span",{className:"text-muted-foreground truncate",children:n(String(l))})]},l)),!r.length&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine Codes vorhanden."})]})]})}function jye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState([]),[i,a]=S.useState([]),[o,l]=S.useState({}),[c,u]=S.useState([]),f=S.useMemo(()=>pe=>{var tt;const je=(pe??"").trim(),nt=(tt=je.match(/\d+/))==null?void 0:tt[0];return nt&&o[String(Number(nt))]||o[je]||je},[o]),p=S.useMemo(()=>Array.from(new Set(c.filter(pe=>Number.isFinite(pe)))).sort((pe,je)=>pe-je),[c]),[m,x]=S.useState(!0),[g,y]=S.useState(!1),[v,w]=S.useState(""),[b,_]=S.useState(""),[T,A]=S.useState("stand"),[N,k]=S.useState(""),[E,P]=S.useState(""),[O,D]=S.useState(""),[H,B]=S.useState(""),[ee,X]=S.useState([]),[W,Y]=S.useState(null),[F,J]=S.useState(null),[ne,I]=S.useState(null),[z,M]=S.useState(null),U=S.useRef(null),te=S.useRef(null),[re,se]=S.useState(null),[ie,ae]=S.useState({});async function ge(){x(!0);try{const[pe,je,nt,tt]=await Promise.all([r("list_promo_ads"),r("list_exhibitors_brief"),r("list_ad_categories").catch(()=>({categories:[]})),et.from("kvz_matching").select("kvz_nr,bezeichnung")]);t(pe.ads??[]),s(je.exhibitors??[]),a(nt.categories??[]);const Nt={},ht=[];for(const Et of tt.data??[])Et!=null&&Et.bezeichnung&&(Nt[String(Et.kvz_nr)]=Et.bezeichnung.trim()),Number.isFinite(Number(Et==null?void 0:Et.kvz_nr))&&ht.push(Number(Et.kvz_nr));l(Nt),u(ht)}catch(pe){le.error((pe==null?void 0:pe.message)??"Fehler beim Laden")}finally{x(!1)}}S.useEffect(()=>{ge()},[]);function G(){U.current=null,Y(null),J(null),I(null),M(null),te.current&&(te.current.value="")}function Ue(){w(""),_(""),k(""),P(""),D(""),B(""),A("stand"),X([]),G()}function Re(pe){k(pe);const je=n.find(nt=>nt.id===pe);je&&(P(je.hall??""),D(je.stand_no??""))}async function He(pe){if(!Tye.includes(pe.type)){le.error("Nur WebP, PNG oder JPG erlaubt.");return}if(pe.size>Cye){le.error("Die Datei ist zu groà (Max. 2 MB).");return}
744M(pe.size>Nye?"Hinweis: Dieses Bild ist recht groÃ. Für eine optimale Ladezeit auf der Messe empfehlen wir Dateien unter 500 KB.":null);const je=URL.createObjectURL(pe),nt=new Image;nt.onload=()=>{const tt=nt.width/nt.height,Nt=Math.abs(tt-qI)/qI;I(Nt>Pye?`Format ${nt.width}Ã${nt.height} weicht stark von 16:9 ab â das Bild wird auf Mobilgeräten ggf. beschnitten. Empfohlen: ${JH}Ã${QH}.`:null),U.current=pe,Y(je),J({name:pe.name,type:pe.type,size:pe.size,w:nt.width,h:nt.height})},nt.onerror=()=>le.error("Bild konnte nicht gelesen werden."),nt.src=je}async function Te(){if(!v.trim()){le.error("Titel fehlt.");return}const pe=U.current;if(!pe){le.error("Bitte ein Banner-Bild auswählen.");return}if(T==="external"){if(!H.trim()){le.error("Externe URL fehlt.");return}try{const je=new URL(H.trim());if(!/^https?:$/.test(je.protocol))throw new Error}catch{le.error("Ungültige URL â bitte inkl. https:// eingeben.");return}}y(!0);try{const je=await new Promise((nt,tt)=>{const Nt=new FileReader;Nt.onload=()=>nt(String(Nt.result??"")),Nt.onerror=()=>tt(new Error("read_failed")),Nt.readAsDataURL(pe)});await r("upload_promo_ad",{title:v.trim(),body:b.trim()||null,exhibitor_id:T==="stand"&&N||null,hall:T==="stand"&&E.trim()||null,stand_no:T==="stand"&&O.trim()||null,external_url:T==="external"?H.trim():null,target_category:ee.length?ee.join(","):null,filename:pe.name,content_type:pe.type,data_base64:je}),le.success("Werbung gespeichert."),Ue(),ge()}catch(je){le.error((je==null?void 0:je.message)==="file_too_large"?"Datei zu groà (max. 2 MB).":(je==null?void 0:je.message)??"Upload fehlgeschlagen")}finally{y(!1)}}async function we(pe){try{await r("toggle_promo_ad",{id:pe.id,active:!pe.active}),ge()}catch(je){le.error((je==null?void 0:je.message)??"Fehler")}}async function Me(pe){if(confirm(`Werbung "${pe.title}" löschen?`))try{await r("delete_promo_ad",{id:pe.id}),ge()}catch(je){le.error((je==null?void 0:je.message)??"Fehler")}}function at(pe){se(pe.id),ae({title:pe.title,body:pe.body,exhibitor_id:pe.exhibitor_id,hall:pe.hall,stand_no:pe.stand_no,external_url:pe.external_url,target_category:pe.target_category})}async function Tr(){if(re)try{await r("update_promo_ad",{id:re,patch:ie}),le.success("Aktualisiert."),se(null),ae({}),ge()}catch(pe){le.error((pe==null?void 0:pe.message)??"Fehler")}}return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Lx,{className:"w-5 h-5 text-primary"}),d.jsx("h3",{className:"font-display font-bold",children:"Aussteller-Werbung (Paid Ads)"})]}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Werbebanner: ",d.jsx("strong",{children:"WebP / PNG / JPG · 1200Ã675 (16:9) · max. 2 MB"}),". Wird zufällig als Interstitial beim Antippen eines Menü-Eintrags angezeigt."]}),d.jsxs("div",{className:"mt-3 grid gap-2",children:[d.jsx("input",{type:"text",placeholder:"Titel der Werbung *",value:v,onChange:pe=>w(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsx("input",{type:"text",placeholder:"Untertitel / Body (optional)",value:b,onChange:pe=>_(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsxs("div",{className:"rounded-xl border border-border p-3 grid gap-2",children:[d.jsx("label",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zuordnung zu Branche / Kategorie"}),d.jsx(ZI,{codes:p,selected:ee,onChange:X,label:f}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Bestimmt, welchen Besuchern diese Werbung nach dem Interessen-Check angezeigt wird."})]}),d.jsxs("div",{className:"rounded-xl border border-border p-3 grid gap-3",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Klick-Ziel"}),d.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[d.jsxs("label",{className:`rounded-lg border px-3 py-2 cursor-pointer flex items-center gap-2 ${T==="stand"?"border-primary bg-primary/10 text-primary font-bold":"border-input"}`,children:[d.jsx("input",{type:"radio",name:"linkmode",className:"accent-primary",checked:T==="stand",onChange:()=>A("stand")}),"Messestand (Aussteller)"]}),d.jsxs("label",{className:`rounded-lg border px-3 py-2 cursor-pointer flex items-center gap-2 ${T==="external"?"border-primary bg-primary/10 text-primary font-bold":"border-input"}`,children:[d.jsx("input",{type:"radio",name:"linkmode",className:"accent-primary",checked:T==="external",onChange:()=>A("external")}),"Externe Webseite (Sponsor)"]})]}),T==="stand"?d.jsxs("div",{className:"grid gap-2",children:[d.jsx("p",{className:"text-xs font-semibold",children:"Verknüpfung mit Messestand (Für Aussteller)"}),d.jsxs("select",{value:N,onChange:pe=>Re(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"â Aussteller zuordnen (optional) â"}),n.map(pe=>d.jsxs("option",{value:pe.id,children:[pe.name," ",pe.hall||pe.stand_no?`(${pe.hall} / ${pe.stand_no})`:""]},pe.id))]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("select",{value:E,onChange:pe=>P(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"Halle wählenâ¦"}),Array.from(new Set(n.map(pe=>
744pe.hall).filter(Boolean))).sort().map(pe=>d.jsx("option",{value:pe,children:pe},pe)),E&&!n.some(pe=>pe.hall===E)&&d.jsx("option",{value:E,children:E})]}),d.jsx("input",{type:"text",placeholder:"Stand-Nr.",value:O,onChange:pe=>D(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"})]}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Muss exakt 1:1 mit der Standnummer im QCAD-Plan und der Aussteller-CSV übereinstimmen!"})]}):d.jsxs("div",{className:"grid gap-2",children:[d.jsx("p",{className:"text-xs font-semibold",children:"Verknüpfung mit externer Webseite (Für Nicht-Aussteller/Sponsoren)"}),d.jsx("input",{type:"url",inputMode:"url",placeholder:"https://www.firma.at",value:H,onChange:pe=>B(pe.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Geben Sie hier die Homepage des Kunden ein (z.B. https://www.firma.at). Ãffnet sich in einem neuen Tab auf dem Handy."})]})]}),d.jsxs("label",{className:"rounded-xl border-2 border-dashed border-input p-3 cursor-pointer hover:bg-accent/30 transition-colors",children:[d.jsx("input",{ref:te,type:"file",accept:"image/webp,image/png,image/jpeg,.webp,.png,.jpg,.jpeg",className:"hidden",onChange:pe=>{var nt;const je=(nt=pe.target.files)==null?void 0:nt[0];je&&He(je)}}),W?d.jsxs("div",{className:"flex gap-3 items-start",children:[d.jsx("img",{src:W,alt:"Vorschau",className:"w-32 h-auto rounded-lg object-cover"}),d.jsxs("div",{className:"text-xs flex-1 min-w-0",children:[d.jsx("p",{className:"font-semibold truncate",children:F==null?void 0:F.name}),d.jsxs("p",{className:"text-muted-foreground",children:[F==null?void 0:F.w,"Ã",F==null?void 0:F.h," px · ",Math.round(((F==null?void 0:F.size)??0)/1024)," KB · ",F==null?void 0:F.type.replace("image/","").toUpperCase()]}),d.jsx("button",{type:"button",onClick:pe=>{pe.preventDefault(),G()},className:"mt-1 text-destructive font-semibold",children:"Entfernen"})]})]}):d.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[d.jsx(aN,{className:"w-4 h-4"}),d.jsx("span",{children:"Werbebanner wählen (WebP empfohlen, PNG/JPG erlaubt · max. 2 MB)"})]})]}),(ne||z)&&d.jsxs("div",{className:"rounded-xl bg-yellow-100 dark:bg-yellow-950/40 text-yellow-900 dark:text-yellow-200 px-3 py-2 text-xs flex items-start gap-2",children:[d.jsx(V4,{className:"w-4 h-4 mt-0.5 shrink-0"}),d.jsxs("div",{className:"space-y-1",children:[z&&d.jsx("p",{children:z}),ne&&d.jsx("p",{children:ne})]})]}),d.jsxs("button",{onClick:Te,disabled:g,className:"rounded-xl bg-primary text-primary-foreground font-bold py-2 px-3 flex items-center justify-center gap-2 disabled:opacity-60 tap-scale",children:[g?d.jsx(kn,{className:"w-4 h-4 animate-spin"}):d.jsx(zb,{className:"w-4 h-4"}),"Werbung speichern"]})]}),d.jsxs("div",{className:"mt-5",children:[d.jsx("h4",{className:"text-sm font-bold mb-2",children:"Aktive & inaktive Werbungen"}),m?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Lädtâ¦"}):e.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Noch keine Werbungen."}):d.jsx("ul",{className:"grid gap-2",children:e.map(pe=>d.jsx("li",{className:"rounded-xl border border-border p-2",children:re===pe.id?d.jsxs("div",{className:"grid gap-2",children:[d.jsx("input",{className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.title??"",onChange:je=>ae({...ie,title:je.target.value}),placeholder:"Titel"}),d.jsx("input",{className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.body??"",onChange:je=>ae({...ie,body:je.target.value}),placeholder:"Body"}),d.jsxs("select",{className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.exhibitor_id??"",onChange:je=>{const nt=je.target.value,tt=n.find(Nt=>Nt.id===nt);ae({...ie,exhibitor_id:nt||null,hall:(tt==null?void 0:tt.hall)??ie.hall,stand_no:(tt==null?void 0:tt.stand_no)??ie.stand_no})},children:[d.jsx("option",{value:"",children:"â kein Aussteller â"}),n.map(je=>d.jsx("option",{value:je.id,children:je.name},je.id))]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx("input",{className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.hall??"",onChange:je=>ae({...ie,hall:je.target.value}),placeholder:"Halle"}),d.jsx("input",{className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.stand_no??"",onChange:je=>ae({...ie,stand_no:je.target.value}),placeholder:"Stand"})]}),d.jsx("input",{type:"url",className:"rounded-lg border border-input bg-background px-2 py-1.5 text-sm",value:ie.external_url??"",onChange:je=>ae({...ie,external_url:je.target.value}),placeholder:"Externe URL (https://â¦)"}),d.jsx(ZI,{codes:p,selected:rC(ie.target_category??null),onChange:je=>ae({...ie,target_category:je.length?je.join(","):null}),label:f}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Entweder Halle+Stand ODER externe URL. Exter
744ne URL öffnet sich in einem neuen Tab."}),d.jsxs("div",{className:"flex gap-2 justify-end",children:[d.jsx("button",{onClick:()=>{se(null),ae({})},className:"text-xs font-bold px-2 py-1 rounded-lg bg-muted",children:"Abbrechen"}),d.jsxs("button",{onClick:Tr,className:"text-xs font-bold px-2 py-1 rounded-lg bg-primary text-primary-foreground inline-flex items-center gap-1",children:[d.jsx(P8,{className:"w-3.5 h-3.5"})," Speichern"]})]})]}):d.jsxs("div",{className:"flex items-center gap-3",children:[pe.image_url?d.jsx("img",{src:pe.image_url,alt:"",className:"w-20 h-12 rounded-md object-cover bg-muted"}):d.jsx("div",{className:"w-20 h-12 rounded-md bg-muted grid place-items-center text-muted-foreground",children:d.jsx(aN,{className:"w-4 h-4"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-semibold text-sm truncate",children:pe.title}),pe.body&&d.jsx("p",{className:"text-xs text-muted-foreground truncate",children:pe.body}),(pe.hall||pe.stand_no)&&d.jsxs("p",{className:"text-[11px] font-bold text-primary mt-0.5",children:[pe.hall?`Halle ${pe.hall}`:"",pe.hall&&pe.stand_no?" · ":"",pe.stand_no?`Stand ${pe.stand_no}`:""]}),pe.external_url&&d.jsxs("p",{className:"text-[11px] font-bold text-primary mt-0.5 truncate",children:["ð ",pe.external_url]}),d.jsxs("p",{className:"text-[10px] mt-0.5 inline-block rounded-full bg-secondary text-secondary-foreground px-2 py-0.5 font-semibold",children:["Zielgruppe: ",rC(pe.target_category).length?rC(pe.target_category).join(", "):"Alle"]})]}),d.jsx("button",{onClick:()=>we(pe),className:`text-xs font-bold rounded-lg px-2 py-1 ${pe.active?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:pe.active?"Aktiv":"Inaktiv"}),d.jsx("button",{onClick:()=>at(pe),className:"text-primary p-1.5 rounded-lg hover:bg-primary/10","aria-label":"Bearbeiten",children:d.jsx(B8,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>Me(pe),className:"text-destructive p-1.5 rounded-lg hover:bg-destructive/10","aria-label":"Löschen",children:d.jsx(fs,{className:"w-4 h-4"})})]})},pe.id))})]})]})}function Oye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(!0),[i,a]=S.useState(!1),[o,l]=S.useState(""),[c,u]=S.useState(""),[f,p]=S.useState(2);async function m(){s(!0);try{const v=await r("list_announcements");t(v.announcements??[])}catch(v){le.error((v==null?void 0:v.message)??"Fehler")}finally{s(!1)}}S.useEffect(()=>{m()},[]);async function x(){if(!o.trim()){le.error("Titel fehlt.");return}if(!c.trim()){le.error("Nachrichten-Inhalt fehlt.");return}a(!0);try{await r("create_announcement",{title:o.trim(),body:c.trim(),hours_valid:f}),le.success("Nachricht gesendet."),l(""),u(""),m()}catch(v){le.error((v==null?void 0:v.message)??"Fehler")}finally{a(!1)}}async function g(v){try{await r("toggle_announcement",{id:v.id,active:!v.active}),m()}catch(w){le.error((w==null?void 0:w.message)??"Fehler")}}async function y(v){if(confirm(`Nachricht "${v.title}" löschen?`))try{await r("delete_announcement",{id:v.id}),m()}catch(w){le.error((w==null?void 0:w.message)??"Fehler")}}return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(y0,{className:"w-5 h-5 text-primary"}),d.jsx("h3",{className:"font-display font-bold",children:"Allgemeine Push-Nachrichten"})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Reine Text-Broadcasts (z. B. âVortrag startet in 20 Min. auf der Hauptbühne"). Wird allen aktiven Besucher-Geräten als In-App-Banner angezeigt.'}),d.jsxs("div",{className:"mt-3 grid gap-2",children:[d.jsx("input",{type:"text",placeholder:"Titel *",value:o,onChange:v=>l(v.target.value),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsx("textarea",{placeholder:"Nachrichten-Inhalt *",value:c,onChange:v=>u(v.target.value),rows:3,className:"rounded-xl border border-input bg-background px-3 py-2 text-sm resize-y"}),d.jsxs("label",{className:"text-xs text-muted-foreground flex items-center gap-2",children:["Gültigkeit:",d.jsxs("select",{value:f,onChange:v=>p(Number(v.target.value)),className:"rounded-lg border border-input bg-background px-2 py-1 text-sm",children:[d.jsx("option",{value:1,children:"1 Stunde"}),d.jsx("option",{value:2,children:"2 Stunden"}),d.jsx("option",{value:4,children:"4 Stunden"}),d.jsx("option",{value:8,children:"8 Stunden"}),d.jsx("option",{value:24,children:"1 Tag"})]})]}),d.jsxs("button",{onClick:x,disabled:i,className:"rounded-xl bg-primary text-primary-foreground font-bold py-2 px-3 flex items-center justify-center gap-2 disabled:opacity-60 tap-scale",children:[i?d.jsx(kn,{className:"w-4 h-4 animate-spin"}):d.jsx(Oq,{className:"w-4 h-4"}),"Jetzt senden"]})]}),d.jsxs("div",{className:"mt-5",children:[d.jsx("h4",{className:"text-sm font-bold mb-2",children:"Letzte Nachrichten"}),n?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Lädtâ¦"}):e.length===0?d.jsx("p",{className:"text-xs text-muted-foreground",children:"Noch keine Nachrichten."}):d.jsx("ul",{className:"grid gap-2",children:e.map(v=>{const w=v.expires_at&&new Date(v.expires_at)<new Date;return d.jsxs("li",{className:"flex items-start gap-3 rounded-xl border border-border p-2.5",children:[d.jsx(y0,{className:"w-4 h-4 mt-0.5 text-primary shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-semibold text-sm",children:v.title}),d.jsx("p",{className:"text-xs text-muted-foreground",children:v.body}),d.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:[new Date(v.created_at).toLocaleStr
744ing("de-AT"),v.expires_at&&` · läuft ab ${new Date(v.expires_at).toLocaleString("de-AT")}`,w&&" · abgelaufen"]})]}),d.jsx("button",{onClick:()=>g(v),className:`text-xs font-bold rounded-lg px-2 py-1 ${v.active&&!w?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:v.active?w?"Abgelaufen":"Live":"Inaktiv"}),d.jsx("button",{onClick:()=>y(v),className:"text-destructive p-1.5 rounded-lg hover:bg-destructive/10","aria-label":"Löschen",children:d.jsx(fs,{className:"w-4 h-4"})})]},v.id)})})]})]})}const JI=["image/webp","image/png","image/jpeg","image/jpg"],Fye=2*1024*1024,QI={title:"",body:"",image_url:"",target_url:"",codes:[],active:!0};function Dye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(!0),[i,a]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState({...QI}),[f,p]=S.useState({}),[m,x]=S.useState([]),[g,y]=S.useState(!1),v=S.useRef(null),w=S.useRef(null),[b,_]=S.useState(null),T=S.useMemo(()=>Array.from(new Set(m.filter(B=>Number.isFinite(B)))).sort((B,ee)=>B-ee),[m]);async function A(){s(!0);try{const[B,ee]=await Promise.all([r("list_push_ads"),et.from("kvz_matching").select("kvz_nr,bezeichnung")]);t(B.push_ads??[]);const X={},W=[];for(const Y of ee.data??[])Y!=null&&Y.bezeichnung&&(X[String(Y.kvz_nr)]=Y.bezeichnung.trim()),Number.isFinite(Number(Y==null?void 0:Y.kvz_nr))&&W.push(Number(Y.kvz_nr));p(X),x(W)}catch(B){le.error((B==null?void 0:B.message)??"Fehler beim Laden")}finally{s(!1)}}S.useEffect(()=>{A()},[]);function N(){l(null),u({...QI}),v.current=null,_(null),w.current&&(w.current.value="")}function k(B){l(B.id),u({title:B.title,body:B.body??"",image_url:B.image_url??"",target_url:B.target_url??"",codes:B.target_codes??[],active:B.active}),v.current=null,_(null)}function E(B){if(B){if(!JI.includes(B.type)){le.error("Nur WebP, PNG oder JPG erlaubt.");return}if(B.size>Fye){le.error("Die Datei ist zu groà (max. 2 MB).");return}v.current=B,_(B.name)}}function P(B){u(ee=>({...ee,codes:ee.codes.includes(B)?ee.codes.filter(X=>X!==B):[...ee.codes,B].sort((X,W)=>X-W)}))}async function O(){if(!c.title.trim()){le.error("Titel fehlt.");return}a(!0);try{let B,ee,X;const W=v.current;W&&(B=await new Promise((Y,F)=>{const J=new FileReader;J.onload=()=>Y(String(J.result??"")),J.onerror=()=>F(new Error("read_failed")),J.readAsDataURL(W)}),ee=W.type,X=W.name),await r("save_push_ad",{id:o??void 0,title:c.title.trim(),body:c.body.trim()||null,image_url:W?null:c.image_url.trim()||null,target_url:c.target_url.trim()||null,target_codes:c.codes,active:c.active,data_base64:B,content_type:ee,filename:X}),le.success(o?"Push-Anzeige aktualisiert.":"Push-Anzeige erstellt."),N(),A()}catch(B){le.error((B==null?void 0:B.message)??"Speichern fehlgeschlagen")}finally{a(!1)}}async function D(B){try{await r("toggle_push_ad",{id:B.id,active:!B.active}),A()}catch(ee){le.error((ee==null?void 0:ee.message)??"Fehler")}}async function H(B){if(confirm(`Push-Anzeige "${B.title}" löschen?`))try{await r("delete_push_ad",{id:B.id}),A()}catch(ee){le.error((ee==null?void 0:ee.message)??"Fehler")}}return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(y0,{className:"w-5 h-5 text-primary"}),d.jsx("h3",{className:"font-display font-bold",children:"Push-Anzeigen (Header-Einblendung)"})]}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Slidet bei jeder 6. Interaktion oben ein, bleibt 5 Sekunden sichtbar und verschwindet automatisch."}),d.jsxs("div",{className:"mt-3 grid gap-2",children:[d.jsx("input",{type:"text",placeholder:"Titel *",value:c.title,onChange:B=>u({...c,title:B.target.value}),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsx("textarea",{placeholder:"Beschreibung / Kurztext",value:c.body,rows:2,onChange:B=>u({...c,body:B.target.value}),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsxs("div",{className:"rounded-xl border border-border p-3 grid gap-2",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Bild / Banner-Grafik"}),d.jsx("input",{ref:w,type:"file",accept:JI.join(","),onChange:B=>{var ee;return E((ee=B.target.files)==null?void 0:ee[0])},className:"text-xs"}),b&&d.jsxs("p",{className:"text-[11px] text-primary font-bold flex items-center gap-1",children:[d.jsx(aN,{className:"w-3 h-3"}),b]}),d.jsx("input",{type:"text",placeholder:"â¦oder Bild-URL",value:c.image_url,onChange:B=>u({...c,image_url:B.target.value}),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"})]}),d.jsx("input",{type:"text",placeholder:"Ziel-URL (z. B. /exhibitors/⦠, /workshops oder https://â¦)",value:c.target_url,onChange:B=>u({...c,target_url:B.target.value}),className:"rounded-xl border border-input bg-background px-3 py-2 text-sm"}),d.jsxs("div",{className:"rounded-xl border border-border p-3 grid gap-2",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zuordnung / Kategorie (optional)"}),d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:c.codes.length?c.codes.map(B=>d.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 text-primary text-[11px] font-bold px-2 py-0.5",children:[B,d.jsx("button",{type:"button",onClick:()=>P(B),"aria-label":`Code ${B} entfernen`,children:d.jsx(Xn,{className:"w-3 h-3"})})]},B)):d.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Alle Besucher"})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"button",onClick:()=>y(B=>!B),className:"text-xs font-bold rounded-lg border border-input px-2 py-1.5",children:g?"Auswahl schlieÃen":"Codes auswählen"}),d.jsx("button",{type:"button",onClick:()=>u(B=>({...B,codes:B.codes.length===T.length?[]:T})),className:"text-xs font-bold rounded-lg bg-muted px-2 py-1.5",children:c.codes.length===T.length&&T.length?"Keine":"Alle"})]}),g&&d.jsxs("div",{className:"max-h-52 overflow-auto rounded-xl border border-border p-2 grid gap-1",children:[T.map(B=>d.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer px-1 py-0.5 rounded hover:bg-accent/30",children:[d.jsx("input",{type:"checkbox",checked:c.codes.includes(B),onChange:()=>P(B)}),d.jsx("span",{className:"font-bold w-8",children:B}),d.jsx("span",{className:"text-muted-foreground truncate",children:f[String(B)]??""})]},B)),!T.length&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine Codes vorhanden."})]})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"checkbox",checked:c.active,onChange:B=>u({...c,active:B.target.checked})}),"Aktiv"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("button",{onClick:O,disabled:i,className:"rounded-xl gradient-hero text-primary-foreground font-bold px-4 py-2.5 text-sm tap-scale inline-flex items-center gap-2 disabled:opacity-60",children:[i?d.jsx(kn,{className:"w-4 h-4 animate-spin"}):d.jsx(P8,{className:"w-4 h-4"}),o?"Ãnderungen speichern":"Push-Anzeige erstellen"]}),o&&d.jsx("button",{onClick:N,className:"rounded-xl bg-muted font-bold px-4 py-2.5 text-sm",children:"Abbrechen"})]})]}),d.jsxs("div",{className:"mt-5",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Alle Push-Anzeigen"}),n?d.jsxs("p",{className:"text-xs text-muted-foreground mt-2 flex items-center gap-2",children:[d.jsx(kn,{className:"w-3 h-3 animate-spin"})," Lädtâ¦"]}):e.length?d.jsx("div",{className:"mt-2 grid gap-2",children:e.map(B=>d.jsxs("div",{className:"rounded-xl border border-border p-3 flex items-start gap-3",children:[B.image_url&&d.jsx("img",{src:B.image_url,alt:"",className:"w-14 h-10 rounded-lg object-cover shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"font-bold text-sm truncate",children:B.title}),B.body&&d.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:B.body}),d.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 truncate",children:[B.target_url||"kein Ziel"," · ",(B.target_co
744des??[]).length?`Codes ${(B.target_codes??[]).join(", ")}`:"alle"]})]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx("button",{onClick:()=>D(B),className:`text-[11px] font-bold rounded-lg px-2 py-1 ${B.active?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:B.active?"Aktiv":"Inaktiv"}),d.jsx("button",{onClick:()=>k(B),"aria-label":"Bearbeiten",className:"p-1.5 rounded-lg hover:bg-accent/30",children:d.jsx(B8,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>H(B),"aria-label":"Löschen",className:"p-1.5 rounded-lg hover:bg-destructive/10 text-destructive",children:d.jsx(fs,{className:"w-4 h-4"})})]})]},B.id))}):d.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Noch keine Push-Anzeigen angelegt."})]})]})}function Mye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(0),[i,a]=S.useState([]),[o,l]=S.useState(0),[c,u]=S.useState(""),[f,p]=S.useState(""),[m,x]=S.useState(!1),g=S.useCallback(async()=>{x(!0);try{const v={from:c||null,to:f||null},[w,b]=await Promise.all([r("ad_impression_stats",v),r("interest_proposal_stats",v)]);t((w==null?void 0:w.rows)??[]),s((w==null?void 0:w.total)??0),a((b==null?void 0:b.rows)??[]),l((b==null?void 0:b.total)??0)}finally{x(!1)}},[r,c,f]);S.useEffect(()=>{g()},[]);function y(){const v=`Anzeige;Typ;Aussteller;Impressionen;Letzte Einblendung 745`,w=e.map(T=>[T.ad_title??"",T.ad_type==="push"?"Push":"Paid",T.exhibitor_name??"",T.count,new Date(T.last_at).toLocaleString("de-AT")].join(";")).join(` 746`),b=URL.createObjectURL(new Blob([v+w],{type:"text/csv;charset=utf-8"})),_=document.createElement("a");_.href=b,_.download="ad-impressionen.csv",_.click(),URL.revokeObjectURL(b)}return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[d.jsxs("label",{className:"text-xs font-bold",children:["Von",d.jsx("input",{type:"date",value:c,onChange:v=>u(v.target.value),className:"mt-1 block rounded-xl border border-border bg-background px-3 py-2 text-sm"})]}),d.jsxs("label",{className:"text-xs font-bold",children:["Bis",d.jsx("input",{type:"date",value:f,onChange:v=>p(v.target.value),className:"mt-1 block rounded-xl border border-border bg-background px-3 py-2 text-sm"})]}),d.jsxs("button",{onClick:g,disabled:m,className:"rounded-xl bg-primary text-primary-foreground px-4 py-2 text-sm font-bold inline-flex items-center gap-2 tap-scale",children:[d.jsx(Ou,{className:`w-4 h-4 ${m?"animate-spin":""}`})," Aktualisieren"]}),d.jsx("button",{onClick:y,disabled:!e.length,className:"rounded-xl bg-secondary text-secondary-foreground px-4 py-2 text-sm font-bold tap-scale",children:"CSV Export"})]}),d.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4 flex items-center gap-3",children:[d.jsx(N8,{className:"w-5 h-5 text-primary"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:"Ausgespielte Werbeanzeigen gesamt"}),d.jsx("p",{className:"font-display text-2xl font-extrabold",children:n.toLocaleString("de-AT")})]})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4 flex items-center gap-3",children:[d.jsx(Mq,{className:"w-5 h-5 text-primary"}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-muted-foreground",children:"Generierte Vorschläge via Interessenscheck"}),d.jsx("p",{className:"font-display text-2xl font-extrabold",children:o.toLocaleString("de-AT")})]})]})]}),d.jsx("div",{className:"overflow-x-auto rounded-2xl border border-border",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-muted text-left",children:d.jsxs("tr",{children:[d.jsx("th",{className:"p-3 font-bold",children:"Anzeige"}),d.jsx("th",{className:"p-3 font-bold",children:"Typ"}),d.jsx("th",{className:"p-3 font-bold",children:"Aussteller"}),d.jsx("th",{className:"p-3 font-bold text-right",children:"Impressionen"}),d.jsx("th",{className:"p-3 font-bold",children:"Zuletzt"})]})}),d.jsxs("tbody",{children:[e.map(v=>d.jsxs("tr",{className:"border-t border-border",children:[d.jsx("td",{className:"p-3",children:v.ad_title??"â"}),d.jsx("td",{className:"p-3",children:v.ad_type==="push"?"Push":"Paid"}),d.jsx("td",{className:"p-3",children:v.exhibitor_name??"â"}),d.jsx("td",{className:"p-3 text-right font-bold",children:v.count.toLocaleStr
746ing("de-AT")}),d.jsx("td",{className:"p-3 text-muted-foreground",children:new Date(v.last_at).toLocaleString("de-AT")})]},v.ad_id)),!e.length&&d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"p-6 text-center text-muted-foreground",children:"Noch keine Impressionen im gewählten Zeitraum."})})]})]})}),d.jsx("h4",{className:"font-display font-extrabold pt-2",children:"Interessenscheck-Vorschläge je Aussteller"}),d.jsx("div",{className:"overflow-x-auto rounded-2xl border border-border",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-muted text-left",children:d.jsxs("tr",{children:[d.jsx("th",{className:"p-3 font-bold",children:"Aussteller"}),d.jsx("th",{className:"p-3 font-bold text-right",children:"Vorschläge"}),d.jsx("th",{className:"p-3 font-bold",children:"Zuletzt"})]})}),d.jsxs("tbody",{children:[i.map(v=>d.jsxs("tr",{className:"border-t border-border",children:[d.jsx("td",{className:"p-3",children:v.exhibitor_name??"â"}),d.jsx("td",{className:"p-3 text-right font-bold",children:v.count.toLocaleString("de-AT")}),d.jsx("td",{className:"p-3 text-muted-foreground",children:new Date(v.last_at).toLocaleString("de-AT")})]},v.exhibitor_id)),!i.length&&d.jsx("tr",{children:d.jsx("td",{colSpan:3,className:"p-6 text-center text-muted-foreground",children:"Noch keine Vorschläge im gewählten Zeitraum."})})]})]})})]})}const Iye=["Vortrag","Workshop","Bühnenprogramm","Highlight"];function Lye({call:r,exhibitors:e=[]}){const[t,n]=S.useState([]),[s,i]=S.useState(!1),[a,o]=S.useState(!1),[l,c]=S.useState(null),[u,f]=S.useState([]),p=S.useRef(null);async function m(){i(!0);try{const w=await r("list_program_events");n(w.events??[])}catch(w){le.error((w==null?void 0:w.message)??"Laden fehlgeschlagen")}finally{i(!1)}}S.useEffect(()=>{m()},[]);const x=S.useMemo(()=>{const w=new Map;for(const b of t){const _=b.datum??"Ohne Datum";w.has(_)||w.set(_,[]),w.get(_).push(b)}return[...w.entries()].sort((b,_)=>b[0].localeCompare(_[0]))},[t]);async function g(){var w;if(!((w=l==null?void 0:l.titel)!=null&&w.trim())){le.error("Titel ist erforderlich");return}o(!0);try{await r("save_program_event",{event:l}),le.success("Programmpunkt gespeichert"),c(null),await m()}catch(b){le.error((b==null?void 0:b.message)??"Speichern fehlgeschlagen")}finally{o(!1)}}async function y(w){if(confirm("Programmpunkt wirklich löschen?"))try{await r("delete_program_event",{id:w}),await m(),le.success("Gelöscht")}catch(b){le.error((b==null?void 0:b.message)??"Löschen fehlgeschlagen")}}async function v(w,b){o(!0),f([]);try{let _;if(/\.(xlsx|xls)$/i.test(w.name)){const T=j0(await w.arrayBuffer(),{type:"array"}),A=T.Sheets[T.SheetNames[0]],k=zo.sheet_to_json(A,{defval:""}).map(E=>{const P={};for(const O of Object.keys(E))P[O.trim().toLowerCase()]=String(E[O]??"").trim();return P});if(!k.length){le.error("Datei enthält keine Zeilen");return}_=await r("import_program_events",{rows:k,replace:b})}else{const T=(await w.text()).replace(/^\uFEFF/,"");if(!T.trim()){le.error("Datei ist leer");return}_=await r("import_program_events",{csv:T,replace:b})}f(_.errors??[]),le.success(`${_.imported??0} Programmpunkte importiert`),await m()}catch(_){console.error("Programm-Import fehlgeschlagen:",_),le.error((_==null?void 0:_.message)??"Import fehlgeschlagen")}finally{o(!1),p.current&&(p.current.value="")}}return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Programm & Ablauf"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:m,className:"inline-flex items-center gap-1 text-xs font-bold text-primary tap-scale",children:[d.jsx(Ou,{className:"w-3.5 h-3.5"})," Neu laden"]}),d.jsxs("button",{onClick:()=>c({kategorie:"Vortrag"}),className:"inline-flex items-center gap-1 text-xs font-extrabold bg-primary text-primary-foreground px-3 py-1.5 rounded-full tap-scale",children:[d.jsx(qh,{className:"w-3.5 h-3.5"})," Neuer Punkt"]})]})]}),d.jsxs("div",{className:"mt-3 rounded-xl border border-dashed border-border p-3",children:[d.jsxs("p",{className:"text-xs font-bold flex items-center gap-1.5",children:[d.jsx(zb,{className:"w-3.5 h-3.5 text-primary"})," Bulk-Import (CSV / Excel)"]}),d.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Spalten: titel, kategorie, ort, halle, stand, datum, startzeit, endzeit, referent, beschreibung"}),d.jsx("input",{ref:p,type:"file",accept:".csv,.xlsx,.xls",className:"mt-2 block w-full text-xs",onChange:w=>{var _;const b=(_=w.target.files)==null?void 0:_[0];b&&v(b,!1)},disabled:a})]}),u.length>0&&d.jsx("ul",{className:"mt-2 text-[11px] text-destructive list-disc pl-4",children:u.slice(0,8).map((w,b)=>d.jsxs("li",{children:["Zeile ",w.row,": ",w.error]},b))}),d.jsxs("div",{className:"mt-4 space-y-4",children:[s&&d.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[d.jsx(kn,{className:"w-3.5 h-3.5 animate-spin"})," Lade â¦"]}),!s&&t.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground",children:"Noch keine Programmpunkte angelegt."}),x.map(([w,b])=>d.jsxs("div",{children:[d.jsxs("p",{className:"text-xs font-extrabold text-primary flex items-center gap-1.5",children:[d.jsx(Su,{className:"w-3.5 h-3.5"}),w==="Ohne Datum"?w:new Date(w+"T00:00:00").toLocaleDateString("de-AT",{weekday:"long",day:"2-digit",month:"2-digit",year:"numeric"})]}),d.jsx("div",{className:"mt-2 space-y-2",children:b.map(_=>d.jsxs("div",{className:"rounded-xl bg-muted/40 p-3 flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(Ch,{variant:"secondary",className:"text-[10px]",children:_.kategorie}),d.jsx("span",{className:"text-[11px] font-bold text-muted-foreground",children:[_.startzeit,_.endzeit].filter(
746Boolean).join(" â ")})]}),d.jsx("p",{className:"font-bold text-sm mt-1 truncate",children:_.titel}),d.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:[_.halle,_.stand_buehne,_.raum_ort,_.referent_veranstalter].filter(Boolean).join(" · ")})]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx("button",{onClick:()=>c(_),className:"p-2 rounded-lg hover:bg-background tap-scale","aria-label":"Bearbeiten",children:d.jsx(av,{className:"w-4 h-4 text-primary"})}),d.jsx("button",{onClick:()=>y(_.id),className:"p-2 rounded-lg hover:bg-background tap-scale","aria-label":"Löschen",children:d.jsx(fs,{className:"w-4 h-4 text-destructive"})})]})]},_.id))})]},w))]}),d.jsx(Zl,{open:!!l,onOpenChange:w=>!w&&c(null),children:d.jsxs(Xo,{className:"max-h-[85vh] overflow-y-auto",children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:l!=null&&l.id?"Programmpunkt bearbeiten":"Neuer Programmpunkt"}),d.jsx(Zo,{children:"Bühnenprogramm, Vorträge, Workshops und Highlights."})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(po,{label:"Titel *",children:d.jsx("input",{className:fo,value:(l==null?void 0:l.titel)??"",onChange:w=>c({...l,titel:w.target.value})})}),d.jsx(po,{label:"Kategorie",children:d.jsx("select",{className:fo,value:(l==null?void 0:l.kategorie)??"Vortrag",onChange:w=>c({...l,kategorie:w.target.value}),children:Iye.map(w=>d.jsx("option",{value:w,children:w},w))})}),d.jsx(po,{label:"Raum / Ort",children:d.jsx("input",{className:fo,placeholder:"Bühne Halle 1",value:(l==null?void 0:l.raum_ort)??"",onChange:w=>c({...l,raum_ort:w.target.value})})}),d.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d.jsx(po,{label:"Datum",children:d.jsx("input",{type:"date",className:fo,value:(l==null?void 0:l.datum)??"",onChange:w=>c({...l,datum:w.target.value})})}),d.jsx(po,{label:"Start",children:d.jsx("input",{type:"time",className:fo,value:(l==null?void 0:l.startzeit)??"",onChange:w=>c({...l,startzeit:w.target.value})})}),d.jsx(po,{label:"Ende",children:d.jsx("input",{type:"time",className:fo,value:(l==null?void 0:l.endzeit)??"",onChange:w=>c({...l,endzeit:w.target.value})})})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx(po,{label:"Halle",children:d.jsx("input",{className:fo,placeholder:"Halle 1",value:(l==null?void 0:l.halle)??"",onChange:w=>c({...l,halle:w.target.value})})}),d.jsx(po,{label:"Stand / Bühne",children:d.jsx("input",{className:fo,placeholder:"Bühne A / H1-05",value:(l==null?void 0:l.stand_buehne)??"",onChange:w=>c({...l,stand_buehne:w.target.value})})})]}),d.jsx(po,{label:"Referent / Veranstalter",children:d.jsx("input",{className:fo,value:(l==null?void 0:l.referent_veranstalter)??"",onChange:w=>c({...l,referent_veranstalter:w.target.value})})}),d.jsx(po,{label:"Beschreibung",children:d.jsx("textarea",{rows:4,className:fo,value:(l==null?void 0:l.beschreibung)??"",onChange:w=>c({...l,beschreibung:w.target.value})})}),e.length>0&&d.jsx(po,{label:"Aussteller (optional)",children:d.jsxs("select",{className:fo,value:(l==null?void 0:l.aussteller_id)??"",onChange:w=>c({...l,aussteller_id:w.target.value||null}),children:[d.jsx("option",{value:"",children:"â kein Aussteller â"}),e.map(w=>d.jsx("option",{value:w.id,children:w.name},w.id))]})})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>c(null),className:"px-4 py-2 rounded-full text-sm font-bold bg-muted tap-scale",children:"Abbrechen"}),d.jsx("button",{onClick:g,disabled:a,className:"px-4 py-2 rounded-full text-sm font-extrabold bg-primary text-primary-foreground tap-scale disabled:opacity-60",children:a?"Speichert â¦":"Speichern"})]})]})})]})}const fo="w-full rounded-xl border border-border bg-background px-3 py-2 text-sm";function po({label:r,children:e}){return d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground",children:r}),d.jsx("div",{className:"mt-1",children:e})]})}const Bye={question:"",option_a:"",option_b:"",option_c:"",correct_option:"a",sort_order:0,target_exhibitor_id:null};function Uye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(""),[i,a]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState([]),f=S.useRef(null);S.useEffect(()=>{(async()=>{const{data:w}=await et.from("exhibitors").select("id,name,hall,stand_no").order("name");u(w??[])})()},[]);async function p(){var w;try{const[b,_]=await Promise.all([r("list_rallye_questions"),r("get_rallye_settings")]);t(b.items??[]),s(((w=_.settings)==null?void 0:w.completion_message)??"")}catch(b){le.error((b==null?void 0:b.message)??"Fehler beim Laden")}}S.useEffect(()=>{p()},[]);function m(){const w=zo.json_to_sheet([{Frage:"Wie viele Hallen hat die Messe Wieselburg?","Antwort A":"2","Antwort B":"4","Antwort C":"6",Richtig:"B",Aussteller:"",Standnummer:""}]),b=zo.book_new();zo.book_append_sheet(b,w,"Rallye"),zH(b,"messe-rallye-vorlage.xlsx")}async function x(w){var b;a(!0);try{const _=await w.arrayBuffer(),T=j0(_,{type:"array"}),A=zo.sheet_to_json(T.Sheets[T.SheetNames[0]],{defval:""});if(!A.length){le.error("Keine Zeilen gefunden.");return}const N=await r("import_rallye_questions",{rows:A});if(N.ok===!1){le.error(`${((b=N.errors)==null?void 0:b.length)??0} Fehler â Import abgebrochen`,{description:(N.errors??[]).slice(0,3).map(k=>`Zeile ${k.row}: ${k.error}`).join(" · ")});return}le.success(`${N.replaced} Fragen importiert`),await p()}catch(_){le.error((_==null?void 0:_.message)??"Import fehlgeschlagen")}finally{a(!1),f.current&&(f.current.value="")}}async function g(){a(!0);try{await r("set_rallye_settings",{completion_message:n.trim()}),le.success("Abschluss-Message gespeichert")}catch(w){le.error((w==null?void 0:w.message)??"Speichern fehlgeschlagen")}finally{a(!1)}}async function y(){if(o){a(!0);try{await r("save_rallye_question",{item:o}),le.success("Frage gespeichert"),l(null),await p()}catch(w){le.error((w==null?void 0:w.message)??"Speichern fehlgeschlagen")}finally{a(!1)}}}async function v(w){if(w&&confirm("Frage wirklich löschen?"))try{await r("delete_rallye_question",{id:w}),await p()}catch(b){le.error((b==null?void 0:b.message)??"Löschen fehlgeschlagen")}}return d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsxs("p",{className:"font-display font-bold flex items-center gap-2",children:[d.jsx(Ux,{className:"w-4 h-4 text-primary"})," Fragen-Upload (Excel / CSV)"]}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Spalten: ",d.jsx("strong",{children:"Frage"}),", ",d.jsx("strong",{children:"Antwort A"}),", ",d.jsx("strong",{children:"Antwort B"}),", ",d.jsx("strong",{children:"Antwort C"}),", ",d.jsx("strong",{children:"Richtig"})," (A/B/C). Optional: ",d.jsx("strong",{children:"Aussteller"})," oder ",d.jsx("strong",{children:"Standnummer"}),' (z. B. âH1-12"). Ein Upload ersetzt die gesamte Fragenliste.']}
746),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d.jsxs("button",{onClick:()=>{var w;return(w=f.current)==null?void 0:w.click()},disabled:i,className:"inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale disabled:opacity-60",children:[i?d.jsx(kn,{className:"w-4 h-4 animate-spin"}):d.jsx(zb,{className:"w-4 h-4"})," Datei hochladen"]}),d.jsxs("button",{onClick:m,className:"inline-flex items-center gap-1.5 border border-border text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale",children:[d.jsx(ME,{className:"w-4 h-4"})," Beispiel-Excel herunterladen"]})]}),d.jsx("input",{ref:f,type:"file",accept:".xlsx,.xls,.csv",className:"hidden",onChange:w=>{var _;const b=(_=w.target.files)==null?void 0:_[0];b&&x(b)}})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsx("p",{className:"font-display font-bold",children:"Abschluss-Message"}),d.jsx("textarea",{value:n,onChange:w=>s(w.target.value),rows:3,className:"mt-2 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Glückwunsch! Du hast alle Fragen gemeistertâ¦"}),d.jsxs("button",{onClick:g,disabled:i||!n.trim(),className:"mt-2 inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale disabled:opacity-60",children:[d.jsx(c1,{className:"w-4 h-4"})," Speichern"]})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("p",{className:"font-display font-bold",children:["Fragen (",e.length,")"]}),d.jsxs("button",{onClick:()=>l({...Bye,sort_order:e.length}),className:"inline-flex items-center gap-1 text-xs font-bold text-primary tap-scale",children:[d.jsx(qh,{className:"w-4 h-4"})," Neue Frage"]})]}),o&&d.jsxs("div",{className:"mt-3 rounded-xl border border-primary/40 bg-primary/5 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"text-sm font-bold",children:o.id?"Frage bearbeiten":"Neue Frage"}),d.jsx("button",{onClick:()=>l(null),children:d.jsx(Xn,{className:"w-4 h-4"})})]}),d.jsx("textarea",{value:o.question,onChange:w=>l({...o,question:w.target.value}),rows:2,placeholder:"Frage",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"}),["option_a","option_b","option_c"].map((w,b)=>d.jsx("input",{value:o[w],onChange:_=>l({...o,[w]:_.target.value}),placeholder:`Antwort ${"ABC"[b]}`,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"},w)),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs font-bold",children:"Aussteller (optional):"}),d.jsxs("select",{value:o.target_exhibitor_id??"",onChange:w=>l({...o,target_exhibitor_id:w.target.value||null}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"â kein Aussteller â"}),c.map(w=>d.jsxs("option",{value:w.id,children:[w.name," (",w.hall," · Stand ",w.stand_no,")"]},w.id))]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-xs font-bold",children:"Richtig:"}),["a","b","c"].map(w=>d.jsx("button",{onClick:()=>l({...o,correct_option:w}),className:`px-3 py-1.5 rounded-lg text-xs font-bold border ${o.correct_option===w?"gradient-hero text-primary-foreground border-transparent":"border-border"}`,children:w.toUpperCase()},w)),d.jsx("input",{type:"number",value:o.sort_order,onChange:w=>l({...o,sort_order:Number(w.target.value)}),className:"ml-auto w-20 rounded-lg border border-border bg-background px-2 py-1.5 text-sm",placeholder:"Reihenfolge"})]}),d.jsxs("button",{onClick:y,disabled:i,className:"inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2 tap-scale disabled:opacity-60",children:[d.jsx(c1,{className:"w-4 h-4"})," Speichern"]})]}),d.jsxs("div",{className:"mt-3 divide-y divide-border",children:[e.map((w,b)=>{var _;return d.jsxs("div",{className:"py-2.5 flex items-start gap-2",children:[d.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-6 shrink-0 pt-0.5",children:[b+1,"."]}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-sm font-semibold break-words",children:w.question}),d.jsxs("p",{className:"text-xs text-muted-foreground break-words",children:["A: ",w.option_a," · B: ",w.option_b," · C: ",w.option_c," ·"," ",d.jsxs("strong",{className:"text-success",children:["Richtig: ",(w.correct_option??"").toUpperCase()]})]}),w.target_exhibitor_id&&d.jsxs("p",{className:"text-[11px] text-primary font-bold mt-0.5",children:["Aussteller: ",((_=c.find(T=>T.id===w.target_exhibitor_id))==null?void 0:_.name)??"unbekannt"]})]}),d.jsx("button",{onClick:()=>l({...w}),className:"p-1.5 text-primary tap-scale",children:d.jsx(av,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>v(w.id),className:"p-1.5 text-destructive tap-scale",children:d.jsx(fs,{className:"w-4 h-4"})})]},w.id??b)}),!e.length&&d.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Noch keine Fragen vorhanden."})]})]})]})}const $ye={question:"",option_a:"",option_b:"",option_c:"",correct_option:"a",points:1,sort_order:0,is_active:!0,target_exhibitor_id:null};function zye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState({completion_message:"",threshold_gold:90,threshold_silver:70,threshold_bronze:50}),[i,a]=S.useState([]),[o,l]=S.useState(null),[c,u]=S.useState(!1),[f,p]=S.useState(null),[m,x]=S.useState([]),g=S.useRef(null);S.useEffect(()=>{(async()=>{const{data:A}=await et.from("exhibitors").select("id,name,hall,stand_no").order("name");x(A??[])})()},[]);async function y(){try{const[A,N,k]=await Promise.all([r("list_level_up_questions"),r("get_level_up_settings"),r("list_level_up_results")]);t(A.items??[]),N.settings&&s({completion_message:N.settings.completion_message??"",threshold_gold:N.settings.threshold_gold??90,threshold_silver:N.settings.threshold_silver??70,threshold_bronze:N.settings.threshold_bronze??50}),a(k.items??[]),l(k.stats??null)}catch(A){le.error((A==null?void 0:A.message)??"Fehler beim Laden")}}S.useEffect(()=>{y()},[]);function v(){const A=zo.json_to_sheet([{Frage:"Wie viele Hallen hat die Messe Wieselburg?","Antwort A":"2","Antwort B":"4","Antwort C":"6",Richtig:"B",Punkte:1,Aussteller:"",Standnummer:""}]),N=zo.book_new();zo.book_append_sheet(N,A,"LevelUp"),zH(N,"level-up-challenge-vorlage.xlsx")}async function w(A){var N;u(!0);try{const k=await A.arrayBuffer(),E=j0(k,{type:"array"}),P=zo.sheet_to_json(E.Sheets[E.SheetNames[0]],{defval:""});if(!P.length){le.error("Keine Zeilen gefunden.");return}const O=await r("import_level_up_questions",{rows:P});if(O.ok===!1){le.error(`${((N=O.errors)==null?void 0:N.length)??0} Fehler â Import abgebrochen`,{description:(O.errors??[]).slice(0,3).map(D=>`Zeile ${D.row}: ${D.error}`).join(" · ")});return}le.success(`${O.replaced} Fragen importiert`),await y()}catch(k){le.error((k==null?void 0:k.message)??"Import fehlgeschlagen")}finally{u(!1),g.current&&(g.current.value="")}}async function b(){u(!0);try{await r("set_level_up_settings",{completion_message:n.completion_message.trim(),threshold_gold:n.threshold_gold,threshold_silver:n.threshold_silver,threshold_bronze:n.threshold_bronze}),le.success("Einstellungen gespeichert")}catch(A){le.error((A==null?void 0:A.message)??"Speichern fehlgeschlagen")}finally{u(!1)}}async function _(){if(f){u(!0);try{await r("save_level_up_question",{item:f}),le.success("Frage gespeichert"),p(null),await y()}catch(A){le.error((A==null?void 0:A.message)??"Speichern fehlgeschlagen")}finally{u(!1)}}}async function T(A){if(A&&confirm("Frage wirklich löschen?"))try{await r("delete_level_up_question",{id:A}),await y()}catch(N){le.error((N==null?void 0:N.message)??"Löschen fehlgeschlagen")}}return d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsxs("p",{className:"font-display font-bold flex items-center gap-2",children:[d.jsx(K2,{className:"w-4 h-4 text-primary"})," Fragen-Upload (Excel / CSV)"]}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Spalten: ",d.jsx("strong",{children:"Frage"}),", ",d.jsx("strong",{children:"Antwort A"}),", ",d.jsx("strong",{children:"Antwort B"}),", ",d.jsx("strong",{children:"Antwort C"}),", ",d.jsx("strong",{children:"Richtig"})," (A/B/C). Optional: ",d.jsx("strong",{children:"Punkte"}),", ",d.jsx("strong",{children:"Aussteller"})," oder ",d.jsx("strong",{children:"Standnummer"}),". Ein Upload ersetzt die gesamte Fragenliste der Level Up Challenge."]}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d.jsxs("button",{onClick:()=>{var A;return(A=g.current)==null?void 0:A.click()}
746,disabled:c,className:"inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale disabled:opacity-60",children:[c?d.jsx(kn,{className:"w-4 h-4 animate-spin"}):d.jsx(zb,{className:"w-4 h-4"})," Datei hochladen"]}),d.jsxs("button",{onClick:v,className:"inline-flex items-center gap-1.5 border border-border text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale",children:[d.jsx(ME,{className:"w-4 h-4"})," Beispiel-Excel herunterladen"]})]}),d.jsx("input",{ref:g,type:"file",accept:".xlsx,.xls,.csv",className:"hidden",onChange:A=>{var k;const N=(k=A.target.files)==null?void 0:k[0];N&&w(N)}})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsx("p",{className:"font-display font-bold",children:"Auswertung & Abschluss-Message"}),d.jsx("textarea",{value:n.completion_message,onChange:A=>s({...n,completion_message:A.target.value}),rows:3,className:"mt-2 w-full rounded-xl border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Level Up! Du hast die Challenge gemeistertâ¦"}),d.jsx("div",{className:"mt-3 grid grid-cols-3 gap-2",children:[["threshold_gold","Gold ab %"],["threshold_silver","Silber ab %"],["threshold_bronze","Bronze ab %"]].map(([A,N])=>d.jsxs("label",{className:"text-xs font-bold",children:[N,d.jsx("input",{type:"number",min:0,max:100,value:n[A],onChange:k=>s({...n,[A]:Number(k.target.value)}),className:"mt-1 w-full rounded-lg border border-border bg-background px-2 py-1.5 text-sm"})]},A))}),d.jsxs("button",{onClick:b,disabled:c||!n.completion_message.trim(),className:"mt-3 inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2.5 tap-scale disabled:opacity-60",children:[d.jsx(c1,{className:"w-4 h-4"})," Speichern"]})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("p",{className:"font-display font-bold",children:["Fragen (",e.length,")"]}),d.jsxs("button",{onClick:()=>p({...$ye,sort_order:e.length}),className:"inline-flex items-center gap-1 text-xs font-bold text-primary tap-scale",children:[d.jsx(qh,{className:"w-4 h-4"})," Neue Frage"]})]}),f&&d.jsxs("div",{className:"mt-3 rounded-xl border border-primary/40 bg-primary/5 p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("p",{className:"text-sm font-bold",children:f.id?"Frage bearbeiten":"Neue Frage"}),d.jsx("button",{onClick:()=>p(null),children:d.jsx(Xn,{className:"w-4 h-4"})})]}),d.jsx("textarea",{value:f.question,onChange:A=>p({...f,question:A.target.value}),rows:2,placeholder:"Frage",className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"}),["option_a","option_b","option_c"].map((A,N)=>d.jsx("input",{value:f[A],onChange:k=>p({...f,[A]:k.target.value}),placeholder:`Antwort ${"ABC"[N]}`,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"},A)),d.jsxs("div",{children:[d.jsx("span",{className:"text-xs font-bold",children:"Aussteller (optional):"}),d.jsxs("select",{value:f.target_exhibitor_id??"",onChange:A=>p({...f,target_exhibitor_id:A.target.value||null}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"â kein Aussteller â"}),m.map(A=>d.jsxs("option",{value:A.id,children:[A.name," (",A.hall," · Stand ",A.stand_no,")"]},A.id))]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:"text-xs font-bold",children:"Richtig:"}),["a","b","c"].map(A=>d.jsx("button",{onClick:()=>p({...f,correct_option:A}),className:`px-3 py-1.5 rounded-lg text-xs font-bold border ${f.correct_option===A?"gradient-hero text-primary-foreground border-transparent":"border-border"}`,children:A.toUpperCase()},A)),d.jsxs("label",{className:"text-xs font-bold ml-auto flex items-center gap-1",children:["Punkte",d.jsx("input",{type:"number",min:1,value:f.points,onChange:A=>p({...f,points:Number(A.target.value)}),className:"w-16 rounded-lg border border-border bg-background px-2 py-1.5 text-sm"})]}),d.jsxs("label",{className:"text-xs font-bold flex items-center gap-1",children:["Reihenfolge",d.jsx("input",{type:"number",value:f.sort_order,onChange:A=>p({...f,sort_order:Number(A.target.value)}),className:"w-20 rounded-lg border border-border bg-background px-2 py-1.5 text-sm"})]}),d.jsxs("label",{className:"text-xs font-bold flex items-center gap-1",children:[d.jsx("input",{type:"checkbox",checked:f.is_active!==!1,onChange:A=>p({...f,is_active:A.target.checked})}),"Aktiv"]})]}
746),d.jsxs("button",{onClick:_,disabled:c,className:"inline-flex items-center gap-1.5 gradient-hero text-primary-foreground text-sm font-bold rounded-xl px-3.5 py-2 tap-scale disabled:opacity-60",children:[d.jsx(c1,{className:"w-4 h-4"})," Speichern"]})]}),d.jsxs("div",{className:"mt-3 divide-y divide-border",children:[e.map((A,N)=>{var k;return d.jsxs("div",{className:"py-2.5 flex items-start gap-2",children:[d.jsxs("span",{className:"text-xs font-bold text-muted-foreground w-6 shrink-0 pt-0.5",children:[N+1,"."]}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("p",{className:"text-sm font-semibold break-words",children:[A.question,A.is_active===!1&&d.jsx("span",{className:"ml-2 text-[11px] font-bold text-muted-foreground",children:"(inaktiv)"})]}),d.jsxs("p",{className:"text-xs text-muted-foreground break-words",children:["A: ",A.option_a," · B: ",A.option_b," · C: ",A.option_c," ·"," ",d.jsxs("strong",{className:"text-success",children:["Richtig: ",(A.correct_option??"").toUpperCase()]})," · ",A.points??1," P."]}),A.target_exhibitor_id&&d.jsxs("p",{className:"text-[11px] text-primary font-bold mt-0.5",children:["Aussteller: ",((k=m.find(E=>E.id===A.target_exhibitor_id))==null?void 0:k.name)??"unbekannt"]})]}),d.jsx("button",{onClick:()=>p({...A}),className:"p-1.5 text-primary tap-scale",children:d.jsx(av,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>T(A.id),className:"p-1.5 text-destructive tap-scale",children:d.jsx(fs,{className:"w-4 h-4"})})]},A.id??N)}),!e.length&&d.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Noch keine Fragen vorhanden."})]})]}),d.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[d.jsxs("p",{className:"font-display font-bold flex items-center gap-2",children:[d.jsx(N8,{className:"w-4 h-4 text-primary"})," Ergebnisse & Auswertung"]}),o&&d.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-center",children:[d.jsxs("div",{className:"rounded-xl bg-primary/5 p-2",children:[d.jsx("p",{className:"font-display text-lg font-extrabold",children:o.submissions}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Teilnahmen"})]}),d.jsxs("div",{className:"rounded-xl bg-primary/5 p-2",children:[d.jsx("p",{className:"font-display text-lg font-extrabold",children:o.avg_score}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"à Punkte"})]}),d.jsxs("div",{className:"rounded-xl bg-primary/5 p-2",children:[d.jsxs("p",{className:"font-display text-lg font-extrabold",children:[o.avg_percent,"%"]}),d.jsx("p",{className:"text-[11px] text-muted-foreground",children:"à Trefferquote"})]})]}),d.jsxs("div",{className:"mt-3 divide-y divide-border max-h-80 overflow-auto",children:[i.map(A=>d.jsxs("div",{className:"py-2 flex items-center gap-2 text-sm",children:[d.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:A.display_name||"Anonym"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(A.created_at).toLocaleString("de-AT")}),d.jsxs("span",{className:"text-xs font-bold",children:[A.score,"/",A.max_score]}),d.jsx("span",{className:"text-[11px] uppercase font-bold text-primary",children:A.tier??""})]},A.id)),!i.length&&d.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Noch keine Teilnahmen."})]})]})]})}function Hye({call:r}){const[e,t]=S.useState([]),[n,s]=S.useState(!0),[i,a]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState(!1),f=async()=>{s(!0);try{const g=await r("list_exhibitor_faqs",{});t((g==null?void 0:g.faqs)??[])}catch(g){le.error((g==null?void 0:g.message)??"FAQs konnten nicht geladen werden")}finally{s(!1)}};S.useEffect(()=>{f()},[]);const p=async g=>{a(!0);try{await r("toggle_exhibitor_faq",{id:g.id,is_published:!g.is_published}),t(y=>y.map(v=>v.id===g.id?{...v,is_published:!v.is_published}:v))}catch(y){le.error((y==null?void 0:y.message)??"Aktion fehlgeschlagen")}finally{a(!1)}},m=async g=>{if(confirm(`FAQ â${g.question}â wirklich löschen?`)){a(!0);try{await r("delete_exhibitor_faq",{id:g.id}),t(y=>y.filter(v=>v.id!==g.id)),le.success("FAQ gelöscht")}catch(y){le.error((y==null?void 0:y.message)??"Löschen fehlgeschlagen")}finally{a(!1)}}},x=async(g,y)=>{const v=g+y;if(v<0||v>=e.length)return;const w=[...e];[w[g],w[v]]=[w[v],w[g]],t(w),a(!0);try{await r("reorder_exhibitor_faqs",{ids:w.map(b=>b.id)})}catch(b){le.error((b==null?void 0:b.message)??"Sortierung fehlgeschlagen"),f()}finally{a(!1)}};return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4 mt-4",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(j8,{className:"w-5 h-5 text-primary"}),d.jsx("h3",{className:"font-display font-extrabold",children:"Aussteller-FAQs"})]}),d.jsxs("button",{onClick:()=>{l(null),u(!0)},className:"px-3 py-1.5 rounded-md text-xs font-bold gradient-hero text-primary-foreground inline-flex items-center gap-1.5",children:[d.jsx(qh,{className:"w-3.5 h-3.5"})," Neue FAQ"]})]}),n&&d.jsxs("p",{className:"text-sm text-muted-foreground inline-flex items-center gap-2",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Lädtâ¦"]}),!n&&e.length===0&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Noch keine FAQs angelegt."}),d.jsx("ul",{className:"flex flex-col gap-2",children:e.map((g,y)=>d.jsx("li",{className:"rounded-xl border border-border p-3",children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"font-bold text-sm break-words",children:g.question}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2 whitespace-pre-wrap",children:g.answer}),d.jsxs("p",{className:"text-[11px] mt-1 text-muted-foreground",children:["#",y+1," · ",g.is_published?"veröffentlicht":"verborgen"]})]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d.jsx("button",{disabled:i||y===0,onClick:()=>x(y,-1),title:"Nach oben",className:"p-1.5 rounded-md hover:bg-muted disabled:opacity-30",children:d.jsx(bq,{className:"w-4 h-4"})}),d.jsx("button",{disabled:i||y===e.length-1,onClick:()=>x(y,1),title:"Nach unten",className:"p-1.5 rounded-md hover:bg-muted disabled:opacity-30",children:d.jsx(wq,{className:"w-4 h-4"})}),d.jsx("button",{disabled:i,onClick:()=>p(g),title:g.is_published?"Verbergen":"Veröffentlichen",className:"p-1.5 rounded-md hover:bg-muted",children:g.is_published?d.jsx(H4,{className:"w-4 h-4"}):d.jsx(F8,{className:"w-4 h-4 text-muted-foreground"})}),d.jsx("button",{onClick:()=>{u(!1),l(g)},title:"Bearbeiten",className:"p-1.5 rounded-md hover:bg-muted",children:d.jsx(av,{className:"w-4 h-4"})}),d.jsx("button",{disabled:i,onClick:()=>m(g),title:"Löschen",className:"p-1.5 rounded-md hover:bg-destructive/10 text-destructive",children:d.jsx(fs,{className:"w-4 h-4"})})]})]})},g.id))}),d.jsx(Wye,{open:c||!!o,row:o,onClose:()=>{u(!1),l(null)},onSaved:()=>{u(!1),l(null),f()},call:r})]})}function Wye({open:r,row:e,onClose:t,onSaved:n,call:s}){const[i,a]=S.useState(""),[o,l]=S.useState(""),[c,u]=S.useState(!0),[f,p]=S.useState(!1);S.useEffect(()=>{r&&(a((e==null?void 0:e.question)??""),l((e==null?void 0:e.answer)??""),u((e==null?void 0:e.is_published)??!0))},[r,e]);const m=async()=>
746{if(!i.trim()){le.error("Frage darf nicht leer sein");return}p(!0);try{await s("save_exhibitor_faq",{id:e==null?void 0:e.id,question:i.trim(),answer:o.trim(),is_published:c,zone:(e==null?void 0:e.zone)??"zone_8"}),le.success(e?"FAQ aktualisiert":"FAQ angelegt"),n()}catch(x){le.error((x==null?void 0:x.message)??"Speichern fehlgeschlagen")}finally{p(!1)}};return d.jsx(Zl,{open:r,onOpenChange:x=>!x&&t(),children:d.jsxs(Xo,{className:"max-w-lg",children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:e?"FAQ bearbeiten":"Neue FAQ"}),d.jsx(Zo,{children:"Frage und Antwort für den Aussteller-Bereich."})]}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Frage"}),d.jsx("input",{value:i,onChange:x=>a(x.target.value),maxLength:500,className:"w-full mt-1 rounded-md border border-border bg-background px-3 py-2 text-sm",placeholder:"z. B. Wann kann ich meinen Stand aufbauen?"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs font-bold",children:"Antwort"}),d.jsx("textarea",{value:o,onChange:x=>l(x.target.value),rows:8,maxLength:2e4,className:"w-full mt-1 rounded-md border border-border bg-background px-3 py-2 text-sm leading-relaxed",placeholder:"Antworttext â¦"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx(xO,{checked:c,onCheckedChange:u}),"Veröffentlicht"]})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:t,className:"px-3 py-2 rounded-md text-sm font-bold hover:bg-muted",children:"Abbrechen"}),d.jsxs("button",{onClick:m,disabled:f,className:"px-4 py-2 rounded-md text-sm font-bold gradient-hero text-primary-foreground disabled:opacity-60 inline-flex items-center gap-2",children:[f&&d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Speichern"]})]})]})})}function Oi({id:r,title:e,subtitle:t,icon:n,open:s,onToggle:i,children:a}){return d.jsxs("section",{className:`rounded-2xl border transition-colors duration-300 overflow-hidden ${s?"border-primary/40 bg-primary/5 shadow-card":"border-border bg-card"}`,children:[d.jsxs("button",{type:"button",onClick:()=>i(r),"aria-expanded":s,className:"w-full flex items-center gap-3 px-4 py-3.5 text-left tap-scale",children:[n&&d.jsx("span",{className:"text-primary shrink-0",children:n}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block font-display font-bold leading-tight",children:e}),t&&d.jsx("span",{className:"block text-[11px] text-muted-foreground mt-0.5",children:t})]}),d.jsx(DE,{className:`w-5 h-5 shrink-0 text-primary transition-transform duration-300 ${s?"rotate-180":""}`})]}),d.jsx("div",{className:`grid transition-all duration-300 ease-in-out ${s?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:d.jsx("div",{className:"overflow-hidden",children:d.jsx("div",{className:"px-4 pb-4",children:a})})})]})}function Vye(r,e=[r[0]]){const[t,n]=S.useState(e.filter(Boolean));return{isOpen:s=>t.includes(s),toggle:s=>n(i=>i.includes(s)?i.filter(a=>a!==s):[...i,s]),expandAll:()=>n(r),collapseAll:()=>n([])}}const Gye=[{key:"Kunden_ID",label:"Kunden ID (intern, nicht sichtbar)",required:!0,aliases:["kundenid","kundennr","kundennummer","kunden","id","customerid","customer","ausstellerid"]},{key:"Name",label:"Firmenname",required:!0,aliases:["name","firma","firmenname","aussteller","company","unternehmen"]},{key:"Strasse",label:"Strasse mit Hausnummer",aliases:["strasse","straÃe","strassehausnr","strassemithausnummer","street","adresse","address"]},{key:"PLZ",label:"PLZ",aliases:["plz","postleitzahl","zip","postalcode"]},{key:"Ort",label:"Ort",aliases:["ort","stadt","city","town"]},{key:"Land",label:"Land",aliases:["land","country","staat"]},{key:"Telefon",label:"Tel Nr.",aliases:["tel","telefon","telnr","telefonnummer","phone","contactphone"]},{key:"Email",label:"E-mail",aliases:["email","mail","kontaktemail","contactemail","emailadresse"]},{key:"Homepage",label:"Homepage",aliases:["homepage","website","url","web"]},{key:"AVZ_Beschreibung",label:"AVZ Beschreibung",aliases:["avzbeschreibung","beschreibung","werbetext","description","ausstellerbeschreibung","promo","text"]},{key:"AVZ_Warengruppe",label:"AVZ Warengruppe",aliases:["avzwarengruppe","warengruppe","kategorie","kategorien","category","categories","branche","produktgruppe"]},{key:"Halle_Stand",label:"Hallen Nr. inkl. Standnummer",aliases:["hallenstand","hallestand","hallenstandnummer","halleundstand","hallestandnummer","standort","halle","standnummer","hall","stand"]},{key:"Aussteller_Code",label:"Aussteller-Code (Portal-Login)",aliases:["ausstellercode","aussteller","code","portalcode","logincode","zugangscode"]}],Kye=[{key:"Kunden_ID",label:"Kunden-ID",required:!0,aliases:["kundenid","kundennr","kundennummer","id"]},{key:"Keywords",label:"Keywords (, ; |)",required:!0,aliases:["keywords","schlagworte","schlagwörter","tags","stichworte","interessen"]}],Xye=[{key:"Code",label:"KVZ Nummer",required:!0,aliases:["id","code","nummer","nr","kvznr","kvz","kvznummer","numero"]},{key:"Kategorie",label:"Bezeichnung",required:!0,aliases:["kategorie","kategoriename","bezeichnung","sparte","branche","name","category"]}];function vh(r){return(r??"").toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]/g,"")}function Yye(r,e){const t=e.map(i=>({raw:i,n:vh(i)})),n={},s=new Set;for(const i of r){const a=new Set([vh(i.key),vh(i.label),...i.al
746iases.map(vh)]),o=t.find(l=>l.raw&&!s.has(l.raw)&&a.has(l.n));o&&(n[i.key]=o.raw,s.add(o.raw))}return n}const Lv="mw.admin.code",PR=5;function qye(){const r=ba(),[e,t]=S.useState(""),[n,s]=S.useState(!1),[i,a]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState(null),[f,p]=S.useState([]),[m,x]=S.useState(null),[g,y]=S.useState([]),[v,w]=S.useState(!1),b=Vye(["admins","exhibitors","maps","workshops","program","marketing","rallye","levelup","infotexte","tools"],["admins"]);S.useEffect(()=>{const k=sessionStorage.getItem(Lv);k&&(t(k),A(k))},[]);async function _(k,E={},P){const O=P??e,{data:D,error:H}=await et.functions.invoke("admin-ops",{body:{action:k,...E},headers:{"x-admin-code":O}});if(H){let B=H.message;try{const ee=H==null?void 0:H.context;if(ee&&typeof ee.json=="function"){const X=await ee.json();X!=null&&X.error&&(B=typeof X.error=="string"?X.error:JSON.stringify(X.error))}}catch{}throw console.error("admin-ops error",k,B),new Error(B)}if(D!=null&&D.error)throw new Error(D.error);return D}async function T(){try{const[k,E,P,O]=await Promise.all([_("stats"),_("list_admins"),_("get_active_hallenplan"),_("list_exhibitors_brief")]);u(k.counts),p(E.admins??[]),x(P.value??null),y(O.exhibitors??[])}catch(k){le.error((k==null?void 0:k.message)??"Fehler beim Laden")}}async function A(k){l(null),a(!0);try{const E=await _("stats",{},k);u(E.counts),s(!0),sessionStorage.setItem(Lv,k);const[P,O,D]=await Promise.all([_("list_admins",{},k),_("get_active_hallenplan",{},k),_("list_exhibitors_brief",{},k)]);p(P.admins??[]),x(O.value??null),y(D.exhibitors??[])}catch(E){s(!1),sessionStorage.removeItem(Lv),l((E==null?void 0:E.message)==="unauthorized"?"Code ungültig.":"Fehler: "+((E==null?void 0:E.message)??"unbekannt"))}finally{a(!1)}}function N(k=!1){sessionStorage.removeItem(Lv);try{localStorage.removeItem(Lv)}catch{}s(!1),t(""),u(null),p([]),x(null),y([]),k&&r("/",{replace:!0})}return n?d.jsxs("div",{className:"min-h-screen bg-background pb-16",children:[d.jsx("header",{className:"px-5 safe-top pb-4 gradient-hero text-primary-foreground rounded-b-[1.5rem]",children:d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs font-bold uppercase opacity-80",children:"Internal · Hybrid Auth"}),d.jsxs("h1",{className:"font-display text-2xl font-extrabold mt-1 flex items-center gap-2",children:[d.jsx(cT,{className:"w-6 h-6"})," Admin Console"]}),d.jsx("p",{className:"text-xs opacity-90 mt-1",children:"5 Zonen · Live-Status · Test-Profile"})]}),d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("button",{onClick:()=>w(!0),className:"inline-flex items-center gap-1.5 text-xs font-extrabold bg-white text-primary hover:bg-white/90 px-3 py-2 rounded-full tap-scale shadow-pop ring-2 ring-white/40",children:[d.jsx(Dq,{className:"w-4 h-4"})," Zur Besucher-Ansicht wechseln"]}),d.jsxs("button",{onClick:()=>N(!1),className:"inline-flex items-center gap-1.5 text-xs font-bold bg-white/15 hover:bg-white/25 px-3 py-1.5 rounded-full tap-scale",children:[d.jsx(i3,{className:"w-3.5 h-3.5"})," Sperren"]}),d.jsxs("button",{onClick:()=>N(!0),className:"inline-flex items-center gap-1.5 text-xs font-extrabold bg-destructive text-destructive-foreground hover:opacity-90 px-3 py-1.5 rounded-full tap-scale shadow-pop",children:[d.jsx(i3,{className:"w-3.5 h-3.5"})," Abmelden"]})]})]})}),d.jsxs("section",{className:"px-5 mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"font-display text-lg font-bold",children:"Live-Status"}),d.jsxs("button",{onClick:T,className:"inline-flex items-center gap-1 text-xs font-bold text-primary tap-scale",children:[d.jsx(Ou,{className:"w-3.5 h-3.5"})," Refresh"]})]}),d.jsx("div",{className:"mt-3 grid grid-cols-2 gap-2",children:c&&Object.entries(c).map(([k,E])=>d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-3",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-muted-foreground truncate",children:k}),d.jsx("p",{className:"font-display text-2xl font-extrabold mt-0.5",children:E})]},k))})]}),d.jsxs("section",{className:"px-5 mt-6",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("h2",{className:"font-display text-lg font-bold",children:"Verwaltungs-Zonen"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:b.expandAll,className:"text-[11px] font-bold text-primary tap-scale px-2 py-1 rounded-full bg-primary/10",children:"Alle aufklappen"}),d.jsx("button",{onClick:b.collapseAll,className:"text-[11px] font-bold text-muted-foreground tap-scale px-2 py-1 rounded-full bg-muted",children:"Alle zuklappen"})]})]}),d.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-3",children:[d.jsx(Oi,{id:"admins",title:"Zone 1: Allgemeine Einstellungen & Admins",subtitle:`Max. ${PR} Admin-Konten · derzeit ${f.length}/${PR}`,icon:d.jsx(ec,{className:"w-5 h-5"}),open:b.isOpen("admins"),onToggle:b.toggle,children:d.jsx(Jye,{admins:f,onChange:T,call:_})}),d.jsx(Oi,{id:"exhibitors",title:"Zone 2: Aussteller- & KVZ-Daten",subtitle:"Ausstellerverzeichnis, Kategorien, Matching & Keywords",icon:d.jsx(Ty,{className:"w-5 h-5"}),open:b.isOpen("exhibitors"),onToggle:b.toggle,children:d.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[d.jsx(RR,{zone:2,title:"Ausstellerverzeichnis",Icon:Ty,description:"UPSERT per Kunden_ID · flexible Spalten-Zuordnung beim Import",fields:Gye,action:"import_exhibitors",successFmt
746:k=>`${k.updated} aktualisiert, ${k.inserted} neu hinzugefügt`,call:_,onChange:T}),d.jsx(s1e,{call:_}),d.jsx(RR,{zone:5,title:"Kategorienverzeichnis",Icon:Rh,description:"Einfache 2-Spalten-Liste: ID / Code · Kategoriename (CSV mit , ; oder Tab, auch ohne Kopfzeile)",fields:Xye,action:"import_categories",successFmt:k=>`${k.imported} Kategorien importiert`,call:_,onChange:T}),d.jsx(n1e,{call:_,onChange:T}),d.jsx(e1e,{exhibitors:g,call:_,onChange:T})]})}),d.jsx(Oi,{id:"maps",title:"Zone 3: Hallenpläne",subtitle:"Gesamtlageplan & Hallenpläne verwalten",icon:d.jsx(Ix,{className:"w-5 h-5"}),open:b.isOpen("maps"),onToggle:b.toggle,children:d.jsx(Qye,{call:_})}),d.jsx(Oi,{id:"workshops",title:"Zone 4: Workshops verwalten",subtitle:"CSV-Import · Ãbersicht · Einzel-Löschung",icon:d.jsx(Su,{className:"w-5 h-5"}),open:b.isOpen("workshops"),onToggle:b.toggle,children:d.jsx(o1e,{call:_,onChange:T,exhibitors:g})}),d.jsx(Oi,{id:"program",title:"Zone 5: Programm & Ablauf",subtitle:"Bühnenprogramm, Vorträge & Highlights · Live in der App",icon:d.jsx(Sq,{className:"w-5 h-5"}),open:b.isOpen("program"),onToggle:b.toggle,children:d.jsx(Lye,{call:(k,E)=>_(k,E??{}),exhibitors:g.map(k=>({id:k.id,name:k.name}))})}),d.jsx(Oi,{id:"wissenswertes",title:"Wissenswertes & Infos",subtitle:"Info- und FAQ-Kacheln für die Besucher-Ansicht",icon:d.jsx(D0,{className:"w-5 h-5"}),open:b.isOpen("wissenswertes"),onToggle:b.toggle,children:d.jsx(dle,{call:(k,E)=>_(k,E??{})})}),d.jsx(Oi,{id:"marketing",title:"Zone 6: Push & Marketing",subtitle:"Promotion-Banner und In-App-Anzeigen",icon:d.jsx(Lx,{className:"w-5 h-5"}),open:b.isOpen("marketing"),onToggle:b.toggle,children:d.jsx(Rye,{call:(k,E)=>_(k,E??{})})}),d.jsx(Oi,{id:"pushads",title:"Push-Anzeigen",subtitle:"Header-Einblendung bei jeder 6. Interaktion · 5 Sekunden sichtbar",icon:d.jsx(y0,{className:"w-5 h-5"}),open:b.isOpen("pushads"),onToggle:b.toggle,children:d.jsx(Dye,{call:(k,E)=>_(k,E??{})})}),d.jsx(Oi,{id:"adstats",title:"Anzeigen-Statistik",subtitle:"Impressionen pro Anzeige · Zeitraum-Filter · CSV-Export",icon:d.jsx(Lx,{className:"w-5 h-5"}),open:b.isOpen("adstats"),onToggle:b.toggle,children:d.jsx(Mye,{call:(k,E)=>_(k,E??{})})}),d.jsx(Oi,{id:"rallye",title:"Zone 7: Messe-Rallye verwalten",subtitle:"Excel-Upload · Fragen bearbeiten · Abschluss-Message",icon:d.jsx(Ux,{className:"w-5 h-5"}),open:b.isOpen("rallye"),onToggle:b.toggle,children:d.jsx(Uye,{call:(k,E)=>_(k,E??{})})}),d.jsx(Oi,{id:"levelup",title:"Level Up Challenge verwalten",subtitle:"Excel-Upload · Fragen & Punkte · Auswertung & Ergebnisse",icon:d.jsx(Ux,{className:"w-5 h-5"}),open:b.isOpen("levelup"),onToggle:b.toggle,children:d.jsx(zye,{call:(k,E)=>_(k,E??{})})}),d.jsxs(Oi,{id:"infotexte",title:"Zone 8: Aussteller-Infos & FAQs",subtitle:"Durchsage · dynamische Fragen & Antworten",icon:d.jsx(iN,{className:"w-5 h-5"}),open:b.isOpen("infotexte"),onToggle:b.toggle,children:[d.jsx(a1e,{call:_}),d.jsx(Hye,{call:(k,E)=>_(k,E??{})})]}),d.jsxs(Oi,{id:"tools",title:"Zone 9: Test-Profile & Tools",subtitle:"Test-Daten und Direktlinks",icon:d.jsx(cT,{className:"w-5 h-5"}),open:b.isOpen("tools"),onToggle:b.toggle,children:[d.jsx(t1e,{call:_,onChange:T}),d.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-2",children:[d.jsxs(Jt,{to:"/map",className:"rounded-2xl bg-card shadow-card p-4 flex items-center gap-3 tap-scale",children:[d.jsx(Ix,{className:"w-5 h-5 text-primary"}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold",children:"Hallenplan prüfen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Pin-Positionen verifizieren"})]})]}),d.jsxs("button",{onClick:()=>r("/exhibitor/portal"),className:"rounded-2xl bg-card shadow-card p-4 flex items-center gap-3 tap-scale text-left",children:[d.jsx(Ty,{className:"w-5 h-5 text-primary"}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold",children:"Aussteller-Portal öffnen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Aktive Aussteller-Session erforderlich"})]})]})]})]})]})]}),v&&d.jsx(Zye,{onClose:()=>w(!1)})]}):d.jsxs("div",{className:"min-h-screen gradient-soft px-6 safe-top pb-8 flex flex-col",children:[d.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[d.jsx(cT,{className:"w-5 h-5"}),d.jsx("h1",{className:"font-display text-2xl font-extrabold",children:"Admin"})]}),d.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Interner Bereich. Master-Code erforderlich."}),d.jsxs("form",{onSubmit:k=>{if(k.preventDefault(),e.trim().length<8){l("Code zu kurz.");return}A(e.trim())},className:"mt-6",children:[d.jsx("label",{className:"block text-sm font-bold",children:"Master-Code"}
746),d.jsx("input",{autoFocus:!0,type:"password",autoComplete:"off",value:e,onChange:k=>t(k.target.value),className:"mt-1.5 w-full rounded-2xl border border-border bg-card px-4 py-3.5 text-base font-mono focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢"}),o&&d.jsx("p",{className:"mt-2 text-sm font-semibold text-destructive",children:o}),d.jsx("button",{type:"submit",disabled:i,className:"mt-5 w-full inline-flex items-center justify-center gap-2 gradient-hero text-primary-foreground font-display font-bold rounded-2xl py-4 shadow-pop tap-scale disabled:opacity-60",children:i?"Prüftâ¦":"Entsperren"})]})]})}function Zye({onClose:r}){const[e,t]=S.useState("/home"),n=[{p:"/home",label:"Home"},{p:"/exhibitors",label:"Aussteller"},{p:"/map",label:"Karte"},{p:"/workshops",label:"Workshops"},{p:"/program",label:"Programm"},{p:"/rallye",label:"Rallye"},{p:"/quiz",label:"Quiz"}];return d.jsxs("div",{className:"fixed inset-0 z-[100] bg-foreground/80 backdrop-blur-sm flex flex-col",children:[d.jsxs("div",{className:"gradient-accent text-accent-foreground px-4 py-2 flex items-center justify-between gap-2 shadow-md",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx(H4,{className:"w-4 h-4 shrink-0"}),d.jsx("p",{className:"text-xs sm:text-sm font-extrabold uppercase tracking-wide truncate",children:"Admin Preview Mode · Active configuration"})]}),d.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1 bg-white/20 hover:bg-white/30 text-accent-foreground px-3 py-1.5 rounded-full text-xs font-bold tap-scale shrink-0",children:[d.jsx(Xn,{className:"w-3.5 h-3.5"})," SchlieÃen"]})]}),d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-start gap-3 p-3 sm:p-6 overflow-auto",children:[d.jsx("div",{className:"flex flex-wrap gap-1.5 justify-center max-w-md",children:n.map(s=>d.jsx("button",{onClick:()=>t(s.p),className:`text-[11px] font-bold px-2.5 py-1 rounded-full tap-scale ${e===s.p?"bg-primary text-primary-foreground":"bg-white/90 text-foreground"}`,children:s.label},s.p))}),d.jsxs("div",{className:"relative bg-foreground rounded-[3rem] p-3 shadow-2xl border-[6px] border-foreground",style:{width:399,height:836},children:[d.jsx("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 w-32 h-7 bg-foreground rounded-full z-20 flex items-center justify-end pr-3",children:d.jsx("div",{className:"w-2 h-2 rounded-full bg-foreground
746/60 ring-1 ring-white/10"})}),d.jsx("div",{className:"absolute -left-1.5 top-24 w-1.5 h-8 rounded-l bg-foreground/80"}),d.jsx("div",{className:"absolute -left-1.5 top-40 w-1.5 h-14 rounded-l bg-foreground/80"}),d.jsx("div",{className:"absolute -left-1.5 top-60 w-1.5 h-14 rounded-l bg-foreground/80"}),d.jsx("div",{className:"absolute -right-1.5 top-32 w-1.5 h-20 rounded-r bg-foreground/80"}),d.jsx("div",{className:"relative bg-background rounded-[2.4rem] overflow-hidden shadow-inner",style:{width:375,height:812},children:d.jsx("iframe",{src:e,title:"Visitor Preview",className:"bg-background block border-0",style:{width:375,height:812},allow:"fullscreen; clipboard-write"},e)})]}),d.jsx("p",{className:"text-xs text-white/80",children:"Mobile-Viewport · 375 à 812 (iPhone-Format)"})]})]})}function Jye({admins:r,onChange:e,call:t}){const[n,s]=S.useState(""),[i,a]=S.useState(!1),o=r.length>=PR;async function l(){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim())){le.error("Ungültige E-Mail");return}a(!0);try{await t("add_admin",{email:n.trim()}),s(""),le.success("Admin hinzugefügt"),e()}catch(u){le.error((u==null?void 0:u.message)==="admin_limit_reached"?"Limit erreicht (5)":(u==null?void 0:u.message)??"Fehler")}finally{a(!1)}}async function c(u){if(confirm("Admin entfernen?")){a(!0);try{await t("delete_admin",{id:u}),le.success("Admin entfernt"),e()}catch(f){le.error((f==null?void 0:f.message)??"Fehler")}finally{a(!1)}}}return d.jsxs("div",{className:"mt-3 rounded-2xl bg-card shadow-card p-3",children:[d.jsxs("ul",{className:"divide-y divide-border",children:[r.length===0&&d.jsx("li",{className:"py-3 text-sm text-muted-foreground",children:"Noch keine Admins eingetragen."}),r.map(u=>d.jsxs("li",{className:"py-2 flex items-center justify-between gap-2",children:[d.jsx("span",{className:"text-sm font-semibold truncate",children:u.email}),d.jsx("button",{onClick:()=>c(u.id),className:"text-destructive p-1.5 rounded-lg hover:bg-destructive/10 tap-scale","aria-label":"Admin entfernen",children:d.jsx(fs,{className:"w-4 h-4"})})]},u.id))]}),d.jsxs("div",{className:"mt-3 flex gap-2",children:[d.jsx("input",{type:"email",value:n,onChange:u=>s(u.target.value),placeholder:o?"Limit erreicht (5/5)":"[email protected]",disabled:o||i,className:"flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary disabled:opacity-50"}),d.jsxs("button",{onClick:l,disabled:o||i||!n,className:"inline-flex items-center gap-1 gradient-hero text-primary-foreground font-bold rounded-xl px-3 py-2 text-sm shadow-pop tap-scale disabled:opacity-50",children:[d.jsx(qh,{className:"w-4 h-4"})," Add"]})]})]})}function Qye({call:r}){var N,k;const[e,t]=S.useState(null),[n,s]=S.useState(!1),[i,a]=S.useState(null),[o,l]=S.useState(null),[c,u]=S.useState("halle-1"),[f,p]=S.useState(!1),m=S.useRef(null),x=S.useRef(null);async function g(){s(!0);try{const E=await r("list_hallenplan_areas");t(E.areas??[])}catch(E){le.error((E==null?void 0:E.message)??"Bereiche konnten nicht geladen werden")}finally{s(!1)}}S.useEffect(()=>{g()},[]);async function y(E,P){var H;const O=E.name.toLowerCase().split(".").pop()??"",D=E.type||(O==="svg"?"image/svg+xml":O==="pdf"?"application/pdf":O==="png"?"image/png":O==="jpg"||O==="jpeg"?"image/jpeg":"");if(!["application/pdf","image/png","image/jpeg","image/svg+xml"].includes(D)){le.error("Nur SVG, PDF, PNG, JPG erlaubt");return}if(E.size>20*1024*1024){le.error("Datei zu groà (max 20 MB)");return}a(P);try{const B=await E.arrayBuffer(),ee=new Uint8Array(B);let X="";const W=32768;for(let J=0;J<ee.length;J+=W)X+=String.fromCharCode(...ee.subarray(J,J+W));const Y=btoa(X);await r("upload_hallenplan_area",{area_key:P,file_base64:Y,filename:E.name,content_type:D});const F=((H=e==null?void 0:e.find(J=>J.key===P))==null?void 0:H.label)??P;le.success(`"${E.name}" für ${F} aktiviert`),await g()}catch(B){le.error((B==null?void 0:B.message)??"Upload fehlgeschlagen")}finally{a(null),m.current&&(m.current.value="")}}async function v(E,P){a(E);try{await r("activate_hallenplan_area",{area_key:E,path:P}),le.success("Aktiviert"),await g()}catch(O){le.error((O==null?void 0:O.message)??"Fehler")}finally{a(null)}}async function w(E,P){if(confirm("Diese Datei endgültig löschen?")){a(E);try{await r("delete_hallenplan_area",{area_key:E,path:P}),le.success("Datei gelöscht"),await g()}
746catch(O){le.error((O==null?void 0:O.message)==="cannot_delete_active"?"Aktive Datei kann nicht gelöscht werden.":(O==null?void 0:O.message)??"Fehler")}finally{a(null)}}}async function b(E){if(confirm("Möchtest du diesen Hallenplan wirklich löschen?")){a(E);try{await r("clear_hallenplan_area",{area_key:E}),le.success("Hallenplan gelöscht"),await g()}catch(P){le.error((P==null?void 0:P.message)??"Fehler")}finally{a(null)}}}function _(E){if(!E)return"â";try{return new Date(E).toLocaleString("de-AT",{dateStyle:"short",timeStyle:"short"})}catch{return E}}function T({u:E}){var D;const P=(D=E.content_type)==null?void 0:D.startsWith("image/"),O=E.content_type==="application/pdf";return d.jsx("div",{className:"w-14 h-14 shrink-0 rounded-lg overflow-hidden bg-secondary flex items-center justify-center border border-border",children:P&&E.url?d.jsx("img",{src:E.url,alt:E.original_filename,className:"w-full h-full object-cover"}):O&&E.url?d.jsx("object",{data:`${E.url}#page=1&view=FitH&toolbar=0`,type:"application/pdf",className:"w-full h-full pointer-events-none","aria-label":"PDF-Vorschau",children:d.jsx(iN,{className:"w-6 h-6 text-muted-foreground"})}):d.jsx(iN,{className:"w-6 h-6 text-muted-foreground"})})}const A=(e==null?void 0:e.find(E=>E.key==="gesamtplan"))??null;return d.jsxs(SA,{zone:1,title:"Hallenpläne (14 Bereiche)",Icon:Ix,description:"Pro Halle / Freigelände ein eigener aktiver Plan · Originaldateinamen bleiben erhalten.",children:[d.jsxs("div",{className:"rounded-xl border-2 border-primary/40 bg-primary/5 p-3 mb-3",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wide text-primary mb-1",children:"Gesamtlageplan verwalten"}),d.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Master-Plan des Messegeländes (SVG empfohlen). Wird Besuchern beim Ãffnen von âHallenpläneâ zuerst angezeigt; Hallenflächen sind antippbar."}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex-1 min-w-0",children:A!=null&&A.active?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ch,{className:"bg-primary text-primary-foreground text-[10px] px-1.5 py-0",children:"Aktiv"}),d.jsx("span",{className:"text-xs font-semibold truncate",title:A.active.original_filename,children:A.active.original_filename})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Noch kein Gesamtlageplan hochgeladen."})}),(A==null?void 0:A.active)&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>l(A.active),className:"inline-flex items-center gap-1 text-[11px] font-bold bg-secondary text-secondary-foreground px-2 py-1 rounded-full tap-scale",children:[d.jsx(oN,{className:"w-3 h-3"})," Vorschau"]}),d.jsxs("button",{onClick:()=>void b("gesamtplan"),disabled:i==="gesamtplan",className:"inline-flex items-center gap-1 text-[11px] font-bold bg-destructive/10 text-destructive px-2 py-1 rounded-full tap-scale disabled:opacity-50","aria-label":"Gesamtplan löschen",children:[d.jsx(fs,{className:"w-3 h-3"})," Löschen"]})]}),d.jsxs("button",{onClick:()=>{var E;return(E=x.current)==null?void 0:E.click()},disabled:i==="gesamtplan",className:"inline-flex items-center gap-1.5 rounded-xl bg-primary text-primary-foreground px-3 py-2 text-xs font-bold shadow-soft tap-scale disabled:opacity-60",children:[i==="gesamtplan"?d.jsx(kn,{className:"w-3.5 h-3.5 animate-spin"}):null,A!=null&&A.active?"Ersetzen":"SVG hochladen"]}),d.jsx("input",{ref:x,type:"file",accept:".svg,.pdf,.png,.jpg,.jpeg,image/svg+xml,application/pdf,image/png,image/jpeg",className:"hidden",onChange:E=>{var O;const P=(O=E.target.files)==null?void 0:O[0];P&&y(P,"gesamtplan"),x.current&&(x.current.value="")}})]})]}),d.jsxs("div",{className:"rounded-xl border border-border bg-card p-3",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground mb-2",children:"Neue Datei hochladen"}),d.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[d.jsx("select",{value:c,onChange:E=>u(E.target.value),className:"rounded-xl border border-border bg-background px-3 py-2 text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-primary",children:(e??[]).map(E=>d.jsx("option",{value:E.key,children:E.label},E.key))}),d.jsxs("div",{onDragOver:E=>{E.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:E=>{var O;E.preventDefault(),p(!1);const P=(O=E.dataTransfer.files)==null?void 0:O[0];P&&y(P,c)},onClick:()=>{var E;
746return(E=m.current)==null?void 0:E.click()},className:`flex-1 rounded-xl border-2 border-dashed p-3 text-center cursor-pointer tap-scale ${f?"border-primary bg-primary/5":"border-border"} ${i===c?"opacity-60 pointer-events-none":""}`,children:[i===c?d.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm font-semibold",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Lädt â¦"]}):d.jsxs("p",{className:"text-sm font-semibold",children:["Datei für ",d.jsx("span",{className:"text-primary",children:((N=e==null?void 0:e.find(E=>E.key===c))==null?void 0:N.label)??c})," ablegen oder klicken"]}),d.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"SVG (empfohlen, QCAD-Export) · PDF · PNG · JPG (max 20 MB) · ersetzt nur den aktiven Plan dieses Bereichs"})]}),d.jsx("input",{ref:m,type:"file",accept:".svg,.pdf,.png,.jpg,.jpeg,image/svg+xml,application/pdf,image/png,image/jpeg",className:"hidden",onChange:E=>{var O;const P=(O=E.target.files)==null?void 0:O[0];P&&y(P,c)}})]})]}),d.jsxs("div",{className:"mt-3",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-muted-foreground",children:"Bereiche · aktive Pläne"}),d.jsx("button",{onClick:()=>void g(),className:"text-[11px] font-bold text-primary tap-scale",disabled:n,children:n?"Lädtâ¦":"Aktualisieren"})]}),!e&&d.jsx("div",{className:"text-xs text-muted-foreground",children:"Lädt Bereiche â¦"}),e&&d.jsx("ul",{className:"space-y-2",children:e.map(E=>d.jsxs("li",{className:"rounded-xl border border-border bg-card p-2.5",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-lg bg-secondary flex items-center justify-center shrink-0",children:d.jsx("span",{className:"text-[11px] font-extrabold text-foreground",children:E.label.replace(/^Halle /,"H")})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-sm font-extrabold",children:E.label}),E.active?d.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[d.jsx(Ch,{className:"bg-primary text-primary-foreground text-[10px] px-1.5 py-0",children:"Aktiv"}),d.jsx("span",{className:"text-xs font-semibold truncate",title:E.active.original_filename,children:E.active.original_filename})]}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Kein Plan hinterlegt."})]}),E.active&&d.jsxs(d.Fragment,{children:[d.jsx(T,{u:E.active}),d.jsxs("button",{onClick:()=>l(E.active),className:"inline-flex items-center gap-1 text-[11px] font-bold bg-secondary text-secondary-foreground px-2 py-1 rounded-full tap-scale",children:[d.jsx(oN,{className:"w-3 h-3"})," Vorschau"]}),d.jsxs("button",{onClick:()=>void b(E.key),disabled:i===E.key,className:"inline-flex items-center gap-1 text-[11px] font-bold bg-destructive/10 text-destructive px-2 py-1 rounded-full tap-scale disabled:opacity-50","aria-label":"Hallenplan löschen",children:[d.jsx(fs,{className:"w-3 h-3"})," Löschen"]})]})]}),E.uploads.length>1&&d.jsxs("details",{className:"mt-2",children:[d.jsxs("summary",{className:"text-[11px] font-bold text-primary cursor-pointer",children:["Verlauf (",E.uploads.length,")"]}),d.jsx("ul",{className:"mt-2 space-y-1.5",children:E.uploads.map(P=>d.jsxs("li",{className:`rounded-lg p-2 flex items-center gap-2 ${P.is_active?"bg-primary/5 ring-1 ring-primary/30":"bg-background border border-border"}`,children:[d.jsx(T,{u:P}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx("p",{className:"text-xs font-bold truncate",title:P.original_filename,children:P.original_filename}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:_(P.uploaded_at)})]}),P.is_active&&d.jsx(Ch,{className:"bg-primary text-primary-foreground text-[10px] px-1.5 py-0",children:"Aktiv"}),d.jsx("button",{onClick:()=>l(P),className:"text-[11px] font-bold text-primary px-2 py-0.5 rounded tap-scale",children:"Vorschau"}),!P.is_active&&d.jsx("button",{onClick:()=>void v(E.key,P.path),disabled:i===E.key,className:"text-[11px] font-bold bg-primary text-primary-foreground px-2 py-0.5 rounded-full tap-scale disabled:opacity-50",children:"Aktivieren"}),!P.is_active&&d.jsx("button",{onClick:()=>void w(E.key,P.path),disabled:i===E.key,className:"text-destructive p-1 rounded hover:bg-destructive/10 tap-scale disabled:opacity-50","aria-label":"Löschen",children:d.jsx(fs,{className:"w-3.5 h-3.5"})})]},P.path))})]})]},E.key))})]}),d.jsx(Zl,{open:!!o,onOpenChange:E=>!E&&l(null),children:d.jsxs(Xo,{className:"max-w-4xl w-[95vw] max-h-[90vh] overflow-hidden p-3 sm:p-4",children:[d.jsxs(Yo,{children:[d.jsx(qo,{className:"truncate pr-8",children:o==null?void 0:o.original_filename}),d.jsx(Zo,{children:o!=null&&o.is_active?"Aktiver Hallenplan":"Archivierter Hallenplan"})]}),d.jsxs("div",{className:"w-full bg-secondary rounded-xl overflow-hidden",style:{height:"70vh"},children:[(o==null?void 0:o.url)&&((k=o.content_type)==null?void 0:k.startsWith("image/"))&&d.jsx("img",{src:o.url,alt:o.original_filename,className:"w-full h-full object-contain"}),(o==null?void 0:o.url)&&o.content_type==="application/pdf"&&d.jsx(Sj,{url:o.url,height:"100%"})]})]})})]})}function RR({zone:r,title:e,description:t,Icon:n,fields:s,action:i,successFmt
746:a,destructive:o,call:l,onChange:c}){const[u,f]=S.useState(!1),[p,m]=S.useState(!1),[x,g]=S.useState([]),[y,v]=S.useState(null),w=S.useRef(null),[b,_]=S.useState(!1),[T,A]=S.useState([]),[N,k]=S.useState([]),[E,P]=S.useState({});function O(W){const Y=W.map(te=>(te??[]).map(re=>String(re??"").trim())).filter(te=>te.some(re=>re!==""));if(!Y.length)throw new Error("Datei ist leer");const F=Math.max(...Y.map(te=>te.length)),J=new Set;for(const te of s){J.add(vh(te.key)),J.add(vh(te.label));for(const re of te.aliases)J.add(vh(re))}const ne=Y[0],I=ne.some(te=>te!==""&&J.has(vh(te))),z=I?Array.from({length:F},(te,re)=>{var se;return((se=ne[re])==null?void 0:se.trim())||`Spalte ${re+1}`}):Array.from({length:F},(te,re)=>`Spalte ${re+1}`),U=(I?Y.slice(1):Y).map(te=>{const re={};return z.forEach((se,ie)=>{re[se]=te[ie]??""}),re});if(!U.length)throw new Error("Keine Datenzeilen gefunden");return{rows:U,headers:z}}async function D(W){if(/\.(xlsx|xls)$/i.test(W.name)){const J=j0(await W.arrayBuffer(),{type:"array"}),ne=J.Sheets[J.SheetNames[0]],I=zo.sheet_to_json(ne,{header:1,defval:"",raw:!1});return O(I)}let Y=await W.text();Y.charCodeAt(0)===65279&&(Y=Y.slice(1));const F=Dz.parse(Y,{header:!1,skipEmptyLines:!0});return O(F.data)}async function H(W){if(g([]),v(null),!/\.(csv|txt|xlsx|xls)$/i.test(W.name)&&!/csv|excel|sheet/i.test(W.type)){le.error("Bitte eine CSV- oder Excel-Datei wählen");return}try{const{rows:Y,headers:F}=await D(W);A(F),k(Y);const J=Yye(s,F);F.every(ne=>/^Spalte \d+$/.test(ne))&&s.forEach((ne,I)=>{!J[ne.key]&&F[I]&&(J[ne.key]=F[I])}),P(J),_(!0)}catch(Y){const F=(Y==null?void 0:Y.message)??"Datei konnte nicht gelesen werden";g([`Fehler: ${F}`]),le.error(F)}finally{w.current&&(w.current.value="")}}const B=s.filter(W=>W.required&&!E[W.key]),ee=B.length===0;async function X(){var W;if(ee&&!(o&&!confirm(`Achtung: "${e}" ERSETZT alle bestehenden Datensätze. Fortfahren?`))){f(!0);try{const Y=N.map(J=>{const ne={};for(const I of s){const z=E[I.key];z&&(ne[I.key]=J[z])}return ne}),F=await l(i,{rows:Y});if((W=F==null?void 0:F.errors)!=null&&W.length?g(F.errors.map(J=>`Zeile ${J.row}: ${J.error}`)):g([]),(F==null?void 0:F.ok)===!1)le.error(F.message??"Import abgebrochen"),v(null);else{const J=`Import successful: ${a(F)}`;v(J),le.success(J)}_(!1),c()}catch(Y){const F=(Y==null?void 0:Y.message)??"Import fehlgeschlagen";g([`Fehler: ${F}`]),le.error(F)}finally{f(!1)}}}return d.jsxs(SA,{zone:r,title:e,Icon:n,description:t,children:[d.jsxs("div",{onDragOver:W=>{W.preventDefault(),m(!0)},onDragLeave:()=>m(!1),onDrop:W=>{var F;W.preventDefault(),m(!1);const Y=(F=W.dataTransfer.files)==null?void 0:F[0];Y&&H(Y)},onClick:()=>{var W;return(W=w.current)==null?void 0:W.click()},className:`mt-1 rounded-xl border-2 border-dashed p-5 text-center cursor-pointer tap-scale ${p?"border-primary bg-primary/5":"border-border"} ${u?"opacity-60 pointer-events-none":""}`,children:[u?d.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm font-semibold",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Verarbeitet â¦"]}):d.jsx("p",{className:"text-sm font-semibold",children:"CSV oder Excel hier ablegen oder klicken"}),d.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Spalten-Zuordnung im nächsten Schritt"}),d.jsx("input",{ref:w,type:"file",accept:".csv,.txt,.xlsx,.xls,text/csv",className:"hidden",onChange:W=>{var F;const Y=(F=W.target.files)==null?void 0:F[0];Y&&H(Y)}})]}),y&&d.jsx(eW,{ok:!0,text:y}),x.length>0&&d.jsxs("div",{className:"mt-2 rounded-xl border border-destructive/30 bg-destructive/5 p-2 max-h-40 overflow-auto",children:[d.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-destructive mb-1",children:"Fehler-Log"}),d.jsx("ul",{className:"text-xs space-y-0.5 font-mono",children:x.map((W,Y)=>d.jsx("li",{className:"text-destructive",children:W},Y))})]}),d.jsx(Zl,{open:b,onOpenChange:W=>!u&&_(W),children:d.jsxs(Xo,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[d.jsxs(Yo,{children:[d.jsxs(qo,{children:["Spalten-Zuordnung · ",e]}),d.jsxs(Zo,{children:[N.length," Zeile(n) erkannt · ",T.length," Spalte(n). Ordne die CSV-Spalten den Anwendungsfeldern zu. Vorschläge wurden automatisch gesetzt."]})]}),d.jsxs("div",{className:"space-y-2",children:[s.map(W=>{const Y=W.required&&!E[W.key];return d.jsxs("div",{className:`grid grid-cols-[1fr,1.2fr] gap-3 items-center rounded-xl p-2.5 border ${Y?"border-destructive/40 bg-destructive/5":"border-border bg-card"}`,children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("p",{className:"text-sm font-bold truncate",children:[W.label," ",W.required&&d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("p",{className:"text-[11px] text-muted-foreground font-mono truncate",children:W.key})]}),d.jsxs("select",{value:E[W.key]??"",onChange:F=>P(J=>({...J,[W.key]:F.target.value})),className:"w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",children:[d.jsx("option",{value:"",children:"â nicht zuordnen â"}),T.map(F=>d.jsx("option",{value:F,children:F},F))]})]},W.key)}),B.length>0&&d.jsxs("p",{className:"text-xs font-semibold text-destructive",children:["Pflichtfelder fehlen: ",B.map(W=>
746W.label).join(", ")]})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>_(!1),disabled:u,className:"px-4 py-2 rounded-xl border border-border text-sm font-semibold tap-scale disabled:opacity-60",children:"Abbrechen"}),d.jsx("button",{onClick:X,disabled:!ee||u,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl gradient-hero text-primary-foreground text-sm font-bold shadow-pop tap-scale disabled:opacity-50",children:u?d.jsxs(d.Fragment,{children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Importiert â¦"]}):d.jsxs(d.Fragment,{children:["Daten importieren (",N.length,")"]})})]})]})})]})}function e1e({exhibitors:r,call:e,onChange:t}){const[n,s]=S.useState("tags"),[i,a]=S.useState(null),[o,l]=S.useState(""),[c,u]=S.useState(!1),f=r.find(g=>g.id===i)??null,p=(f==null?void 0:f.keywords)??[];async function m(){const g=o.trim();if(!(!f||!g)){u(!0);try{await e("set_exhibitor_keywords",{exhibitor_id:f.id,keywords:Array.from(new Set([...p??[],g]))}),l(""),le.success("Tag hinzugefügt"),t()}catch(y){le.error((y==null?void 0:y.message)??"Fehler")}finally{u(!1)}}}async function x(g){if(f){u(!0);try{await e("set_exhibitor_keywords",{exhibitor_id:f.id,keywords:(p??[]).filter(y=>y!==g)}),le.success("Tag entfernt"),t()}catch(y){le.error((y==null?void 0:y.message)??"Fehler")}finally{u(!1)}}}return d.jsxs(SA,{zone:7,title:"Suchbegriffe / Keywords",Icon:Rh,description:"Keywords pro Aussteller für die Aussteller-Suche · nicht Teil des Interessenschecks.",children:[d.jsx("div",{className:"mt-1 flex gap-1 p-1 bg-secondary rounded-xl",children:["tags","csv"].map(g=>d.jsx("button",{onClick:()=>s(g),className:`flex-1 rounded-lg px-3 py-1.5 text-xs font-bold tap-scale ${n===g?"bg-card shadow-card text-foreground":"text-muted-foreground"}`,children:g==="tags"?"Tag-Editor":"CSV Import"},g))}),n==="csv"?d.jsx("div",{className:"mt-2",children:d.jsx(RR,{zone:6,title:"Keywords CSV",Icon:Rh,description:"Spalten frei wählbar · Keywords (mit , ; oder | getrennt)",fields:Kye,action:"import_keywords",successFmt:g=>`${g.updated} Aussteller mit Keywords versehen`,call:e,onChange:t})}):d.jsxs("div",{className:"mt-2",children:[d.jsxs("select",{value:i??"",onChange:g=>a(g.target.value||null),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"Aussteller wählen â¦"}),r.map(g=>d.jsxs("option",{value:g.id,children:[g.name," ",g.hall?`· ${g.hall}`:""," ",g.stand_no?`· ${g.stand_no}`:""]},g.id))]}),f&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[p.length===0&&d.jsx("span",{className:"text-xs text-muted-foreground",children:"Keine Tags."}),p.map(g=>d.jsxs("span",{className:"inline-flex items-center gap-1 bg-secondary rounded-full px-2.5 py-1 text-xs font-semibold",children:[g,d.jsx("button",{onClick:()=>x(g),className:"hover:text-destructive","aria-label":"Tag entfernen",children:d.jsx(Xn,{className:"w-3 h-3"})})]},g))]}),d.jsxs("div",{className:"mt-2 flex gap-2",children:[d.jsx("input",{value:o,onChange:g=>l(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),m())},placeholder:"Neues Keyword â¦",className:"flex-1 rounded-xl border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"}),d.jsx("button",{onClick:m,disabled:c||!o.trim(),className:"inline-flex items-center gap-1 gradient-hero text-primary-foreground font-bold rounded-xl px-3 py-2 text-sm shadow-pop tap-scale disabled:opacity-50",children:d.jsx(qh,{className:"w-4 h-4"})})]})]})]})]})}function t1e({call:r,onChange:e}){const[t,n]=S.useState(null);async function s(){n("visitor");try{const c=(await r("create_test_visitor")).visitor;v3(),rj({id:c.id,first_name:c.first_name,zip_code:c.zip_code,role:"visitor"}),le.success(`Test-Besucher "${c.first_name}" aktiv`),e()}catch(l){le.error((l==null?void 0:l.message)??"Fehler")}finally{n(null)}}async function i(){n("exhibitor");try{const l=await r("create_test_exhibitor"),c=l.exhibitor;x3(),sj({exhibitor_id:c.id,name:c.name,hall:c.hall,stand_no:c.stand_no,code:l.code}),le.success(`Test-Aussteller "${c.name}" aktiv (Code: ${l.code})`),e()}catch(l){le.error((l==null?void 0:l.message)??"Fehler")}finally{n(null)}}function a(){x3(),v3();try{Object.keys(localStorage).filter(l=>
746l.startsWith("mw.notes.")).forEach(l=>localStorage.removeItem(l))}catch{}le.success("Lokale Session gelöscht")}async function o(){if(confirm("Alle Test-Daten (Test-Besucher, Test-Aussteller) löschen?")){n("delete");try{const l=await r("delete_test_data");le.success(`Gelöscht: ${l.deleted_test_exhibitors} Test-Aussteller`),e()}catch(l){le.error((l==null?void 0:l.message)??"Fehler")}finally{n(null)}}}return d.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-2",children:[d.jsxs("button",{onClick:s,disabled:t==="visitor",className:"rounded-2xl bg-card shadow-card p-4 text-left tap-scale flex items-center gap-3 disabled:opacity-60",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl gradient-hero flex items-center justify-center shrink-0",children:d.jsx(Lq,{className:"w-5 h-5 text-primary-foreground"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold",children:"Test-Besucher anlegen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Frisches Profil + automatisch einloggen"})]})]}),d.jsxs("button",{onClick:i,disabled:t==="exhibitor",className:"rounded-2xl bg-card shadow-card p-4 text-left tap-scale flex items-center gap-3 disabled:opacity-60",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl gradient-accent flex items-center justify-center shrink-0",children:d.jsx(Ty,{className:"w-5 h-5 text-accent-foreground"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold",children:"Test-Aussteller anlegen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Stand TEST + Code â Portal testen"})]})]}),d.jsxs("button",{onClick:a,className:"rounded-2xl border border-border p-4 text-left tap-scale flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-secondary flex items-center justify-center shrink-0",children:d.jsx(O8,{className:"w-5 h-5 text-foreground"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold",children:"Lokale Session zurücksetzen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Logt aus, löscht lokale Notizen"})]})]}),d.jsxs("button",{onClick:o,disabled:t==="delete",className:"rounded-2xl border border-destructive/30 p-4 text-left tap-scale flex items-center gap-3 disabled:opacity-60",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center shrink-0",children:d.jsx(fs,{className:"w-5 h-5 text-destructive"})}),d.jsxs("div",{children:[d.jsx("p",{className:"font-bold text-destructive",children:"Alle Test-Daten löschen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Entfernt Test-Besucher & Test-Aussteller"})]})]})]})}function SA({zone:r,title:e,Icon:t,description:n,children:s}){return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-11 h-11 rounded-xl gradient-hero flex items-center justify-center shrink-0",children:d.jsx(t,{className:"w-5 h-5 text-primary-foreground"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:["Zone ",r]}),d.jsx("h3",{className:"font-display font-extrabold leading-tight",children:e}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:n})]})]}),d.jsx("div",{className:"mt-3",children:s})]})}function eW({ok:r,text:e}){return d.jsx("p",{className:`mt-2 text-xs font-semibold ${r?"text-primary":"text-destructive"}`,children:e})}const r1e=r=>r.toLowerCase().replace(/[\s._\-()]/g,"");function hc(r,e){for(const t of Object.keys(r)){const n=r1e(t);if(e.some(s=>n===s||n.startsWith(s)))return r[t]}}function n1e({call:r,onChange:e}){const[t,n]=S.useState(!1),[s,i]=S.useState(null),[a,o]=S.useState([]),l=S.useRef(null);async function c(u){if(i(null),o([]),!/\.(xlsx|xlsm|xls)$/i.test(u.name)){le.error("Bitte eine Excel-Datei (.xlsx) wählen");return}n(!0);try{const f=j0(await u.arrayBuffer(),{type:"array"}),p=[],m=[],x=[],g=[];let y=null;const v=/(archiv|legende|legend|hinweis|info)/i,w=[...f.SheetNames].sort((k,E)=>{const P=O=>/app\s*import/i.test(O)?0:1;return P(k)-P(E)});for(const k of w){if(v.test(k)){g.push(k);continue}const E=zo.sheet_to_json(f.Sheets[k],{defval:""});let P=0,O=0;for(const D of E){const H=hc(D,["kvznr","kvznummer","kvz"]),B=hc(D,["bezeichnung","beruf","kategorie"]),ee=hc(D,["kundenid","kundennr","kdnr"]);ee&&H?(m.push({Kunden_ID:String(ee).trim(),KVZ_Nr:String(H).trim()}),O++):H&&B&&(y===null||y===k)&&(y=k,p.push({KVZ_Nr:H,Bezeichnung:B,Hauptgruppe:hc(D,["hauptgruppe"])??"",AMS_Typ:hc(D,["amstyp","amszuordnung","ams"])??"",Anteil_A:hc(D,["anteila"])??0,Anteil_B:hc(D,["anteilb"])??0,Anteil_C:hc(D,["anteilc"])??0,Anteil_D:hc(D,["anteild"])??0}),P++)}P?x.push(`${k} (${P} KVZ-Kategorien)`):O?x.push(`${k} (${O} Aussteller-Zuordnungen)`):E.length&&g.push(k)}if(!p.length&&!m.length)throw new Error("Keine passenden Spalten gefunden (kvz_nr/bezeichnung bzw. Kunden_ID/KVZ_Nr)");const b=[];let _=0,T=0;if(p.length){const k=await r("import_kvz",{rows:p});_=(k==null?void 0:k.imported)??0,((k==null?void 0:k.errors)??[]).forEac
746h(E=>b.push(`KVZ Zeile ${E.row}: ${E.error}`))}if(m.length){const k=await r("import_exhibitor_kvz",{rows:m});T=new Set(m.map(E=>E.Kunden_ID)).size,((k==null?void 0:k.errors)??[]).forEach(E=>b.push(`Zuordnung Zeile ${E.row}: ${E.error}`))}const A=`${_} KVZ-Kategorien und ${T} Aussteller-Zuordnungen aktualisiert`;i(A);const N=[...x.map(k=>`â importiert: ${k}`),...g.map(k=>`â ignoriert: ${k}`),...m.length===0?["â Keine Aussteller-Zuordnung in dieser Datei (Blatt mit Kunden-ID + KVZ-Nr fehlt)"]:[]];o([...N,...b.slice(0,40)]),le.success(A),e()}catch(f){const p=(f==null?void 0:f.message)??"Excel-Datei konnte nicht verarbeitet werden";o([`Fehler: ${p}`]),le.error(p)}finally{n(!1),l.current&&(l.current.value="")}}return d.jsxs(SA,{zone:6,title:"Interessenscheck â Excel Import",Icon:Rh,description:"Eine Datei für alles (z. B. KVZ_Stand_22.07_AMS_Prozent_Matching_final.xlsx): Blatt âAPP Importâ = KVZ-Kategorien, Blatt mit Kunden-ID + KVZ-Nr = Aussteller-Zuordnung. Archiv-/Legenden-Blätter werden ignoriert.",children:[d.jsx("input",{ref:l,type:"file",accept:".xlsx,.xlsm,.xls",disabled:t,onChange:u=>{var p;const f=(p=u.target.files)==null?void 0:p[0];f&&c(f)},className:"block w-full text-xs file:mr-3 file:rounded-lg file:border-0 file:bg-primary file:px-3 file:py-2 file:text-xs file:font-bold file:text-primary-foreground"}),t&&d.jsxs("p",{className:"mt-2 text-xs font-semibold text-muted-foreground inline-flex items-center gap-2",children:[d.jsx(kn,{className:"w-3.5 h-3.5 animate-spin"})," Excel wird verarbeitetâ¦"]}),s&&d.jsx(eW,{ok:!0,text:s}),a.length>0&&d.jsx("ul",{className:"mt-2 max-h-32 overflow-y-auto text-[11px] text-destructive font-mono space-y-0.5",children:a.map((u,f)=>d.jsx("li",{children:u},f))})]})}function eL(r){var t,n,s,i;const e=[];return(t=r.name)!=null&&t.trim()||e.push("Firmenname fehlt"),(!((n=r.hall)!=null&&n.trim())||!((s=r.stand_no)!=null&&s.trim()))&&e.push("Halle/Stand fehlt"),(!r.categories||r.categories.length===0)&&e.push("Warengruppe leer"),(i=r.promo_text)!=null&&i.trim()||e.push("Beschreibung leer"),{ok:e.length===0,warns:e}}function s1e({call:r}){const[e,t]=S.useState(null),[n,s]=S.useState(""),[i,a]=S.useState(!1),[o,l]=S.useState(null),[c,u]=S.useState(null);async function f(){a(!0);try{const y=await r("list_exhibitors_full");t(y.exhibitors??[])}catch(y){le.error((y==null?void 0:y.message)??"Fehler beim Laden")}finally{a(!1)}}S.useEffect(()=>{f()},[]);const p=S.useMemo(()=>{if(!e)return[];const y=n.trim().toLowerCase();return y?e.filter(v=>{var b;const w=(v.categories??[]).join(" ").toLowerCase();return((b=v.name)==null?void 0:b.toLowerCase().includes(y))||(v.stand_no??"").toLowerCase().includes(y)||(v.hall??"").toLowerCase().includes(y)||w.includes(y)||(v.kunden_id??"").toLowerCase().includes(y)||(v.aussteller_code??"").toLowerCase().includes(y)}):e},[e,n]),m=S.useMemo(()=>(e??[]).filter(y=>!eL(y).ok).length,[e]);async function x(y){try{await r("delete_exhibitor",{id:y}),le.success("Aussteller gelöscht"),u(null),await f()}catch(v){le.error((v==null?void 0:v.message)??"Löschen fehlgeschlagen")}}async function g(y,v){try{await r("update_exhibitor",{id:y,patch:v}),le.success("Gespeichert"),l(null),await f()}catch(w){le.error((w==null?void 0:w.message)??"Speichern fehlgeschlagen")}}return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-11 h-11 rounded-xl bg-primary/10 flex items-center justify-center shrink-0",children:d.jsx(Rh,{className:"w-5 h-5 text-primary"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Audit · Zone 2"}),d.jsx("h3",{className:"font-display font-extrabold leading-tight",children:"Aussteller-Datenkontrolle"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:e?`${e.length} Einträge · ${m} mit Warnungen`:"Lädtâ¦"})]}),d.jsxs("button",{onClick:()=>void f(),className:"text-xs font-bold text-primary inline-flex items-center gap-1 tap-scale",children:[d.jsx(Ou,{className:"w-3.5 h-3.5"})," Refresh"]})]}),d.jsx("div",{className:"mt-3",children:d.jsx("input",{value:n,onChange:y=>s(y.target.value),placeholder:"Suchen: Firma, Stand, Kategorie, Kunden-ID, Aussteller-Codeâ¦",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"})}),d.jsx("div",{className:"mt-3 max-h-[480px] overflow-auto rounded-xl border border-border",children:d.jsxs("table",{className:"w-full text-sm",children:[d.jsx("thead",{className:"bg-muted/50 sticky top-0 z-10",children:d.jsxs("tr",{className:"text-left",children:[d.jsx("th",{className:"p-2 font-bold",children:"Firma"}),d.jsx("th",{className:"p-2 font-bold",children:"Halle/Stand"}),d.jsx("th",{className:"p-2 font-bold hidden sm:table-cell",children:"Warengruppe"}),d.jsx("th",{className:"p-2 font-bold",children:"Status"}),d.jsx("th",{className:"p-2 font-bold text-right",children:"Aktion"})]})}),d.jsxs("tbody",{children:[i&&d.jsx("tr",{children:d.jsxs("td",{colSpan:5,className:"p-4 text-center text-muted-foreground",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin inline mr-2"}),"Lädtâ¦"]})}),!i&&p.length===0&&d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"p-4 text-center text-muted-foreground",children:"Keine Einträge."})}),p.map(y=>{const v=eL(y);return d.jsxs("tr",{className:"border-t border-border",children:[d.jsxs("td",{className:"p-2 align-top",children:[d.jsx("p",{className:"font-bold leading-tight",children:y.name||d.jsx("span",{className:"text-destructive",children:"â fehlt â"})}),d.jsxs("p",{className:"text-[10px] text-muted-foreground font-mono",children:["KID: ",y.kunden_id??"â"]}
746),d.jsxs("p",{className:"text-[10px] text-muted-foreground font-mono",children:["Code: ",y.aussteller_code??"â"]})]}),d.jsx("td",{className:"p-2 align-top whitespace-nowrap",children:y.hall||y.stand_no?`${y.hall??"?"} / ${y.stand_no??"?"}`:d.jsx("span",{className:"text-destructive font-semibold",children:"â fehlt â"})}),d.jsx("td",{className:"p-2 align-top hidden sm:table-cell",children:d.jsx("p",{className:"text-xs line-clamp-2",children:(y.categories??[]).join(", ")||d.jsx("span",{className:"text-muted-foreground italic",children:"leer"})})}),d.jsx("td",{className:"p-2 align-top",children:v.ok?d.jsx(Ch,{className:"bg-primary text-primary-foreground hover:bg-primary",children:"Complete"}):d.jsxs(Ch,{variant:"destructive",title:v.warns.join(" · "),children:[v.warns.length," â "]})}),d.jsxs("td",{className:"p-2 align-top text-right whitespace-nowrap",children:[d.jsx("button",{onClick:()=>l(y),className:"inline-flex items-center gap-1 text-xs font-bold text-primary px-2 py-1 rounded-md hover:bg-primary/10 tap-scale",children:"Editieren"}),d.jsx("button",{onClick:()=>u(y),className:"inline-flex items-center gap-1 text-xs font-bold text-destructive px-2 py-1 rounded-md hover:bg-destructive/10 tap-scale",children:d.jsx(fs,{className:"w-3.5 h-3.5"})})]})]},y.id)})]})]})}),o&&d.jsx(i1e,{exhibitor:o,call:r,onClose:()=>l(null),onSave:g}),d.jsx(Zl,{open:!!c,onOpenChange:y=>!y&&u(null),children:d.jsxs(Xo,{children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:"Aussteller löschen?"}),d.jsxs(Zo,{children:[d.jsx("strong",{children:c==null?void 0:c.name})," (KID ",(c==null?void 0:c.kunden_id)??"â",") wird inkl. zugehöriger Workshops und Zugangscodes endgültig entfernt."]})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>u(null),className:"px-3 py-2 rounded-md text-sm font-bold hover:bg-muted",children:"Abbrechen"}),d.jsx("button",{onClick:()=>c&&x(c.id),className:"px-3 py-2 rounded-md text-sm font-bold bg-destructive text-destructive-foreground hover:opacity-90",children:"Löschen"})]})]})})]})}function i1e({exhibitor:r,call:e,onClose:t,onSave:n}){const[s,i]=S.useState({name:r.name??"",street:r.street??"",postal_code:r.postal_code??"",city:r.city??"",country:r.country??"",contact_phone:r.contact_phone??"",contact_email:r.contact_email??"",website:r.website??"",promo_text:r.promo_text??"",categories:(r.categories??[]).join(", "),hall:r.hall??"",stand_no:r.stand_no??"",aussteller_code:r.aussteller_code??""}),[a,o]=S.useState(null);S.useEffect(()=>{let v=!0;return(async()=>{try{const w=await e("list_exhibitor_logins",{exhibitor_id:r.id});v&&o(w.logins??[])}catch{v&&o([])}})(),()=>{v=!1}},[e,r.id]);const[l,c]=S.useState(!!r.exclude_from_quiz),[u,f]=S.useState(!1);function p(v,w){i(b=>({...b,[v]:w}))}const m=s.name.trim().length>0;async function x(){if(!m){le.error("Firmenname ist Pflicht");return}f(!0);try{await n(r.id,{...s,aussteller_code:s.aussteller_code.trim()||null,exclude_from_quiz:l,categories:s.categories.split(/[,;|]/).map(v=>v.trim()).filter(Boolean)})}finally{f(!1)}}const g=({label:v,children:w})=>d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-muted-foreground",children:v}),d.jsx("div",{className:"mt-1",children:w})]}),y="w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary";return d.jsx(Zl,{open:!0,onOpenChange:v=>!v&&t(),children:d.jsxs(Xo,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:"Aussteller bearbeiten"}),d.jsx(Zo,{children:"11 Felder · Kunden-ID ist schreibgeschützt."})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mt-2",children:[d.jsx(g,{label:"Kunden ID (intern, read-only)",children:d.jsx("input",{value:r.kunden_id??"",readOnly:!0,disabled:!0,className:y+" bg-muted font-mono text-muted-foreground cursor-not-allowed"})}),d.jsx(g,{label:"Firmenname *",children:d.jsx("input",{value:s.name,onChange:v=>p("name",v.target.value),className:y})}),d.jsx(g,{label:"Strasse mit Hausnummer",children:d.jsx("input",{value:s.street,onChange:v=>p("street",v.target.value),className:y})}),d.jsx(g,{label:"PLZ",children:d.jsx("input",{value:s.postal_code,onChange:v=>p("postal_code",v.target.value),className:y})}),d.jsx(g,{label:"Ort",children:d.jsx("input",{value:s.city,onChange:v=>p("city",v.target.value),className:y})}),d.jsx(g,{label:"Land",children:d.jsx("input",{value:s.country,onChange:v=>p("country",v.target.value),className:y})}),d.jsx(g,{label:"Tel Nr.",children:d.jsx("input",{value:s.contact_phone,onChange:v=>p("contact_phone",v.target.value),className:y})}),d.jsx(g,{label:"E-mail",children:d.jsx("input",{value:s.contact_email,onChange:v=>p("contact_email",v.target.value),className:y})}),d.jsx(g,{label:"Homepage",children:d.jsx("input",{value:s.website,onChange:v=>p("website",v.target.value),className:y})}),d.jsx(g,{label:"Hallen Nr. inkl. Standnummer",children:d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{value:s.hall,onChange:v=>p("hall",v.target.value),placeholder:"Halle",className:y}),d.jsx("input",{value:s.stand_no,onChange:v=>p("stand_no",v.target.value),placeholder:"Stand",className:y})]})}),d.jsx(g,{label:"Aussteller-Code (unbegrenzt mehrfach nutzbar)",children:d.jsx("input",{value:s.aussteller_code,onChange:v=>p("aussteller_code",v.target.value),placeholder:"z. B. MW-2026-XYZ",className:y+" font-mono"})}),d.jsx(g,{label:"AVZ Warengruppe (Komma-getrennt)",children:d.jsx("input",{value:s.categories,onChange:v=>p("categories",v.target.value),className:y})}),d.jsx("div",{className:"sm:col-span-2",children:d.jsx(g,{label:"AVZ Beschreibung",children:d.jsx("textarea",{value:s.promo_text,onChange:v=>p("promo_text",v.target.value),rows:4,className:y})})}),d.jsxs("div",{className:"sm:col-span-2 flex items-start justify-between gap-3 rounded-md border border-border p-3",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-bold",children:"Vom Interessenscheck ausschlieÃen"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Aussteller bleibt auf dem Hallenplan und im Ausstellerverzeichnis
746sichtbar, erscheint aber nicht in âMeine Matchesâ."})]}),d.jsx(xO,{checked:l,onCheckedChange:c,"aria-label":"Vom Interessenscheck ausschlieÃen"})]}),d.jsxs("div",{className:"sm:col-span-2 rounded-md border border-border p-3",children:[d.jsx("p",{className:"text-sm font-bold",children:"Angemeldete Zugänge mit diesem Code"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Der Code ist ein Organisations-Schlüssel und kann beliebig oft verwendet werden."}),a===null?d.jsxs("p",{className:"mt-2 text-xs text-muted-foreground inline-flex items-center gap-2",children:[d.jsx(kn,{className:"w-3.5 h-3.5 animate-spin"}),"Lädtâ¦"]}):a.length===0?d.jsx("p",{className:"mt-2 text-xs text-muted-foreground italic",children:"Noch keine Anmeldungen erfasst."}):d.jsx("ul",{className:"mt-2 space-y-1 max-h-40 overflow-auto",children:a.map(v=>d.jsxs("li",{className:"text-xs flex items-center justify-between gap-2 border-b border-border/60 pb-1",children:[d.jsx("span",{className:"font-mono truncate",children:v.display_name||(v.device_id?`Gerät ${v.device_id.slice(0,8)}`:"Unbekannt")}),d.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[v.login_count,"à · ",new Date(v.last_login_at).toLocaleString("de-AT")]})]},v.id))})]})]}),d.jsxs(Jl,{className:"mt-4",children:[d.jsx("button",{onClick:t,className:"px-3 py-2 rounded-md text-sm font-bold hover:bg-muted",children:"Abbrechen"}),d.jsxs("button",{onClick:x,disabled:u||!m,className:"px-4 py-2 rounded-md text-sm font-bold gradient-hero text-primary-foreground disabled:opacity-60 inline-flex items-center gap-2",children:[u&&d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Speichern"]})]})]})})}function a1e({call:r}){const[e,t]=S.useState(""),[n,s]=S.useState(""),[i,a]=S.useState(null),[o,l]=S.useState(!0),[c,u]=S.useState(!1),f=async()=>{l(!0);try{const x=await r("get_aussteller_infotext"),g=String((x==null?void 0:x.text)??"");t(g),s(g),a((x==null?void 0:x.updated_at)??null)}catch(x){le.error((x==null?void 0:x.message)??"Konnte Infotext nicht laden")}finally{l(!1)}};S.useEffect(()=>{f()},[]);const p=async()=>{u(!0);try{await r("set_aussteller_infotext",{text:e}),s(e),a(new Date().toISOString()),le.success("Infotext gespeichert â für Aussteller sofort sichtbar.")}catch(x){le.error((x==null?void 0:x.message)??"Speichern fehlgeschlagen")}finally{u(!1)}},m=e!==n;return d.jsx("div",{className:"rounded-2xl bg-card shadow-card p-4",children:o?d.jsxs("p",{className:"text-sm text-muted-foreground inline-flex items-center gap-2",children:[d.jsx(kn,{className:"w-4 h-4 animate-spin"})," Lädtâ¦"]}):d.jsxs(d.Fragment,{children:[d.jsx("textarea",{value:e,onChange:x=>t(x.target.value),rows:12,placeholder:"Wichtige Informationen für Aussteller: Aufbauzeiten, Anlieferung, Technik, Kontakte â¦",className:"w-full rounded-xl border border-border bg-background p-3 text-sm leading-relaxed font-mono",maxLength:2e4}),d.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs text-muted-foreground",children:[d.jsxs("span",{children:[e.length," / 20 000 Zeichen",i&&` · zuletzt aktualisiert ${new Date(i).toLocaleString("de-AT")}`]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>t(n),disabled:!m||c,className:"px-3 py-1.5 rounded-md text-xs font-bold hover:bg-muted disabled:opacity-40",children:"Zurücksetzen"}),d.jsxs("button",{onClick:p,disabled:!m||c,className:"px-4 py-1.5 rounded-md text-xs font-bold gradient-hero text-primary-foreground disabled:opacity-50 inline-flex items-center gap-1.5",children:[c&&d.jsx(kn,{className:"w-3.5 h-3.5 animate-spin"})," Speichern"]})]})]})]})})}function o1e({call:r,onChange:e,exhibitors:t=[]}){var z;const n="#ef6e00",[s,i]=S.useState([]),[a,o]=S.useState(!1),[l,c]=S.useState(!1),[u,f]=S.useState(!1),[p,m]=S.useState([]),[x,g]=S.useState([]),y=S.useRef(null),[v,w]=S.useState(null),[b,_]=S.useState(null),[T,A]=S.useState(!1),[N,k]=S.useState(""),[E,P]=S.useState(null),[O,D]=S.useState([]),[H,B]=S.useState(!1);async function ee(M){P(M),D([]),B(!0);try{const U=await r("list_workshop_bookings",{workshop_id:M.id});D(U.bookings??[])}catch(U){le.error((U==null?void 0:U.message)??"Laden fehlgeschlagen")}finally{B(!1)}}function X(){if(!E)return;const M=G=>`"${String(G??"").replace(/"/g,'""')}"`,U=["Name","Schule/Organisation","PLZ","Plätze","Buchungsart","Begleitperson","E-Mail","Gebucht am"],te=O.map(G=>
746[G.name,G.school??"",G.zip_code??"",G.seats,G.booking_type==="group"?"Gruppe":"Einzeln",G.teacher_name??"",G.email??"",new Date(G.created_at).toLocaleString("de-AT",{timeZone:"Europe/Vienna"})].map(M).join(";")),re="\uFEFF"+U.map(M).join(";")+` 747`+te.join(` 748`),se=new Blob([re],{type:"text/csv;charset=utf-8"}),ie=URL.createObjectURL(se),ae=document.createElement("a"),ge=E.starts_at?String(E.starts_at).slice(0,10):"";ae.href=ie,ae.download=`teilnehmer_${(E.external_id??E.title).replace(/[^a-z0-9]+/gi,"_")}_${ge}.csv`,ae.click(),URL.revokeObjectURL(ie)}const W=S.useMemo(()=>{const M=N.trim().toLocaleLowerCase("de-AT");return M?s.filter(U=>{var te,re;return[U.external_id,U.title,U.tag,U.uhrzeit,U.room,(te=U.exhibitor)==null?void 0:te.name,(re=U.exhibitor)==null?void 0:re.aussteller_code].some(se=>String(se??"").toLocaleLowerCase("de-AT").includes(M))}):s},[s,N]);async function Y(){o(!0);try{const M=await r("list_workshops");i(M.workshops??[])}catch(M){le.error((M==null?void 0:M.message)??"Laden fehlgeschlagen")}finally{o(!1)}}S.useEffect(()=>{Y()},[]);async function F(M,U){var te;f(!0),g([]),m([]);try{const re=await M.text(),se=Dz.parse(re,{header:!0,skipEmptyLines:!0,transformHeader:Ue=>Ue.trim()});if((te=se.errors)!=null&&te.length){le.error("CSV-Parse-Fehler: "+se.errors[0].message);return}const ie=(se.data??[]).map(Ue=>{const Re={};for(const He of Object.keys(Ue))Re[He.trim().toLowerCase()]=(Ue[He]??"").trim();return Re});if(ie.length===0){le.error("CSV enthält keine Zeilen");return}U&&await r("wipe_workshops");const ae=await r("import_workshops",{rows:ie});m(ae.warnings??[]),g(ae.errors??[]);const ge=ae.inserted??0,G=ae.updated??0;(ge||G)&&le.success(`${ge} neu · ${G} aktualisiert`),(ae.errors??[]).length&&le.error(`${ae.errors.length} Fehlerzeile(n)`),(ae.warnings??[]).length&&le(`${ae.warnings.length} Warnung(en)`),await Y(),e()}catch(re){le.error((re==null?void 0:re.message)??"Import fehlgeschlagen")}finally{f(!1),y.current&&(y.current.value="")}}async function J(M){A(!0);try{await r("delete_workshop",{id:M}),le.success("Workshop erfolgreich gelöscht"),_(null),await Y(),e()}catch(U){le.error((U==null?void 0:U.message)??"Löschen fehlgeschlagen")}finally{A(!1)}}async function ne(){var M;if(!((M=v==null?void 0:v.title)!=null&&M.trim())){le.error("Titel ist erforderlich");return}A(!0);try{await r("save_workshop",{workshop:v}),le.success("Workshop gespeichert"),w(null),await Y(),e()}catch(U){le.error((U==null?void 0:U.message)??"Speichern fehlgeschlagen")}finally{A(!1)}}async function I(){if(confirm("ALLE Workshops (inkl. Buchungen) unwiderruflich löschen?")){f(!0);try{await r("wipe_workshops"),le.success("Alle Workshops entfernt"),await Y(),e()}catch(M){le.error((M==null?void 0:M.message)??"Löschen fehlgeschlagen")}finally{f(!1)}}}return d.jsxs("div",{className:"rounded-2xl bg-card shadow-card p-4",children:[d.jsxs("div",{onDragOver:M=>{M.preventDefault(),c(!0)},onDragLeave:()=>c(!1),onDrop:M=>{var te;M.preventDefault(),c(!1);const U=(te=M.dataTransfer.files)==null?void 0:te[0];U&&F(U,!1)},className:"rounded-xl border-2 border-dashed p-6 text-center transition-colors",style:{borderColor:l?n:"hsl(var(--border))",background:l?"rgba(239,110,0,0.06)":void 0},children:[d.jsx(zb,{className:"w-6 h-6 mx-auto",style:{color:n}}),d.jsx("p",{className:"mt-2 text-sm font-bold",children:"CSV hier ablegen oder auswählen"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Spalten: workshop_id, aussteller_code, titel, tag, uhrzeit, ort, max_teilnehmer"}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 justify-center",children:[d.jsxs("button",{disabled:u,onClick:()=>{var M;return(M=y.current)==null?void 0:M.click()},className:"inline-flex items-center gap-1.5 rounded-xl px-4 py-2 text-sm font-extrabold text-white tap-scale disabled:opacity-60",style:{backgroundColor:n},children:[d.jsx(s3,{className:"w-4 h-4"})," Datei auswählen"]}),d.jsxs("button",{disabled:u||s.length===0,onClick:()=>{y.current&&(y.current.dataset.wipe="1",y.current.click())},className:"inline-flex items-center gap-1.5 rounded-xl px-4 py-2 text-sm font-extrabold border-2 tap-scale disabled:opacity-60",style:{borderColor:n,color:n,background:"white"},children:[d.jsx(O8,{className:"w-4 h-4"})," Leeren & Neu hochladen"]}),d.jsxs("button",{disabled:u||s.length===0,onClick:I,className:"inline-flex items-center gap-1.5 rounded-xl px-4 py-2 text-sm font-bold bg-destructive text-destructive-foreground tap-scale disabled:opacity-60",children:[d.jsx(fs,{className:"w-4 h-4"})," Alle Workshops löschen"]})]}),d.jsx("input",{ref:y,type:"file",accept:".csv,text/csv",hidden:!0,onChange:M=>{var re,se;const U=(re=M.target.files)==null?void 0:re[0],te=((se=y.current)==null?void 0:se.dataset.wipe)==="1";y.current&&delete y.current.dataset.wipe,U&&F(U,te)}})]}),p.length>0&&d.jsxs("div",{className:"mt-3 rounded-xl border border-yellow-400/50 bg-yellow-50 p-3 text-xs",children:[d.jsxs("p",{className:"font-bold text-yellow-800 mb
748-1",children:["Warnungen (",p.length,")"]}),d.jsxs("ul",{className:"list-disc pl-5 space-y-0.5 text-yellow-900",children:[p.slice(0,8).map((M,U)=>d.jsxs("li",{children:["Zeile ",M.row,": ",M.message]},U)),p.length>8&&d.jsxs("li",{children:["⦠weitere ",p.length-8]})]})]}),x.length>0&&d.jsxs("div",{className:"mt-2 rounded-xl border border-destructive/40 bg-destructive/5 p-3 text-xs",children:[d.jsxs("p",{className:"font-bold text-destructive mb-1",children:["Fehler (",x.length,")"]}),d.jsxs("ul",{className:"list-disc pl-5 space-y-0.5",children:[x.slice(0,8).map((M,U)=>d.jsxs("li",{children:["Zeile ",M.row,": ",M.error]},U)),x.length>8&&d.jsxs("li",{children:["⦠weitere ",x.length-8]})]})]}),d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("p",{className:"text-sm font-bold",children:["Ãbersicht (",N.trim()?`${W.length} von ${s.length}`:s.length,")"]}),d.jsxs("button",{onClick:Y,className:"inline-flex items-center gap-1 text-xs font-bold text-primary tap-scale",children:[d.jsx(Ou,{className:"w-3.5 h-3.5"})," Neu laden"]})]}),d.jsxs("div",{className:"relative mb-3",children:[d.jsx(IE,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"search",value:N,onChange:M=>k(M.target.value),placeholder:"Workshop, ID, Aussteller, Tag oder Uhrzeit suchen",className:"w-full rounded-xl border border-border bg-background py-2.5 pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary"})]}),a&&d.jsx("p",{className:"text-sm text-muted-foreground",children:"Lädtâ¦"}),!a&&s.length===0&&d.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"Noch keine Workshops importiert."}),!a&&s.length>0&&W.length===0&&d.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"Keine passenden Workshops gefunden."}),W.length>0&&d.jsx("div",{className:"overflow-auto rounded-xl border border-border",children:d.jsxs("table",{className:"w-full text-xs",children:[d.jsx("thead",{className:"bg-muted/50 text-left",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-2 py-2 font-bold",children:"ID"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Aussteller"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Titel"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Tag"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Zeit"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Ort"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Plätze"}),d.jsx("th",{className:"px-2 py-2"})]})}),d.jsx("tbody",{children:W.map(M=>d.jsxs("tr",{className:"border-t border-border align-top",children:[d.jsx("td",{className:"px-2 py-2 font-mono",children:M.external_id??"â"}),d.jsx("td",{className:"px-2 py-2",children:M.exhibitor?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-semibold",children:M.exhibitor.name}),d.jsx("span",{className:"block text-muted-foreground",children:M.exhibitor.aussteller_code??"â"})]}):d.jsx("span",{className:"text-destructive font-bold",children:"â unzugeordnet"})}),d.jsx("td",{className:"px-2 py-2",children:M.title}),d.jsx("td",{className:"px-2 py-2",children:M.tag??"â"}),d.jsx("td",{className:"px-2 py-2 tabular-nums whitespace-nowrap",children:M.uhrzeit??"â"}),d.jsx("td",{className:"px-2 py-2",children:M.room}),d.jsxs("td",{className:"px-2 py-2 tabular-nums",children:[d.jsxs("span",{className:M.booked>=M.max_capacity?"text-destructive font-bold":"",children:[M.booked," / ",M.max_capacity]}),d.jsx("span",{className:"block text-muted-foreground text-[10px]",children:"gebucht"})]}),d.jsx("td",{className:"px-2 py-2",children:d.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[d.jsx("button",{onClick:()=>ee(M),"aria-label":"Teilnehmer anzeigen",title:"Teilnehmer anzeigen",className:"p-2 rounded-lg text-primary hover:bg-primary/10 tap-scale",children:d.jsx(ec,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>w(M),"aria-label":"Bearbeiten",title:"Bearbeiten",className:"p-2 rounded-lg text-primary hover:bg-primary/10 tap-scale",children:d.jsx(av,{className:"w-4 h-4"})}),d.jsx("button",{onClick:()=>_(M),"aria-label":"Löschen",title:"Löschen",className:"p-2 rounded-lg text-destructive hover:bg-destructive/10 tap-scale",children:d.jsx(fs,{className:"w-4 h-4"})})]})})]},M.id))})]})})]}),d.jsx(Zl,{open:!!v,onOpenChange:M=>!M&&!T&&w(null),children:d.jsxs(Xo,{className:"max-h-[85vh] overflow-y-auto",children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:v!=null&&v.id?"Workshop bearbeiten":"Neuer Workshop"}),d.jsx(Zo,{children:"Alle Angaben werden sofort in der Datenbank aktualisiert."})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(Vu,{label:"Workshop Titel *",children:d.jsx("input",{className:Wu,value:(v==null?void 0:v.title)??"",onChange:M=>w({...v,title:M.target.value})})}),d.jsx(Vu,{label:"Aussteller / Veranstalter",children:d.jsxs("select",{className:Wu,value:(v==null?void 0:v.exhibitor_id)??((z=v==null?void 0:v.exhibitor)==null?void 0:z.id)??"",onChange:M=>w({...v,exhibitor_id:M.target.value||null}),children:[d.jsx("option",{value:"",children:"â kein Aussteller â"}),t.map(M=>d.jsx("option",{value:M.id,children:M.name},M.id))]})}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx(Vu,{label:"Raum / Ort (Hallenplan)",children:d.jsx("input",{className:Wu,placeholder:"Halle 1 / Raum A",value:(v==null?void 0:v.room)??"",onChange:M=>w({...v,room:M.target.value})})}),d.jsx(Vu,{label:"Tag",children:d.jsxs("select",{className:Wu,value:(v==null?void 0:v.tag)??"",onChange:M=>w({...v,tag:M.target.value||null}),children:[d.jsx("option",{value:"",children:"â kein Tag â"}),["Donnerstag","Freitag","Samstag"].map(M=>d.jsx("option",{value:M,children:M},M))]})})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx(Vu,{label:"Datum",children:d.jsx("input",{type:"date",className:Wu,value:v!=null&&v.starts_at?String(v.starts_at).slice(0,10):"",onCh
748ange:M=>w({...v,starts_at:M.target.value?new Date(M.target.value+"T00:00:00Z").toISOString():v==null?void 0:v.starts_at})})}),d.jsx(Vu,{label:"Uhrzeit (Start â Ende)",children:d.jsx("input",{className:Wu,placeholder:"09:00 â 10:30",value:(v==null?void 0:v.uhrzeit)??"",onChange:M=>w({...v,uhrzeit:M.target.value})})})]}),d.jsx(Vu,{label:"Maximale Teilnehmerzahl / Kapazität",children:d.jsx("input",{type:"number",min:0,className:Wu,value:(v==null?void 0:v.max_capacity)??0,onChange:M=>w({...v,max_capacity:Number(M.target.value)})})}),d.jsx(Vu,{label:"Beschreibung & Zielgruppe",children:d.jsx("textarea",{rows:4,className:Wu,value:(v==null?void 0:v.description)??"",onChange:M=>w({...v,description:M.target.value})})})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>w(null),disabled:T,className:"px-4 py-2 rounded-full text-sm font-bold bg-muted tap-scale",children:"Abbrechen"}),d.jsx("button",{onClick:ne,disabled:T,className:"px-4 py-2 rounded-full text-sm font-extrabold text-white tap-scale disabled:opacity-60",style:{backgroundColor:n},children:T?"Speichert â¦":"Speichern"})]})]})}),d.jsx(Zl,{open:!!E,onOpenChange:M=>!M&&P(null),children:d.jsxs(Xo,{className:"max-h-[85vh] overflow-y-auto sm:max-w-3xl",children:[d.jsxs(Yo,{children:[d.jsxs(qo,{children:["Teilnehmer: ",E==null?void 0:E.title]}),d.jsxs(Zo,{children:[(E==null?void 0:E.tag)??"",E!=null&&E.uhrzeit?` · ${E.uhrzeit}`:"",E!=null&&E.room?` · ${E.room}`:""," · ",O.length," Buchung(en), ",O.reduce((M,U)=>M+(U.seats??1),0)," Platz/Plätze"]})]}),H&&d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Lädtâ¦"}),!H&&O.length===0&&d.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Noch keine Buchungen für diesen Termin."}),!H&&O.length>0&&d.jsx("div",{className:"overflow-auto rounded-xl border border-border",children:d.jsxs("table",{className:"w-full text-xs",children:[d.jsx("thead",{className:"bg-muted/50 text-left",children:d.jsxs("tr",{children:[d.jsx("th",{className:"px-2 py-2 font-bold",children:"Name"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Schule / Organisation"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"PLZ"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Plätze"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Art"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Begleitperson"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"E-Mail"}),d.jsx("th",{className:"px-2 py-2 font-bold",children:"Gebucht am"})]})}),d.jsx("tbody",{children:O.map(M=>d.jsxs("tr",{className:"border-t border-border align-top",children:[d.jsx("td",{className:"px-2 py-2 font-semibold",children:M.name}),d.jsx("td",{className:"px-2 py-2",children:M.school??"â"}),d.jsx("td",{className:"px-2 py-2 tabular-nums",children:M.zip_code??"â"}),d.jsx("td",{className:"px-2 py-2 tabular-nums",children:M.seats}),d.jsx("td",{className:"px-2 py-2",children:M.booking_type==="group"?"Gruppe":"Einzeln"}),d.jsx("td",{className:"px-2 py-2",children:M.teacher_name??"â"}),d.jsx("td",{className:"px-2 py-2",children:M.email??"â"}),d.jsx("td",{className:"px-2 py-2 whitespace-nowrap tabular-nums",children:new Date(M.created_at).toLocaleString("de-AT",{timeZone:"Europe/Vienna",dateStyle:"short",timeStyle:"short"})})]},M.id))})]})}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>P(null),className:"px-4 py-2 rounded-full text-sm font-bold bg-muted tap-scale",children:"SchlieÃen"}),d.jsxs("button",{onClick:X,disabled:O.length===0,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-extrabold text-white tap-scale disabled:opacity-60",style:{backgroundColor:n},children:[d.jsx(s3,{className:"w-4 h-4"})," Teilnehmerliste exportieren"]})]})]})}),d.jsx(Zl,{open:!!b,onOpenChange:M=>!M&&!T&&_(null),children:d.jsxs(Xo,{children:[d.jsxs(Yo,{children:[d.jsx(qo,{children:"Workshop löschen?"}),d.jsxs(Zo,{children:["Möchtest du den Workshop ",d.jsx("strong",{children:b==null?void 0:b.title})," wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden. Vorhandene Buchungen werden ebenfalls storniert."]})]}),d.jsxs(Jl,{children:[d.jsx("button",{onClick:()=>_(null),disabled:T,className:"px-4 py-2 rounded-full text-sm font-bold bg-muted tap-scale",children:"Abbrechen"}),d.jsx("button",{onClick:()=>b&&J(b.id),disabled:T,className:"px-4 py-2 rounded-full text-sm font-extrabold bg-destructive text-destructive-foreground tap-scale disabled:opacity-60",children:T?"Löscht â¦":"Endgültig löschen"})]})]})})]})}const Wu="w-full rounded-xl border border-border bg-background px-3 py-2 text-sm";function Vu({label:r,children:e}){return d.jsxs("label",{className:"block",children:[d.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground",children:r}),d.jsx("div",{className:"mt-1",children:e})]})}function of({label:r,children:e}){return d.jsxs("li",{className:"flex flex-col sm:flex-row sm:gap-2",children:[d.jsx("span",{className:"text-sm font-bold text-foreground shrink-0",children:r}),d.jsx("span",{className:"text-sm text-muted-foreground break-words",children:e})]})}function l1e(){const r=ba();return d.jsxs("div",{className:"min-h-screen bg-background pb-12",children:[d.jsxs("header",{className:"px-5 safe-top pb-5 gradient-hero text-primary-foreground rounded-b-[1.5rem] shadow-card",children:[d.jsxs("button",{onClick:()=>window.history.length>1?r(-1):r("/"),className:"inline-flex items-center gap-1.5 text-xs font-bold bg-white/20 hover:bg-white/30 px-3 py-1.5 rounded-full tap-scale",children:[d.jsx(_i,{className:"w-3.5 h-3.5"})," Zurück"]}),d.jsx("h1",{className:"font-display text-3xl font-extrabold mt-3",children:"Impressum"}
748),d.jsx("p",{className:"text-primary-foreground/85 text-sm mt-1",children:"Offenlegung gemäà §5 ECG und §25 MedienG"})]}),d.jsxs("main",{className:"px-5 mt-5 space-y-4",children:[d.jsxs("section",{className:"rounded-2xl bg-card shadow-card p-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(C8,{className:"w-5 h-5 text-primary"}),d.jsx("h2",{className:"font-display text-lg font-extrabold",children:"Messe Wieselburg GmbH"})]}),d.jsxs("address",{className:"not-italic text-sm text-muted-foreground leading-relaxed",children:["Volksfestplatz 3",d.jsx("br",{}),"3250 Wieselburg",d.jsx("br",{}),"Ãsterreich / Austria"]}),d.jsxs("ul",{className:"mt-4 space-y-2",children:[d.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[d.jsx(U8,{className:"w-4 h-4 text-primary shrink-0"}),d.jsx("a",{href:"tel:+43741650200",className:"hover:underline",children:"+43 (0) 7416 / 502 â 0"})]}),d.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[d.jsx(I8,{className:"w-4 h-4 text-primary shrink-0"}),d.jsx("a",{href:"mailto:[email protected]",className:"hover:underline break-all",children:"[email protected]"})]}),d.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[d.jsx(D8,{className:"w-4 h-4 text-primary shrink-0"}),d.jsx("a",{href:"https://www.messewieselburg.at",target:"_blank",rel:"noopener noreferrer",className:"hover:underline break-all",children:"www.messewieselburg.at"})]})]})]}),d.jsxs("section",{className:"rounded-2xl bg-card shadow-card p-5",children:[d.jsx("h2",{className:"font-display text-lg font-extrabold mb-3",children:"Firmenangaben"}),d.jsxs("ul",{className:"space-y-2.5",children:[d.jsx(of,{label:"Firmenbuchnummer:",children:"FN 275438g"}),d.jsx(of,{label:"UID-Nummer:",children:"ATU62336500"}),d.jsx(of,{label:"Firmenbuchgericht:",children:"Landesgericht St. Pölten"}),d.jsx(of,{label:"Unternehmensgegenstand:",children:"Organisation und Durchführung von Messen / Veranstaltungen sowie Vermietung von Räumlichkeiten"}),d.jsx(of,{label:"Kammermitgliedschaft:",children:"Mitglied der Wirtschaftskammer Niederösterreich (WKNÃ)"}),d.jsxs(of,{label:"Aufsichtsbehörde / Gewerbeordnung:",children:["Bezirkshauptmannschaft Scheibbs, Gewerbeordnung abrufbar unter"," ",d.jsx("a",{href:"https://www.ris.bka.gv.at",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"www.ris.bka.gv.at"})]}),d.jsx(of,{label:"Gesellschafter:",children:"Verkehrsverein Wieselburg (100 %)"})]})]}),d.jsxs("section",{className:"rounded-2xl bg-card shadow-card p-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(jq,{className:"w-5 h-5 text-primary"}),d.jsx("h2",{className:"font-display text-lg font-extrabold",children:"Rechtliche Hinweise & Haftungsausschluss"})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Urheberrecht"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:"Der Inhalt dieser Anwendung und Website ist urheberrechtlich geschützt."})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Haftung für Links"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:"Die Messe Wieselburg GmbH übernimmt keine Haftung für die Inhalte externer Links. Für den Inhalt der verlinkten Seiten sind ausschlieÃlich deren Betreiber verantwortlich."})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Online-Streitbeilegung"}),d.jsxs("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:["Verbraucher haben die Möglichkeit, Beschwerden an die Online-Streitbeilegungsplattform der EU zu richten:"," ",d.jsx("a",{href:"https://ec.europa.eu/consumers/odr",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-all",children:"https://ec.europa.eu/consumers/odr"}),"."]})]})]})]}),d.jsx("p",{className:"text-center text-[11px] text-muted-foreground pt-2",children:"© Messe Wieselburg GmbH · Volksfestplatz 3, 3250 Wieselburg"})]})]})}
748const c1e=new eK,u1e=()=>d.jsx(rK,{client:c1e,children:d.jsxs(qJ,{children:[d.jsx(kZ,{}),d.jsx(xY,{}),d.jsx(RX,{children:d.jsx(tre,{children:d.jsxs(aX,{children:[d.jsx(Dr,{path:"/",element:d.jsx(Bre,{})}),d.jsx(Dr,{path:"/register",element:d.jsx(zre,{})}),d.jsx(Dr,{path:"/exhibitor/login",element:d.jsx(fle,{})}),d.jsx(Dr,{path:"/exhibitor/portal",element:d.jsx(LM,{})}),d.jsx(Dr,{path:"/aussteller-login",element:d.jsx(ple,{})}),d.jsx(Dr,{path:"/aussteller-dashboard",element:d.jsx(LM,{})}),d.jsxs(Dr,{element:d.jsx(Zte,{}),children:[d.jsx(Dr,{path:"/home",element:d.jsx(ene,{})}),d.jsx(Dr,{path:"/quiz",element:d.jsx(nne,{})}),d.jsx(Dr,{path:"/rallye",element:d.jsx(ane,{})}),d.jsx(Dr,{path:"/level-up",element:d.jsx(cne,{})}),d.jsx(Dr,{path:"/workshops",element:d.jsx(dne,{})}),d.jsx(Dr,{path:"/my-workshops",element:d.jsx(mne,{})}),d.jsx(Dr,{path:"/map",element:d.jsx(Z9,{})}),d.jsx(Dr,{path:"/exhibitors",element:d.jsx(J9,{})}),d.jsx(Dr,{path:"/categories",element:d.jsx(Q9,{})}),d.jsx(Dr,{path:"/exhibitors/:id",element:d.jsx(toe,{})}),d.jsx(Dr,{path:"/program",element:d.jsx(ez,{})}),d.jsx(Dr,{path:"/wissenswertes",element:d.jsx(hle,{})})]}),d.jsx(Dr,{path:"/impressum",element:d.jsx(l1e,{})}),d.jsx(Dr,{path:"/admin",element:d.jsx(qye,{})}),d.jsx(Dr,{path:"*",element:d.jsx(yle,{})})]})})})]})});SB(document.getElementById("root")).render(d.jsx(u1e,{}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.