PageSourceSearch

https://purpose-driven-ventures.lovable.app/assets/index-DFDVKIo0.js

js purpose-driven-ventures.lovable.app collected 2026-10-03 03:40:38 UTC 1,470,583 bytes, 429 lines download raw bytes

vendor: 5,968 bytes, lines 1-9
1var WH=Object.defineProperty;var fI=t=>{throw TypeError(t)};var GH=(t,e,n)=>e in t?WH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var F=(t,e,n)=>GH(t,typeof e!="symbol"?e+"":e,n),uA=(t,e,n)=>e.has(t)||fI("Cannot "+n);var u=(t,e,n)=>(uA(t,e,"read from private field"),n?n.call(t):e.get(t)),E=(t,e,n)=>e.has(t)?fI("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),S=(t,e,n,r)=>(uA(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),T=(t,e,n)=>(uA(t,e,"access private method"),n);var jt=(t,e,n,r)=>({set _(i){S(t,e,i,n)},get _(){return u(t,e,r)}});function qH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var wS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gj={exports:{}},nk={},yj={exports:{}},Fe={};/**
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 L0=Symbol.for("react.element"),KH=Symbol.for("react.portal"),YH=Symbol.for("react.fragment"),XH=Symbol.for("react.strict_mode"),QH=Symbol.for("react.profiler"),JH=Symbol.for("react.provider"),ZH=Symbol.for("react.context"),e6=Symbol.for("react.forward_ref"),t6=Symbol.for("react.suspense"),n6=Symbol.for("react.memo"),r6=Symbol.for("react.lazy"),pI=Symbol.iterator;function i6(t){return t===null||typeof t!="object"?null:(t=pI&&t[pI]||t["@@iterator"],typeof t=="function"?t:null)}var vj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wj=Object.assign,bj={};function wg(t,e,n){this.props=t,this.context=e,this.refs=bj,this.updater=n||vj}wg.prototype.isReactComponent={};wg.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};wg.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function xj(){}xj.prototype=wg.prototype;function MP(t,e,n){this.props=t,this.context=e,this.refs=bj,this.updater=n||vj}var DP=MP.prototype=new xj;DP.constructor=MP;wj(DP,wg.prototype);DP.isPureReactComponent=!0;var mI=Array.isArray,Sj=Object.prototype.hasOwnProperty,LP={current:null},kj={key:!0,ref:!0,__self:!0,__source:!0};function Aj(t,e,n){var r,i={},s=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)Sj.call(e,r)&&!kj.hasOwnProperty(r)&&(i[r]=e[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:L0,type:t,key:s,ref:a,props:i,_owner:LP.current}}function s6(t,e){return{$$typeof:L0,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function jP(t){return typeof t=="object"&&t!==null&&t.$$typeof===L0}function a6(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var gI=/\/+/g;function hA(t,e){return typeof t=="object"&&t!==null&&t.key!=null?a6(""+t.key):e.toString(36)}function ix(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case L0:case KH:a=!0}}if(a)return a=t,i=i(a),t=r===""?"."+hA(a,0):r,mI(i)?(n="",t!=null&&(n=t.replace(gI,"$&/")+"/"),ix(i,e,n,"",function(c){return c})):i!=null&&(jP(i)&&(i=s6(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(gI,"$&/")+"/")+t)),e.push(i)),1;if(a=0,r=r===""?".":r+":",mI(t))for(var o=0;o<t.length;o++){s=t[o];var l=r+hA(s,o);a+=ix(s,e,n,l,i)}else if(l=i6(t),typeof l=="function")for(t=l.call(t),o=0;!(s=t.next()).done;)s=s.value,l=r+hA(s,o++),a+=ix(s,e,n,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function ib(t,e,n){if(t==null)return t;var r=[],i=0;return ix(t,r,"","",function(s){return e.call(n,s,i++)}),r}function o6(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var jr={current:null},sx={transition:null},l6={ReactCurrentDispatcher:jr,ReactCurrentBatchConfig:sx,ReactCurrentOwner:LP};function Ej(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,490 bytes, lines 9-25
9Fe.Children={map:ib,forEach:function(t,e,n){ib(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ib(t,function(){e++}),e},toArray:function(t){return ib(t,function(e){return e})||[]},only:function(t){if(!jP(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Fe.Component=wg;Fe.Fragment=YH;Fe.Profiler=QH;Fe.PureComponent=MP;Fe.StrictMode=XH;Fe.Suspense=t6;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=l6;Fe.act=Ej;Fe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=wj({},t.props),i=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=LP.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)Sj.call(e,l)&&!kj.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:L0,type:t.type,key:i,ref:s,props:r,_owner:a}};Fe.createContext=function(t){return t={$$typeof:ZH,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:JH,_context:t},t.Consumer=t};Fe.createElement=Aj;Fe.createFactory=function(t){var e=Aj.bind(null,t);return e.type=t,e};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(t){return{$$typeof:e6,render:t}};Fe.isValidElement=jP;Fe.lazy=function(t){return{$$typeof:r6,_payload:{_status:-1,_result:t},_init:o6}};Fe.memo=function(t,e){return{$$typeof:n6,type:t,compare:e===void 0?null:e}};Fe.startTransition=function(t){var e=sx.transition;sx.transition={};try{t()}finally{sx.transition=e}};Fe.unstable_act=Ej;Fe.useCallback=function(t,e){return jr.current.useCallback(t,e)};Fe.useContext=function(t){return jr.current.useContext(t)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(t){return jr.current.useDeferredValue(t)};Fe.useEffect=function(t,e){return jr.current.useEffect(t,e)};Fe.useId=function(){return jr.current.useId()};Fe.useImperativeHandle=function(t,e,n){return jr.current.useImperativeHandle(t,e,n)};Fe.useInsertionEffect=function(t,e){return jr.current.useInsertionEffect(t,e)};Fe.useLayoutEffect=function(t,e){return jr.current.useLayoutEffect(t,e)};Fe.useMemo=function(t,e){return jr.current.useMemo(t,e)};Fe.useReducer=function(t,e,n){return jr.current.useReducer(t,e,n)};Fe.useRef=function(t){return jr.current.useRef(t)};Fe.useState=function(t){return jr.current.useState(t)};Fe.useSyncExternalStore=function(t,e,n){return jr.current.useSyncExternalStore(t,e,n)};Fe.useTransition=function(){return jr.current.useTransition()};Fe.version="18.3.1";yj.exports=Fe;var A=yj.exports;const q=Jd(A),_j=qH({__proto__:null,default:q},[A]);/**
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 c6=A,u6=Symbol.for("react.element"),h6=Symbol.for("react.fragment"),d6=Object.prototype.hasOwnProperty,f6=c6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p6={key:!0,ref:!0,__self:!0,__source:!0};function Cj(t,e,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)d6.call(e,r)&&!p6.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:u6,type:t,key:s,ref:a,props:i,_owner:f6.current}}nk.Fragment=h6;nk.jsx=Cj;nk.jsxs=Cj;gj.exports=nk;var g=gj.exports,Tj={exports:{}},Yi={},Pj={exports:{}},Nj={};/**
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(t){function e(L,V){var N=L.length;L.push(V);e:for(;0<N;){var G=N-1>>>1,Y=L[G];if(0<i(Y,V))L[G]=V,L[N]=Y,N=G;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var V=L[0],N=L.pop();if(N!==V){L[0]=N;e:for(var G=0,Y=L.length,I=Y>>>1;G<I;){var we=2*(G+1)-1,Oe=L[we],oe=we+1,he=L[oe];if(0>i(Oe,N))oe<Y&&0>i(he,Oe)?(L[G]=he,L[oe]=N,G=oe):(L[G]=Oe,L[we]=N,G=we);else if(oe<Y&&0>i(he,N))L[G]=he,L[oe]=N,G=oe;else break e}}return V}function i(L,V){var N=L.sortIndex-V.sortIndex;return N!==0?N:L.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,d=null,f=3,p=!1,m=!1,y=!1,x=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(L){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=L)r(c),V.sortIndex=V.expirationTime,e(l,V);else break;V=n(c)}}function k(L){if(y=!1,b(L),!m)if(n(l)!==null)m=!0,$(_);else{var V=n(c);V!==null&&W(k,V.startTime-L)}}function _(L,V){m=!1,y&&(y=!1,v(R),R=-1),p=!0;var N=f;try{for(b(V),d=n(l);d!==null&&(!(d.expirationTime>V)||L&&!D());){var G=d.callback;
vendor: 9,155 bytes, lines 25-34
25if(typeof G=="function"){d.callback=null,f=d.priorityLevel;var Y=G(d.expirationTime<=V);V=t.unstable_now(),typeof Y=="function"?d.callback=Y:d===n(l)&&r(l),b(V)}else r(l);d=n(l)}if(d!==null)var I=!0;else{var we=n(c);we!==null&&W(k,we.startTime-V),I=!1}return I}finally{d=null,f=N,p=!1}}var C=!1,P=null,R=-1,O=5,M=-1;function D(){return!(t.unstable_now()-M<O)}function j(){if(P!==null){var L=t.unstable_now();M=L;var V=!0;try{V=P(!0,L)}finally{V?U():(C=!1,P=null)}}else C=!1}var U;if(typeof w=="function")U=function(){w(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,z=B.port2;B.port1.onmessage=j,U=function(){z.postMessage(null)}}else U=function(){x(j,0)};function $(L){P=L,C||(C=!0,U())}function W(L,V){R=x(function(){L(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,$(_))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(L){switch(f){case 1:case 2:case 3:var V=3;break;default:V=f}var N=f;f=V;try{return L()}finally{f=N}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,V){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var N=f;f=L;try{return V()}finally{f=N}},t.unstable_scheduleCallback=function(L,V,N){var G=t.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?G+N:G):N=G,L){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=N+Y,L={id:h++,callback:V,priorityLevel:L,startTime:N,expirationTime:Y,sortIndex:-1},N>G?(L.sortIndex=N,e(c,L),n(l)===null&&L===n(c)&&(y?(v(R),R=-1):y=!0,W(k,N-G))):(L.sortIndex=Y,e(l,L),m||p||(m=!0,$(_))),L},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(L){var V=f;return function(){var N=f;f=V;try{return L.apply(this,arguments)}finally{f=N}}}})(Nj);Pj.exports=Nj;var m6=Pj.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 g6=A,Gi=m6;function K(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Rj=new Set,sv={};function Zd(t,e){eg(t,e),eg(t+"Capture",e)}function eg(t,e){for(sv[t]=e,t=0;t<e.length;t++)Rj.add(e[t])}var Al=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),VE=Object.prototype.hasOwnProperty,y6=/^[: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]*$/,yI={},vI={};function v6(t){return VE.call(vI,t)?!0:VE.call(yI,t)?!1:y6.test(t)?vI[t]=!0:(yI[t]=!0,!1)}function w6(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function b6(t,e,n,r){if(e===null||typeof e>"u"||w6(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Fr(t,e,n,r,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var ir={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ir[t]=new Fr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ir[e]=new Fr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ir[t]=new Fr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ir[t]=new Fr(t,2,!1,t,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(t){ir[t]=new Fr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ir[t]=new Fr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ir[t]=new Fr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ir[t]=new Fr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ir[t]=new Fr(t,5,!1,t.toLowerCase(),null,!1,!1)});var FP=/[\-:]([a-z])/g;function BP(t){return t[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(t){var e=t.replace(FP,BP);ir[e]=new Fr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(FP,BP);ir[e]=new Fr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(FP,BP);ir[e]=new Fr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ir[t]=new Fr(t,1,!1,t.toLowerCase(),null,!1,!1)});ir.xlinkHref=new Fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ir[t]=new Fr(t,1,!1,t.toLowerCase(),null,!0,!0)});function $P(t,e,n,r){var i=ir.hasOwnProperty(e)?ir[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(b6(e,n,i,r)&&(n=null),r||i===null?v6(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ol=g6.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sb=Symbol.for("react.element"),Ff=Symbol.for("react.portal"),Bf=Symbol.for("react.fragment"),UP=Symbol.for("react.strict_mode"),HE=Symbol.for("react.profiler"),Ij=Symbol.for("react.provider"),Oj=Symbol.for("react.context"),zP=Symbol.for("react.forward_ref"),WE=Symbol.for("react.suspense"),GE=Symbol.for("react.suspense_list"),VP=Symbol.for("react.memo"),Kl=Symbol.for("react.lazy"),Mj=Symbol.for("react.offscreen"),wI=Symbol.iterator;function Mg(t){return t===null||typeof t!="object"?null:(t=wI&&t[wI]||t["@@iterator"],typeof t=="function"?t:null)}var Gt=Object.assign,dA;function ny(t){if(dA===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);dA=e&&e[1]||""}return`
34`+dA+t}var fA=!1;function pA(t,e){if(!t||fA)return"";fA=!0;var n=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 r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}
vendor: 18,177 bytes, lines 34-37
34catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35`),s=r.stack.split(`
36`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var l=`
37`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{fA=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ny(t):""}function x6(t){switch(t.tag){case 5:return ny(t.type);case 16:return ny("Lazy");case 13:return ny("Suspense");case 19:return ny("SuspenseList");case 0:case 2:case 15:return t=pA(t.type,!1),t;case 11:return t=pA(t.type.render,!1),t;case 1:return t=pA(t.type,!0),t;default:return""}}function qE(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Bf:return"Fragment";case Ff:return"Portal";case HE:return"Profiler";case UP:return"StrictMode";case WE:return"Suspense";case GE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Oj:return(t.displayName||"Context")+".Consumer";case Ij:return(t._context.displayName||"Context")+".Provider";case zP:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case VP:return e=t.displayName||null,e!==null?e:qE(t.type)||"Memo";case Kl:e=t._payload,t=t._init;try{return qE(t(e))}catch{}}return null}function S6(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qE(e);case 8:return e===UP?"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 gu(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Dj(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function k6(t){var e=Dj(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ab(t){t._valueTracker||(t._valueTracker=k6(t))}function Lj(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Dj(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function bS(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function KE(t,e){var n=e.checked;return Gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function bI(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=gu(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function jj(t,e){e=e.checked,e!=null&&$P(t,"checked",e,!1)}function YE(t,e){jj(t,e);var n=gu(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?XE(t,e.type,n):e.hasOwnProperty("defaultValue")&&XE(t,e.type,gu(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function xI(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function XE(t,e,n){(e!=="number"||bS(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ry=Array.isArray;function rp(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+gu(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function QE(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(K(91));return Gt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function SI(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(K(92));if(ry(n)){if(1<n.length)throw Error(K(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:gu(n)}}function Fj(t,e){var n=gu(e.value),r=gu(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function kI(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Bj(t){switch(t){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 JE(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Bj(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ob,$j=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(ob=ob||document.createElement("div"),ob.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ob.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function av(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Iy={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},A6=["Webkit","ms","Moz","O"];Object.keys(Iy).forEach(function(t){A6.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Iy[e]=Iy[t]})});function Uj(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Iy.hasOwnProperty(t)&&Iy[t]?(""+e).trim():e+"px"}function zj(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Uj(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var E6=Gt({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 ZE(t,e){if(e){if(E6[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(K(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(K(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(K(61))}if(e.style!=null&&typeof e.style!="object")throw Error(K(62))}}function e_(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t_=null;function HP(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var n_=null,ip=null,sp=null;function AI(t){if(t=B0(t)){if(typeof n_!="function")throw Error(K(280));var e=t.stateNode;e&&(e=ok(e),n_(t.stateNode,t.type,e))}}function Vj(t){ip?sp?sp.push(t):sp=[t]:ip=t}function Hj(){if(ip){var t=ip,e=sp;if(sp=ip=null,AI(t),e)for(t=0;t<e.length;t++)AI(e[t])}}function Wj(t,e){return t(e)}function Gj(){}var mA=!1;function qj(t,e,n){if(mA)return t(e,n);mA=!0;try{return Wj(t,e,n)}finally{mA=!1,(ip!==null||sp!==null)&&(Gj(),Hj())}}function ov(t,e){var n=t.stateNode;if(n===null)return null;var r=ok(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(K(231,e,typeof n));return n}var r_=!1;if(Al)try{var Dg={};Object.defineProperty(Dg,"passive",{get:function(){r_=!0}}),window.addEventListener("test",Dg,Dg),window.removeEventListener("test",Dg,Dg)}catch{r_=!1}function _6(t,e,n,r,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(h){this.onError(h)}}var Oy=!1,xS=null,SS=!1,i_=null,C6={onError:function(t){Oy=!0,xS=t}};function T6(t,e,n,r,i,s,a,o,l){Oy=!1,xS=null,_6.apply(C6,arguments)}function P6(t,e,n,r,i,s,a,o,l){if(T6.apply(this,arguments),Oy){if(Oy){var c=xS;Oy=!1,xS=null}else throw Error(K(198));SS||(SS=!0,i_=c)}}function ef(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Kj(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function EI(t){if(ef(t)!==t)throw Error(K(188))}function N6(t){var e=t.alternate;if(!e){if(e=ef(t),e===null)throw Error(K(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return EI(i),t;if(s===r)return EI(i),e;s=s.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?t:e}function Yj(t){return t=N6(t),t!==null?Xj(t):null}function Xj(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Xj(t);if(e!==null)return e;t=t.sibling}return null}var Qj=Gi.unstable_scheduleCallback,_I=Gi.unstable_cancelCallback,R6=Gi.unstable_shouldYield,I6=Gi.unstable_requestPaint,un=Gi.unstable_now,O6=Gi.unstable_getCurrentPriorityLevel,WP=Gi.unstable_ImmediatePriority,Jj=Gi.unstable_UserBlockingPriority,kS=Gi.unstable_NormalPriority,M6=Gi.unstable_LowPriority,Zj=Gi.unstable_IdlePriority,rk=null,lo=null;function D6(t){if(lo&&typeof lo.onCommitFiberRoot=="function")try{lo.onCommitFiberRoot(rk,t,void 0,(t.current.flags&128)===128)}catch{}}var sa=Math.clz32?Math.clz32:F6,L6=Math.log,j6=Math.LN2;function F6(t){return t>>>=0,t===0?32:31-(L6(t)/j6|0)|0}var lb=64,cb=4194304;function iy(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function AS(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=iy(o):(s&=a,s!==0&&(r=iy(s)))}else a=n&~i,a!==0?r=iy(a):s!==0&&(r=iy(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-sa(e),i=1<<n,r|=t[n],e&=~i;return r}function B6(t,e){switch(t){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 $6(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-sa(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=B6(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}function s_(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function eF(){var t=lb;return lb<<=1,!(lb&4194240)&&(lb=64),t}function gA(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function j0(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-sa(e),t[e]=n}function U6(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-sa(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function GP(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-sa(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var at=0;function tF(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var nF,qP,rF,iF,sF,a_=!1,ub=[],au=null,ou=null,lu=null,lv=new Map,cv=new Map,Ql=[],z6="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 CI(t,e){switch(t){case"focusin":case"focusout":au=null;break;case"dragenter":case"dragleave":ou=null;break;case"mouseover":case"mouseout":lu=null;break;case"pointerover":case"pointerout":lv.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":cv.delete(e.pointerId)}}function Lg(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=B0(e),e!==null&&qP(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function V6(t,e,n,r,i){switch(e){case"focusin":return au=Lg(au,t,e,n,r,i),!0;case"dragenter":return ou=Lg(ou,t,e,n,r,i),!0;case"mouseover":return lu=Lg(lu,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return lv.set(s,Lg(lv.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,cv.set(s,Lg(cv.get(s)||null,t,e,n,r,i)),!0}return!1}function aF(t){var e=Zu(t.target);if(e!==null){var n=ef(e);if(n!==null){if(e=n.tag,e===13){if(e=Kj(n),e!==null){t.blockedOn=e,sF(t.priority,function(){rF(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ax(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=o_(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);t_=r,n.target.dispatchEvent(r),t_=null}else return e=B0(n),e!==null&&qP(e),t.blockedOn=n,!1;e.shift()}return!0}function TI(t,e,n){ax(t)&&n.delete(e)}function H6(){a_=!1,au!==null&&ax(au)&&(au=null),ou!==null&&ax(ou)&&(ou=null),lu!==null&&ax(lu)&&(lu=null),lv.forEach(TI),cv.forEach(TI)}function jg(t,e){t.blockedOn===e&&(t.blockedOn=null,a_||(a_=!0,Gi.unstable_scheduleCallback(Gi.unstable_NormalPriority,H6)))}function uv(t){function e(i){return jg(i,t)}if(0<ub.length){jg(ub[0],t);for(var n=1;n<ub.length;n++){var r=ub[n];r.blockedOn===t&&(r.blockedOn=null)}}for(au!==null&&jg(au,t),ou!==null&&jg(ou,t),lu!==null&&jg(lu,t),lv.forEach(e),cv.forEach(e),n=0;n<Ql.length;n++)r=Ql[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Ql.length&&(n=Ql[0],n.blockedOn===null);)aF(n),n.blockedOn===null&&Ql.shift()}var ap=Ol.ReactCurrentBatchConfig,ES=!0;function W6(t,e,n,r){var i=at,s=ap.transition;ap.transition=null;try{at=1,KP(t,e,n,r)}finally{at=i,ap.transition=s}}function G6(t,e,n,r){var i=at,s=ap.transition;ap.transition=null;try{at=4,KP(t,e,n,r)}finally{at=i,ap.transition=s}}function KP(t,e,n,r){if(ES){var i=o_(t,e,n,r);if(i===null)_A(t,e,r,_S,n),CI(t,r);else if(V6(i,t,e,n,r))r.stopPropagation();else if(CI(t,r),e&4&&-1<z6.indexOf(t)){for(;i!==null;){var s=B0(i);if(s!==null&&nF(s),s=o_(t,e,n,r),s===null&&_A(t,e,r,_S,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else _A(t,e,r,null,n)}}var _S=null;function o_(t,e,n,r){if(_S=null,t=HP(r),t=Zu(t),t!==null)if(e=ef(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Kj(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return _S=t,null}
vendor: 7,139 bytes, line 37
37function oF(t){switch(t){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(O6()){case WP:return 1;case Jj:return 4;case kS:case M6:return 16;case Zj:return 536870912;default:return 16}default:return 16}}var tu=null,YP=null,ox=null;function lF(){if(ox)return ox;var t,e=YP,n=e.length,r,i="value"in tu?tu.value:tu.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===i[s-r];r++);return ox=i.slice(t,1<r?1-r:void 0)}function lx(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function hb(){return!0}function PI(){return!1}function Xi(t){function e(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?hb:PI,this.isPropagationStopped=PI,this}return Gt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hb)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hb)},persist:function(){},isPersistent:hb}),e}var bg={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},XP=Xi(bg),F0=Gt({},bg,{view:0,detail:0}),q6=Xi(F0),yA,vA,Fg,ik=Gt({},F0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:QP,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fg&&(Fg&&t.type==="mousemove"?(yA=t.screenX-Fg.screenX,vA=t.screenY-Fg.screenY):vA=yA=0,Fg=t),yA)},movementY:function(t){return"movementY"in t?t.movementY:vA}}),NI=Xi(ik),K6=Gt({},ik,{dataTransfer:0}),Y6=Xi(K6),X6=Gt({},F0,{relatedTarget:0}),wA=Xi(X6),Q6=Gt({},bg,{animationName:0,elapsedTime:0,pseudoElement:0}),J6=Xi(Q6),Z6=Gt({},bg,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),eW=Xi(Z6),tW=Gt({},bg,{data:0}),RI=Xi(tW),nW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rW={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"},iW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sW(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=iW[t])?!!e[t]:!1}function QP(){return sW}var aW=Gt({},F0,{key:function(t){if(t.key){var e=nW[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=lx(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?rW[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:QP,charCode:function(t){return t.type==="keypress"?lx(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?lx(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),oW=Xi(aW),lW=Gt({},ik,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),II=Xi(lW),cW=Gt({},F0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:QP}),uW=Xi(cW),hW=Gt({},bg,{propertyName:0,elapsedTime:0,pseudoElement:0}),dW=Xi(hW),fW=Gt({},ik,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),pW=Xi(fW),mW=[9,13,27,32],JP=Al&&"CompositionEvent"in window,My=null;Al&&"documentMode"in document&&(My=document.documentMode);var gW=Al&&"TextEvent"in window&&!My,cF=Al&&(!JP||My&&8<My&&11>=My),OI=" ",MI=!1;function uF(t,e){switch(t){case"keyup":return mW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hF(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $f=!1;function yW(t,e){switch(t){case"compositionend":return hF(e);case"keypress":return e.which!==32?null:(MI=!0,OI);case"textInput":return t=e.data,t===OI&&MI?null:t;default:return null}}function vW(t,e){if($f)return t==="compositionend"||!JP&&uF(t,e)?(t=lF(),ox=YP=tu=null,$f=!1,t):null;switch(t){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 cF&&e.locale!=="ko"?null:e.data;default:return null}}var wW={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 DI(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!wW[t.type]:e==="textarea"}function dF(t,e,n,r){Vj(r),e=CS(e,"onChange"),0<e.length&&(n=new XP("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Dy=null,hv=null;function bW(t){kF(t,0)}function sk(t){var e=Vf(t);if(Lj(e))return t}function xW(t,e){if(t==="change")return e}var fF=!1;if(Al){var bA;if(Al){var xA="oninput"in document;if(!xA){var LI=document.createElement("div");LI.setAttribute("oninput","return;
37"),xA=typeof LI.oninput=="function"}bA=xA}else bA=!1;fF=bA&&(!document.documentMode||9<document.documentMode)}function jI(){Dy&&(Dy.detachEvent("onpropertychange",pF),hv=Dy=null)}function pF(t){if(t.propertyName==="value"&&sk(hv)){var e=[];dF(e,hv,t,HP(t)),qj(bW,e)}}function SW(t,e,n){t==="focusin"?(jI(),Dy=e,hv=n,Dy.attachEvent("onpropertychange",pF)):t==="focusout"&&jI()}function kW(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sk(hv)}function AW(t,e){if(t==="click")return sk(e)}function EW(t,e){if(t==="input"||t==="change")return sk(e)}function _W(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var la=typeof Object.is=="function"?Object.is:_W;function dv(t,e){if(la(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!VE.call(e,i)||!la(t[i],e[i]))return!1}return!0}function FI(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function BI(t,e){var n=FI(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=FI(n)}}function mF(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?mF(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function gF(){for(var t=window,e=bS();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=bS(t.document)}return e}function ZP(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function CW(t){var e=gF(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&mF(n.ownerDocument.documentElement,n)){if(r!==null&&ZP(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=BI(n,s);var a=BI(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var TW=Al&&"documentMode"in document&&11>=document.documentMode,Uf=null,l_=null,Ly=null,c_=!1;function $I(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;c_||Uf==null||Uf!==bS(r)||(r=Uf,"selectionStart"in r&&ZP(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ly&&dv(Ly,r)||(Ly=r,r=CS(l_,"onSelect"),0<r.length&&(e=new XP("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Uf)))}function db(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var zf={animationend:db("Animation","AnimationEnd"),animationiteration:db("Animation","AnimationIteration"),animationstart:db("Animation","AnimationStart"),transitionend:db("Transition","TransitionEnd")},SA={},yF={};Al&&(yF=document.createElement("div").style,"AnimationEvent"in window||(delete zf.animationend.animation,delete zf.animationiteration.animation,delete zf.animationstart.animation),"TransitionEvent"in window||delete zf.transitionend.transition);function ak(t){if(SA[t])return SA[t];if(!zf[t])return t;var e=zf[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in yF)return SA[t]=e[n];return t}var vF=ak("animationend"),wF=ak("animationiteration"),bF=ak("animationstart"),xF=ak("transitionend"),SF=new Map,UI="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 Pu(t,e){SF.set(t,e),Zd(e,[t])}for(var kA=0;kA<UI.length;kA++){var AA=UI[kA],PW=AA.toLowerCase(),NW=AA[0].toUpperCase()+AA.slice(1);Pu(PW,"on"+NW)}Pu(vF,"onAnimationEnd");Pu(wF,"onAnimationIteration");Pu(bF,"onAnimationStart");Pu("dblclick","onDoubleClick");Pu("focusin","onFocus");Pu("focusout","onBlur");Pu(xF,"onTransitionEnd");eg("onMouseEnter",["mouseout","mouseover"]);eg("onMouseLeave",["mouseout","mouseover"]);eg("onPointerEnter",["pointerout","pointerover"]);eg("onPointerLeave",["pointerout","pointerover"]);Zd("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37Zd("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zd("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zd("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zd("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zd("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sy="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(" "),RW=new Set("cancel close invalid load scroll toggle".split(" ").concat(sy));function zI(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,P6(r,e,void 0,t),t.currentTarget=null}function kF(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;zI(i,o,c),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;zI(i,o,c),s=l}}}if(SS)throw t=i_,SS=!1,i_=null,t}function Et(t,e){var n=e[p_];n===void 0&&(n=e[p_]=new Set);var r=t+"__bubble";n.has(r)||(AF(e,t,2,!1),n.add(r))}function EA(t,e,n){var r=0;e&&(r|=4),AF(n,t,r,e)}var fb="_reactListening"+Math.random().toString(36).slice(2);function fv(t){if(!t[fb]){t[fb]=!0,Rj.forEach(function(n){n!=="selectionchange"&&(RW.has(n)||EA(n,!1,t),EA(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[fb]||(e[fb]=!0,EA("selectionchange",!1,e))}}function AF(t,e,n,r){switch(oF(e)){case 1:var i=W6;break;case 4:i=G6;break;default:i=KP}n=i.bind(null,e,n,t),i=void 0,!r_||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function _A(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Zu(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}qj(function(){var c=s,h=HP(n),d=[];e:{var f=SF.get(t);if(f!==void 0){var p=XP,m=t;switch(t){case"keypress":if(lx(n)===0)break e;case"keydown":case"keyup":p=oW;break;case"focusin":m="focus",p=wA;break;case"focusout":m="blur",p=wA;break;case"beforeblur":case"afterblur":p=wA;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=NI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Y6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=uW;break;case vF:case wF:case bF:p=J6;break;case xF:p=dW;break;case"scroll":p=q6;break;case"wheel":p=pW;break;case"copy":case"cut":case"paste":p=eW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=II}var y=(e&4)!==0,x=!y&&t==="scroll",v=y?f!==null?f+"Capture":null:f;y=[];for(var w=c,b;w!==null;){b=w;var k=b.stateNode;if(b.tag===5&&k!==null&&(b=k,v!==null&&(k=ov(w,v),k!=null&&y.push(pv(w,k,b)))),x)break;w=w.return}0<y.length&&(f=new p(f,m,null,n,h),d.push({event:f,listeners:y}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==t_&&(m=n.relatedTarget||n.fromElement)&&(Zu(m)||m[El]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?Zu(m):null,m!==null&&(x=ef(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(y=NI,k="onMouseLeave",v="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(y=II,k="onPointerLeave",v="onPointerEnter",w="pointer"),x=p==null?f:Vf(p),b=m==null?f:Vf(m),f=new y(k,w+"leave",p,n,h),f.target=x,f.relatedTarget=b,k=null,Zu(h)===c&&(y=new y(v,w+"enter",m,n,h),y.target=b,y.relatedTarget=x,k=y),x=k,p&&m)t:{for(y=p,v=m,w=0,b=y;b;b=cf(b))w++;for(b=0,k=v;k;k=cf(k))b++;for(;0<w-b;)y=cf(y),w--;for(;0<b-w;)v=cf(v),b--;for(;w--;){if(y===v||v!==null&&y===v.alternate)break t;y=cf(y),v=cf(v)}y=null}else y=null;p!==null&&VI(d,f,p,y,!1),m!==null&&x!==null&&VI(d,x,m,y,!0)}}
vendor: 5,240 bytes, lines 37-38
37e:{if(f=c?Vf(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var _=xW;else if(DI(f))if(fF)_=EW;else{_=kW;var C=SW}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=AW);if(_&&(_=_(t,c))){dF(d,_,n,h);break e}C&&C(t,f,c),t==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&XE(f,"number",f.value)}switch(C=c?Vf(c):window,t){case"focusin":(DI(C)||C.contentEditable==="true")&&(Uf=C,l_=c,Ly=null);break;case"focusout":Ly=l_=Uf=null;break;case"mousedown":c_=!0;break;case"contextmenu":case"mouseup":case"dragend":c_=!1,$I(d,n,h);break;case"selectionchange":if(TW)break;case"keydown":case"keyup":$I(d,n,h)}var P;if(JP)e:{switch(t){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else $f?uF(t,n)&&(R="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(cF&&n.locale!=="ko"&&($f||R!=="onCompositionStart"?R==="onCompositionEnd"&&$f&&(P=lF()):(tu=h,YP="value"in tu?tu.value:tu.textContent,$f=!0)),C=CS(c,R),0<C.length&&(R=new RI(R,t,null,n,h),d.push({event:R,listeners:C}),P?R.data=P:(P=hF(n),P!==null&&(R.data=P)))),(P=gW?yW(t,n):vW(t,n))&&(c=CS(c,"onBeforeInput"),0<c.length&&(h=new RI("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=P))}kF(d,e)})}function pv(t,e,n){return{instance:t,listener:e,currentTarget:n}}function CS(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ov(t,n),s!=null&&r.unshift(pv(t,s,i)),s=ov(t,e),s!=null&&r.push(pv(t,s,i))),t=t.return}return r}function cf(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function VI(t,e,n,r,i){for(var s=e._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&c!==null&&(o=c,i?(l=ov(n,s),l!=null&&a.unshift(pv(n,l,o))):i||(l=ov(n,s),l!=null&&a.push(pv(n,l,o)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var IW=/\r\n?/g,OW=/\u0000|\uFFFD/g;function HI(t){return(typeof t=="string"?t:""+t).replace(IW,`
38`).replace(OW,"")}function pb(t,e,n){if(e=HI(e),HI(t)!==e&&n)throw Error(K(425))}function TS(){}var u_=null,h_=null;function d_(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var f_=typeof setTimeout=="function"?setTimeout:void 0,MW=typeof clearTimeout=="function"?clearTimeout:void 0,WI=typeof Promise=="function"?Promise:void 0,DW=typeof queueMicrotask=="function"?queueMicrotask:typeof WI<"u"?function(t){return WI.resolve(null).then(t).catch(LW)}:f_;function LW(t){setTimeout(function(){throw t})}function CA(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),uv(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);uv(e)}function cu(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function GI(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var xg=Math.random().toString(36).slice(2),no="__reactFiber$"+xg,mv="__reactProps$"+xg,El="__reactContainer$"+xg,p_="__reactEvents$"+xg,jW="__reactListeners$"+xg,FW="__reactHandles$"+xg;function Zu(t){var e=t[no];if(e)return e;for(var n=t.parentNode;n;){if(e=n[El]||n[no]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=GI(t);t!==null;){if(n=t[no])return n;t=GI(t)}return e}t=n,n=t.parentNode}return null}function B0(t){return t=t[no]||t[El],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Vf(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(K(33))}function ok(t){return t[mv]||null}var m_=[],Hf=-1;function Nu(t){return{current:t}}function Nt(t){0>Hf||(t.current=m_[Hf],m_[Hf]=null,Hf--)}function wt(t,e){Hf++,m_[Hf]=t.current,t.current=e}var yu={},yr=Nu(yu),ti=Nu(!1),$d=yu;function tg(t,e){var n=t.type.contextTypes;if(!n)return yu;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ni(t){return t=t.childContextTypes,t!=null}function PS(){Nt(ti),Nt(yr)}function qI(t,e,n){if(yr.current!==yu)throw Error(K(168));wt(yr,e),wt(ti,n)}function EF(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(K(108,S6(t)||"Unknown",i));return Gt({},n,r)}function NS(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||yu,$d=yr.current,wt(yr,t),wt(ti,ti.current),!0}function KI(t,e,n){var r=t.stateNode;if(!r)throw Error(K(169));n?(t=EF(t,e,$d),r.__reactInternalMemoizedMergedChildContext=t,Nt(ti),Nt(yr),wt(yr,t)):Nt(ti),wt
vendor: 25,591 bytes, lines 38-40
38(ti,n)}var Io=null,lk=!1,TA=!1;function _F(t){Io===null?Io=[t]:Io.push(t)}function BW(t){lk=!0,_F(t)}function Ru(){if(!TA&&Io!==null){TA=!0;var t=0,e=at;try{var n=Io;for(at=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Io=null,lk=!1}catch(i){throw Io!==null&&(Io=Io.slice(t+1)),Qj(WP,Ru),i}finally{at=e,TA=!1}}return null}var Wf=[],Gf=0,RS=null,IS=0,ms=[],gs=0,Ud=null,gl=1,yl="";function $u(t,e){Wf[Gf++]=IS,Wf[Gf++]=RS,RS=t,IS=e}function CF(t,e,n){ms[gs++]=gl,ms[gs++]=yl,ms[gs++]=Ud,Ud=t;var r=gl;t=yl;var i=32-sa(r)-1;r&=~(1<<i),n+=1;var s=32-sa(e)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,gl=1<<32-sa(e)+i|n<<i|r,yl=s+t}else gl=1<<s|n<<i|r,yl=t}function eN(t){t.return!==null&&($u(t,1),CF(t,1,0))}function tN(t){for(;t===RS;)RS=Wf[--Gf],Wf[Gf]=null,IS=Wf[--Gf],Wf[Gf]=null;for(;t===Ud;)Ud=ms[--gs],ms[gs]=null,yl=ms[--gs],ms[gs]=null,gl=ms[--gs],ms[gs]=null}var Vi=null,Ui=null,Lt=!1,ta=null;function TF(t,e){var n=ws(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function YI(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Vi=t,Ui=cu(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Vi=t,Ui=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ud!==null?{id:gl,overflow:yl}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=ws(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Vi=t,Ui=null,!0):!1;default:return!1}}function g_(t){return(t.mode&1)!==0&&(t.flags&128)===0}function y_(t){if(Lt){var e=Ui;if(e){var n=e;if(!YI(t,e)){if(g_(t))throw Error(K(418));e=cu(n.nextSibling);var r=Vi;e&&YI(t,e)?TF(r,n):(t.flags=t.flags&-4097|2,Lt=!1,Vi=t)}}else{if(g_(t))throw Error(K(418));t.flags=t.flags&-4097|2,Lt=!1,Vi=t}}}function XI(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Vi=t}function mb(t){if(t!==Vi)return!1;if(!Lt)return XI(t),Lt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!d_(t.type,t.memoizedProps)),e&&(e=Ui)){if(g_(t))throw PF(),Error(K(418));for(;e;)TF(t,e),e=cu(e.nextSibling)}if(XI(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(K(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Ui=cu(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Ui=null}}else Ui=Vi?cu(t.stateNode.nextSibling):null;return!0}function PF(){for(var t=Ui;t;)t=cu(t.nextSibling)}function ng(){Ui=Vi=null,Lt=!1}function nN(t){ta===null?ta=[t]:ta.push(t)}var $W=Ol.ReactCurrentBatchConfig;function Bg(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},e._stringRef=s,e)}if(typeof t!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,t))}return t}function gb(t,e){throw t=Object.prototype.toString.call(e),Error(K(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function QI(t){var e=t._init;return e(t._payload)}function NF(t){function e(v,w){if(t){var b=v.deletions;b===null?(v.deletions=[w],v.flags|=16):b.push(w)}}function n(v,w){if(!t)return null;for(;w!==null;)e(v,w),w=w.sibling;return null}function r(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 i(v,w){return v=fu(v,w),v.index=0,v.sibling=null,v}function s(v,w,b){return v.index=b,t?(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 t&&v.alternate===null&&(v.flags|=2),v}function o(v,w,b,k){return w===null||w.tag!==6?(w=DA(b,v.mode,k),w.return=v,w):(w=i(w,b),w.return=v,w)}function l(v,w,b,k){var _=b.type;return _===Bf?h(v,w,b.props.children,k,b.key):w!==null&&(w.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Kl&&QI(_)===w.type)?(k=i(w,b.props),k.ref=Bg(v,w,b),k.return=v,k):(k=mx(b.type,b.key,b.props,null,v.mode,k),k.ref=Bg(v,w,b),k.return=v,k)}function c(v,w,b,k){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=LA(b,v.mode,k),w.return=v,w):(w=i(w,b.children||[]),w.return=v,w)}function h(v,w,b,k,_){return w===null||w.tag!==7?(w=Ld(b,v.mode,k,_),w.return=v,w):(w=i(w,b),w.return=v,w)}function d(v,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=DA(""+w,v.mode,b),w.return=v,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case sb:return b=mx(w.type,w.key,w.props,null,v.mode,b),b.ref=Bg(v,null,w),b.return=v,b;case Ff:return w=LA(w,v.mode,b),w.return=v,w;case Kl:var k=w._init;return d(v,k(w._payload),b)}if(ry(w)||Mg(w))return w=Ld(w,v.mode,b,null),w.return=v,w;gb(v,w)}return null}function f(v,w,b,k){var _=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:o(v,w,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case sb:return b.key===_?l(v,w,b,k):null;case Ff:return b.key===_?c(v,w,b,k):null;case Kl:return _=b._init,f(v,w,_(b._payload),k)}if(ry(b)||Mg(b))return _!==null?null:h(v,w,b,k,null);gb(v,b)}return null}function p(v,w,b,k,_){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(b)||null,o(w,v,""+k,_);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case sb:return v=v.get(k.key===null?b:k.key)||null,l(w,v,k,_);case Ff:return v=v.get(k.key===null?b:k.key)||null,c(w,v,k,_);case Kl:var C=k._init;return p(v,w,b,C(k._payload),_)}if(ry(k)||Mg(k))return v=v.get(b)||null,h(w,v,k,_,null);gb(w,k)}return null}function m(v,w,b,k){for(var _=null,C=null,P=w,R=w=0,O=null;P!==null&&R<b.length;R++){P.index>R?(O=P,P=null):O=P.sibling;var M=f(v,P,b[R],k);if(M===null){P===null&&(P=O);break}t&&P&&M.alternate===null&&e(v,P),w=s(M,w,R),C===null?_=M:C.sibling=M,C=M,P=O}if(R===b.length)return n(v,P),Lt&&$u(v,R),_;if(P===null){for(;R<b.length;R++)P=d(v,b[R],k),P!==null&&(w=s(P,w,R),C===null?_=P:C.sibling=P,C=P);return Lt&&$u(v,R),_}for(P=r(v,P);R<b.length;R++)O=p(P,v,R,b[R],k),O!==null&&(t&&O.alternate!==null&&P.delete(O.key===null?R:O.key),w=s(O,w,R),C===null?_=O:C.sibling=O,C=O);return t&&P.forEach(function(D){return e(v,D)}),Lt&&$u(v,R),_}function y(v,w,b,k){var _=Mg(b);if(typeof _!="function")throw Error(K(150));if(b=_.call(b),b==null)throw Error(K(151));for(var C=_=null,P=w,R=w=0,O=null,M=b.next();P!==null&&!M.done;R++,M=b.next()){P.index>R?(O=P,P=null):O=P.sibling;var D=f(v,P,M.value,k);if(D===null){P===null&&(P=O);break}t&&P&&D.alternate===null&&e(v,P),w=s(D,w,R),C===null?_=D:C.sibling=D,C=D,P=O}if(M.done)return n(v,P),Lt&&$u(v,R),_;if(P===null){for(;!M.done;R++,M=b.next())M=d(v,M.value,k),M!==null&&(w=s(M,w,R),C===null?_=M:C.sibling=M,C=M);return Lt&&$u(v,R),_}for(P=r(v,P);!M.done;R++,M=b.next())M=p(P,v,R,M.value,k),M!==null&&(t&&M.alternate!==null&&P.delete(M.key===null?R:M.key),w=s(M,w,R),C===null?_=M:C.sibling=M,C=M);return t&&P.forEach(function(j){return e(v,j)}),Lt&&$u(v,R),_}function x(v,w,b,k){if(typeof b=="object"&&b!==null&&b.type===Bf&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case sb:e:{for(var _=b.key,C=w;C!==null;){if(C.key===_){if(_=b.type,_===Bf){if(C.tag===7){n(v,C.sibling),w=i(C,b.props.children),w.return=v,v=w;break e}}else if(C.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Kl&&QI(_)===C.type){n(v,C.sibling),w=i(C,b.props),w.ref=Bg(v,C,b),w.return=v,v=w;break e}n(v,C);break}else e(v,C);C=C.sibling}b.type===Bf?(w=Ld(b.props.children,v.mode,k,b.key),w.return=v,v=w):(k=mx(b.type,b.key,b.props,null,v.mode,k),k.ref=Bg(v,w,b),k.return=v,v=k)}return a(v);case Ff:e:{for(C=b.key;w!==null;){if(w.key===C)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){n(v,w.sibling),w=i(w,b.children||[]),w.return=v,v=w;break e}else{n(v,w);break}else e(v,w);w=w.sibling}w=LA(b,v.mode,k),w.return=v,v=w}return a(v);case Kl:return C=b._init,x(v,w,C(b._payload),k)}if(ry(b))return m(v,w,b,k);if(Mg(b))return y(v,w,b,k);gb(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(n(v,w.sibling),w=i(w,b),w.return=v,v=w):(n(v,w),w=DA(b,v.mode,k),w.return=v,v=w),a(v)):n(v,w)}return x}var rg=NF(!0),RF=NF(!1),OS=Nu(null),MS=null,qf=null,rN=null;function iN(){rN=qf=MS=null}function sN(t){var e=OS.current;Nt(OS),t._currentValue=e}function v_(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function op(t,e){MS=t,rN=qf=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ei=!0),t.firstContext=null)}function As(t){var e=t._currentValue;if(rN!==t)if(t={context:t,memoizedValue:e,next:null},qf===null){if(MS===null)throw Error(K(308));qf=t,MS.dependencies={lanes:0,firstContext:t}}else qf=qf.next=t;return e}var eh=null;function aN(t){eh===null?eh=[t]:eh.push(t)}function IF(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,aN(e)):(n.next=i.next,i.next=n),e.interleaved=n,_l(t,r)}function _l(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Yl=!1;function oN(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OF(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function wl(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function uu(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ve&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,_l(t,n)}return i=r.interleaved,i===null?(e.next=e,aN(r)):(e.next=i.next,i.next=e),r.interleaved=e,_l(t,n)}function cx(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,GP(t,n)}}function JI(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function DS(t,e,n,r){var i=t.updateQueue;Yl=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var h=t.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,h=c=l=null,o=s;do{var f=o.lane,p=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=t,y=o;switch(f=e,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Gt({},d,f);break e;case 2:Yl=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else p={eventTime:p,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=p,l=d):h=h.next=p,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Vd|=a,t.lanes=a,t.memoizedState=d}}function ZI(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var $0={},co=Nu($0),gv=Nu($0),yv=Nu($0);function th(t){if(t===$0)throw Error(K(174));return t}function lN(t,e){switch(wt(yv,e),wt(gv,t),wt(co,$0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:JE(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=JE(e,t)}Nt(co),wt(co,e)}function ig(){Nt(co),Nt(gv),Nt(yv)}function MF(t){th(yv.current);var e=th(co.current),n=JE(e,t.type);e!==n&&(wt(gv,t),wt(co,n))}function cN(t){gv.current===t&&(Nt(co),Nt(gv))}var Ut=Nu(0);function LS(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var PA=[];function uN(){for(var t=0;t<PA.length;t++)PA[t]._workInProgressVersionPrimary=null;PA.length=0}var ux=Ol.ReactCurrentDispatcher,NA=Ol.ReactCurrentBatchConfig,zd=0,Ht=null,Tn=null,$n=null,jS=!1,jy=!1,vv=0,UW=0;function sr(){throw Error(K(321))}function hN(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!la(t[n],e[n]))return!1;return!0}function dN(t,e,n,r,i,s){if(zd=s,Ht=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ux.current=t===null||t.memoizedState===null?WW:GW,t=n(r,i),jy){s=0;do{if(jy=!1,vv=0,25<=s)throw Error(K(301));s+=1,$n=Tn=null,e.updateQueue=null,ux.current=qW,t=n(r,i)}while(jy)}if(ux.current=FS,e=Tn!==null&&Tn.next!==null,zd=0,$n=Tn=Ht=null,jS=!1,e)throw Error(K(300));return t}function fN(){var t=vv!==0;return vv=0,t}function Aa(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $n===null?Ht.memoizedState=$n=t:$n=$n.next=t,$n}function Es(){if(Tn===null){var t=Ht.alternate;t=t!==null?t.memoizedState:null}else t=Tn.next;var e=$n===null?Ht.memoizedState:$n.next;if(e!==null)$n=e,Tn=t;else{if(t===null)throw Error(K(310));Tn=t,t={memoizedState:Tn.memoizedState,baseState:Tn.baseState,baseQueue:Tn.baseQueue,queue:Tn.queue,next:null},$n===null?Ht.memoizedState=$n=t:$n=$n.next=t}return $n}function wv(t,e){return typeof e=="function"?e(t):e}function RA(t){var e=Es(),n=e.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=t;var r=Tn,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,c=s;do{var h=c.lane;if((zd&h)===h)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=d,a=r):l=l.next=d,Ht.lanes|=h,Vd|=h}c=c.next}while(c!==null&&c!==s);l===null?a=r:l.next=o,la(r,e.memoizedState)||(ei=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Ht.lanes|=s,Vd|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function IA(t){var e=Es(),n=e.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);la(s,e.memoizedState)||(ei=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function DF(){}function LF(t,e){var n=Ht,r=Es(),i=e(),s=!la(r.memoizedState,i);if(s&&(r.memoizedState=i,ei=!0),r=r.queue,pN(BF.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||$n!==null&&$n.memoizedState.tag&1){if(n.flags|=2048,bv(9,FF.bind(null,n,r,i,e),void 0,null),Un===null)throw Error(K(349));zd&30||jF(n,e,i)}return i}function jF(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ht.updateQueue,e===null?(e={lastEffect:null,stores:null},Ht.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function FF(t,e,n,r){e.value=n,e.getSnapshot=r,$F(e)&&UF(t)}function BF(t,e,n){return n(function(){$F(e)&&UF(t)})}function $F(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!la(t,n)}catch{return!0}}function UF(t){var e=_l(t,1);e!==null&&aa(e,t,1,-1)}function eO(t){var e=Aa();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wv,lastRenderedState:t},e.queue=t,t=t.dispatch=HW.bind(null,Ht,t),[e.memoizedState,t]}function bv(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ht.updateQueue,e===null?(e={lastEffect:null,stores:null},Ht.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function zF(){return Es().memoizedState}function hx(t,e,n,r){var i=Aa();Ht.flags|=t,i.memoizedState=bv(1|e,n,void 0,r===void 0?null:r)}function ck(t,e,n,r){var i=Es();r=r===void 0?null:r;var s=void 0;if(Tn!==null){var a=Tn.memoizedState;if(s=a.destroy,r!==null&&hN(r,a.deps)){i.memoizedState=bv(e,n,s,r);return}}Ht.flags|=t,i.memoizedState=bv(1|e,n,s,r)}function tO(t,e){return hx(8390656,8,t,e)}function pN(t,e){return ck(2048,8,t,e)}function VF(t,e){return ck(4,2,t,e)}function HF(t,e){return ck(4,4,t,e)}function WF(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function GF(t,e,n){return n=n!=null?n.concat([t]):null,ck(4,4,WF.bind(null,e,t),n)}function mN(){}function qF(t,e){var n=Es();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hN(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function KF(t,e){var n=Es();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hN(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function YF(t,e,n){return zd&21?(la(n,e)||(n=eF(),Ht.lanes|=n,Vd|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ei=!0),t.memoizedState=n)}function zW(t,e){var n=at;at=n!==0&&4>n?n:4,t(!0);var r=NA.transition;NA.transition={};try{t(!1),e()}finally{at=n,NA.transition=r}}function XF(){return Es().memoizedState}function VW(t,e,n){var r=du(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},QF(t))JF(e,n);else if(n=IF(t,e,n,r),n!==null){var i=Dr();aa(n,t,r,i),ZF(n,e,r)}}function HW(t,e,n){var r=du(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(QF(t))JF(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,la(o,a)){var l=e.interleaved;l===null?(i.next=i,aN(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=IF(t,e,i,r),n!==null&&(i=Dr(),aa(n,t,r,i),ZF(n,e,r))}}function QF(t){var e=t.alternate;return t===Ht||e!==null&&e===Ht}function JF(t,e){jy=jS=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function ZF(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,GP(t,n)}}var FS={readContext:As,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},WW={readContext:As,useCallback:function(t,e){return Aa().memoizedState=[t,e===void 0?null:e],t},useContext:As,useEffect:tO,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,hx(4194308,4,WF.bind(null,e,t),n)},useLayoutEffect:function(t,e){return hx(4194308,4,t,e)},useInsertionEffect:function(t,e){return hx(4,2,t,e)},useMemo:function(t,e){var n=Aa();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Aa();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=VW.bind(null,Ht,t),[r.memoizedState,t]},useRef:function(t){var e=Aa();return t={current:t},e.memoizedState=t},useState:eO,useDebugValue:mN,useDeferredValue:function(t){return Aa().memoizedState=t},useTransition:function(){var t=eO(!1),e=t[0];return t=zW.bind(null,t[1]),Aa().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ht,i=Aa();if(Lt){if(n===void 0)throw Error(K(407));n=n()}else{if(n=e(),Un===null)throw Error(K(349));zd&30||jF(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,tO(BF.bind(null,r,s,t),[t]),r.flags|=2048,bv(9,FF.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Aa(),e=Un.identifierPrefix;if(Lt){var n=yl,r=gl;n=(r&~(1<<32-sa(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=vv++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=UW++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},GW={readContext:As,useCallback:qF,useContext:As,useEffect:pN,useImperativeHandle:GF,useInsertionEffect:VF,useLayoutEffect:HF,useMemo:KF,useReducer:RA,useRef:zF,useState:function(){return RA(wv)},useDebugValue:mN,useDeferredValue:function(t){var e=Es();return YF(e,Tn.memoizedState,t)},useTransition:function(){var t=RA(wv)[0],e=Es().memoizedState;return[t,e]},useMutableSource:DF,useSyncExternalStore:LF,useId:XF,unstable_isNewReconciler:!1},qW={readContext:As,useCallback:qF,useContext:As,useEffect:pN,useImperativeHandle:GF,useInsertionEffect:VF,useLayoutEffect:HF,useMemo:KF,useReducer:IA,useRef:zF,useState:function(){return IA(wv)},useDebugValue:mN,useDeferredValue:function(t){var e=Es();return Tn===null?e.memoizedState=t:YF(e,Tn.memoizedState,t)},useTransition:function(){var t=IA(wv)[0],e=Es().memoizedState;return[t,e]},useMutableSource:DF,useSyncExternalStore:LF,useId:XF,unstable_isNewReconciler:!1};function Ls(t,e){if(t&&t.defaultProps){e=Gt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function w_(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Gt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var uk={isMounted:function(t){return(t=t._reactInternals)?ef(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Dr(),i=du(t),s=wl(r,i);s.payload=e,n!=null&&(s.callback=n),e=uu(t,s,i),e!==null&&(aa(e,t,i,r),cx(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Dr(),i=du(t),s=wl(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=uu(t,s,i),e!==null&&(aa(e,t,i,r),cx(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Dr(),r=du(t),i=wl(n,r);i.tag=2,e!=null&&(i.callback=e),e=uu(t,i,r),e!==null&&(aa(e,t,r,n),cx(e,t,r))}};function nO(t,e,n,r,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,a):e.prototype&&e.prototype.isPureReactComponent?!dv(n,r)||!dv(i,s):!0}function eB(t,e,n){var r=!1,i=yu,s=e.contextType;return typeof s=="object"&&s!==null?s=As(s):(i=ni(e)?$d:yr.current,r=e.contextTypes,s=(r=r!=null)?tg(t,i):yu),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=uk,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function rO(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&uk.enqueueReplaceState(e,e.state,null)}function b_(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},oN(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=As(s):(s=ni(e)?$d:yr.current,i.context=tg(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(w_(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&uk.enqueueReplaceState(i,i.state,null),DS(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function sg(t,e){try{var n="",r=e;do n+=x6(r),r=r.return;while(r);var i=n}catch(s){i=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function OA(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function x_(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var KW=typeof WeakMap=="function"?WeakMap:Map;function tB(t,e,n){n=wl(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){$S||($S=!0,R_=r),x_(t,e)},n}function nB(t,e,n){n=wl(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){x_(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){x_(t,e),t
vendor: 10,399 bytes, line 40
40ypeof r!="function"&&(hu===null?hu=new Set([this]):hu.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function iO(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new KW;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=l8.bind(null,t,e,n),e.then(t,t))}function sO(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function aO(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=wl(-1,1),e.tag=2,uu(n,e,1))),n.lanes|=1),t)}var YW=Ol.ReactCurrentOwner,ei=!1;function Pr(t,e,n,r){e.child=t===null?RF(e,null,n,r):rg(e,t.child,n,r)}function oO(t,e,n,r,i){n=n.render;var s=e.ref;return op(e,i),r=dN(t,e,n,r,s,i),n=fN(),t!==null&&!ei?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Cl(t,e,i)):(Lt&&n&&eN(e),e.flags|=1,Pr(t,e,r,i),e.child)}function lO(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!kN(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,rB(t,e,s,r,i)):(t=mx(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:dv,n(a,r)&&t.ref===e.ref)return Cl(t,e,i)}return e.flags|=1,t=fu(s,r),t.ref=e.ref,t.return=e,e.child=t}function rB(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(dv(s,r)&&t.ref===e.ref)if(ei=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(ei=!0);else return e.lanes=t.lanes,Cl(t,e,i)}return S_(t,e,n,r,i)}function iB(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(Yf,Di),Di|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,wt(Yf,Di),Di|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,wt(Yf,Di),Di|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,wt(Yf,Di),Di|=r;return Pr(t,e,i,n),e.child}function sB(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function S_(t,e,n,r,i){var s=ni(n)?$d:yr.current;return s=tg(e,s),op(e,i),n=dN(t,e,n,r,s,i),r=fN(),t!==null&&!ei?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Cl(t,e,i)):(Lt&&r&&eN(e),e.flags|=1,Pr(t,e,n,i),e.child)}function cO(t,e,n,r,i){if(ni(n)){var s=!0;NS(e)}else s=!1;if(op(e,i),e.stateNode===null)dx(t,e),eB(e,n,r),b_(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=As(c):(c=ni(n)?$d:yr.current,c=tg(e,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&rO(e,a,r,c),Yl=!1;var f=e.memoizedState;a.state=f,DS(e,r,a,i),l=e.memoizedState,o!==r||f!==l||ti.current||Yl?(typeof h=="function"&&(w_(e,n,h,r),l=e.memoizedState),(o=Yl||nO(e,n,o,r,f,l,c))?(d||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=r,e.memoizedState=l),a.props=r,a.state=l,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,OF(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:Ls(e.type,o),a.props=c,d=e.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=As(l):(l=ni(n)?$d:yr.current,l=tg(e,l));var p=n.getDerivedStateFromProps;(h=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==l)&&rO(e,a,r,l),Yl=!1,f=e.memoizedState,a.state=f,DS(e,r,a,i);var m=e.memoizedState;o!==d||f!==m||ti.current||Yl?(typeof p=="function"&&(w_(e,n,p,r),m=e.memoizedState),(c=Yl||nO(e,n,c,r,f,m,l)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),a.props=r,a.state=m,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return k_(t,e,n,r,s,i)}function k_(t,e,n,r,i,s){sB(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&KI(e,n,!1),Cl(t,e,s);r=e.stateNode,YW.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=rg(e,t.child,null,s),e.child=rg(e,null,o,s)):Pr(t,e,o,s),e.memoizedState=r.state,i&&KI(e,n,!0),e.child}function aB(t){var e=t.stateNode;e.pendingContext?qI(t,e.pendingContext,e.pendingContext!==e.context):e.context&&qI(t,e.context,!1),lN(t,e.containerInfo)}function uO(t,e,n,r,i){return ng(),nN(i),e.flags|=256,Pr(t,e,n,r),e.child}var A_={dehydrated:null,treeContext:null,retryLane:0};function E_(t){return{baseLanes:t,cachePool:null,transitions:null}}function oB(t,e,n){var r=e.pendingProps,i=Ut.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),wt(Ut,i&1),t===null)return y_(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,s?(r=e.mode,s=e.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=fk(a,r,0,null),t=Ld(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=E_(n),e.memoizedState=A_,t):gN(e,a));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return XW(t,e,a,r,o,i,n);if(s){s=r.fallback,a=e.mode,i=t.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=fu(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=fu(o,s):(s=Ld(s,a,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,a=t.child.memoizedState,a=a===null?E_(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~n,e.memoizedState=A_,r}return s=t.child,t=s.sibling,r=fu(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function gN(t,e){return e=fk({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function yb(t,e,n,r){return r!==null&&nN(r),rg(e,t.child,null,n),t=gN(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function XW(t,e,n,r,i,s,a){if(n)return e.flags&256?(e.flags&=-257,r=OA(Error(K(422))),yb(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=fk({mode:"visible",children:r.children},i,0,null),s=Ld(s,i,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&rg(e,t.child,null,a),e.child.memoizedState=E_(a),e.memoizedState=A_,s);if(!(e.mode&1))return yb(t,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(K(419)),r=OA(s,r,void 0),yb(t,e,a,r)}if(o=(a&t.childLanes)!==0,ei||o){if(r=Un,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,_l(t,i),aa(r,t,i,-1))}return SN(),r=OA(Error(K(421))),yb(t,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=c8.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Ui=cu(i.nextSibling),Vi=e,Lt=!0,ta=null,t!==null&&(ms[gs++]=gl,ms[gs++]=yl,ms[gs++]=Ud,gl=t.id,yl=t.overflow,Ud=e),e=gN(e,r.children),e.flags|=4096,e)}function hO(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),v_(t.return,e,n)}function MA(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function lB(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Pr(t,e,r.children,n),r=Ut.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&hO(t,n,e);else if(t.tag===19)hO(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(wt(Ut,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&LS(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),MA(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&LS(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}MA(e,!0,n,null,s);break;case"together":MA(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function dx(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,903 bytes, line 40
40function Cl(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Vd|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(K(153));if(e.child!==null){for(t=e.child,n=fu(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=fu(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function QW(t,e,n){switch(e.tag){case 3:aB(e),ng();break;case 5:MF(e);break;case 1:ni(e.type)&&NS(e);break;case 4:lN(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;wt(OS,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(wt(Ut,Ut.current&1),e.flags|=128,null):n&e.child.childLanes?oB(t,e,n):(wt(Ut,Ut.current&1),t=Cl(t,e,n),t!==null?t.sibling:null);wt(Ut,Ut.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return lB(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),wt(Ut,Ut.current),r)break;return null;case 22:case 23:return e.lanes=0,iB(t,e,n)}return Cl(t,e,n)}var cB,__,uB,hB;cB=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};__=function(){};uB=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,th(co.current);var s=null;switch(n){case"input":i=KE(t,i),r=KE(t,r),s=[];break;case"select":i=Gt({},i,{value:void 0}),r=Gt({},r,{value:void 0}),s=[];break;case"textarea":i=QE(t,i),r=QE(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=TS)}ZE(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(sv.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(sv.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Et("scroll",t),s||o===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};hB=function(t,e,n,r){n!==r&&(e.flags|=4)};function $g(t,e){if(!Lt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ar(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function JW(t,e,n){var r=e.pendingProps;switch(tN(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ar(e),null;case 1:return ni(e.type)&&PS(),ar(e),null;case 3:return r=e.stateNode,ig(),Nt(ti),Nt(yr),uN(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(mb(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ta!==null&&(M_(ta),ta=null))),__(t,e),ar(e),null;case 5:cN(e);var i=th(yv.current);if(n=e.type,t!==null&&e.stateNode!=null)uB(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(K(166));return ar(e),null}if(t=th(co.current),mb(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[no]=e,r[mv]=s,t=(e.mode&1)!==0,n){case"dialog":Et("cancel",r),Et("close",r);break;case"iframe":case"object":case"embed":Et("load",r);break;case"video":case"audio":for(i=0;i<sy.length;i++)Et(sy[i],r);break;case"source":Et("error",r);break;case"img":case"image":case"link":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"input":bI(r,s),Et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Et("invalid",r);break;case"textarea":SI(r,s),Et("invalid",r)}ZE(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];
vendor: 30,188 bytes, line 40
40a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&pb(r.textContent,o,t),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&pb(r.textContent,o,t),i=["children",""+o]):sv.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Et("scroll",r)}switch(n){case"input":ab(r),xI(r,s,!0);break;case"textarea":ab(r),kI(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=TS)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Bj(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[no]=e,t[mv]=r,cB(t,e,!1,!1),e.stateNode=t;e:{switch(a=e_(n,r),n){case"dialog":Et("cancel",t),Et("close",t),i=r;break;case"iframe":case"object":case"embed":Et("load",t),i=r;break;case"video":case"audio":for(i=0;i<sy.length;i++)Et(sy[i],t);i=r;break;case"source":Et("error",t),i=r;break;case"img":case"image":case"link":Et("error",t),Et("load",t),i=r;break;case"details":Et("toggle",t),i=r;break;case"input":bI(t,r),i=KE(t,r),Et("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Gt({},r,{value:void 0}),Et("invalid",t);break;case"textarea":SI(t,r),i=QE(t,r),Et("invalid",t);break;default:i=r}ZE(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?zj(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&$j(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&av(t,l):typeof l=="number"&&av(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(sv.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Et("scroll",t):l!=null&&$P(t,s,l,a))}switch(n){case"input":ab(t),xI(t,r,!1);break;case"textarea":ab(t),kI(t);break;case"option":r.value!=null&&t.setAttribute("value",""+gu(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?rp(t,!!r.multiple,s,!1):r.defaultValue!=null&&rp(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=TS)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ar(e),null;case 6:if(t&&e.stateNode!=null)hB(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(K(166));if(n=th(yv.current),th(co.current),mb(e)){if(r=e.stateNode,n=e.memoizedProps,r[no]=e,(s=r.nodeValue!==n)&&(t=Vi,t!==null))switch(t.tag){case 3:pb(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&pb(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[no]=e,e.stateNode=r}return ar(e),null;case 13:if(Nt(Ut),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Lt&&Ui!==null&&e.mode&1&&!(e.flags&128))PF(),ng(),e.flags|=98560,s=!1;else if(s=mb(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(K(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(K(317));s[no]=e}else ng(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ar(e),s=!1}else ta!==null&&(M_(ta),ta=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Ut.current&1?Pn===0&&(Pn=3):SN())),e.updateQueue!==null&&(e.flags|=4),ar(e),null);case 4:return ig(),__(t,e),t===null&&fv(e.stateNode.containerInfo),ar(e),null;case 10:return sN(e.type._context),ar(e),null;case 17:return ni(e.type)&&PS(),ar(e),null;case 19:if(Nt(Ut),s=e.memoizedState,s===null)return ar(e),null;if(r=(e.flags&128)!==0,a=s.rendering,a===null)if(r)$g(s,!1);else{if(Pn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=LS(t),a!==null){for(e.flags|=128,$g(s,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return wt(Ut,Ut.current&1|2),e.child}t=t.sibling}s.tail!==null&&un()>ag&&(e.flags|=128,r=!0,$g(s,!1),e.lanes=4194304)}else{if(!r)if(t=LS(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),$g(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Lt)return ar(e),null}else 2*un()-s.renderingStartTime>ag&&n!==1073741824&&(e.flags|=128,r=!0,$g(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(n=s.last,n!==null?n.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=un(),e.sibling=null,n=Ut.current,wt(Ut,r?n&1|2:n&1),e):(ar(e),null);case 22:case 23:return xN(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Di&1073741824&&(ar(e),e.subtreeFlags&6&&(e.flags|=8192)):ar(e),null;case 24:return null;case 25:return null}throw Error(K(156,e.tag))}function ZW(t,e){switch(tN(e),e.tag){case 1:return ni(e.type)&&PS(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ig(),Nt(ti),Nt(yr),uN(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return cN(e),null;case 13:if(Nt(Ut),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(K(340));ng()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Nt(Ut),null;case 4:return ig(),null;case 10:return sN(e.type._context),null;case 22:case 23:return xN(),null;case 24:return null;default:return null}}var vb=!1,mr=!1,e8=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Kf(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nn(t,e,r)}else n.current=null}function C_(t,e,n){try{n()}catch(r){nn(t,e,r)}}var dO=!1;function t8(t,e){if(u_=ES,t=gF(),ZP(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,h=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(o=a),f===s&&++h===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(h_={focusedElem:t,selectionRange:n},ES=!1,ie=e;ie!==null;)if(e=ie,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ie=t;else for(;ie!==null;){e=ie;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,x=m.memoizedState,v=e.stateNode,w=v.getSnapshotBeforeUpdate(e.elementType===e.type?y:Ls(e.type,y),x);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(K(163))}}catch(k){nn(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,ie=t;break}ie=e.return}return m=dO,dO=!1,m}function Fy(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&C_(e,n,s)}i=i.next}while(i!==r)}}function hk(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function T_(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function dB(t){var e=t.alternate;e!==null&&(t.alternate=null,dB(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[no],delete e[mv],delete e[p_],delete e[jW],delete e[FW])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function fB(t){return t.tag===5||t.tag===3||t.tag===4}function fO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fB(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function P_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=TS));else if(r!==4&&(t=t.child,t!==null))for(P_(t,e,n),t=t.sibling;t!==null;)P_(t,e,n),t=t.sibling}function N_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(N_(t,e,n),t=t.sibling;t!==null;)N_(t,e,n),t=t.sibling}var Qn=null,ea=!1;function Ll(t,e,n){for(n=n.child;n!==null;)pB(t,e,n),n=n.sibling}function pB(t,e,n){if(lo&&typeof lo.onCommitFiberUnmount=="function")try{lo.onCommitFiberUnmount(rk,n)}catch{}switch(n.tag){case 5:mr||Kf(n,e);case 6:var r=Qn,i=ea;Qn=null,Ll(t,e,n),Qn=r,ea=i,Qn!==null&&(ea?(t=Qn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qn.removeChild(n.stateNode));break;case 18:Qn!==null&&(ea?(t=Qn,n=n.stateNode,t.nodeType===8?CA(t.parentNode,n):t.nodeType===1&&CA(t,n),uv(t)):CA(Qn,n.stateNode));break;case 4:r=Qn,i=ea,Qn=n.stateNode.containerInfo,ea=!0,Ll(t,e,n),Qn=r,ea=i;break;case 0:case 11:case 14:case 15:if(!mr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&C_(n,e,a),i=i.next}while(i!==r)}Ll(t,e,n);break;case 1:if(!mr&&(Kf(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){nn(n,e,o)}Ll(t,e,n);break;case 21:Ll(t,e,n);break;case 22:n.mode&1?(mr=(r=mr)||n.memoizedState!==null,Ll(t,e,n),mr=r):Ll(t,e,n);break;default:Ll(t,e,n)}}function pO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new e8),e.forEach(function(r){var i=u8.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ps(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:Qn=o.stateNode,ea=!1;break e;case 3:Qn=o.stateNode.containerInfo,ea=!0;break e;case 4:Qn=o.stateNode.containerInfo,ea=!0;break e}o=o.return}if(Qn===null)throw Error(K(160));pB(s,a,i),Qn=null,ea=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){nn(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)mB(e,t),e=e.sibling}function mB(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ps(e,t),va(t),r&4){try{Fy(3,t,t.return),hk(3,t)}catch(y){nn(t,t.return,y)}try{Fy(5,t,t.return)}catch(y){nn(t,t.return,y)}}break;case 1:Ps(e,t),va(t),r&512&&n!==null&&Kf(n,n.return);break;case 5:if(Ps(e,t),va(t),r&512&&n!==null&&Kf(n,n.return),t.flags&32){var i=t.stateNode;try{av(i,"")}catch(y){nn(t,t.return,y)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,a=n!==null?n.memoizedProps:s,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&jj(i,s),e_(o,a);var c=e_(o,s);for(a=0;a<l.length;a+=2){var h=l[a],d=l[a+1];h==="style"?zj(i,d):h==="dangerouslySetInnerHTML"?$j(i,d):h==="children"?av(i,d):$P(i,h,d,c)}switch(o){case"input":YE(i,s);break;case"textarea":Fj(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?rp(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?rp(i,!!s.multiple,s.defaultValue,!0):rp(i,!!s.multiple,s.multiple?[]:"",!1))}i[mv]=s}catch(y){nn(t,t.return,y)}}break;case 6:if(Ps(e,t),va(t),r&4){if(t.stateNode===null)throw Error(K(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(y){nn(t,t.return,y)}}break;case 3:if(Ps(e,t),va(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{uv(e.containerInfo)}catch(y){nn(t,t.return,y)}break;case 4:Ps(e,t),va(t);break;case 13:Ps(e,t),va(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(wN=un())),r&4&&pO(t);break;case 22:if(h=n!==null&&n.memoizedState!==null,t.mode&1?(mr=(c=mr)||h,Ps(e,t),mr=c):Ps(e,t),va(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!h&&t.mode&1)for(ie=t,h=t.child;h!==null;){for(d=ie=h;ie!==null;){switch(f=ie,p=f.child,f.tag){case 0:case 11:case 14:case 15:Fy(4,f,f.return);break;case 1:Kf(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(y){nn(r,n,y)}}break;case 5:Kf(f,f.return);break;case 22:if(f.memoizedState!==null){gO(d);continue}}p!==null?(p.return=f,ie=p):gO(d)}h=h.sibling}e:for(h=null,d=t;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=Uj("display",a))}catch(y){nn(t,t.return,y)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){nn(t,t.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ps(e,t),va(t),r&4&&pO(t);break;case 21:break;default:Ps(e,t),va(t)}}function va(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(fB(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(av(i,""),r.flags&=-33);var s=fO(t);N_(t,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=fO(t);P_(t,o,a);break;default:throw Error(K(161))}}catch(l){nn(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function n8(t,e,n){ie=t,gB(t)}function gB(t,e,n){for(var r=(t.mode&1)!==0;ie!==null;){var i=ie,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||vb;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||mr;o=vb;var c=mr;if(vb=a,(mr=l)&&!c)for(ie=i;ie!==null;)a=ie,l=a.child,a.tag===22&&a.memoizedState!==null?yO(i):l!==null?(l.return=a,ie=l):yO(i);for(;s!==null;)ie=s,gB(s),s=s.sibling;ie=i,vb=o,mr=c}mO(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ie=s):mO(t)}}function mO(t){for(;ie!==null;){var e=ie;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:mr||hk(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!mr)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Ls(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&ZI(e,s,r);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}ZI(e,a,n)}break;case 5:var o=e.stateNode;if(n===null&&e.flags&4){n=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.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 h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&uv(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}mr||e.flags&512&&T_(e)}catch(f){nn(e,e.return,f)}}if(e===t){ie=null;break}if(n=e.sibling,n!==null){n.return=e.return,ie=n;break}ie=e.return}}function gO(t){for(;ie!==null;){var e=ie;if(e===t){ie=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ie=n;break}ie=e.return}}function yO(t){for(;ie!==null;){var e=ie;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{hk(4,e)}catch(l){nn(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){nn(e,i,l)}}var s=e.return;try{T_(e)}catch(l){nn(e,s,l)}break;case 5:var a=e.return;try{T_(e)}catch(l){nn(e,a,l)}}}catch(l){nn(e,e.return,l)}if(e===t){ie=null;break}var o=e.sibling;if(o!==null){o.return=e.return,ie=o;break}ie=e.return}}var r8=Math.ceil,BS=Ol.ReactCurrentDispatcher,yN=Ol.ReactCurrentOwner,xs=Ol.ReactCurrentBatchConfig,Ve=0,Un=null,vn=null,rr=0,Di=0,Yf=Nu(0),Pn=0,xv=null,Vd=0,dk=0,vN=0,By=null,Jr=null,wN=0,ag=1/0,Co=null,$S=!1,R_=null,hu=null,wb=!1,nu=null,US=0,$y=0,I_=null,fx=-1,px=0;function Dr(){return Ve&6?un():fx!==-1?fx:fx=un()}function du(t){return t.mode&1?Ve&2&&rr!==0?rr&-rr:$W.transition!==null?(px===0&&(px=eF()),px):(t=at,t!==0||(t=window.event,t=t===void 0?16:oF(t.type)),t):1}function aa(t,e,n,r){if(50<$y)throw $y=0,I_=null,Error(K(185));j0(t,n,r),(!(Ve&2)||t!==Un)&&(t===Un&&(!(Ve&2)&&(dk|=n),Pn===4&&Jl(t,rr)),ri(t,r),n===1&&Ve===0&&!(e.mode&1)&&(ag=un()+500,lk&&Ru()))}function ri(t,e){var n=t.callbackNode;$6(t,e);var r=AS(t,t===Un?rr:0);if(r===0)n!==null&&_I(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&_I(n),e===1)t.tag===0?BW(vO.bind(null,t)):_F(vO.bind(null,t)),DW(function(){!(Ve&6)&&Ru()}),n=null;else{switch(tF(r)){case 1:n=WP;break;case 4:n=Jj;break;case 16:n=kS;break;case 536870912:n=Zj;break;default:n=kS}n=AB(n,yB.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function yB(t,e){if(fx=-1,px=0,Ve&6)throw Error(K(327));var n=t.callbackNode;if(lp()&&t.callbackNode!==n)return null;var r=AS(t,t===Un?rr:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=zS(t,r);else{e=r;var i=Ve;Ve|=2;var s=wB();(Un!==t||rr!==e)&&(Co=null,ag=un()+500,Dd(t,e));do try{a8();break}catch(o){vB(t,o)}while(!0);iN(),BS.current=s,Ve=i,vn!==null?e=0:(Un=null,rr=0,e=Pn)}if(e!==0){if(e===2&&(i=s_(t),i!==0&&(r=i,e=O_(t,i))),e===1)throw n=xv,Dd(t,0),Jl(t,r),ri(t,un()),n;if(e===6)Jl(t,r);else{if(i=t.current.alternate,!(r&30)&&!i8(i)&&(e=zS(t,r),e===2&&(s=s_(t),s!==0&&(r=s,e=O_(t,s))),e===1))throw n=xv,Dd(t,0),Jl(t,r),ri(t,un()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(K(345));case 2:Uu(t,Jr,Co);break;case 3:if(Jl(t,r),(r&130023424)===r&&(e=wN+500-un(),10<e)){if(AS(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Dr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=f_(Uu.bind(null,t,Jr,Co),e);break}Uu(t,Jr,Co);break;case 4:if(Jl(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var a=31-sa(r);s=1<<a,a=e[a],a>i&&(i=a),r&=~s}if(r=i,r=un()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*r8(r/1960))-r,10<r){t.timeoutHandle=f_(Uu.bind(null,t,Jr,Co),r);break}Uu(t,Jr,Co);break;case 5:Uu(t,Jr,Co);break;default:throw Error(K(329))}}}return ri(t,un()),t.callbackNode===n?yB.bind(null,t):null}function O_(t,e){var n=By;return t.current.memoizedState.isDehydrated&&(Dd(t,e).flags|=256),t=zS(t,e),t!==2&&(e=Jr,Jr=n,e!==null&&M_(e)),t}function M_(t){Jr===null?Jr=t:Jr.push.apply(Jr,t)}function i8(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!la(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Jl(t,e){for(e&=~vN,e&=~dk,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-sa(e),r=1<<n;t[n]=-1,e&=~r}}function vO(t){if(Ve&6)throw Error(K(327));lp();var e=AS(t,0);if(!(e&1))return ri(t,un()),null;var n=zS(t,e);if(t.tag!==0&&n===2){var r=s_(t);r!==0&&(e=r,n=O_(t,r))}if(n===1)throw n=xv,Dd(t,0),Jl(t,e),ri(t,un()),n;if(n===6)throw Error(K(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Uu(t,Jr,Co),ri(t,un()),null}function bN(t,e){var n=Ve;Ve|=1;try{return t(e)}finally{Ve=n,Ve===0&&(ag=un()+500,lk&&Ru())}}function Hd(t){nu!==null&&nu.tag===0&&!(Ve&6)&&lp();var e=Ve;Ve|=1;var n=xs.transition,r=at;try{if(xs.transition=null,at=1,t)return t()}finally{at=r,xs.transition=n,Ve=e,!(Ve&6)&&Ru()}}function xN(){Di=Yf.current,Nt(Yf)}function Dd(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,MW(n)),vn!==null)for(n=vn.return;n!==null;){var r=n;switch(tN(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&PS();break;case 3:ig(),Nt(ti),Nt(yr),uN();break;case 5:cN(r);break;case 4:ig();break;case 13:Nt(Ut);break;case 19:Nt(Ut);break;case 10:sN(r.type._context);break;case 22:case 23:xN()}n=n.return}if(Un=t,vn=t=fu(t.current,null),rr=Di=e,Pn=0,xv=null,vN=dk=Vd=0,Jr=By=null,eh!==null){for(e=0;e<eh.length;e++)if(n=eh[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}eh=null}return t}function vB(t,e){do{var n=vn;try{if(iN(),ux.current=FS,jS){for(var r=Ht.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}jS=!1}if(zd=0,$n=Tn=Ht=null,jy=!1,vv=0,yN.current=null,n===null||n.return===null){Pn=1,xv=e,vn=null;break}e:{var s=t,a=n.return,o=n,l=e;if(e=rr,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=sO(a);if(p!==null){p.flags&=-257,aO(p,a,o,s,e),p.mode&1&&iO(s,c,e),e=p,l=c;var m=e.updateQueue;if(m===null){var y=new Set;y.add(l),e.updateQueue=y}else m.add(l);break e}else{if(!(e&1)){iO(s,c,e),SN();break e}l=Error(K(426))}}else if(Lt&&o.mode&1){var x=sO(a);if(x!==null){!(x.flags&65536)&&(x.flags|=256),aO(x,a,o,s,e),nN(sg(l,o));break e}}s=l=sg(l,o),Pn!==4&&(Pn=2),By===null?By=[s]:By.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var v=tB(s,l,e);JI(s,v);break e;case 1:o=l;var w=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(hu===null||!hu.has(b)))){s.flags|=65536,e&=-e,s.lanes|=e;var k=nB(s,o,e);JI(s,k);break e}}s=s.return}while(s!==null)}xB(n)}catch(_){e=_,vn===n&&n!==null&&(vn=n=n.return);continue}break}while(!0)}function wB(){var t=BS.current;return BS.current=FS,t===null?FS:t}function SN(){(Pn===0||Pn===3||Pn===2)&&(Pn=4),Un===null||!(Vd&268435455)&&!(dk&268435455)||Jl(Un,rr)}function zS(t,e){var n=Ve;Ve|=2;var r=wB();(Un!==t||rr!==e)&&(Co=null,Dd(t,e));do try{s8();break}catch(i){vB(t,i)}while(!0);if(iN(),Ve=n,BS.current=r,vn!==null)throw Error(K(261));return Un=null,rr=0,Pn}function s8(){for(;vn!==null;)bB(vn)}function a8(){for(;vn!==null&&!R6();)bB(vn)}function bB(t){var e=kB(t.alternate,t,Di);t.memoizedProps=t.pendingProps,e===null?xB(t):vn=e,yN.current=null}function xB(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=ZW(n,e),n!==null){n.flags&=32767,vn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pn=6,vn=null;return}}else if(n=JW(n,e,Di),n!==null){vn=n;return}if(e=e.sibling,e!==null){vn=e;return}vn=e=t}while(e!==null);Pn===0&&(Pn=5)}function Uu(t,e,n){var r=at,i=xs.transition;try{xs.transition=null,at=1,o8(t,e,n,r)}finally{xs.transition=i,at=r}return null}function o8(t,e,n,r){do lp();while(nu!==null);if(Ve&6)throw Error(K(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(K(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(U6(t,s),t===Un&&(vn=Un=null,rr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||wb||(wb=!0,AB(kS,function(){return lp(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=xs.transition,xs.transition=null;var a=at;at=1;var o=Ve;Ve|=4,yN.current=null,t8(t,n),mB(n,t),CW(h_),ES=!!u_,h_=u_=null,t.current=n,n8(n),I6(),Ve=o,at=a,xs.transition=s}else t.current=n;if(wb&&(wb=!1,nu=t,US=i),s=t.pendingLanes,s===0&&(hu=null),D6(n.stateNode),ri(t,un()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if($S)throw $S=!1,t=R_,R_=null,t;return US&1&&t.tag!==0&&lp(),s=t.pendingLanes,s&1?t===I_?$y++:($y=0,I_=t):$y=0,Ru(),null}function lp(){if(nu!==null){var t=tF(US),e=xs.transition,n=at;try{if(xs.transition=null,at=16>t?16:t,nu===null)var r=!1;else{if(t=nu,nu=null,US=0,Ve&6)throw Error(K(331));var i=Ve;for(Ve|=4,ie=t.current;ie!==null;){var s=ie,a=s.child;if(ie.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(ie=c;ie!==null;){var h=ie;switch(h.tag){case 0:case 11:case 15:Fy(8,h,s)}var d=h.child;if(d!==null)d.return=h,ie=d;else for(;ie!==null;){h=ie;var f=h.sibling,p=h.return;if(dB(h),h===c){ie=null;break}if(f!==null){f.return=p,ie=f;break}ie=p}}}var m=s.alternate;if(m!==null){var y=m.child;if(y!==null){m.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}ie=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,ie=a;else e:for(;ie!==null;){if(s=ie,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Fy(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,ie=v;break e}ie=s.return}}var w=t.current;for(ie=w;ie!==null;){a=ie;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,ie=b;else e:for(a=w;ie!==null;){if(o=ie,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:hk(9,o)}}catch(_){nn(o,o.return,_)}if(o===a){ie=null;break e}var k=o.sibling;if(k!==null){k.return=o.return,ie=k;break e}ie=o.return}}if(Ve=i,Ru(),lo&&typeof lo.onPostCommitFiberRoot=="function")try{lo.onPostCommitFiberRoot(rk,t)}catch{}r=!0}return r}finally{at=n,xs.transition=e}}return!1}function wO(t,e,n){e=sg(n,e),e=tB(t,e,1),t=uu(t,e,1),e=Dr(),t!==null&&(j0(t,1,e),ri(t,e))}function nn(t,e,n){if(t.tag===3)wO(t,t,n);else for(;e!==null;){if(e.tag===3){wO(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hu===null||!hu.has(r))){t=sg(n,t),t=nB(e,t,1),e=uu(e,t,1),t=Dr(),e!==null&&(j0(e,1,t),ri(e,t));break}}e=e.return}}function l8(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Dr(),t.pingedLanes|=t.suspendedLanes&n,Un===t&&(rr&n)===n&&(Pn===4||Pn===3&&(rr&130023424)===rr&&500>un()-wN?Dd(t,0):vN|=n),ri(t,e)}function SB(t,e){e===0&&(t.mode&1?(e=cb,cb<<=1,!(cb&130023424)&&(cb=4194304)):e=1);var n=Dr();t=_l(t,e),t!==null&&(j0(t,e,n),ri(t,n))}function c8(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),SB(t,n)}function u8(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(e),SB(t,n)}var kB;kB=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ti.current)ei=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ei=!1,QW(t,e,n);ei=!!(t.flags&131072)}else ei=!1,Lt&&e.flags&1048576&&CF(e,IS,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;dx(t,e),t=e.pendingProps;var i=tg(e,yr.current);op(e,n),i=dN(null,e,r,t,i,n);var s=fN();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ni(r)?(s=!0,NS(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,oN(e),i.updater=uk,e.stateNode=i,i._reactInternals=e,b_(e,r,t,n),e=k_(null,e,r,!0,s,n)):(e.tag=0,Lt&&s&&eN(e),Pr(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(dx(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=d8(r),t=Ls(r,t),i){case 0:e=S_(null,e,r,t,n);break e;case 1:e=cO(null,e,r,t,n);break e;case 11:e=oO(null,e,r,t,n);break e;case 14:e=lO(null,e,r,Ls(r.type,t),n);break e}throw Error(K(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),S_(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),cO(t,e,r,i,n);case 3:e:{if(aB(e),t===null)throw Error(K(387));r=e.pendingProps,s=e.memoizedState,i=s.element,OF(t,e),DS(e,r,null,n);var a=e.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=sg(Error(K(423)),e),e=uO(t,e,r,n,i);break e}else if(r!==i){i=sg(Error(K(424)),e),e=uO(t,e,r,n,i);break e}else for(Ui=cu(e.stateNode.containerInfo.firstChild),Vi=e,Lt=!0,ta=null,n=RF(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ng(),r===i){e=Cl(t,e,n);break e}Pr(t,e,r,n)}e=e.child}return e;case 5:return MF(e),t===null&&y_(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,d_(r,i)?a=null:s!==null&&d_(r,s)&&(e.flags|=32),sB(t,e),Pr(t,e,a,n),e.child;case 6:return t===null&&y_(e),null;case 13:return oB(t,e,n);case 4:return lN(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=rg(e,null,r,n):Pr(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),oO(t,e,r,i,n);case 7:return Pr(t,e,e.pendingProps,n),e.child;case 8:return Pr(t,e,e.pendingProps.children,n),e.child;case 12:return Pr(t,e,e.pendingProps.children,n),e.child;
vendor: 4,956 bytes, line 40
40case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,wt(OS,r._currentValue),r._currentValue=a,s!==null)if(la(s.value,a)){if(s.children===i.children&&!ti.current){e=Cl(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=wl(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?l.next=l:(l.next=h.next,h.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),v_(s.return,n,e),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(K(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),v_(a,n,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Pr(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,op(e,n),i=As(i),r=r(i),e.flags|=1,Pr(t,e,r,n),e.child;case 14:return r=e.type,i=Ls(r,e.pendingProps),i=Ls(r.type,i),lO(t,e,r,i,n);case 15:return rB(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ls(r,i),dx(t,e),e.tag=1,ni(r)?(t=!0,NS(e)):t=!1,op(e,n),eB(e,r,i),b_(e,r,i,n),k_(null,e,r,!0,t,n);case 19:return lB(t,e,n);case 22:return iB(t,e,n)}throw Error(K(156,e.tag))};function AB(t,e){return Qj(t,e)}function h8(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(t,e,n,r){return new h8(t,e,n,r)}function kN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function d8(t){if(typeof t=="function")return kN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===zP)return 11;if(t===VP)return 14}return 2}function fu(t,e){var n=t.alternate;return n===null?(n=ws(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function mx(t,e,n,r,i,s){var a=2;if(r=t,typeof t=="function")kN(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Bf:return Ld(n.children,i,s,e);case UP:a=8,i|=8;break;case HE:return t=ws(12,n,e,i|2),t.elementType=HE,t.lanes=s,t;case WE:return t=ws(13,n,e,i),t.elementType=WE,t.lanes=s,t;case GE:return t=ws(19,n,e,i),t.elementType=GE,t.lanes=s,t;case Mj:return fk(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ij:a=10;break e;case Oj:a=9;break e;case zP:a=11;break e;case VP:a=14;break e;case Kl:a=16,r=null;break e}throw Error(K(130,t==null?t:typeof t,""))}return e=ws(a,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Ld(t,e,n,r){return t=ws(7,t,r,e),t.lanes=n,t}function fk(t,e,n,r){return t=ws(22,t,r,e),t.elementType=Mj,t.lanes=n,t.stateNode={isHidden:!1},t}function DA(t,e,n){return t=ws(6,t,null,e),t.lanes=n,t}function LA(t,e,n){return e=ws(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function f8(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gA(0),this.expirationTimes=gA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gA(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function AN(t,e,n,r,i,s,a,o,l){return t=new f8(t,e,n,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ws(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oN(s),t}function p8(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ff,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function EB(t){if(!t)return yu;t=t._reactInternals;e:{if(ef(t)!==t||t.tag!==1)throw Error(K(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ni(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(K(171))}if(t.tag===1){var n=t.type;
vendor: 4,184 bytes, line 40
40if(ni(n))return EF(t,n,e)}return e}function _B(t,e,n,r,i,s,a,o,l){return t=AN(n,r,!0,t,i,s,a,o,l),t.context=EB(null),n=t.current,r=Dr(),i=du(n),s=wl(r,i),s.callback=e??null,uu(n,s,i),t.current.lanes=i,j0(t,i,r),ri(t,r),t}function pk(t,e,n,r){var i=e.current,s=Dr(),a=du(i);return n=EB(n),e.context===null?e.context=n:e.pendingContext=n,e=wl(s,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=uu(i,e,a),t!==null&&(aa(t,i,a,s),cx(t,i,a)),a}function VS(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function bO(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function EN(t,e){bO(t,e),(t=t.alternate)&&bO(t,e)}function m8(){return null}var CB=typeof reportError=="function"?reportError:function(t){console.error(t)};function _N(t){this._internalRoot=t}mk.prototype.render=_N.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(K(409));pk(t,e,null,null)};mk.prototype.unmount=_N.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Hd(function(){pk(null,t,null,null)}),e[El]=null}};function mk(t){this._internalRoot=t}mk.prototype.unstable_scheduleHydration=function(t){if(t){var e=iF();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ql.length&&e!==0&&e<Ql[n].priority;n++);Ql.splice(n,0,t),n===0&&aF(t)}};function CN(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function gk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function xO(){}function g8(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=VS(a);s.call(c)}}var a=_B(e,r,t,0,null,!1,!1,"",xO);return t._reactRootContainer=a,t[El]=a.current,fv(t.nodeType===8?t.parentNode:t),Hd(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=VS(l);o.call(c)}}var l=AN(t,0,!1,null,null,!1,!1,"",xO);return t._reactRootContainer=l,t[El]=l.current,fv(t.nodeType===8?t.parentNode:t),Hd(function(){pk(e,l,n,r)}),l}function yk(t,e,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=VS(a);o.call(l)}}pk(e,a,t,i)}else a=g8(n,e,t,i,r);return VS(a)}nF=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=iy(e.pendingLanes);n!==0&&(GP(e,n|1),ri(e,un()),!(Ve&6)&&(ag=un()+500,Ru()))}break;case 13:Hd(function(){var r=_l(t,1);if(r!==null){var i=Dr();aa(r,t,1,i)}}),EN(t,1)}};qP=function(t){if(t.tag===13){var e=_l(t,134217728);if(e!==null){var n=Dr();aa(e,t,134217728,n)}EN(t,134217728)}};rF=function(t){if(t.tag===13){var e=du(t),n=_l(t,e);if(n!==null){var r=Dr();aa(n,t,e,r)}EN(t,e)}};iF=function(){return at};sF=function(t,e){var n=at;try{return at=t,e()}finally{at=n}};n_=function(t,e,n){switch(e){case"input":if(YE(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=ok(r);if(!i)throw Error(K(90));Lj(r),YE(r,i)}}}break;case"textarea":Fj(t,n);break;case"select":e=n.value,e!=null&&rp(t,!!n.multiple,e,!1)}};Wj=bN;Gj=Hd;var y8={usingClientEntryPoint:!1,Events:[B0,Vf,ok,Vj,Hj,bN]},Ug={findFiberByHostInstance:Zu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},v8={bundleType:Ug.bundleType,version:Ug.version,rendererPackageName:Ug.rendererPackageName,rendererConfig:Ug.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ol.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Yj(t),t===null?null:t.stateNode},findFiberByHostInstance:Ug.findFiberByHostInstance||m8,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 bb=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bb.isDisabled&&bb.supportsFiber)try{rk=bb.inject(v8),lo=bb}catch{}}Yi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=y8;Yi.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!CN(e))throw Error(K(200));return p8(t,e,null,n)};Yi.createRoot=function(t,e){if(!CN(t))throw Error(K(299));var n=!1,r="",i=CB;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=AN(t,1,!1,null,null,n,!1,r,i),t[El]=e.current,fv(t.nodeType===8?t.parentNode:t),new _N(e)};Yi.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(K(188)):(t=Object.keys(t).join(","),Error(K(268,t)));return t=Yj(e),t=t===null?null:t.stateNode,t};Yi.flushSync=function(t){return Hd(t)};Yi.hydrate=function(t,e,n){if(!gk(e))throw Error(K(200));return yk(null,t,e,!0,n)};Yi.hydrateRoot=function(t,e,n){if(!CN(t))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=CB;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=_B(e,null,t,1,n??null,i,!1,s,a),t[El]=e.current,fv(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new mk(e)};Yi.render=function(t,e,n){if(!gk(e))throw Error(K(200));return yk(null,t,e,!1,n)};Yi.unmountComponentAtNode=function(t){if(!gk(t))throw Error(K(40));return t._reactRootContainer?(Hd(function(){yk(null,null,t,!1,function(){t._reactRootContainer=null,t[El]=null})}),!0):!1};Yi.unstable_batchedUpdates=bN;Yi.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!gk(n))throw Error(K(200));if(t==null||t._reactInternals===void 0)throw Error(K(38));return yk(t,e,n,!1,r)};Yi.version="18.3.1-next-f1338f8080-20240426";function TB(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TB)}catch(t){console.error(t)}}TB(),Tj.exports=Yi;var Sg=Tj.exports;const TN=Jd(Sg);var PB,SO=Sg;PB=SO.createRoot,SO.hydrateRoot;/**
41 * @remix-run/router v1.19.2
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 */function Sv(){return Sv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Sv.apply(this,arguments)}var ru;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ru||(ru={}));const kO="popstate";function w8(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:a,hash:o}=r.location;return D_("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:HS(i)}return x8(e,n,null,t)}function wn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function NB(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function b8(){return Math.random().toString(36).substr(2,8)}function AO(t,e){return{usr:t.state,key:t.key,idx:e}}function D_(t,e,n,r){return n===void 0&&(n=null),Sv({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?kg(e):e,{state:n,key:e&&e.key||r||b8()})}function HS(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function kg(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function x8(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=ru.Pop,l=null,c=h();c==null&&(c=0,a.replaceState(Sv({},a.state,{idx:c}),""));function h(){return(a.state||{idx:null}).idx}function d(){o=ru.Pop;
vendor: 3,517 bytes, line 49
49let x=h(),v=x==null?null:x-c;c=x,l&&l({action:o,location:y.location,delta:v})}function f(x,v){o=ru.Push;let w=D_(y.location,x,v);c=h()+1;let b=AO(w,c),k=y.createHref(w);try{a.pushState(b,"",k)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(k)}s&&l&&l({action:o,location:y.location,delta:1})}function p(x,v){o=ru.Replace;let w=D_(y.location,x,v);c=h();let b=AO(w,c),k=y.createHref(w);a.replaceState(b,"",k),s&&l&&l({action:o,location:y.location,delta:0})}function m(x){let v=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof x=="string"?x:HS(x);return w=w.replace(/ $/,"%20"),wn(v,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,v)}let y={get action(){return o},get location(){return t(i,a)},listen(x){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(kO,d),l=x,()=>{i.removeEventListener(kO,d),l=null}},createHref(x){return e(i,x)},createURL:m,encodeLocation(x){let v=m(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(x){return a.go(x)}};return y}var EO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(EO||(EO={}));function S8(t,e,n){return n===void 0&&(n="/"),k8(t,e,n,!1)}function k8(t,e,n,r){let i=typeof e=="string"?kg(e):e,s=PN(i.pathname||"/",n);if(s==null)return null;let a=RB(t);A8(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let c=D8(s);o=O8(a[l],c,r)}return o}function RB(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,o)=>{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(wn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=pu([r,l.relativePath]),h=n.concat(l);s.children&&s.children.length>0&&(wn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),RB(s.children,e,h,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:R8(c,s.index),routesMeta:h})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of IB(s.path))i(s,a,l)}),e}function IB(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=IB(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function A8(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:I8(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const E8=/^:[\w-]+$/,_8=3,C8=2,T8=1,P8=10,N8=-2,_O=t=>t==="*";function R8(t,e){let n=t.split("/"),r=n.length;return n.some(_O)&&(r+=N8),e&&(r+=C8),n.filter(i=>!_O(i)).reduce((i,s)=>i+(E8.test(s)?_8:s===""?T8:P8),r)}function I8(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function O8(t,e,n){let{routesMeta:r}=t,i={},s="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],c=o===r.length-1,h=s==="/"?e:e.slice(s.length)||"/",d=CO({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},h),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=CO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!d)return null;
vendor: 6,834 bytes, lines 49-58
49Object.assign(i,d.params),a.push({params:i,pathname:pu([s,d.pathname]),pathnameBase:B8(pu([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=pu([s,d.pathnameBase]))}return a}function CO(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=M8(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,h,d)=>{let{paramName:f,isOptional:p}=h;if(f==="*"){let y=o[d]||"";a=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const m=o[d];return p&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:t}}function M8(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),NB(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function D8(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return NB(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function PN(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function L8(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?kg(t):t;return{pathname:n?n.startsWith("/")?n:j8(n,e):e,search:$8(r),hash:U8(i)}}function j8(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function jA(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function F8(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function OB(t,e){let n=F8(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MB(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=kg(t):(i=Sv({},t),wn(!i.pathname||!i.pathname.includes("?"),jA("?","pathname","search",i)),wn(!i.pathname||!i.pathname.includes("#"),jA("#","pathname","hash",i)),wn(!i.search||!i.search.includes("#"),jA("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?e[d]:"/"}let l=L8(i,o),c=a&&a!=="/"&&a.endsWith("/"),h=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||h)&&(l.pathname+="/"),l}const pu=t=>t.join("/").replace(/\/\/+/g,"/"),B8=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),$8=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,U8=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function z8(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const DB=["post","put","patch","delete"];new Set(DB);const V8=["get",...DB];new Set(V8);/**
50 * React Router v6.26.2
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function kv(){return kv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},kv.apply(this,arguments)}const NN=A.createContext(null),H8=A.createContext(null),tf=A.createContext(null),vk=A.createContext(null),nf=A.createContext({outlet:null,matches:[],isDataRoute:!1}),LB=A.createContext(null);function W8(t,e){let{relative:n}=e===void 0?{}:e;U0()||wn(!1);let{basename:r,navigator:i}=A.useContext(tf),{hash:s,pathname:a,search:o}=FB(t,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:pu([r,a])),i.createHref({pathname:l,search:o,hash:s})}function U0(){return A.useContext(vk)!=null}function z0(){return U0()||wn(!1),A.useContext(vk).location}function jB(t){A.useContext(tf).static||A.useLayoutEffect(t)}function rf(){let{isDataRoute:t}=A.useContext(nf);return t?iG():G8()}function G8(){U0()||wn(!1);let t=A.useContext(NN),{basename:e,future:n,navigator:r}=A.useContext(tf),{matches:i}=A.useContext(nf),{pathname:s}=z0(),a=JSON.stringify(OB(i,n.v7_relativeSplatPath)),o=A.useRef(!1);return jB(()=>{o.current=!0}),A.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let d=MB(c,JSON.parse(a),s,h.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:pu([e,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[e,r,a,s,t])}function FB(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=A.useContext(tf),{matches:i}=A.useContext(nf),{pathname:s}=z0(),a=JSON.stringify(OB(i,r.v7_relativeSplatPath));return A.useMemo(()=>MB(t,JSON.parse(a),s,n==="path"),[t,a,s,n])}function q8(t,e){return K8(t,e)}function K8(t,e,n,r){U0()||wn(!1);let{navigator:i}=A.useContext(tf),{matches:s}=A.useContext(nf),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=z0(),h;if(e){var d;let x=typeof e=="string"?kg(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||wn(!1),h=x}else h=c;let f=h.pathname||"/",p=f;if(l!=="/"){let x=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=S8(t,{pathname:p}),y=Z8(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},o,x.params),pathname:pu([l,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:pu([l,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,n,r);return e&&y?A.createElement(vk.Provider,{value:{location:kv({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:ru.Pop}},y):y}function Y8(){let t=rG(),e=z8(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application 
58Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},e),n?A.createElement("pre",{style:i},n):null,null)}const X8=A.createElement(Y8,null);class Q8 extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?A.createElement(nf.Provider,{value:this.props.routeContext},A.createElement(LB.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function J8(t){let{routeContext:e,match:n,children:r}=t,i=A.useContext(NN);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),A.createElement(nf.Provider,{value:e},r)}function Z8(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,o=(i=n)==null?void 0:i.errors;if(o!=null){let h=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||wn(!1),a=a.slice(0,Math.min(a.length,h+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<a.length;h++){let d=a[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:f,errors:p}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((h,d,f)=>{let p,m=!1,y=null,x=null;n&&(p=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||X8,l&&(c<0&&f===0?(m=!0,x=null):c===f&&(m=!0,x=d.route.hydrateFallbackElement||null)));let v=e.concat(a.slice(0,f+1)),w=()=>{let b;return p?b=y:m?b=x:d.route.Component?b=A.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=h,A.createElement(J8,{match:d,routeContext:{outlet:h,matches:v,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?A.createElement(Q8,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:w(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):w()},null)}var BB=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(BB||{}),WS=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(WS||{});function eG(t){let e=A.useContext(NN);return e||wn(!1),e}function tG(t){let e=A.useContext(H8);return e||wn(!1),e}function nG(t){let e=A.useContext(nf);return e||wn(!1),e}function $B(t){let e=nG(),n=e.matches[e.matches.length-1];return n.route.id||wn(!1),n.route.id}function rG(){var t;let e=A.useContext(LB),n=tG(WS.UseRouteError),r=$B(WS.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function iG(){let{router:t}=eG(BB.UseNavigateStable),e=$B(WS.UseNavigateStable),n=A.useRef(!1);return jB(()=>{n.current=!0}),A.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,kv({fromRouteId:e},s)))},[t,e])}function Sa(t){wn(!1)}function sG(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ru.Pop,navigator:s,static:a=!1,future:o}=t;U0()&&wn(!1);let l=e.replace(/^\/*/,"/"),c=A.useMemo(()=>({basename:l,navigator:s,static:a,future:kv({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=kg(r));let{pathname:h="/",search:d="",hash:f="",state:p=null,key:m="default"}=r,y=A.useMemo(()=>{let x=PN(h,l);return x==null?null:{location:{pathname:x,search:d,hash:f,state:p,key:m},navigationType:i}},[l,h,d,f,p,m,i]);return y==null?null:A.createElement(tf.Provider,{value:c},A.createElement(vk.Provider,{children:n,value:y}))}function aG(t){let{children:e,location:n}=t;return q8(L_(e),n)}new Promise(()=>{});function L_(t,e){e===void 0&&(e=[]);let n=[];
58return A.Children.forEach(t,(r,i)=>{if(!A.isValidElement(r))return;let s=[...e,i];if(r.type===A.Fragment){n.push.apply(n,L_(r.props.children,s));return}r.type!==Sa&&wn(!1),!r.props.index||!r.props.children||wn(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=L_(r.props.children,s)),n.push(a)}),n}/**
59 * React Router DOM v6.26.2
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function j_(){return j_=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},j_.apply(this,arguments)}function oG(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function lG(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function cG(t,e){return t.button===0&&(!e||e==="_self")&&!lG(t)}const uG=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],hG="6";try{window.__reactRouterVersion=hG}catch{}const dG="startTransition",TO=_j[dG];function fG(t){let{basename:e,children:n,future:r,window:i}=t,s=A.useRef();s.current==null&&(s.current=w8({window:i,v5Compat:!0}));let a=s.current,[o,l]=A.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},h=A.useCallback(d=>{c&&TO?TO(()=>l(d)):l(d)},[l,c]);return A.useLayoutEffect(()=>a.listen(h),[a,h]),A.createElement(sG,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const pG=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mG=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ca=A.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:c,preventScrollReset:h,unstable_viewTransition:d}=e,f=oG(e,uG),{basename:p}=A.useContext(tf),m,y=!1;if(typeof c=="string"&&mG.test(c)&&(m=c,pG))try{let b=new URL(window.location.href),k=c.startsWith("//")?new URL(b.protocol+c):new URL(c),_=PN(k.pathname,p);k.origin===b.origin&&_!=null?c=_+k.search+k.hash:y=!0}catch{}let x=W8(c,{relative:i}),v=gG(c,{replace:a,state:o,target:l,preventScrollReset:h,relative:i,unstable_viewTransition:d});function w(b){r&&r(b),b.defaultPrevented||v(b)}return A.createElement("a",j_({},f,{href:m||x,onClick:y||s?r:w,ref:n,target:l}))});var PO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(PO||(PO={}));var NO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(NO||(NO={}));function gG(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,unstable_viewTransition:o}=e===void 0?{}:e,l=rf(),c=z0(),h=FB(t,{relative:a});return A.useCallback(d=>{if(cG(d,n)){d.preventDefault();let f=r!==void 0?r:HS(c)===HS(h);l(t,{replace:f,state:i,preventScrollReset:s,relative:a,unstable_viewTransition:o})}},[c,l,h,r,i,n,t,s,a,o])}var yG=typeof Element<"u",vG=typeof Map=="function",wG=typeof Set=="function",bG=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function gx(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!gx(t[r],e[r]))return!1;return!0}var s;if(vG&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;for(s=t.entries();!(r=s.next()).done;)if(!gx(r.value[1],e.get(r.value[0])))return!1;return!0}if(wG&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s=t.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(bG&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(yG&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!gx(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var xG=function(e,n){try{return gx(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const SG=Jd(xG);var kG=function(t,e,n,r,i,s,a,o){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,s,a,o],h=0;l=new Error(e.replace(/%s/g,function(){return c[h++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},AG=kG;const RO=Jd(AG);
67var EG=function(e,n,r,i){var s=r?r.call(i,e,n):void 0;if(s!==void 0)return!!s;if(e===n)return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;var a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),c=0;c<a.length;c++){var h=a[c];if(!l(h))return!1;var d=e[h],f=n[h];if(s=r?r.call(i,d,f,h):void 0,s===!1||s===void 0&&d!==f)return!1}return!0};const _G=Jd(EG);var UB=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(UB||{}),FA={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},IO=Object.values(UB),wk={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},zB=Object.entries(wk).reduce((t,[e,n])=>(t[n]=e,t),{}),na="data-rh",cp={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},up=(t,e)=>{for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},CG=t=>{let e=up(t,"title");const n=up(t,cp.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,()=>e);const r=up(t,cp.DEFAULT_TITLE);return e||r||void 0},TG=t=>up(t,cp.ON_CHANGE_CLIENT_STATE)||(()=>{}),BA=(t,e)=>e.filter(n=>typeof n[t]<"u").map(n=>n[t]).reduce((n,r)=>({...n,...r}),{}),PG=(t,e)=>e.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let s=0;s<i.length;s+=1){const o=i[s].toLowerCase();if(t.indexOf(o)!==-1&&r[o])return n.concat(r)}}return n},[]),NG=t=>console&&typeof console.warn=="function"&&console.warn(t),zg=(t,e,n)=>{const r={};return n.filter(i=>Array.isArray(i[t])?!0:(typeof i[t]<"u"&&NG(`Helmet: ${t} should be of type "Array". Instead found type "${typeof i[t]}"`),!1)).map(i=>i[t]).reverse().reduce((i,s)=>{const a={};s.filter(l=>{let c;const h=Object.keys(l);for(let f=0;f<h.length;f+=1){const p=h[f],m=p.toLowerCase();e.indexOf(m)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(m==="rel"&&l[m].toLowerCase()==="stylesheet")&&(c=m),e.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const d=l[c].toLowerCase();return r[c]||(r[c]={}),a[c]||(a[c]={}),r[c][d]?!1:(a[c][d]=!0,!0)}).reverse().forEach(l=>i.push(l));const o=Object.keys(a);for(let l=0;l<o.length;l+=1){const c=o[l],h={...r[c],...a[c]};r[c]=h}return i},[]).reverse()},RG=(t,e)=>{if(Array.isArray(t)&&t.length){for(let n=0;n<t.length;n+=1)if(t[n][e])return!0}return!1},IG=t=>({baseTag:PG(["href"],t),bodyAttributes:BA("bodyAttributes",t),defer:up(t,cp.DEFER),encode:up(t,cp.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:BA("htmlAttributes",t),linkTags:zg("link",["rel","href"],t),metaTags:zg("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:zg("noscript",["innerHTML"],t),onChangeClientState:TG(t),scriptTags:zg("script",["src","innerHTML"],t),styleTags:zg("style",["cssText"],t),title:CG(t),titleAttributes:BA("titleAttributes",t),prioritizeSeoTags:RG(t,cp.PRIORITIZE_SEO_TAGS)}),VB=t=>Array.isArray(t)?t.join(""):t,OG=(t,e)=>{const n=Object.keys(t);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&e[n[r]].includes(t[n[r]]))return!0;return!1},$A=(t,e)=>Array.isArray(t)?t.reduce((n,r)=>(OG(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},OO=(t,e)=>({...t,[e]:void 0}),MG=["noscript","script","style"],F_=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),HB=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}
67="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),DG=(t,e,n,r)=>{const i=HB(n),s=VB(e);return i?`<${t} ${na}="true" ${i}>${F_(s,r)}</${t}>`:`<${t} ${na}="true">${F_(s,r)}</${t}>`},LG=(t,e,n=!0)=>e.reduce((r,i)=>{const s=i,a=Object.keys(s).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,h)=>{const d=typeof s[h]>"u"?h:`${h}="${F_(s[h],n)}"`;return c?`${c} ${d}`:d},""),o=s.innerHTML||s.cssText||"",l=MG.indexOf(t)===-1;return`${r}<${t} ${na}="true" ${a}${l?"/>":`>${o}</${t}>`}`},""),WB=(t,e={})=>Object.keys(t).reduce((n,r)=>{const i=wk[r];return n[i||r]=t[r],n},e),jG=(t,e,n)=>{const r={key:e,[na]:!0},i=WB(n,r);return[q.createElement("title",i,e)]},yx=(t,e)=>e.map((n,r)=>{const i={key:r,[na]:!0};return Object.keys(n).forEach(s=>{const o=wk[s]||s;if(o==="innerHTML"||o==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[o]=n[s]}),q.createElement(t,i)}),es=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>jG(t,e.title,e.titleAttributes),toString:()=>DG(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>WB(e),toString:()=>HB(e)};default:return{toComponent:()=>yx(t,e),toString:()=>LG(t,e,n)}}},FG=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const i=$A(t,FA.meta),s=$A(e,FA.link),a=$A(n,FA.script);return{priorityMethods:{toComponent:()=>[...yx("meta",i.priority),...yx("link",s.priority),...yx("script",a.priority)],toString:()=>`${es("meta",i.priority,r)} ${es("link",s.priority,r)} ${es("script",a.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},BG=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:l,prioritizeSeoTags:c}=t;let{linkTags:h,metaTags:d,scriptTags:f}=t,p={toComponent:()=>[],toString:()=>""};return c&&({priorityMethods:p,linkTags:h,metaTags:d,scriptTags:f}=FG(t)),{priority:p,base:es("base",e,r),bodyAttributes:es("bodyAttributes",n,r),htmlAttributes:es("htmlAttributes",i,r),link:es("link",h,r),meta:es("meta",d,r),noscript:es("noscript",s,r),script:es("script",f,r),style:es("style",a,r),title:es("title",{title:o,titleAttributes:l},r)}},B_=BG,xb=[],RN=!!(typeof window<"u"&&window.document&&window.document.createElement),$_=class{constructor(t,e){F(this,"instances",[]);F(this,"canUseDOM",RN);F(this,"context");F(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?xb:this.instances,add:t=>{(this.canUseDOM?xb:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?xb:this.instances).indexOf(t);(this.canUseDOM?xb:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=B_({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},$G=parseInt(q.version.split(".")[0],10),U_=$G>=19,UG={},GB=q.createContext(UG),lh,qB=(lh=class extends A.Component{constructor(n){super(n);F(this,"helmetData");U_?this.helmetData=null:this.helmetData=new $_(this.props.context||{},lh.canUseDOM)}render(){return U_?q.createElement(q.Fragment,null,this.props.children):q.createElement(GB.Provider,{value:this.helmetData.value},this.props.children)}},F(lh,"canUseDOM",RN),lh),uf=(t,e)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${t}[${na}]`),i=[].slice.call(r),s=[];let a;return e&&e.length&&e.forEach(o=>{const l=document.createElement(t);for(const c in o)if(Object.prototype.hasOwnProperty.call(o,c))if(c==="innerHTML")l.innerHTML=o.innerHTML;else if(c==="cssText"){const h=o.cssText;l.appendChild(document.createTextNode(h))}else{const h=c,d=typeof o[h]>"u"?"":o[h];l.setAttribute(c,d)}l.setAttribute(na,"true"),i.some((c,h)=>(a=h,l.isEqualNode(c)))?i.splice(a,1):s.push(l)}),i.forEach(o=>{var l;return(l=o.parentNode)==null?void 0:l.removeChild(o)}),s.forEach(o=>n.appendChild(o)),{oldTags:i,newTags:s}},z_=(t,e)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const r=n.getAttribute(na),i=r?r.split(","):[],s=[...i],a=Object.keys(e);for(const o of a){const l=e[o]||"";n.getAttribute(o)!==l&&n.setAttribute(o,l),i.indexOf(o)===-1&&i.push(o);const c=s.indexOf(o);c!==-1&&s.splice(c,1)}for(let o=s.length-1;o>=0;o-=1)n.removeAttribute(s[o]);i.length===s.length?n.removeAttribute(na):n.getAttribute(na)!==a.join(",")&&n.setAttribute(na,a.join(","))},zG=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=VB(t)),z_("title",e)},MO=(t,e)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:l,scriptTags:c,styleTags:h,title:d,titleAttributes:f}=t;z_("body",r),z_("html",i),zG(d,f);const p={baseTag:uf("base",n),linkTags:uf("link",s),metaTags:uf("meta",a),noscriptTags:uf("noscript",o),scriptTags:uf("script",c),styleTags:uf("style",h)},m={},y={};
67Object.keys(p).forEach(x=>{const{newTags:v,oldTags:w}=p[x];v.length&&(m[x]=v),w.length&&(y[x]=p[x].oldTags)}),e&&e(),l(t,m,y)},Vg=null,VG=t=>{Vg&&cancelAnimationFrame(Vg),t.defer?Vg=requestAnimationFrame(()=>{MO(t,()=>{Vg=null})}):(MO(t),Vg=null)},HG=VG,DO=class extends A.Component{constructor(){super(...arguments);F(this,"rendered",!1)}shouldComponentUpdate(e){return!_G(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:n}=this.props.context;let r=null;const i=IG(e.get().map(s=>{const{context:a,...o}=s.props;return o}));qB.canUseDOM?HG(i):B_&&(r=B_(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},vx=[],LO=t=>{const e={};for(const n of Object.keys(t))e[zB[n]||n]=t[n];return e},Du=t=>{const e={};for(const n of Object.keys(t)){const r=wk[n];e[r||n]=t[n]}return e},jO=(t,e)=>{if(!RN)return;const n=document.getElementsByTagName(t)[0];if(!n)return;const r="data-rh-managed",i=n.getAttribute(r),s=i?i.split(","):[],a=Object.keys(e);for(const o of s)a.includes(o)||n.removeAttribute(o);for(const o of a){const l=e[o];l==null||l===!1?n.removeAttribute(o):l===!0?n.setAttribute(o,""):n.setAttribute(o,String(l))}a.length>0?n.setAttribute(r,a.join(",")):n.removeAttribute(r)},UA=()=>{const t={},e={};for(const n of vx){const{htmlAttributes:r,bodyAttributes:i}=n.props;r&&Object.assign(t,LO(r)),i&&Object.assign(e,LO(i))}jO("html",t),jO("body",e)},WG=class extends A.Component{componentDidMount(){vx.push(this),UA()}componentDidUpdate(){UA()}componentWillUnmount(){const t=vx.indexOf(this);t!==-1&&vx.splice(t,1),UA()}resolveTitle(){const{title:t,titleTemplate:e,defaultTitle:n}=this.props;return t&&e?e.replace(/%s/g,()=>Array.isArray(t)?t.join(""):t):t||n||void 0}renderTitle(){const t=this.resolveTitle();if(t===void 0)return null;const e=this.props.titleAttributes||{};return q.createElement("title",Du(e),t)}renderBase(){const{base:t}=this.props;return t?q.createElement("base",Du(t)):null}renderMeta(){const{meta:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>q.createElement("meta",{key:n,...Du(e)}))}renderLink(){const{link:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>q.createElement("link",{key:n,...Du(e)}))}renderScript(){const{script:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{innerHTML:r,...i}=e,s=Du(i);return r&&(s.dangerouslySetInnerHTML={__html:r}),q.createElement("script",{key:n,...s})})}renderStyle(){const{style:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{cssText:r,...i}=e,s=Du(i);return r&&(s.dangerouslySetInnerHTML={__html:r}),q.createElement("style",{key:n,...s})})}renderNoscript(){const{noscript:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{innerHTML:r,...i}=e,s=Du(i);return r&&(s.dangerouslySetInnerHTML={__html:r}),q.createElement("noscript",{key:n,...s})})}render(){return q.createElement(q.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},zE,GG=(zE=class extends A.Component{shouldComponentUpdate(t){return!SG(OO(this.props,"helmetData"),OO(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,n,r){return{...e,[t.type]:[...e[t.type]||[],{...n,...this.mapNestedChildrenToProps(t,r)}]}}mapObjectTypeChildren(t,e,n,r){switch(t.type){case"title":return{...e,[t.type]:r,titleAttributes:{...n}};case"body":return{...e,bodyAttributes:{...n}};case"html":return{...e,htmlAttributes:{...n}};default:return{...e,[t.type]:{...n}}}}mapArrayTypeChildrenToProps(t,e){let n={...e};return Object.keys(t).forEach(r=>{n={...n,[r]:t[r]}}),n}
67warnOnInvalidChildren(t,e){return RO(IO.some(n=>t.type===n),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${IO.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),RO(!e||typeof e=="string"||Array.isArray(e)&&!e.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let n={};return q.Children.forEach(t,r=>{if(!r||!r.props)return;const{children:i,...s}=r.props,a=Object.keys(s).reduce((l,c)=>(l[zB[c]||c]=s[c],l),{});let{type:o}=r;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(r,i),o){case"Symbol(react.fragment)":e=this.mapChildrenToProps(i,e);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,i);break;default:e=this.mapObjectTypeChildren(r,e,a,i);break}}),this.mapArrayTypeChildrenToProps(n,e)}render(){const{children:t,...e}=this.props;let n={...e},{helmetData:r}=e;if(t&&(n=this.mapChildrenToProps(t,n)),r&&!(r instanceof $_)){const i=r;r=new $_(i.context,!0),delete n.helmetData}return U_?q.createElement(WG,{...n}):r?q.createElement(DO,{...n,context:r.value}):q.createElement(GB.Consumer,null,i=>q.createElement(DO,{...n,context:i}))}},F(zE,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),zE);const qG=1,KG=1e6;let zA=0;function YG(){return zA=(zA+1)%Number.MAX_SAFE_INTEGER,zA.toString()}const VA=new Map,FO=t=>{if(VA.has(t))return;const e=setTimeout(()=>{VA.delete(t),Uy({type:"REMOVE_TOAST",toastId:t})},KG);VA.set(t,e)},XG=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,qG)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?FO(n):t.toasts.forEach(r=>{FO(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},wx=[];let bx={toasts:[]};function Uy(t){bx=XG(bx,t),wx.forEach(e=>{e(bx)})}function zy({...t}){const e=YG(),n=i=>Uy({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Uy({type:"DISMISS_TOAST",toastId:e});return Uy({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function Ag(){const[t,e]=A.useState(bx);return A.useEffect(()=>(wx.push(e),()=>{const n=wx.indexOf(e);n>-1&&wx.splice(n,1)}),[t]),{...t,toast:zy,dismiss:n=>Uy({type:"DISMISS_TOAST",toastId:n})}}function st(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function QG(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function KB(...t){return e=>t.forEach(n=>QG(n,e))}function Sn(...t){return A.useCallback(KB(...t),t)}function bk(t,e=[]){let n=[];function r(s,a){const o=A.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:f,children:p,...m}=d,y=(f==null?void 0:f[t][l])||o,x=A.useMemo(()=>m,Object.values(m));return g.jsx(y.Provider,{value:x,children:p})}function h(d,f){const p=(f==null?void 0:f[t][l])||o,m=A.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,h]}const i=()=>{const s=n.map(a=>A.createContext(a));return function(o){const l=(o==null?void 0:o[t])||s;return A.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,JG(i,...e)]}function JG(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...o,...d}},{});return A.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var og=A.forwardRef((t,e)=>{const{children:n,...r}=t,i=A.Children.toArray(n),s=i.find(ZG);if(s){const a=s.props.children,o=i.map(l=>l===s?A.Children.count(a)>1?A.Children.only(null):A.isValidElement(a)?a.props.children:null:l);return g.jsx(V_,{...r,ref:e,children:A.isValidElement(a)?A.cloneElement(a,void 0,o):null})}return g.jsx(V_,{...r,ref:e,children:n})});og.displayName="Slot";var V_=A.forwardRef((t,e)=>{const{children:n,...r}=t;if(A.isValidElement(n)){const i=t9(n);return A.cloneElement(n,{...e9(r,n.props),ref:e?KB(e,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});V_.displayName="SlotClone";var YB=({children:t})=>g.jsx(g.Fragment,{children:t});function ZG(t){return A.isValidElement(t)&&t.type===YB}function e9(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}
vendor: 4,591 bytes, line 67
67:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function t9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function n9(t){const e=t+"CollectionProvider",[n,r]=bk(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:y}=p,x=q.useRef(null),v=q.useRef(new Map).current;return g.jsx(i,{scope:m,itemMap:v,collectionRef:x,children:y})};a.displayName=e;const o=t+"CollectionSlot",l=q.forwardRef((p,m)=>{const{scope:y,children:x}=p,v=s(o,y),w=Sn(m,v.collectionRef);return g.jsx(og,{ref:w,children:x})});l.displayName=o;const c=t+"CollectionItemSlot",h="data-radix-collection-item",d=q.forwardRef((p,m)=>{const{scope:y,children:x,...v}=p,w=q.useRef(null),b=Sn(m,w),k=s(c,y);return q.useEffect(()=>(k.itemMap.set(w,{ref:w,...v}),()=>void k.itemMap.delete(w))),g.jsx(og,{[h]:"",ref:b,children:x})});d.displayName=c;function f(p){const m=s(t+"CollectionConsumer",p);return q.useCallback(()=>{const x=m.collectionRef.current;if(!x)return[];const v=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(m.itemMap.values()).sort((k,_)=>v.indexOf(k.ref.current)-v.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}var r9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],St=r9.reduce((t,e)=>{const n=A.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?og:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function IN(t,e){t&&Sg.flushSync(()=>t.dispatchEvent(e))}function ai(t){const e=A.useRef(t);return A.useEffect(()=>{e.current=t}),A.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function XB(t,e=globalThis==null?void 0:globalThis.document){const n=ai(t);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var i9="DismissableLayer",H_="dismissableLayer.update",s9="dismissableLayer.pointerDownOutside",a9="dismissableLayer.focusOutside",BO,QB=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),JB=A.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=t,c=A.useContext(QB),[h,d]=A.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=A.useState({}),m=Sn(e,P=>d(P)),y=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),w=h?y.indexOf(h):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,k=w>=v,_=l9(P=>{const R=P.target,O=[...c.branches].some(M=>M.contains(R));!k||O||(i==null||i(P),a==null||a(P),P.defaultPrevented||o==null||o())},f),C=c9(P=>{const R=P.target;[...c.branches].some(M=>M.contains(R))||(s==null||s(P),a==null||a(P),P.defaultPrevented||o==null||o())},f);return XB(P=>{w===c.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&o&&(P.preventDefault(),o()))},f),A.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(BO=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),$O(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=BO)}},[h,f,n,c]),A.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),$O())},[h,c]),A.useEffect(()=>{const P=()=>p({});return document.addEventListener(H_,P),()=>document.removeEventListener(H_,P)},[]),g.jsx(St.div,{...l,ref:m,style:{pointerEvents:b?k?"auto":"none":void 0,...t.style},onFocusCapture:st(t.onFocusCapture,C.onFocusCapture),onBlurCapture:st(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:st(t.onPointerDownCapture,_.onPointerDownCapture)})});JB.displayName=i9;var o9="DismissableLayerBranch",ZB=A.forwardRef((t,e)=>{const n=A.useContext(QB),r=A.useRef(null),i=Sn(e,r);return A.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(St.div,{...t,ref:i})});ZB.displayName=o9;function l9(t,e=globalThis==null?void 0:globalThis.document){const n=ai(t),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const s=o=>
67{if(o.target&&!r.current){let l=function(){e$(s9,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function c9(t,e=globalThis==null?void 0:globalThis.document){const n=ai(t),r=A.useRef(!1);return A.useEffect(()=>{const i=s=>{s.target&&!r.current&&e$(a9,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $O(){const t=new CustomEvent(H_);document.dispatchEvent(t)}function e$(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?IN(i,s):i.dispatchEvent(s)}var u9=JB,h9=ZB,qi=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{},d9="Portal",t$=A.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,s]=A.useState(!1);qi(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?TN.createPortal(g.jsx(St.div,{...r,ref:e}),a):null});t$.displayName=d9;function f9(t,e){return A.useReducer((n,r)=>e[n][r]??n,t)}var ON=t=>{const{present:e,children:n}=t,r=p9(e),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),s=Sn(r.ref,m9(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:s}):null};ON.displayName="Presence";function p9(t){const[e,n]=A.useState(),r=A.useRef({}),i=A.useRef(t),s=A.useRef("none"),a=t?"mounted":"unmounted",[o,l]=f9(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=Sb(r.current);s.current=o==="mounted"?c:"none"},[o]),qi(()=>{const c=r.current,h=i.current;if(h!==t){const f=s.current,p=Sb(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),qi(()=>{if(e){const c=d=>{const p=Sb(r.current).includes(d.animationName);d.target===e&&p&&Sg.flushSync(()=>l("ANIMATION_END"))},h=d=>{d.target===e&&(s.current=Sb(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Sb(t){return(t==null?void 0:t.animationName)||"none"}function m9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function MN({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=g9({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,o=ai(n),l=A.useCallback(c=>{if(s){const d=typeof c=="function"?c(t):c;d!==t&&o(d)}else i(c)},[s,t,i,o]);return[a,l]}function g9({defaultProp:t,onChange:e}){const n=A.useState(t),[r]=n,i=A.useRef(r),s=ai(e);return A.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var y9="VisuallyHidden",xk=A.forwardRef((t,e)=>g.jsx(St.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));xk.displayName=y9;var v9=xk,DN="ToastProvider",[LN,w9,b9]=n9("Toast"),[n$,xpe]=bk("Toast",[b9]),[x9,Sk]=n$(DN),r$=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=t,[o,l]=A.useState(null),[c,h]=A.useState(0),d=A.useRef(!1),f=A.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${DN}\`. Expected non-empty \`string\`.`),g.jsx(LN.Provider,{scope:e,children:g.jsx(x9,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:o,onViewportChange:l,onToastAdd:A.useCallback(()=>h(p=>p+1),[]),onToastRemove:A.useCallback(()=>h(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};r$.displayName=DN;var i$="ToastViewport",S9=["F8"],W_="toast.viewportPause",G_="toast.viewportResume",s$=A.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=S9,label:i="Notifications ({hotkey})",...s}=t,a=Sk(i$,n),o=w9(n),l=A.useRef(null),c=A.useRef(null),h=A.useRef(null),d=A.useRef(null),f=Sn(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;A.useEffect(()=>{const x=v=>{var b;r.every(k=>
67v[k]||v.code===k)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),A.useEffect(()=>{const x=l.current,v=d.current;if(m&&x&&v){const w=()=>{if(!a.isClosePausedRef.current){const C=new CustomEvent(W_);v.dispatchEvent(C),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const C=new CustomEvent(G_);v.dispatchEvent(C),a.isClosePausedRef.current=!1}},k=C=>{!x.contains(C.relatedTarget)&&b()},_=()=>{x.contains(document.activeElement)||b()};return x.addEventListener("focusin",w),x.addEventListener("focusout",k),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",_),window.addEventListener("blur",w),window.addEventListener("focus",b),()=>{x.removeEventListener("focusin",w),x.removeEventListener("focusout",k),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",_),window.removeEventListener("blur",w),window.removeEventListener("focus",b)}}},[m,a.isClosePausedRef]);const y=A.useCallback(({tabbingDirection:x})=>{const w=o().map(b=>{const k=b.ref.current,_=[k,...D9(k)];return x==="forwards"?_:_.reverse()});return(x==="forwards"?w.reverse():w).flat()},[o]);return A.useEffect(()=>{const x=d.current;if(x){const v=w=>{var _,C,P;const b=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!b){const R=document.activeElement,O=w.shiftKey;if(w.target===x&&O){(_=c.current)==null||_.focus();return}const j=y({tabbingDirection:O?"backwards":"forwards"}),U=j.findIndex(B=>B===R);HA(j.slice(U+1))?w.preventDefault():O?(C=c.current)==null||C.focus():(P=h.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[o,y]),g.jsxs(h9,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&g.jsx(q_,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});
67HA(x)}}),g.jsx(LN.Slot,{scope:n,children:g.jsx(St.ol,{tabIndex:-1,...s,ref:f})}),m&&g.jsx(q_,{ref:h,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});HA(x)}})]})});s$.displayName=i$;var a$="ToastFocusProxy",q_=A.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=Sk(a$,n);return g.jsx(xk,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const o=a.relatedTarget;!((c=s.viewport)!=null&&c.contains(o))&&r()}})});q_.displayName=a$;var kk="Toast",k9="toast.swipeStart",A9="toast.swipeMove",E9="toast.swipeCancel",_9="toast.swipeEnd",o$=A.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}=t,[o=!0,l]=MN({prop:r,defaultProp:i,onChange:s});return g.jsx(ON,{present:n||o,children:g.jsx(P9,{open:o,...a,ref:e,onClose:()=>l(!1),onPause:ai(t.onPause),onResume:ai(t.onResume),onSwipeStart:st(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:st(t.onSwipeMove,c=>{const{x:h,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:st(t.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:st(t.onSwipeEnd,c=>{const{x:h,y:d}=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",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});o$.displayName=kk;var[C9,T9]=n$(kk,{onClose(){}}),P9=A.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:c,onSwipeStart:h,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=t,y=Sk(kk,n),[x,v]=A.useState(null),w=Sn(e,B=>v(B)),b=A.useRef(null),k=A.useRef(null),_=i||y.duration,C=A.useRef(0),P=A.useRef(_),R=A.useRef(0),{onToastAdd:O,onToastRemove:M}=y,D=ai(()=>{var z;(x==null?void 0:x.contains(document.activeElement))&&((z=y.viewport)==null||z.focus()),a()}),j=A.useCallback(B=>{!B||B===1/0||(window.clearTimeout(R.current),C.current=new Date().getTime(),R.current=window.setTimeout(D,B))},[D]);A.useEffect(()=>{const B=y.viewport;if(B){const z=()=>{j(P.current),c==null||c()},$=()=>{const W=new Date().getTime()-C.current;P.current=P.current-W,window.clearTimeout(R.current),l==null||l()};return B.addEventListener(W_,$),B.addEventListener(G_,z),()=>{B.removeEventListener(W_,$),B.removeEventListener(G_,z)}}},[y.viewport,_,l,c,j]),A.useEffect(()=>{s&&!y.isClosePausedRef.current&&j(_)},[s,_,y.isClosePausedRef,j]),A.useEffect(()=>(O(),()=>M()),[O,M]);const U=A.useMemo(()=>x?p$(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[U&&g.jsx(N9,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),g.jsx(C9,{scope:n,onClose:D,children:Sg.createPortal(g.jsx(LN.ItemSlot,{scope:n,children:g.jsx(u9,{asChild:!0,onEscapeKeyDown:st(o,()=>{y.isFocusedToastEscapeKeyDownRef.current||D(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(St.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":y.swipeDirection,...m,ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:st(t.onKeyDown,B=>{B.key==="Escape"&&(o==null||o(B.nativeEvent),B.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:st(t.onPointerDown,B=>{B.button===0&&(b.current={x:B.clientX,y:B.clientY})}),onPointerMove:st(t.onPointerMove,B=>{if(!b.current)return;const z=B.clientX-b.current.x,$=B.clientY-b.current.y,W=!!k.current,L=["left","right"].includes(y.swipeDirection),V=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,N=L?V(0,z):0,G=L?0:V(0,$),Y=B.pointerType==="touch"?10:2,I={x:N,y:G},we={originalEvent:B,delta:I};W?(k.current=I,kb(A9,d,we,{discrete:!1})):UO(I,y.swipeDirection,Y)?(k.current=I,kb(k9,h,we,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(z)>Y||Math.abs($)>Y)&&(b.current=null)}),onPointerUp:st(t.onPointerUp,B=>{const z=k.current,$=B.target;if($.hasPointerCapture(B.pointerId)&&$.releasePointerCapture(B.pointerId),k.current=null,b.current=null,z){const W=B.currentTarget,L={originalEvent:B,delta:z};UO(z,y.swipeDirection,y.swipeThreshold)?kb(_9,p,L,{discrete:!0}):kb(E9,f,L,{discrete:!0}),W.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),N9=t=>{const{__scopeToast:e,children:n,...r}=t,i=Sk(kk,e),[s,a]=A.useState(!1),[o,l]=A.useState(!1);return O9(()=>a(!0)),A.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),o?null:g.jsx(t$,{asChild:!0,children:g.jsx(xk,{...r,children:s&&g.jsxs(g.Fragment,{children:[i.label," ",n]})})})},R9="ToastTitle",l$=A.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return g.jsx(St.div,{...r,ref:e})});l$.displayName=R9;var I9="ToastDescription",c$=A.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return g.jsx(St.div,{...r,ref:e})});c$.displayName=I9;var u$="ToastAction",h$=A.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?g.jsx(f$,{altText:n,asChild:!0,children:g.jsx(jN,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${u$}\`. Expected non-empty \`string\`.`),null)});h$.displayName=u$;var d$="ToastClose",jN=A.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=T9(d$,n);return g.jsx(f$,{asChild:!0,children:g.jsx(St.button,{type:"button",...r,ref:e,onClick:st(t.onClick,i.onClose)})})});jN.displayName=d$;var f$=A.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return g.jsx(St.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function p$(t){const e=[];
vendor: 8,904 bytes, lines 67-161
67return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),M9(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...p$(r))}}),e}function kb(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?IN(i,s):i.dispatchEvent(s)}var UO=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function O9(t=()=>{}){const e=ai(t);qi(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function M9(t){return t.nodeType===t.ELEMENT_NODE}function D9(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function HA(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var L9=r$,m$=s$,g$=o$,y$=l$,v$=c$,w$=h$,b$=jN;function x$(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=x$(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function S$(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=x$(t))&&(r&&(r+=" "),r+=e);return r}const zO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,VO=S$,Ak=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return VO(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(c=>{const h=n==null?void 0:n[c],d=s==null?void 0:s[c];if(h===null)return null;const f=zO(h)||zO(d);return i[c][f]}),o=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...p}=h;return Object.entries(p).every(m=>{let[y,x]=m;return Array.isArray(x)?x.includes({...s,...o}[y]):{...s,...o}[y]===x})?[...c,d,f]:c},[]);return VO(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
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 j9=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),k$=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
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 */var F9={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"};/**
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 B9=A.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>A.createElement("svg",{ref:l,...F9,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:k$("lucide",i),...o},[...a.map(([c,h])=>A.createElement(c,h)),...Array.isArray(s)?s:[s]]));/**
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 ze=(t,e)=>{const n=A.forwardRef(({className:r,...i},s)=>A.createElement(B9,{ref:s,iconNode:e,className:k$(`lucide-${j9(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
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 A$=ze("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 oo=ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 $9=ze("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"}]]);/**
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 E$=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 U9=ze("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 z9=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 _$=ze("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 V9=ze("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
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 C$=ze("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"}]]);/**
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 FN=ze("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"}]]);/**
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 H9=ze("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"}]]);/**
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 T$=ze("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"}]]);/**
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 Ek=ze("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"}]]);/**
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 W9=ze("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"}]]);/**
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 G9=ze("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"}]]);/**
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 q9=ze("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
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 P$=ze("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
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 bl=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 HO=ze("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
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 K9=ze("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"}]]);/**
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 N$=ze("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"}]]);/**
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 Y9=ze("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
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 X9=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Q9=ze("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
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 J9=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Z9=ze("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"}]]);/**
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 eq=ze("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
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 tq=ze("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"}]]);/**
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 nq=ze("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
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 rq=ze("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
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 K_=ze("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"}]]);/**
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 iq=ze("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"}]]);/**
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 R$=ze("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"}]]);/**
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 lg=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 7,489 bytes, line 257
257],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),BN="-",sq=t=>{const e=oq(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(BN);return o[0]===""&&o.length!==1&&o.shift(),I$(o,e)||aq(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},I$=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?I$(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(BN);return(a=e.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},WO=/^\[(.+)\]$/,aq=t=>{if(WO.test(t)){const e=WO.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},oq=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return cq(Object.entries(t.classGroups),n).forEach(([s,a])=>{Y_(a,r,s,e)}),r},Y_=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:GO(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(lq(i)){Y_(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Y_(a,GO(e,s),n,r)})})},GO=(t,e)=>{let n=t;return e.split(BN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lq=t=>t.isThemeGetter,cq=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[e+a,o])):s);return[n,i]}):t,uq=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},O$="!",hq=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,a=o=>{const l=[];let c=0,h=0,d;for(let x=0;x<o.length;x++){let v=o[x];if(c===0){if(v===i&&(r||o.slice(x,x+s)===e)){l.push(o.slice(h,x)),h=x+s;continue}if(v==="/"){d=x;continue}}v==="["?c++:v==="]"&&c--}const f=l.length===0?o:o.substring(h),p=f.startsWith(O$),m=p?f.substring(1):f,y=d&&d>h?d-h:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?o=>n({className:o,parseClassName:a}):a},dq=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},fq=t=>({cache:uq(t.cacheSize),parseClassName:hq(t),...sq(t)}),pq=/\s+/,mq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(pq);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let m=!!p,y=r(m?f.substring(0,p):f);if(!y){if(!m){o=c+(o.length>0?" "+o:o);continue}if(y=r(f),!y){o=c+(o.length>0?" "+o:o);continue}m=!1}const x=dq(h).join(":"),v=d?x+O$:x,w=v+y;if(s.includes(w))continue;s.push(w);const b=i(y,m);for(let k=0;k<b.length;++k){const _=b[k];s.push(v+_)}o=c+(o.length>0?" "+o:o)}return o};function gq(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=M$(e))&&(r&&(r+=" "),r+=n);return r}const M$=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=M$(t[r]))&&(n&&(n+=" "),n+=e);return n};function yq(t,...e){let n,r,i,s=a;function a(l){const c=e.reduce((h,d)=>d(h),t());return n=fq(c),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const c=r(l);if(c)return c;const h=mq(l,n);return i(l,h),h}return function(){return s(gq.apply(null,arguments))}}const At=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},D$=/^\[(?:([a-z-]+):)?(.+)\]$/i,vq=/^\d+\/\d+$/,wq=new Set(["px","full","screen"]),bq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xq=/\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$/,Sq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,kq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Aq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xo=t=>hp(t)||wq.has(t)||vq.test(t),jl=t=>Eg(t,"length",Iq),hp=t=>!!t&&!Number.isNaN(Number(t)),WA=t=>Eg(t,"number",hp),Hg=t=>!!t&&Number.isInteger(Number(t)),Eq=t=>t.endsWith("%")&&hp(t.slice(0,-1)),Pe=t=>D$.test(t),Fl=t=>bq.test(t),_q=new Set(["length","size","percentage"]),Cq=t=>Eg(t,_q,L$),Tq=t=>Eg(t,"position",L$),Pq=new Set(["image","url"]),Nq=t=>Eg(t,Pq,Mq),Rq=t=>Eg(t,"",Oq),Wg=()=>!0,Eg=(t,e,n)=>{const r=D$.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Iq=t=>xq.test(t)&&!Sq.test(t),L$=()=>!1,Oq=t=>kq.test(t),Mq=t=>Aq.test(t),Dq=()=>{const t=At("colors"),e=At("spacing"),n=At("blur"),r=At("brightness"),i=At("borderColor"),s=At("borderRadius"),a=At("borderSpacing"),o=At("borderWidth"),l=At("contrast"),c=At("grayscale"),h=At("hueRotate"),d=At("invert"),f=At("gap"),p=At("gradientColorStops"),m=At("gradientColorStopPositions"),y=At("inset"),x=At("margin"),v=At("opacity"),w=At("padding"),b=At("saturate"),k=At("scale"),_=At("sepia"),C=At("skew"),P=At("space"),R=At("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",Pe,e],j=()=>[Pe,e],U=()=>["",xo,jl],B=()=>["auto",hp,Pe],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["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"],L=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",Pe],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[hp,Pe];return{cacheSize:500,separator:":",theme:{colors:[Wg],spacing:[xo,jl],blur:["none","",Fl,Pe],brightness:G(),borderColor:[t],borderRadius:["none","","full",Fl,Pe],borderSpacing:j(),borderWidth:U(),contrast:G(),grayscale:V(),hueRotate:G(),invert:V(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[Eq,jl],inset:D(),margin:D(),opacity:G(),padding:j(),saturate:G(),scale:G(),sepia:V(),skew:G(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[Fl]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:[...z(),Pe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}
vendor: 9,874 bytes, line 257
257],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Hg,Pe]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Hg,Pe]}],"grid-cols":[{"grid-cols":[Wg]}],"col-start-end":[{col:["auto",{span:["full",Hg,Pe]},Pe]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Wg]}],"row-start-end":[{row:["auto",{span:[Hg,Pe]},Pe]}],"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",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"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:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,e]}],"min-w":[{"min-w":[Pe,e,"min","max","fit"]}],"max-w":[{"max-w":[Pe,e,"none","full","min","max","fit","prose",{screen:[Fl]},Fl]}],h:[{h:[Pe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Fl,jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",WA]}],"font-family":[{font:[Wg]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",hp,WA]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xo,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xo,jl]}],"underline-offset":[{"underline-offset":["auto",xo,Pe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],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",Pe]}],"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:[...z(),Tq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Cq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Nq]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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:[...$(),"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:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[xo,Pe]}],"outline-w":[{outline:[xo,jl]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[xo,jl]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Fl,Rq]}],"shadow-color":[{shadow:[Wg]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Fl,Pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",Pe]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Hg,Pe]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",t]}],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",Pe]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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,613 bytes, line 257
257],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",Pe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[xo,jl,WA]}],stroke:[{stroke:[t,"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-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"]}}},Lq=yq(Dq);function Ue(...t){return Lq(S$(t))}const jq=L9,j$=A.forwardRef(({className:t,...e},n)=>g.jsx(m$,{ref:n,className:Ue("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]",t),...e}));j$.displayName=m$.displayName;const Fq=Ak("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"}}),F$=A.forwardRef(({className:t,variant:e,...n},r)=>g.jsx(g$,{ref:r,className:Ue(Fq({variant:e}),t),...n}));F$.displayName=g$.displayName;const Bq=A.forwardRef(({className:t,...e},n)=>g.jsx(w$,{ref:n,className:Ue("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));Bq.displayName=w$.displayName;const B$=A.forwardRef(({className:t,...e},n)=>g.jsx(b$,{ref:n,className:Ue("absolute right-2 top-2 rounded-md p-1 text-foreground
257/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:g.jsx(lg,{className:"h-4 w-4"})}));B$.displayName=b$.displayName;const $$=A.forwardRef(({className:t,...e},n)=>g.jsx(y$,{ref:n,className:Ue("text-sm font-semibold",t),...e}));$$.displayName=y$.displayName;const U$=A.forwardRef(({className:t,...e},n)=>g.jsx(v$,{ref:n,className:Ue("text-sm opacity-90",t),...e}));U$.displayName=v$.displayName;function $q(){const{toasts:t}=Ag();return g.jsxs(jq,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return g.jsxs(F$,{...s,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx($$,{children:n}),r&&g.jsx(U$,{children:r})]}),i,g.jsx(B$,{})]},e)}),g.jsx(j$,{})]})}var qO=["light","dark"],Uq="(prefers-color-scheme: dark)",zq=A.createContext(void 0),Vq={setTheme:t=>{},themes:[]},Hq=()=>{var t;return(t=A.useContext(zq))!=null?t:Vq};A.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:l})=>{let c=s==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?qO.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(m,y=!1,x=!0)=>{let v=a?a[m]:m,w=y?m+"|| ''":`'${v}'`,b="";return i&&x&&!y&&qO.includes(m)&&(b+=`d.style.colorScheme = '${m}';`),n==="class"?y||v?b+=`c.add(${w})`:b+="null":v&&(b+=`d[s](n,${w})`),b},p=t?`!function(){${h}${f(t)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${Uq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${d}}catch(t){}}();`;return A.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var Wq=t=>{switch(t){case"success":return Kq;case"info":return Xq;case"warning":return Yq;case"error":return Qq;default:return null}},Gq=Array(12).fill(0),qq=({visible:t})=>q.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},q.createElement("div",{className:"sonner-spinner"},Gq.map((e,n)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Kq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Yq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.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"})),Xq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Qq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Jq=()=>{let[t,e]=q.useState(document.hidden);return q.useEffect(()=>{let n=()=>{e(document.hidden)};
257return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},X_=1,Zq=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:X_++,s=this.toasts.find(o=>o.id===i),a=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(o=>o.id===i?(this.publish({...o,...t,id:i,title:n}),{...o,...t,id:i,dismissible:a,title:n}):o):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0;return r.then(async s=>{if(tK(s)&&!s.ok){i=!1;let a=typeof e.error=="function"?await e.error(`HTTP error! status: ${s.status}`):e.error,o=typeof e.description=="function"?await e.description(`HTTP error! status: ${s.status}`):e.description;this.create({id:n,type:"error",message:a,description:o})}else if(e.success!==void 0){i=!1;let a=typeof e.success=="function"?await e.success(s):e.success,o=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"success",message:a,description:o})}}).catch(async s=>{if(e.error!==void 0){i=!1;let a=typeof e.error=="function"?await e.error(s):e.error,o=typeof e.description=="function"?await e.description(s):e.description;this.create({id:n,type:"error",message:a,description:o})}}).finally(()=>{var s;i&&(this.dismiss(n),n=void 0),(s=e.finally)==null||s.call(e)}),n},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||X_++;return this.create({jsx:t(n),id:n,...e}),n},this.subscribers=[],this.toasts=[]}},Oi=new Zq,eK=(t,e)=>{let n=(e==null?void 0:e.id)||X_++;return Oi.addToast({title:t,...e,id:n}),n},tK=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",nK=eK,rK=()=>Oi.toasts;Object.assign(nK,{success:Oi.success,info:Oi.info,warning:Oi.warning,error:Oi.error,custom:Oi.custom,message:Oi.message,promise:Oi.promise,dismiss:Oi.dismiss,loading:Oi.loading},{getHistory:rK});function iK(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}iK(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;
257left: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;background:var(--gray1);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}: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:0;right:0;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}
257: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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%);--error-text: hsl(358, 100%, 81%)}[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%)}
258`);function Ab(t){return t.label!==void 0}var sK=3,aK="32px",oK=4e3,lK=356,cK=14,uK=20,hK=200;function dK(...t){return t.filter(Boolean).join(" ")}var fK=t=>{var e,n,r,i,s,a,o,l,c,h;let{invert:d,toast:f,unstyled:p,interacting:m,setHeights:y,visibleToasts:x,heights:v,index:w,toasts:b,expanded:k,removeToast:_,defaultRichColors:C,closeButton:P,style:R,cancelButtonStyle:O,actionButtonStyle:M,className:D="",descriptionClassName:j="",duration:U,position:B,gap:z,loadingIcon:$,expandByDefault:W,classNames:L,icons:V,
258closeButtonAriaLabel:N="Close toast",pauseWhenPageIsHidden:G,cn:Y}=t,[I,we]=q.useState(!1),[Oe,oe]=q.useState(!1),[he,rn]=q.useState(!1),[kn,sn]=q.useState(!1),[wr,Br]=q.useState(0),[$r,Ts]=q.useState(0),me=q.useRef(null),Me=q.useRef(null),De=w===0,Rt=w+1<=x,be=f.type,It=f.dismissible!==!1,Ur=f.className||"",Rn=f.descriptionClassName||"",li=q.useMemo(()=>v.findIndex(fe=>fe.toastId===f.id)||0,[v,f.id]),lf=q.useMemo(()=>{var fe;return(fe=f.closeButton)!=null?fe:P},[f.closeButton,P]),nb=q.useMemo(()=>f.duration||U||oK,[f.duration,U]),H=q.useRef(0),Z=q.useRef(0),ve=q.useRef(0),Ce=q.useRef(null),[Qe,ci]=B.split("-"),ma=q.useMemo(()=>v.reduce((fe,kt,mt)=>mt>=li?fe:fe+kt.height,0),[v,li]),Qi=Jq(),Mu=f.invert||d,bo=be==="loading";Z.current=q.useMemo(()=>li*z+ma,[li,ma]),q.useEffect(()=>{we(!0)},[]),q.useLayoutEffect(()=>{if(!I)return;let fe=Me.current,kt=fe.style.height;fe.style.height="auto";let mt=fe.getBoundingClientRect().height;fe.style.height=kt,Ts(mt),y(ga=>ga.find(ya=>ya.toastId===f.id)?ga.map(ya=>ya.toastId===f.id?{...ya,height:mt}:ya):[{toastId:f.id,height:mt,position:f.position},...ga])},[I,f.title,f.description,y,f.id]);let qt=q.useCallback(()=>{oe(!0),Br(Z.current),y(fe=>fe.filter(kt=>kt.toastId!==f.id)),setTimeout(()=>{_(f)},hK)},[f,_,y,Z]);q.useEffect(()=>{if(f.promise&&be==="loading"||f.duration===1/0||f.type==="loading")return;let fe,kt=nb;return k||m||G&&Qi?(()=>{if(ve.current<H.current){let mt=new Date().getTime()-H.current;kt=kt-mt}ve.current=new Date().getTime()})():kt!==1/0&&(H.current=new Date().getTime(),fe=setTimeout(()=>{var mt;(mt=f.onAutoClose)==null||mt.call(f,f),qt()},kt)),()=>clearTimeout(fe)},[k,m,W,f,nb,qt,f.promise,be,G,Qi]),q.useEffect(()=>{let fe=Me.current;if(fe){let kt=fe.getBoundingClientRect().height;return Ts(kt),y(mt=>[{toastId:f.id,height:kt,position:f.position},...mt]),()=>y(mt=>mt.filter(ga=>ga.toastId!==f.id))}},[y,f.id]),q.useEffect(()=>{f.delete&&qt()},[qt,f.delete]);function Dl(){return V!=null&&V.loading?q.createElement("div",{className:"sonner-loader","data-visible":be==="loading"},V.loading):$?q.createElement("div",{className:"sonner-loader","data-visible":be==="loading"},$):q.createElement(qq,{visible:be==="loading"})}return q.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Me,className:Y(D,Ur,L==null?void 0:L.toast,(e=f==null?void 0:f.classNames)==null?void 0:e.toast,L==null?void 0:L.default,L==null?void 0:L[be],(n=f==null?void 0:f.classNames)==null?void 0:n[be]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:C,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":I,"data-promise":!!f.promise,"data-removed":Oe,"data-visible":Rt,"data-y-position":Qe,"data-x-position":ci,"data-index":w,"data-front":De,"data-swiping":he,"data-dismissible":It,"data-type":be,"data-invert":Mu,"data-swipe-out":kn,"data-expanded":!!(k||W&&I),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${Oe?wr:Z.current}px`,"--initial-height":W?"auto":`${$r}px`,...R,...f.style},onPointerDown:fe=>{bo||!It||(me.current=new Date,Br(Z.current),fe.target.setPointerCapture(fe.pointerId),fe.target.tagName!=="BUTTON"&&(rn(!0),Ce.current={x:fe.clientX,y:fe.clientY}))},onPointerUp:()=>{var fe,kt,mt,ga;if(kn||!It)return;Ce.current=null;let ya=Number(((fe=Me.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount").replace("px",""))||0),rb=new Date().getTime()-((kt=me.current)==null?void 0:kt.getTime()),HH=Math.abs(ya)/rb;if(Math.abs(ya)>=uK||HH>.11){Br(Z.current),(mt=f.onDismiss)==null||mt.call(f,f),qt(),sn(!0);return}(ga=Me.current)==null||ga.style.setProperty("--swipe-amount","0px"),rn(!1)},onPointerMove:fe=>{var kt;if(!Ce.current||!It)return;let mt=fe.clientY-Ce.current.y,ga=fe.clientX-Ce.current.x,ya=(Qe==="top"?Math.min:Math.max)(0,mt),rb=fe.pointerType==="touch"?10:2;Math.abs(ya)>rb?(kt=Me.current)==null||kt.style.setProperty("--swipe-amount",`${mt}px`):Math.abs(ga)>rb&&(Ce.current=null)}},lf&&!f.jsx?q.createElement("button",{"aria-label":N,"data-disabled":bo,"data-close-button":!0,onClick:bo||!It?()=>{}:()=>{var fe;qt(),(fe=f.onDismiss)==null||fe.call(f,f)},className:Y(L==null?void 0:L.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},q.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"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||q.isValidElement(f.title)?f.jsx||f.title:q.createElement(q.Fragment,null,be||f.icon||f.promise?q.createElement("div",{"data-icon":"",className:Y(L==null?void 0:L.icon,(s=f==null?void 0:f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Dl():null,f.type!=="loading"?f.icon||(V==null?void 0:V[be])||Wq(be):null):null,q.createElement("div",{"data-content":"",className:Y(L==null?void 0:L.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},q.createElement("div",{"data-title":"",className:Y(L==null?void 0:L.title,(o=f==null?void 0:f.classNames)==null?void 0:o.title)},f.title),f.description?q.createElement("div",{"data-description":"",className:Y(j,Rn,L==null?void 0:L.description,(l=f==null?void 0:f.classNames)==null?void 0:l.description)},f.description):null),q.isValidElement(f.cancel)?f.cancel:f.cancel&&Ab(f.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||O,onClick:fe=>{var kt,mt;Ab(f.cancel)&&It&&((mt=(kt=f.cancel).onClick)==null||mt.call(kt,fe),qt())},className:Y(L==null?void 0:L.cancelButton,(c=f==null?void 0:f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,q.isValidElement(f.action)?f.action:f.action&&Ab(f.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||M,onClick:fe=>{var kt,mt;Ab(f.action)&&(fe.defaultPrevented||((mt=(kt=f.action).onClick)==null||mt.call(kt,fe),qt()))},className:Y(L==null?void 0:L.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function KO(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var pK=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:o,theme:l="light",richColors:c,duration:h,style:d,visibleToasts:f=sK,toastOptions:p,dir:m=KO(),gap:y=cK,loadingIcon:x,icons:v,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:b,cn:k=dK}=t,[_,C]=q.useState([]),P=q.useMemo(()=>Array.from(new Set([n].concat(_.filter(G=>G.position).map(G=>G.position)))),[_,n]),[R,O]=q.useState([]),[M,D]=q.useState(!1),[j,U]=q.useState(!1),[B,z]=q.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
258k":"light"),$=q.useRef(null),W=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=q.useRef(null),V=q.useRef(!1),N=q.useCallback(G=>{var Y;(Y=_.find(I=>I.id===G.id))!=null&&Y.delete||Oi.dismiss(G.id),C(I=>I.filter(({id:we})=>we!==G.id))},[_]);return q.useEffect(()=>Oi.subscribe(G=>{if(G.dismiss){C(Y=>Y.map(I=>I.id===G.id?{...I,delete:!0}:I));return}setTimeout(()=>{TN.flushSync(()=>{C(Y=>{let I=Y.findIndex(we=>we.id===G.id);return I!==-1?[...Y.slice(0,I),{...Y[I],...G},...Y.slice(I+1)]:[G,...Y]})})})}),[]),q.useEffect(()=>{if(l!=="system"){z(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:G})=>{z(G?"dark":"light")})},[l]),q.useEffect(()=>{_.length<=1&&D(!1)},[_]),q.useEffect(()=>{let G=Y=>{var I,we;r.every(Oe=>Y[Oe]||Y.code===Oe)&&(D(!0),(I=$.current)==null||I.focus()),Y.code==="Escape"&&(document.activeElement===$.current||(we=$.current)!=null&&we.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[r]),q.useEffect(()=>{if($.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,V.current=!1)}},[$.current]),_.length?q.createElement("section",{"aria-label":`${w} ${W}`,tabIndex:-1},P.map((G,Y)=>{var I;let[we,Oe]=G.split("-");return q.createElement("ol",{key:G,dir:m==="auto"?KO():m,tabIndex:-1,ref:$,className:a,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":we,"data-x-position":Oe,style:{"--front-toast-height":`${((I=R[0])==null?void 0:I.height)||0}px`,"--offset":typeof o=="number"?`${o}px`:o||aK,"--width":`${lK}px`,"--gap":`${y}px`,...d},onBlur:oe=>{V.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(V.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||V.current||(V.current=!0,L.current=oe.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{j||D(!1)},onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},_.filter(oe=>!oe.position&&Y===0||oe.position===G).map((oe,he)=>{var rn,kn;return q.createElement(fK,{key:oe.id,icons:v,index:he,toast:oe,defaultRichColors:c,duration:(rn=p==null?void 0:p.duration)!=null?rn:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:e,visibleToasts:f,closeButton:(kn=p==null?void 0:p.closeButton)!=null?kn:s,interacting:j,position:G,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:N,toasts:_.filter(sn=>sn.position==oe.position),heights:R.filter(sn=>sn.position==oe.position),setHeights:O,expandByDefault:i,gap:y,loadingIcon:x,expanded:M,pauseWhenPageIsHidden:b,cn:k})}))})):null};const mK=({...t})=>{const{theme:e="system"}=Hq();return g.jsx(pK,{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]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function gK(t,e=[]){let n=[];function r(s,a){const o=A.createContext(a),l=n.length;n=[...n,a];const c=d=>{var v;const{scope:f,children:p,...m}=d,y=((v=f==null?void 0:f[t])==null?void 0:v[l])||o,x=A.useMemo(()=>m,Object.values(m));return g.jsx(y.Provider,{value:x,children:p})};c.displayName=s+"Provider";function h(d,f){var y;const p=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,m=A.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,h]}const i=()=>{const s=n.map(a=>A.createContext(a));return function(o){const l=(o==null?void 0:o[t])||s;return A.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,yK(i,...e)]}function yK(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:c}
vendor: 15,517 bytes, line 258
258)=>{const d=l(s)[`__scope${c}`];return{...o,...d}},{});return A.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var vK="DismissableLayer",Q_="dismissableLayer.update",wK="dismissableLayer.pointerDownOutside",bK="dismissableLayer.focusOutside",YO,z$=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$N=A.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=t,c=A.useContext(z$),[h,d]=A.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=A.useState({}),m=Sn(e,P=>d(P)),y=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),w=h?y.indexOf(h):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,k=w>=v,_=kK(P=>{const R=P.target,O=[...c.branches].some(M=>M.contains(R));!k||O||(i==null||i(P),a==null||a(P),P.defaultPrevented||o==null||o())},f),C=AK(P=>{const R=P.target;[...c.branches].some(M=>M.contains(R))||(s==null||s(P),a==null||a(P),P.defaultPrevented||o==null||o())},f);return XB(P=>{w===c.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&o&&(P.preventDefault(),o()))},f),A.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(YO=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),XO(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=YO)}},[h,f,n,c]),A.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),XO())},[h,c]),A.useEffect(()=>{const P=()=>p({});return document.addEventListener(Q_,P),()=>document.removeEventListener(Q_,P)},[]),g.jsx(St.div,{...l,ref:m,style:{pointerEvents:b?k?"auto":"none":void 0,...t.style},onFocusCapture:st(t.onFocusCapture,C.onFocusCapture),onBlurCapture:st(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:st(t.onPointerDownCapture,_.onPointerDownCapture)})});$N.displayName=vK;var xK="DismissableLayerBranch",SK=A.forwardRef((t,e)=>{const n=A.useContext(z$),r=A.useRef(null),i=Sn(e,r);return A.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(St.div,{...t,ref:i})});SK.displayName=xK;function kK(t,e=globalThis==null?void 0:globalThis.document){const n=ai(t),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){V$(wK,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function AK(t,e=globalThis==null?void 0:globalThis.document){const n=ai(t),r=A.useRef(!1);return A.useEffect(()=>{const i=s=>{s.target&&!r.current&&V$(bK,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function XO(){const t=new CustomEvent(Q_);document.dispatchEvent(t)}function V$(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?IN(i,s):i.dispatchEvent(s)}var EK=_j.useId||(()=>{}),_K=0;function GA(t){const[e,n]=A.useState(EK());return qi(()=>{t||n(r=>r??String(_K++))},[t]),t||(e?`radix-${e}`:"")}const CK=["top","right","bottom","left"],vu=Math.min,Fi=Math.max,GS=Math.round,Eb=Math.floor,wu=t=>({x:t,y:t}),TK={left:"right",right:"left",bottom:"top",top:"bottom"},PK={start:"end",end:"start"};function J_(t,e,n){return Fi(t,vu(e,n))}function Tl(t,e){return typeof t=="function"?t(e):t}function Pl(t){return t.split("-")[0]}function _g(t){return t.split("-")[1]}function UN(t){return t==="x"?"y":"x"}function zN(t){return t==="y"?"height":"width"}function bu(t){return["top","bottom"].includes(Pl(t))?"y":"x"}function VN(t){return UN(bu(t))}function NK(t,e,n){n===void 0&&(n=!1);const r=_g(t),i=VN(t),s=zN(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=qS(a)),[a,qS(a)]}function RK(t){const e=qS(t);return[Z_(t),e,Z_(e)]}function Z_(t){return t.replace(/start|end/g,e=>PK[e])}function IK(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:a;default:return[]}}function OK(t,e,n,r){const i=_g(t);let s=IK(Pl(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(Z_)))),s}function qS(t){return t.replace(/left|right|bottom|top/g,e=>TK[e])}function MK(t){return{top:0,right:0,bottom:0,left:0,...t}}function H$(t){return typeof t!="number"?MK(t):{top:t,right:t,bottom:t,left:t}}function KS(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function QO(t,e,n){let{reference:r,floating:i}=t;const s=bu(e),a=VN(e),o=zN(a),l=Pl(e),c=s==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let p;switch(l){case"top":p={x:h,y:r.y-i.height};break;case"bottom":p={x:h,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_g(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const DK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=QO(c,r,l),f=r,p={},m=0;for(let y=0;y<o.length;y++){const{name:x,fn:v}=o[y],{x:w,y:b,data:k,reset:_}=await v({x:h,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});h=w??h,d=b??d,p={...p,[x]:{...p[x],...k}},_&&m<=50&&(m++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(c=_.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:h,y:d}=QO(c,f,l)),y=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:p}};async function Av(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Tl(e,t),m=H$(p),x=o[f?d==="floating"?"reference":"floating":d],v=KS(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),k=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},_=KS(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:b,strategy:l}):w);return{top:(v.top-_.top+m.top)/k.y,bottom:(_.bottom-v.bottom+m.bottom)/k.y,left:(v.left-_.left+m.left)/k.x,right:(_.right-v.right+m.right)/k.x}}const LK=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:c,padding:h=0}=Tl(t,e)||{};if(c==null)return{};const d=H$(h),f={x:n,y:r},p=VN(i),m=zN(p),y=await a.getDimensions(c),x=p==="y",v=x?"top":"left",w=x?"bottom":"right",b=x?"clientHeight":"clientWidth",k=s.reference[m]+s.reference[p]-f[p]-s.floating[m],_=f[p]-s.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let P=C?C[b]:0;(!P||!await(a.isElement==null?void 0:a.isElement(C)))&&(P=o.floating[b]||s.floating[m]);const R=k/2-_/2,O=P/2-y[m]/2-1,M=vu(d[v],O),D=vu(d[w],O),j=M,U=P-y[m]-D,B=P/2-y[m]/2+R,z=J_(j,B,U),$=!l.arrow&&_g(i)!=null&&B!==z&&s.reference[m]/2-(B<j?M:D)-y[m]/2<0,W=$?B<j?B-j:B-U:0;return{[p]:f[p]+W,data:{[p]:z,centerOffset:B-z-W,...$&&{alignmentOffset:W}},reset:$}}}),jK=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...x}=Tl(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Pl(i),w=bu(o),b=Pl(o)===o,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(b||!y?[qS(o)]:RK(o)),C=m!=="none";!f&&C&&_.push(...OK(o,y,m,k));const P=[o,..._],R=await Av(e,x),O=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&O.push(R[v]),d){const B=NK(i,a,k);O.push(R[B[0]],R[B[1]])}if(M=[...M,{placement:i,overflows:O}],!O.every(B=>B<=0)){var D,j;const B=(((D=s.flip)==null?void 0:D.index)||0)+1,z=P[B];if(z)return{data:{index:B,overflows:M},reset:{placement:z}};let $=(j=M.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:j.placement;if(!$)switch(p){case"bestFit":{var U;const W=(U=M.filter(L=>{if(C){const V=bu(L.placement);return V===w||V==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(V=>V>0).reduce((V,N)=>V+N,0)]).sort((L,V)=>L[1]-V[1])[0])==null?void 0:U[0];W&&($=W);break}case"initialPlacement":$=o;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function JO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ZO(t){return CK.some(e=>t[e]>=0)}const FK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Tl(t,e);switch(r){case"referenceHidden":{const s=await Av(e,{...i,elementContext:"reference"}),a=JO(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ZO(a)}}}case"escaped":{const s=await Av(e,{...i,altBoundary:!0}),a=JO(s,n.floating);return{data:{escapedOffsets:a,escaped:ZO(a)}}}default:return{}}}}};async function BK(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Pl(n),o=_g(n),l=bu(n)==="y",c=["left","top"].includes(a)?-1:1,h=s&&l?-1:1,d=Tl(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof m=="number"&&(p=o==="end"?m*-1:m),l?{x:p*h,y:f*c}:{x:f*c,y:p*h}}const $K=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=e,l=await BK(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},UK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:x=>{let{x:v,y:w}=x;return{x:v,y:w}}},...l}=Tl(t,e),c={x:n,y:r},h=await Av(e,l),d=bu(Pl(i)),f=UN(d);let p=c[f],m=c[d];if(s){const x=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=p+h[x],b=p-h[v];p=J_(w,p,b)}if(a){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",w=m+h[x],b=m-h[v];m=J_(w,m,b)}const y=o.fn({...e,[f]:p,[d]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[d]:a}}}}}},zK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Tl(t,e),h={x:n,y:r},d=bu(i),f=UN(d);let p=h[f],m=h[d];const y=Tl(o,e),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const b=f==="y"?"height":"width",k=s.reference[f]-s.floating[b]+x.mainAxis,_=s.reference[f]+s.reference[b]-x.mainAxis;p<k?p=k:p>_&&(p=_)}if(c){var v,w;const b=f==="y"?"width":"height",k=["top","left"].includes(Pl(i)),_=s.reference[d]-s.floating[b]+(k&&((v=a.offset)==null?void 0:v[d])||0)+(k?0:x.crossAxis),C=s.reference[d]+s.reference[b]+(k?0:((w=a.offset)==null?void 0:w[d])||0)-(k?x.crossAxis:0);m<_?m=_:m>C&&(m=C)}return{[f]:p,[d]:m}}}},VK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:l=()=>{},...c}=Tl(t,e),h=await Av(e,c),d=Pl(i),f=_g(i),p=bu(i)==="y",{width:m,height:y}=s.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,x=f==="end"?"top":"bottom");const w=y-h.top-h.bottom,b=m-h.left-h.right,k=vu(y-h[x],w),_=vu(m-h[v],b),C=!e.middlewareData.shift;let P=k,R=_;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(P=w),C&&!f){const M=Fi(h.left,0),D=Fi(h.right,0),j=Fi(h.top,0),U=Fi(h.bottom,0);p?R=m-2*(M!==0||D!==0?M+D:Fi(h.left,h.right)):P=y-2*(j!==0||U!==0?j+U:Fi(h.top,h.bottom))}await l({...e,availableWidth:R,availableHeight:P});const O=await a.getDimensions(o.floating);return m!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function _k(){return typeof window<"u"}function Cg(t){return W$(t)?(t.nodeName||"").toLowerCase():"#document"}function Hi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wo(t){var e;return(e=(W$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function W$(t){return _k()?t instanceof Node||t instanceof Hi(t).Node:!1}function ca(t){return _k()?t instanceof Element||t instanceof Hi(t).Element:!1}function fo(t){return _k()?t instanceof HTMLElement||t instanceof Hi(t).HTMLElement:!1}function eM(t){return!_k()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Hi(t).ShadowRoot}function V0(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ua(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function HK(t){return["table","td","th"].includes(Cg(t))}function Ck(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function HN(t){const e=WN(),n=ca(t)?ua(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function WK(t){let e=xu(t);for(;fo(e)&&!cg(e);){if(HN(e))return e;if(Ck(e))return null;e=xu(e)}return null}function WN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cg(t){return["html","body","#document"].includes(Cg(t))}function ua(t){return Hi(t).getComputedStyle(t)}function Tk(t){return ca(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xu(t){if(Cg(t)==="html")return t;const e=t.assignedSlot||t.parentNode||eM(t)&&t.host||wo(t);return eM(e)?e.host:e}function G$(t){const e=xu(t);return cg(e)?t.ownerDocument?t.ownerDocument.body:t.body:fo(e)&&V0(e)?e:G$(e)}function Ev(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=G$(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=Hi(i);if(s){const o=eC(a);
vendor: 4,564 bytes, line 258
258return e.concat(a,a.visualViewport||[],V0(i)?i:[],o&&n?Ev(o):[])}return e.concat(i,Ev(i,[],n))}function eC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function q$(t){const e=ua(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=fo(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,o=GS(n)!==s||GS(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function GN(t){return ca(t)?t:t.contextElement}function dp(t){const e=GN(t);if(!fo(e))return wu(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=q$(e);let a=(s?GS(n.width):n.width)/r,o=(s?GS(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const GK=wu(0);function K$(t){const e=Hi(t);return!WN()||!e.visualViewport?GK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Hi(t)?!1:e}function Wd(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=GN(t);let a=wu(1);e&&(r?ca(r)&&(a=dp(r)):a=dp(t));const o=qK(s,n,r)?K$(s):wu(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(s){const f=Hi(s),p=r&&ca(r)?Hi(r):r;let m=f,y=eC(m);for(;y&&r&&p!==m;){const x=dp(y),v=y.getBoundingClientRect(),w=ua(y),b=v.left+(y.clientLeft+parseFloat(w.paddingLeft))*x.x,k=v.top+(y.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,c*=x.y,h*=x.x,d*=x.y,l+=b,c+=k,m=Hi(y),y=eC(m)}}return KS({width:h,height:d,x:l,y:c})}function KK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=wo(r),o=e?Ck(e.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=wu(1);const h=wu(0),d=fo(r);if((d||!d&&!s)&&((Cg(r)!=="body"||V0(a))&&(l=Tk(r)),fo(r))){const f=Wd(r);c=dp(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x,y:n.y*c.y-l.scrollTop*c.y+h.y}}function YK(t){return Array.from(t.getClientRects())}function tC(t,e){const n=Tk(t).scrollLeft;return e?e.left+n:Wd(wo(t)).left+n}function XK(t){const e=wo(t),n=Tk(t),r=t.ownerDocument.body,i=Fi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Fi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+tC(t);const o=-n.scrollTop;return ua(r).direction==="rtl"&&(a+=Fi(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function QK(t,e){const n=Hi(t),r=wo(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const c=WN();(!c||c&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function JK(t,e){const n=Wd(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=fo(t)?dp(t):wu(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:a,height:o,x:l,y:c}}function tM(t,e,n){let r;if(e==="viewport")r=QK(t,n);else if(e==="document")r=XK(wo(t));else if(ca(e))r=JK(e,n);else{const i=K$(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return KS(r)}function Y$(t,e){const n=xu(t);return n===e||!ca(n)||cg(n)?!1:ua(n).position==="fixed"||Y$(n,e)}function ZK(t,e){const n=e.get(t);if(n)return n;let r=Ev(t,[],!1).filter(o=>ca(o)&&Cg(o)!=="body"),i=null;const s=ua(t).position==="fixed";let a=s?xu(t):t;for(;ca(a)&&!cg(a);){const o=ua(a),l=HN(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||V0(a)&&!l&&Y$(t,a))?r=r.filter(h=>h!==a):i=o,a=xu(a)}return e.set(t,r),r}function eY(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?Ck(e)?[]:ZK(e,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,h)=>{const d=tM(e,h,i);return c.top=Fi(d.top,c.top),c.right=vu(d.right,c.right),c.bottom=vu(d.bottom,c.bottom),c.left=Fi(d.left,c.left),c},tM(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tY(t){const{width:e,height:n}=q$(t);return{width:e,height:n}}function nY(t,e,n){const r=fo(e),i=wo(e),s=n==="fixed",a=Wd(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const l=wu(0);if(r||!r&&!s)if((Cg(e)!=="body"||V0(i))&&(o=Tk(e)),r){const p=Wd(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&(l.x=tC(i));let c=0,h=0;if(i&&!r&&!s){const p=i.getBoundingClientRect();h=p.top+o.scrollTop,c=p.left+o.scrollLeft-tC(i,p)}const d=a.left+o.scrollLeft-l.x-c,f=a.top+o.scrollTop-l.y-h;return{x:d,y:f,width:a.width,height:a.height}}function qA(t){return ua(t).position==="static"}function nM(t,e){if(!fo(t)||ua(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return wo(t)===n&&(n=n.ownerDocument.body),n}
vendor: 8,928 bytes, line 258
258function X$(t,e){const n=Hi(t);if(Ck(t))return n;if(!fo(t)){let i=xu(t);for(;i&&!cg(i);){if(ca(i)&&!qA(i))return i;i=xu(i)}return n}let r=nM(t,e);for(;r&&HK(r)&&qA(r);)r=nM(r,e);return r&&cg(r)&&qA(r)&&!HN(r)?n:r||WK(t)||n}const rY=async function(t){const e=this.getOffsetParent||X$,n=this.getDimensions,r=await n(t.floating);return{reference:nY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iY(t){return ua(t).direction==="rtl"}const sY={convertOffsetParentRelativeRectToViewportRelativeRect:KK,getDocumentElement:wo,getClippingRect:eY,getOffsetParent:X$,getElementRects:rY,getClientRects:YK,getDimensions:tY,getScale:dp,isElement:ca,isRTL:iY};function aY(t,e){let n=null,r;const i=wo(t);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const{left:c,top:h,width:d,height:f}=t.getBoundingClientRect();if(o||e(),!d||!f)return;const p=Eb(h),m=Eb(i.clientWidth-(c+d)),y=Eb(i.clientHeight-(h+f)),x=Eb(c),w={rootMargin:-p+"px "+-m+"px "+-y+"px "+-x+"px",threshold:Fi(0,vu(1,l))||1};let b=!0;function k(_){const C=_[0].intersectionRatio;if(C!==l){if(!b)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(t)}return a(!0),s}function oY(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=GN(t),h=i||s?[...c?Ev(c):[],...Ev(e)]:[];h.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&o?aY(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let m,y=l?Wd(t):null;l&&x();function x(){const v=Wd(t);y&&(v.x!==y.x||v.y!==y.y||v.width!==y.width||v.height!==y.height)&&n(),y=v,m=requestAnimationFrame(x)}return n(),()=>{var v;h.forEach(w=>{i&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const lY=$K,cY=UK,uY=jK,hY=VK,dY=FK,rM=LK,fY=zK,pY=(t,e,n)=>{const r=new Map,i={platform:sY,...n},s={...i.platform,_c:r};return DK(t,e,{...i,platform:s})};var xx=typeof document<"u"?A.useLayoutEffect:A.useEffect;function YS(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!YS(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!YS(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Q$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iM(t,e){const n=Q$(t);return Math.round(e*n)/n}function KA(t){const e=A.useRef(t);return xx(()=>{e.current=t}),e}function mY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=t,[h,d]=A.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=A.useState(r);YS(f,r)||p(r);const[m,y]=A.useState(null),[x,v]=A.useState(null),w=A.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),b=A.useCallback(L=>{L!==P.current&&(P.current=L,v(L))},[]),k=s||m,_=a||x,C=A.useRef(null),P=A.useRef(null),R=A.useRef(h),O=l!=null,M=KA(l),D=KA(i),j=KA(c),U=A.useCallback(()=>{if(!C.current||!P.current)return;const L={placement:e,strategy:n,middleware:f};D.current&&(L.platform=D.current),pY(C.current,P.current,L).then(V=>{const N={...V,isPositioned:j.current!==!1};B.current&&!YS(R.current,N)&&(R.current=N,Sg.flushSync(()=>{d(N)}))})},[f,e,n,D,j]);xx(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const B=A.useRef(!1);xx(()=>(B.current=!0,()=>{B.current=!1}),[]),xx(()=>{if(k&&(C.current=k),_&&(P.current=_),k&&_){if(M.current)return M.current(k,_,U);U()}},[k,_,U,M,O]);const z=A.useMemo(()=>({reference:C,floating:P,setReference:w,setFloating:b}),[w,b]),$=A.useMemo(()=>({reference:k,floating:_}),[k,_]),W=A.useMemo(()=>{const L={position:n,left:0,top:0};if(!$.floating)return L;const V=iM($.floating,h.x),N=iM($.floating,h.y);return o?{...L,transform:"translate("+V+"px, "+N+"px)",...Q$($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:N}},[n,o,$.floating,h.x,h.y]);return A.useMemo(()=>({...h,update:U,refs:z,elements:$,floatingStyles:W}),[h,U,z,$,W])}const gY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rM({element:r.current,padding:i}).fn(n):{}:r?rM({element:r,padding:i}).fn(n):{}}}},yY=(t,e)=>({...lY(t),options:[t,e]}),vY=(t,e)=>({...cY(t),options:[t,e]}),wY=(t,e)=>({...fY(t),options:[t,e]}),bY=(t,e)=>({...uY(t),options:[t,e]}),xY=(t,e)=>({...hY(t),options:[t,e]}),SY=(t,e)=>({...dY(t),options:[t,e]}),kY=(t,e)=>({...gY(t),options:[t,e]});var AY="Arrow",J$=A.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return g.jsx(St.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});J$.displayName=AY;var EY=J$;function Z$(t){const[e,n]=A.useState(void 0);return qi(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var eU="Popper",[tU,nU]=bk(eU),[Spe,rU]=tU(eU),iU="PopperAnchor",sU=A.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=rU(iU,n),a=A.useRef(null),o=Sn(e,a);return A.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:g.jsx(St.div,{...i,ref:o})});sU.displayName=iU;var qN="PopperContent",[_Y,CY]=tU(qN),aU=A.forwardRef((t,e)=>{var he,rn,kn,sn,wr,Br;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...y}=t,x=rU(qN,n),[v,w]=A.useState(null),b=Sn(e,$r=>w($r)),[k,_]=A.useState(null),C=Z$(k),P=(C==null?void 0:C.width)??0,R=(C==null?void 0:C.height)??0,O=r+(s!=="center"?"-"+s:""),M=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},D=Array.isArray(c)?c:[c],j=D.length>0,U={padding:M,boundary:D.filter(PY),altBoundary:j},{refs:B,floatingStyles:z,placement:$,isPositioned:W,middlewareData:L}=mY({strategy:"fixed",placement:O,whileElementsMounted:(...$r)=>oY(...$r,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[yY({mainAxis:i+R,alignmentAxis:a}),l&&vY({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?wY():void 0,...U}),l&&bY({...U}),xY({...U,apply:({elements:$r,rects:Ts,availableWidth:me,availableHeight:Me})=>{const{width:De,height:Rt}=Ts.reference,be=$r.floating.style;be.setProperty("--radix-popper-available-width",`${me}px`),be.setProperty("--radix-popper-available-height",`${Me}px`),be.setProperty("--radix-popper-anchor-width",`${De}px`),be.setProperty("--radix-popper-anchor-height",`${Rt}px`)}}),k&&kY({element:k,padding:o}),NY({arrowWidth:P,arrowHeight:R}),f&&SY({strategy:"referenceHidden",...U})]}),[V,N]=cU($),G=ai(m);qi(()=>{W&&(G==null||G())},[W,G]);const Y=(he=L.arrow)==null?void 0:he.x,I=(rn=L.arrow)==null?void 0:rn.y,we=((kn=L.arrow)==null?void 0:kn.centerOffset)!==0,[Oe,oe]=A.useState();return qi(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:W?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[(sn=L.transformOrigin)==null?void 0:sn.x,(wr=L.transformOrigin)==null?void 0:wr.y].join(" "),...((Br=L.hide)==null?void 0:Br.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(_Y,{scope:n,placedSide:V,onArrowChange:_,arrowX:Y,arrowY:I,shouldHideArrow:we,children:g.jsx(St.div,{"data-side":V,"data-align":N,...y,ref:b,style:{...y.style,animation:W?void 0:"none"}})})})});aU.displayName=qN;var oU="PopperArrow",TY={top:"bottom",right:"left",bottom:"top",left:"r
258ight"},lU=A.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=CY(oU,r),a=TY[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(EY,{...i,ref:n,style:{...i.style,display:"block"}})})});lU.displayName=oU;function PY(t){return t!==null}var NY=t=>({name:"transformOrigin",options:t,fn(e){var x,v,w;const{placement:n,rects:r,middlewareData:i}=e,a=((x=i.arrow)==null?void 0:x.centerOffset)!==0,o=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,h]=cU(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((v=i.arrow)==null?void 0:v.x)??0)+o/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+l/2;let m="",y="";return c==="bottom"?(m=a?d:`${f}px`,y=`${-l}px`):c==="top"?(m=a?d:`${f}px`,y=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,y=a?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,y=a?d:`${p}px`),{data:{x:m,y}}}});function cU(t){const[e,n="center"]=t.split("-");return[e,n]}var RY=sU,IY=aU,OY=lU,MY="Portal",uU=A.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,s]=A.useState(!1);qi(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?TN.createPortal(g.jsx(St.div,{...r,ref:e}),a):null});uU.displayName=MY;function DY(t,e){return A.useReducer((n,r)=>e[n][r]??n,t)}var hU=t=>{const{present:e,children:n}=t,r=LY(e),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),s=Sn(r.ref,jY(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:s}):null};hU.displayName="Presence";function LY(t){const[e,n]=A.useState(),r=A.useRef({}),i=A.useRef(t),s=A.useRef("none"),a=t?"mounted":"unmounted",[o,l]=DY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=_b(r.current);s.current=o==="mounted"?c:"none"},[o]),qi(()=>{const c=r.current,h=i.current;if(h!==t){const f=s.current,p=_b(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),qi(()=>{if(e){let c;const h=e.ownerDocument.defaultView??window,d=p=>{const y=_b(r.current).includes(p.animationName);if(p.target===e&&y&&(l("ANIMATION_END"),!i.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",c=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},f=p=>{p.target===e&&(s.current=_b(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{h.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function _b(t){return(t==null?void 0:t.animationName)||"none"}function jY(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var[Pk,kpe]=gK("Tooltip",[nU]),KN=nU(),dU="TooltipProvider",FY=700,sM="tooltip.open",[BY,fU]=Pk(dU),pU=t=>{const{__scopeTooltip:e,delayDuration:n=FY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[a,o]=A.useState(!0),l=A.useRef(!1),c=A.useRef(0);return A.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),g.jsx(BY,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:A.useCallback(()=>{window.clearTimeout(c.current),o(!1)},[]),onClose:A.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 4,435 bytes, line 258
258o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:A.useCallback(h=>{l.current=h},[]),disableHoverableContent:i,children:s})};pU.displayName=dU;var mU="Tooltip",[Ape,Nk]=Pk(mU),nC="TooltipTrigger",$Y=A.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Nk(nC,n),s=fU(nC,n),a=KN(n),o=A.useRef(null),l=Sn(e,o,i.onTriggerChange),c=A.useRef(!1),h=A.useRef(!1),d=A.useCallback(()=>c.current=!1,[]);return A.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(RY,{asChild:!0,...a,children:g.jsx(St.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:st(t.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:st(t.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:st(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:st(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:st(t.onBlur,i.onClose),onClick:st(t.onClick,i.onClose)})})});$Y.displayName=nC;var UY="TooltipPortal",[Epe,zY]=Pk(UY,{forceMount:void 0}),ug="TooltipContent",gU=A.forwardRef((t,e)=>{const n=zY(ug,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,a=Nk(ug,t.__scopeTooltip);return g.jsx(hU,{present:r||a.open,children:a.disableHoverableContent?g.jsx(yU,{side:i,...s,ref:e}):g.jsx(VY,{side:i,...s,ref:e})})}),VY=A.forwardRef((t,e)=>{const n=Nk(ug,t.__scopeTooltip),r=fU(ug,t.__scopeTooltip),i=A.useRef(null),s=Sn(e,i),[a,o]=A.useState(null),{trigger:l,onClose:c}=n,h=i.current,{onPointerInTransitChange:d}=r,f=A.useCallback(()=>{o(null),d(!1)},[d]),p=A.useCallback((m,y)=>{const x=m.currentTarget,v={x:m.clientX,y:m.clientY},w=qY(v,x.getBoundingClientRect()),b=KY(v,w),k=YY(y.getBoundingClientRect()),_=QY([...b,...k]);o(_),d(!0)},[d]);return A.useEffect(()=>()=>f(),[f]),A.useEffect(()=>{if(l&&h){const m=x=>p(x,h),y=x=>p(x,l);return l.addEventListener("pointerleave",m),h.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",m),h.removeEventListener("pointerleave",y)}}},[l,h,p,f]),A.useEffect(()=>{if(a){const m=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},w=(l==null?void 0:l.contains(x))||(h==null?void 0:h.contains(x)),b=!XY(v,a);w?f():b&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,h,a,c,f]),g.jsx(yU,{...t,ref:s})}),[HY,WY]=Pk(mU,{isInside:!1}),yU=A.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=t,l=Nk(ug,n),c=KN(n),{onClose:h}=l;return A.useEffect(()=>(document.addEventListener(sM,h),()=>document.removeEventListener(sM,h)),[h]),A.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,h]),g.jsx($N,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:g.jsxs(IY,{"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:[g.jsx(YB,{children:r}),g.jsx(HY,{scope:n,isInside:!0,children:g.jsx(v9,{id:l.contentId,role:"tooltip",children:i||r})})]})})});gU.displayName=ug;var vU="TooltipArrow",GY=A.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=KN(n);return WY(vU,n).isInside?null:g.jsx(OY,{...i,...r,ref:e})});GY.displayName=vU;function qY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function KY(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}
258function YY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function XY(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s].x,l=e[s].y,c=e[a].x,h=e[a].y;l>r!=h>r&&n<(c-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function QY(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),JY(e)}function JY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var ZY=pU,wU=gU;const e7=ZY,t7=A.forwardRef(({className:t,sideOffset:e=4,...n},r)=>g.jsx(wU,{ref:r,sideOffset:e,className:Ue("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",t),...n}));t7.displayName=wU.displayName;var Rk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ik=typeof window>"u"||"Deno"in globalThis;function js(){}function n7(t,e){return typeof t=="function"?t(e):t}function r7(t){return typeof t=="number"&&t>=0&&t!==1/0}function i7(t,e){return Math.max(t+(e||0)-Date.now(),0)}function aM(t,e){return typeof t=="function"?t(e):t}function s7(t,e){return typeof t=="function"?t(e):t}function oM(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==YN(a,e.options))return!1}else if(!Cv(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function lM(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(_v(e.options.mutationKey)!==_v(s))return!1}else if(!Cv(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function YN(t,e){return((e==null?void 0:e.queryKeyHashFn)||_v)(t)}function _v(t){return JSON.stringify(t,(e,n)=>rC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Cv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Cv(t[n],e[n])):!1}function bU(t,e){if(t===e)return t;const n=cM(t)&&cM(e);if(n||rC(t)&&rC(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,o=n?[]:{};let l=0;for(let c=0;c<a;c++){const h=n?c:s[c];(!n&&r.includes(h)||n)&&t[h]===void 0&&e[h]===void 0?(o[h]=void 0,l++):(o[h]=bU(t[h],e[h]),o[h]===t[h]&&t[h]!==void 0&&l++)}return i===a&&l===i?t:o}return e}function cM(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rC(t){if(!uM(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uM(t){return Object.prototype.toString.call(t)==="[object Object]"}function a7(t){return new Promise(e=>{setTimeout(e,t)})}function o7(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?bU(t,e):e}function l7(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function c7(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var xU=Symbol();function SU(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===xU?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ch,nc,wp,oj,u7=(oj=class extends Rk{constructor(){super();E(this,ch);E(this,nc);E(this,wp);S(this,wp,e=>{if(!Ik&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){u(this,nc)||this.setEventListener(u(this,wp))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,nc))==null||e.call(this),S(this,nc,void 0))}setEventListener(e){var n;S(this,wp,e),(n=u(this,nc))==null||n.call(this),S(this,nc,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){u(this,ch)!==e&&(S(this,ch,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 18,737 bytes, line 258
258this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof u(this,ch)=="boolean"?u(this,ch):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ch=new WeakMap,nc=new WeakMap,wp=new WeakMap,oj),kU=new u7,bp,rc,xp,lj,h7=(lj=class extends Rk{constructor(){super();E(this,bp,!0);E(this,rc);E(this,xp);S(this,xp,e=>{if(!Ik&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){u(this,rc)||this.setEventListener(u(this,xp))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,rc))==null||e.call(this),S(this,rc,void 0))}setEventListener(e){var n;S(this,xp,e),(n=u(this,rc))==null||n.call(this),S(this,rc,e(this.setOnline.bind(this)))}setOnline(e){u(this,bp)!==e&&(S(this,bp,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return u(this,bp)}},bp=new WeakMap,rc=new WeakMap,xp=new WeakMap,lj),XS=new h7;function d7(t){return Math.min(1e3*2**t,3e4)}function AU(t){return(t??"online")==="online"?XS.isOnline():!0}var EU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function YA(t){return t instanceof EU}function _U(t){let e=!1,n=0,r=!1,i,s,a;const o=new Promise((v,w)=>{s=v,a=w}),l=v=>{var w;r||(m(new EU(v)),(w=t.abort)==null||w.call(t))},c=()=>{e=!0},h=()=>{e=!1},d=()=>kU.isFocused()&&(t.networkMode==="always"||XS.isOnline())&&t.canRun(),f=()=>AU(t.networkMode)&&t.canRun(),p=v=>{var w;r||(r=!0,(w=t.onSuccess)==null||w.call(t,v),i==null||i(),s(v))},m=v=>{var w;r||(r=!0,(w=t.onError)==null||w.call(t,v),i==null||i(),a(v))},y=()=>new Promise(v=>{var w;i=b=>{(r||d())&&v(b)},(w=t.onPause)==null||w.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),x=()=>{if(r)return;let v;const w=n===0?t.initialPromise:void 0;try{v=w??t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(p).catch(b=>{var R;if(r)return;const k=t.retry??(Ik?0:3),_=t.retryDelay??d7,C=typeof _=="function"?_(n,b):_,P=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,b);if(e||!P){m(b);return}n++,(R=t.onFail)==null||R.call(t,n,b),a7(C).then(()=>d()?void 0:y()).then(()=>{e?m(b):x()})})};return{promise:o,cancel:l,continue:()=>(i==null||i(),o),cancelRetry:c,continueRetry:h,canStart:f,start:()=>(f()?x():y().then(x),o)}}function f7(){let t=[],e=0,n=o=>{o()},r=o=>{o()},i=o=>setTimeout(o,0);const s=o=>{e?t.push(o):i(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Rr=f7(),uh,cj,CU=(cj=class{constructor(){E(this,uh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),r7(this.gcTime)&&S(this,uh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ik?1/0:5*60*1e3))}clearGcTimeout(){u(this,uh)&&(clearTimeout(u(this,uh)),S(this,uh,void 0))}},uh=new WeakMap,cj),Sp,kp,ts,ur,Xv,hh,Bs,ko,uj,p7=(uj=class extends CU{constructor(e){super();E(this,Bs);E(this,Sp);E(this,kp);E(this,ts);E(this,ur);E(this,Xv);E(this,hh);S(this,hh,!1),S(this,Xv,e.defaultOptions),this.setOptions(e.options),this.observers=[],S(this,ts,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,S(this,Sp,g7(this.options)),this.state=e.state??u(this,Sp),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=u(this,ur))==null?void 0:e.promise}setOptions(e){this.options={...u(this,Xv),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&u(this,ts).remove(this)}setData(e,n){const r=o7(this.state.data,e,this.options);return T(this,Bs,ko).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){T(this,Bs,ko).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=u(this,ur))==null?void 0:r.promise;return(i=u(this,ur))==null||i.cancel(e),n?n.then(js).catch(js):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(u(this,Sp))}isActive(){return this.observers.some(e=>s7(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!i7(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=u(this,ur))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=u(this,ur))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),u(this,ts).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(u(this,ur)&&(u(this,hh)?u(this,ur).cancel({revert:!0}):u(this,ur).cancelRetry()),this.scheduleGc()),u(this,ts).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||T(this,Bs,ko).call(this,{type:"invalidate"})}fetch(e,n){var l,c,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(u(this,ur))return u(this,ur).continueRetry(),u(this,ur).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(S(this,hh,!0),r.signal)})},s=()=>{const d=SU(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),S(this,hh,!1),this.options.persister?this.options.persister(d,f,this):d(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(l=this.options.behavior)==null||l.onFetch(a,this),S(this,kp,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&T(this,Bs,ko).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const o=d=>{var f,p,m,y;YA(d)&&d.silent||T(this,Bs,ko).call(this,{type:"error",error:d}),YA(d)||((p=(f=u(this,ts).config).onError)==null||p.call(f,d,this),(y=(m=u(this,ts).config).onSettled)==null||y.call(m,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return S(this,ur,_U({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,p,m,y;if(d===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(x){o(x);return}(p=(f=u(this,ts).config).onSuccess)==null||p.call(f,d,this),(y=(m=u(this,ts).config).onSettled)==null||y.call(m,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:o,onFail:(d,f)=>{T(this,Bs,ko).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{T(this,Bs,ko).call(this,{type:"pause"})},onContinue:()=>{T(this,Bs,ko).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),u(this,ur).start()}},Sp=new WeakMap,kp=new WeakMap,ts=new WeakMap,ur=new WeakMap,Xv=new WeakMap,hh=new WeakMap,Bs=new WeakSet,ko=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...m7(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return YA(i)&&i.revert&&u(this,kp)?{...u(this,kp),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Rr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),u(this,ts).notify({query:this,type:"updated",action:e})})},uj);function m7(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function g7(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Pa,hj,y7=(hj=class extends Rk{constructor(e={}){super();E(this,Pa);this.config=e,S(this,Pa,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??YN(i,n);let a=this.get(s);return a||(a=new p7({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){u(this,Pa).has(e.queryHash)||(u(this,Pa).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=u(this,Pa).get(e.queryHash);n&&(e.destroy(),n===e&&u(this,Pa).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(this,Pa).get(e)}getAll(){return[...u(this,Pa).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oM(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oM(e,r)):n}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pa=new WeakMap,hj),Na,Sr,dh,Ra,Ul,dj,v7=(dj=class extends CU{constructor(e){super();E(this,Ra);E(this,Na);E(this,Sr);E(this,dh);this.mutationId=e.mutationId,S(this,Sr,e.mutationCache),S(this,Na,[]),this.state=e.state||w7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){u(this,Na).includes(e)||(u(this,Na).push(e),this.clearGcTimeout(),u(this,Sr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){S(this,Na,u(this,Na).filter(n=>n!==e)),this.scheduleGc(),u(this,Sr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){u(this,Na).length||(this.state.status==="pending"?this.scheduleGc():u(this,Sr).remove(this))}continue(){var e;return((e=u(this,dh))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,a,o,l,c,h,d,f,p,m,y,x,v,w,b,k,_,C,P;S(this,dh,_U({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(R,O)=>{T(this,Ra,Ul).call(this,{type:"failed",failureCount:R,error:O})},onPause:()=>{T(this,Ra,Ul).call(this,{type:"pause"})},onContinue:()=>{T(this,Ra,Ul).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(this,Sr).canRun(this)}));const n=this.state.status==="pending",r=!u(this,dh).canStart();try{if(!n){T(this,Ra,Ul).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=u(this,Sr).config).onMutate)==null?void 0:s.call(i,e,this));const O=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));O!==this.state.context&&T(this,Ra,Ul).call(this,{type:"pending",context:O,variables:e,isPaused:r})}const R=await u(this,dh).start();return await((c=(l=u(this,Sr).config).onSuccess)==null?void 0:c.call(l,R,e,this.state.context,this)),await((d=(h=this.options).onSuccess)==null?void 0:d.call(h,R,e,this.state.context)),await((p=(f=u(this,Sr).config).onSettled)==null?void 0:p.call(f,R,null,this.state.variables,this.state.context,this)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,R,null,e,this.state.context)),T(this,Ra,Ul).call(this,{type:"success",data:R}),R}catch(R){try{throw await((v=(x=u(this,Sr).config).onError)==null?void 0:v.call(x,R,e,this.state.context,this)),await((b=(w=this.options).onError)==null?void 0:b.call(w,R,e,this.state.context)),await((_=(k=u(this,Sr).config).onSettled)==null?void 0:_.call(k,void 0,R,this.state.variables,this.state.context,this)),await((P=(C=this.options).onSettled)==null?void 0:P.call(C,void 0,R,e,this.state.context)),R}finally{T(this,Ra,Ul).call(this,{type:"error",error:R})}}finally{u(this,Sr).runNext(this)}}},Na=new WeakMap,Sr=new WeakMap,dh=new WeakMap,Ra=new WeakSet,Ul=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Rr.batch(()=>{u(this,Na).forEach(r=>{r.onMutationUpdate(e)}),u(this,Sr).notify({mutation:this,type:"updated",action:e})})},dj);function w7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mi,Qv,fj,b7=(fj=class extends Rk{constructor(e={}){super();E(this,mi);E(this,Qv);this.config=e,S(this,mi,new Map),S(this,Qv,Date.now())}build(e,n,r){const i=new v7({mutationCache:this,mutationId:++jt(this,Qv)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){const n=Cb(e),r=u(this,mi).get(n)??[];r.push(e),u(this,mi).set(n,r),this.notify({type:"added",mutation:e})}remove(e){var r;const n=Cb(e);if(u(this,mi).has(n)){const i=(r=u(this,mi).get(n))==null?void 0:r.filter(s=>s!==e);i&&(i.length===0?u(this,mi).delete(n):u(this,mi).set(n,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=(r=u(this,mi).get(Cb(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===e}runNext(e){var r;const n=(r=u(this,mi).get(Cb(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Rr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...u(this,mi).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>lM(n,r))}findAll(e={}){return this.getAll().filter(n=>lM(e,n))}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rr.batch(()=>Promise.all(e.map(n=>n.continue().catch(js))))}},mi=new WeakMap,Qv=new WeakMap,fj);function Cb(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function hM(t){return{onFetch:(e,n)=>{var h,d,f,p,m;const r=e.options,i=(f=(d=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((p=e.state.data)==null?void 0:p.pages)||[],a=((m=e.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let y=!1;const x=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},v=SU(e.options,e.fetchOptions),w=async(b,k,_)=>{if(y)return Promise.reject();if(k==null&&b.pages.length)return Promise.resolve(b);const C={queryKey:e.queryKey,pageParam:k,direction:_?"backward":"forward",meta:e.options.meta};x(C);const P=await v(C),{maxPages:R}=e.options,O=_?c7:l7;return{pages:O(b.pages,P,R),pageParams:O(b.pageParams,k,R)}};if(i&&s.length){const b=i==="backward",k=b?x7:dM,_={pages:s,pageParams:a},C=k(r,_);o=await w(_,C,b)}else{const b=t??s.length;do{const k=l===0?a[0]??r.initialPageParam:dM(r,o);if(l>0&&k==null)break;o=await w(o,k),l++}while(l<b)}return o};e.options.persister?e.fetchFn=()=>{var y,x;return(x=(y=e.options).persister)==null?void 0:x.call(y,c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function dM(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function x7(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Yt,ic,sc,Ap,Ep,ac,_p,Cp,pj,S7=(pj=class{constructor(t={}){E(this,Yt);E(this,ic);E(this,sc);E(this,Ap);E(this,Ep);E(this,ac);E(this,_p);E(this,Cp);S(this,Yt,t.queryCache||new y7),S(this,ic,t.mutationCache||new b7),S(this,sc,t.defaultOptions||{}),S(this,Ap,new Map),S(this,Ep,new Map),S(this,ac,0)}mount(){jt(this,ac)._++,u(this,ac)===1&&(S(this,_p,kU.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,Yt).onFocus())})),S(this,Cp,XS.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,Yt).onOnline())})))}unmount(){var t,e;jt(this,ac)._--,u(this,ac)===0&&((t=u(this,_p))==null||t.call(this),S(this,_p,void 0),(e=u(this,Cp))==null||e.call(this),S(this,Cp,void 0))}isFetching(t){return u(this,Yt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return u(this,ic).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=u(this,Yt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=u(this,Yt).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(aM(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return u(this,Yt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=u(this,Yt).get(r.queryHash),s=i==null?void 0:i.state.data,a=n7(e,s);if(a!==void 0)return u(this,Yt).build(this,r).setData(a,{...n,manual:!0})}
258setQueriesData(t,e,n){return Rr.batch(()=>u(this,Yt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=u(this,Yt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=u(this,Yt);Rr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=u(this,Yt),r={type:"active",...t};return Rr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=Rr.batch(()=>u(this,Yt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(js).catch(js)}invalidateQueries(t={},e={}){return Rr.batch(()=>{if(u(this,Yt).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=Rr.batch(()=>u(this,Yt).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(js)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(js)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=u(this,Yt).build(this,e);return n.isStaleByTime(aM(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(js).catch(js)}fetchInfiniteQuery(t){return t.behavior=hM(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(js).catch(js)}ensureInfiniteQueryData(t){return t.behavior=hM(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return XS.isOnline()?u(this,ic).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,Yt)}getMutationCache(){return u(this,ic)}getDefaultOptions(){return u(this,sc)}setDefaultOptions(t){S(this,sc,t)}setQueryDefaults(t,e){u(this,Ap).set(_v(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...u(this,Ap).values()];let n={};return e.forEach(r=>{Cv(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){u(this,Ep).set(_v(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...u(this,Ep).values()];let n={};return e.forEach(r=>{Cv(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...u(this,sc).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=YN(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.enabled!==!0&&e.queryFn===xU&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...u(this,sc).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){u(this,Yt).clear(),u(this,ic).clear()}},Yt=new WeakMap,ic=new WeakMap,sc=new WeakMap,Ap=new WeakMap,Ep=new WeakMap,ac=new WeakMap,_p=new WeakMap,Cp=new WeakMap,pj),k7=A.createContext(void 0),A7=({client:t,children:e})=>(A.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),g.jsx(k7.Provider,{value:t,children:e}));const E7=()=>{const t=z0(),e=rf(),[n,r]=A.useState(!1);A.useEffect(()=>{const s=()=>r(window.scrollY>24);return s(),window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]);const i=[{href:"/",label:"Home"},{href:"/team",label:"Team"},{href:"/blog",label:"Blog"},{href:"/vfti-quiz",label:"VFTI"}];return g.jsx("nav",{className:Ue("fixed top-0 left-0 right-0 z-50 transition-all duration-500",n?"bg-background/85 backdrop-blur-xl border-b border-white/10":"bg-transparent border-b border-transparent"),children:g.jsxs("div",{className:"max-w-screen-2xl mx-auto px-6 lg:px-16 h-20 flex items-center justify-between",children:[g.jsxs(Ca,{to:"/",className:"display text-3xl tracking-tight text-white leading-none",children:["REAL",g.jsx("span",{className:"italic-accent",children:"R."})]}),g.jsxs("div",{className:"hidden md:flex items-center gap-12",children:[i.map(s=>g.jsx(Ca,{to:s.href,className:Ue("mono text-[10px] uppercase tracking-[0.35em] transition-colors duration-300",t.pathname===s.href?"text-white":"text-white/40 hover:text-white"),children:s.label},s.href)),g.jsx("button",{onClick:()=>e("/assessment"),className:"ml-2 px-5 py-2.5 bg-primary text-primary-foreground mono text-[10px] uppercase tracking-[0.3em] hover:bg-primary-glow transition-all duration-300",children:"Pitch to us"})]})]})})},_7=()=>g.jsx("footer",{className:"pt-32 lg:pt-40 pb-16 px-6 lg:px-16 border-t border-white/10 bg-background",children:g.jsxs("div",{className:"max-w-screen-2xl mx-auto",children:[g.jsxs("div",{className:"grid lg:grid-cols-4 gap-16 mb-24",children:[g.jsxs("div",{className:"lg:col-span-2",children:[g.jsxs(Ca,{to:"/",className:"font-display text-3xl font-black tracking-tighter mb-8 inl
258ine-block",children:["REAL",g.jsx("span",{className:"text-primary italic",children:"R"})]}),g.jsx("p",{className:"text-white/40 max-w-sm leading-relaxed",children:"An early-stage venture firm backing founders obsessed with redefining the next decade. Zürich."})]}),g.jsxs("div",{children:[g.jsx("h4",{className:"text-[10px] uppercase tracking-[0.3em] font-bold text-white/30 mb-8 font-display",children:"Ecosystem"}),g.jsxs("ul",{className:"space-y-4 text-sm font-medium",children:[g.jsx("li",{children:g.jsx(Ca,{to:"/vfti-quiz",className:"text-white/70 hover:text-primary transition-colors",children:"VFTI Diagnostic"})}),g.jsx("li",{children:g.jsx(Ca,{to:"/team",className:"text-white/70 hover:text-primary transition-colors",children:"The Team"})}),g.jsx("li",{children:g.jsx(Ca,{to:"/blog",className:"text-white/70 hover:text-primary transition-colors",children:"Blog"})})]})]}),g.jsxs("div",{children:[g.jsx("h4",{className:"text-[10px] uppercase tracking-[0.3em] font-bold text-white/30 mb-8 font-display",children:"Network"}),g.jsx("ul",{className:"space-y-4 text-sm font-medium",children:g.jsx("li",{children:g.jsxs("a",{href:"https://www.linkedin.com/company/realrventures/",target:"_blank",rel:"noopener noreferrer",className:"text-white/70 hover:text-primary transition-colors inline-flex items-center gap-2",children:[g.jsx(P$,{className:"w-4 h-4"})," LinkedIn"]})})})]})]}),g.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6 pt-8 border-t border-white/5 text-[10px] uppercase tracking-[0.3em] text-white/30 font-display font-bold",children:[g.jsx("p",{children:"© 2026 REALR Ventures · All rights reserved"}),g.jsxs("div",{className:"flex gap-8",children:[g.jsx(Ca,{to:"/imprint",className:"hover:text-white transition-colors",children:"Imprint"}),g.jsx(Ca,{to:"/privacy",className:"hover:text-white transition-colors",children:"Privacy"}),g.jsx(Ca,{to:"/cookies",className:"hover:text-white transition-colors",children:"Cookies"})]})]})]})}),C7=Ak("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ye=A.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const a=r?og:"button";return g.jsx(a,{className:Ue(C7({variant:e,size:n,className:t})),ref:s,...i})});Ye.displayName="Button";const T7=()=>{const[t,e]=A.useState(!1);A.useEffect(()=>{localStorage.getItem("cookieConsent")||e(!0)},[]);const n=()=>{localStorage.setItem("cookieConsent","all"),localStorage.setItem("cookiePreferences",JSON.stringify({necessary:!0,analytics:!0,marketing:!0})),e(!1)},r=()=>{localStorage.setItem("cookieConsent","necessary"),localStorage.setItem("cookiePreferences",JSON.stringify({necessary:!0,analytics:!1,marketing:!1})),e(!1)},i=()=>{e(!1)};return t?g.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-black/80 backdrop-blur-md shadow-lg border-t border-white/10 z-50 p-4 md:p-6",children:g.jsx("div",{className:"container mx-auto max-w-6xl",children:g.jsxs("div",{className:"flex justify-between items-start",children:[g.jsxs("div",{className:"flex-1 mr-4",children:[g.jsx("p",{className:"text-white/80 mb-4",children:'We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies.'}),g.jsxs("div",{className:"flex flex-wrap gap-3",children:[g.jsx(Ye,{onClick:n,className:"bg-purple text-white hover:bg-purple/90 border border-purple/50",children:"Accept All"}),g.jsx(Ye,{onClick:r,className:"bg-white/10 text-white hover:bg-white/20 border border-white/20",children:"Accept Necessary Only"})]})]}),g.jsx("button",{onClick:i,className:"text-white/50 hover:text-white focus:outline-none","aria-label":"Close",children:g.jsx(lg,{size:24})})]})})}):null},XN=A.createContext({});function QN(t){const e=A.useRef(null);return e.current===null&&(e.current=t()),e.current}const P7=typeof window<"u",TU=P7?A.useLayoutEffect:A.useEffect,Ok=A.createContext(null);function JN(t,e){t.indexOf(e)===-1&&t.push(e)}function QS(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const po=(t,e,n)=>n>e?e:n<t?t:n;let Mk=()=>{},hg=()=>{};const Su={},PU=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function NU(t){return typeof t=="object"&&t!==null}const RU=t=>/^0[^.\s]+$/u.test(t);function IU(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ss=t=>t,N7=(t,e)=>n=>e(t(n)),H0=(...t)=>t.reduce(N7),Tv=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class ZN{constructor(){this.subscriptions=[]}add(e){return JN(this.subscriptions,e),()=>QS(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ii=t=>t*1e3,bs=t=>t/1e3;function OU(t,e){return e?t*(1e3/e):0}const MU=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,R7=1e-7,I7=12;function O7(t,e,n,r,i){let s,a,o=0;do a=e+(n-e)/2,s=MU(a,r,i)-t,s>0?n=a:e=a;while(Math.abs(s)>R7&&++o<I7);return a}function W0(t,e,n,r){if(t===e&&n===r)return Ss;const i=s=>O7(s,0,1,t,n);return s=>s===0||s===1?s:MU(i(s),e,r)}const DU=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,LU=t=>e=>1-t(1-e),jU=W0(.33,1.53,.69,.99),eR=LU(jU),FU=DU(eR),BU=t=>t>=1?1:(t*=2)<1?.5*eR(t):.5*(2-Math.pow(2,-10*(t-1))),tR=t=>1-Math.sin(Math.acos(t)),$U=LU(tR),UU=DU(tR),M7=W0(.42,0,1,1),D7=W0(0,0,.58,1),zU=W0(.42,0,.58,1),L7=t=>Array.isArray(t)&&typeof t[0]!="number",VU=t=>Array.isArray(t)&&typeof t[0]=="number",fM={linear:Ss,easeIn:M7,easeInOut:zU,easeOut:D7,circIn:tR,circInOut:UU,circOut:$U,backIn:eR,backInOut:FU,backOut:jU,anticipate:BU},j7=t=>typeof t=="string",pM=t=>{if(VU(t)){hg(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,i]=t;return W0(e,n,r,i)}else if(j7(t))return hg(fM[t]!==void 0,`Invalid easing type '${t}
258'`,"invalid-easing-type"),fM[t];return t},Tb=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],mM={value:null,addProjectionMetrics:null};function F7(t,e){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){a.has(d)&&(h.schedule(d),t()),l++,d(o)}const h={schedule:(d,f=!1,p=!1)=>{const y=p&&i?n:r;return f&&a.add(d),y.add(d),d},cancel:d=>{r.delete(d),a.delete(d)},process:d=>{if(o=d,i){s=!0;return}i=!0;const f=n;n=r,r=f,n.forEach(c),e&&mM.value&&mM.value.frameloop[e].push(l),l=0,n.clear(),i=!1,s&&(s=!1,h.process(d))}};return h}const B7=40;function HU(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Tb.reduce((b,k)=>(b[k]=F7(s,e?k:void 0),b),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:h,update:d,preRender:f,render:p,postRender:m}=a,y=()=>{const b=Su.useManualTiming,k=b?i.timestamp:performance.now();n=!1,b||(i.delta=r?1e3/60:Math.max(Math.min(k-i.timestamp,B7),1)),i.timestamp=k,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(y))},x=()=>{n=!0,r=!0,i.isProcessing||t(y)};return{schedule:Tb.reduce((b,k)=>{const _=a[k];return b[k]=(C,P=!1,R=!1)=>(n||x(),_.schedule(C,P,R)),b},{}),cancel:b=>{for(let k=0;k<Tb.length;k++)a[Tb[k]].cancel(b)},state:i,steps:a}}const{schedule:pt,cancel:ku,state:Jn,steps:XA}=HU(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ss,!0);let Sx;function $7(){Sx=void 0}const Ir={now:()=>(Sx===void 0&&Ir.set(Jn.isProcessing||Su.useManualTiming?Jn.timestamp:performance.now()),Sx),set:t=>{Sx=t,queueMicrotask($7)}},WU=t=>e=>typeof e=="string"&&e.startsWith(t),GU=WU("--"),U7=WU("var(--"),nR=t=>U7(t)?z7.test(t.split("/*")[0].trim()):!1,z7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gM(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Tg={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Pv={...Tg,transform:t=>po(0,1,t)},Pb={...Tg,default:1},Vy=t=>Math.round(t*1e5)/1e5,rR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function V7(t){return t==null}const H7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iR=(t,e)=>n=>!!(typeof n=="string"&&H7.test(n)&&n.startsWith(t)||e&&!V7(n)&&Object.prototype.hasOwnProperty.call(n,e)),qU=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(rR);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},W7=t=>po(0,255,t),QA={...Tg,transform:t=>Math.round(W7(t))},nh={test:iR("rgb","red"),parse:qU("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+QA.transform(t)+", "+QA.transform(e)+", "+QA.transform(n)+", "+Vy(Pv.transform(r))+")"};function G7(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const iC={test:iR("#"),parse:G7,transform:nh.transform},G0=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),zl=G0("deg"),uo=G0("%"),se=G0("px"),q7=G0("vh"),K7=G0("vw"),yM={...uo,parse:t=>uo.parse(t)/100,transform:t=>uo.transform(t*100)},Xf={test:iR("hsl","hue"),parse:qU("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+uo.transform(Vy(e))+", "+uo.transform(Vy(n))+", "+Vy(Pv.transform(r))+")"},gn={test:t=>nh.test(t)||iC.test(t)||Xf.test(t),parse:t=>nh.test(t)?nh.parse(t):Xf.test(t)?Xf.parse(t):iC.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?nh.transform(t):Xf.transform(t),getAnimatableNone:t=>{const e=gn.parse(t);return e.alpha=0,gn.transform(e)}},Y7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function X7(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(rR))==null?void 0:e.length)||0)+(((n=t.match(Y7))==null?void 0:n.length)||0)>0}const KU="number",YU="color",Q7="var",J7="var(",vM="${}",Z7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function dg(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=e.replace(Z7,l=>(gn.test(l)?(r.color.push(s),i.push(YU),n.push(gn.parse(l))):l.startsWith(J7)?(r.var.push(s),i.push(Q7),n.push(l)):(r.number.push(s),i.push(KU),n.push(parseFloat(l))),++s,vM)).split(vM);return{values:n,split:o,indexes:r,types:i}}function eX(t){return dg(t).values}function XU({split:t,types:e}){const n=t.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],r[s]!==void 0){const a=e[s];a===KU?i+=Vy(r[s]):a===YU?i+=gn.transform(r[s]):i+=r[s]}return i}}function tX(t){return XU(dg(t))}const nX=t=>typeof t=="number"?0:gn.test(t)?gn.getAnimatableNone(t):t,rX=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:nX(t);function iX(t){const e=dg(t);return XU(e)(e.values.map((r,i)=>rX(r,e.split[i])))}const oa={test:X7,parse:eX,createTransformer:tX,getAnimatableNone:iX};function JA(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function sX({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,a=0;if(!e)i=s=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=JA(l,o,t+1/3),s=JA(l,o,t),a=JA(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function JS(t,e){return n=>n>0?e:t}const Pt=(t,e,n)=>t+(e-t)*n,ZA=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},aX=[iC,nh,Xf],oX=t=>aX.find(e=>e.test(t));function wM(t){const e=oX(t);if(Mk(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===Xf&&(n=sX(n)),n}const bM=(t,e)=>{const n=wM(t),r=wM(e);if(!n||!r)return JS(t,e);const i={...n};return s=>(i.red=ZA(n.red,r.red,s),i.green=ZA(n.green,r.green,s),i.blue=ZA(n.blue,r.blue,s),i.alpha=Pt(n.alpha,r.alpha,s),nh.transform(i))},sC=new Set(["none","hidden"]);function lX(t,e){return sC.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function cX(t,e){return n=>Pt(t,e,n)}function sR(t){return typeof t=="number"?cX:typeof t=="string"?nR(t)?JS:gn.test(t)?bM:dX:Array.isArray(t)?QU:typeof t=="object"?gn.test(t)?bM:uX:JS}function QU(t,e){const n=[...t],r=n.length,i=t.map((s,a)=>
vendor: 21,854 bytes, line 258
258sR(s)(s,e[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function uX(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=sR(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function hX(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],a=t.indexes[s][r[s]],o=t.values[a]??0;n[i]=o,r[s]++}return n}const dX=(t,e)=>{const n=oa.createTransformer(e),r=dg(t),i=dg(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?sC.has(t)&&!i.values.length||sC.has(e)&&!r.values.length?lX(t,e):H0(QU(hX(r,i),i.values),n):(Mk(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),JS(t,e))};function JU(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Pt(t,e,n):sR(t)(t,e)}const fX=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>pt.update(e,n),stop:()=>ku(e),now:()=>Jn.isProcessing?Jn.timestamp:Ir.now()}},ZU=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ZS=2e4;function aR(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<ZS;)e+=n,r=t.next(e);return e>=ZS?1/0:e}function pX(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(aR(r),ZS);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:bs(i)}}const $t={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function aC(t,e){return t*Math.sqrt(1-e*e)}const mX=12;function gX(t,e,n){let r=n;for(let i=1;i<mX;i++)r=r-t(r)/e(r);return r}const eE=.001;function yX({duration:t=$t.duration,bounce:e=$t.bounce,velocity:n=$t.velocity,mass:r=$t.mass}){let i,s;Mk(t<=ii($t.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=po($t.minDamping,$t.maxDamping,a),t=po($t.minDuration,$t.maxDuration,bs(t)),a<1?(i=c=>{const h=c*a,d=h*t,f=h-n,p=aC(c,a),m=Math.exp(-d);return eE-f/p*m},s=c=>{const d=c*a*t,f=d*n+n,p=Math.pow(a,2)*Math.pow(c,2)*t,m=Math.exp(-d),y=aC(Math.pow(c,2),a);return(-i(c)+eE>0?-1:1)*((f-p)*m)/y}):(i=c=>{const h=Math.exp(-c*t),d=(c-n)*t+1;return-eE+h*d},s=c=>{const h=Math.exp(-c*t),d=(n-c)*(t*t);return h*d});const o=5/t,l=gX(i,s,o);if(t=ii(t),isNaN(l))return{stiffness:$t.stiffness,damping:$t.damping,duration:t};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:t}}}const vX=["duration","bounce"],wX=["stiffness","damping","mass"];function xM(t,e){return e.some(n=>t[n]!==void 0)}function bX(t){let e={velocity:$t.velocity,stiffness:$t.stiffness,damping:$t.damping,mass:$t.mass,isResolvedFromDuration:!1,...t};if(!xM(t,wX)&&xM(t,vX))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*po(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:$t.mass,stiffness:i,damping:s}}else{const n=yX({...t,velocity:0});e={...e,...n,mass:$t.mass},e.isResolvedFromDuration=!0}return e}function e1(t=$t.visualDuration,e=$t.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:l,damping:c,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=bX({...n,velocity:-bs(n.velocity||0)}),m=f||0,y=c/(2*Math.sqrt(l*h)),x=a-s,v=bs(Math.sqrt(l/h)),w=Math.abs(x)<5;r||(r=w?$t.restSpeed.granular:$t.restSpeed.default),i||(i=w?$t.restDelta.granular:$t.restDelta.default);let b,k,_,C,P,R;if(y<1)_=aC(v,y),C=(m+y*v*x)/_,b=M=>{const D=Math.exp(-y*v*M);return a-D*(C*Math.sin(_*M)+x*Math.cos(_*M))},P=y*v*C+x*_,R=y*v*x-C*_,k=M=>Math.exp(-y*v*M)*(P*Math.sin(_*M)+R*Math.cos(_*M));else if(y===1){b=D=>a-Math.exp(-v*D)*(x+(m+v*x)*D);const M=m+v*x;k=D=>Math.exp(-v*D)*(v*M*D-m)}else{const M=v*Math.sqrt(y*y-1);b=B=>{const z=Math.exp(-y*v*B),$=Math.min(M*B,300);return a-z*((m+y*v*x)*Math.sinh($)+M*x*Math.cosh($))/M};const D=(m+y*v*x)/M,j=y*v*D-x*M,U=y*v*x-D*M;k=B=>{const z=Math.exp(-y*v*B),$=Math.min(M*B,300);return z*(j*Math.sinh($)+U*Math.cosh($))}}const O={calculatedDuration:p&&d||null,velocity:M=>ii(k(M)),next:M=>{if(!p&&y<1){const j=Math.exp(-y*v*M),U=Math.sin(_*M),B=Math.cos(_*M),z=a-j*(C*U+x*B),$=ii(j*(P*U+R*B));return o.done=Math.abs($)<=r&&Math.abs(a-z)<=i,o.value=o.done?a:z,o}const D=b(M);if(p)o.done=M>=d;else{const j=ii(k(M));o.done=Math.abs(j)<=r&&Math.abs(a-D)<=i}return o.value=o.done?a:D,o},toString:()=>{const M=Math.min(aR(O),ZS),D=ZU(j=>O.next(M*j).value,M,30);return M+"ms "+D},toTransition:()=>{}};return O}e1.applyToOptions=t=>{const e=pX(t,100,e1);return t.ease=e.ease,t.duration=ii(e.duration),t.type="keyframes",t};const xX=5;function e4(t,e,n){const r=Math.max(e-xX,0);return OU(n-t(r),e-r)}function oC({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:h}){const d=t[0],f={done:!1,value:d},p=R=>o!==void 0&&R<o||l!==void 0&&R>l,m=R=>o===void 0?l:l===void 0||Math.abs(o-R)<Math.abs(l-R)?o:l;let y=n*e;const x=d+y,v=a===void 0?x:a(x);v!==x&&(y=v-d);const w=R=>-y*Math.exp(-R/r),b=R=>v+w(R),k=R=>{const O=w(R),M=b(R);f.done=Math.abs(O)<=c,f.value=f.done?v:M};let _,C;const P=R=>{p(f.value)&&(_=R,C=e1({keyframes:[f.value,m(f.value)],velocity:e4(b,R,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:h}))};return P(0),{calculatedDuration:null,next:R=>{let O=!1;return!C&&_===void 0&&(O=!0,k(R),P(R)),_!==void 0&&R>=_?C.next(R-_):(!O&&k(R),f)}}}function SX(t,e,n){const r=[],i=n||Su.mix||JU,s=t.length-1;for(let a=0;a<s;a++){let o=i(t[a],t[a+1]);if(e){const l=Array.isArray(e)?e[a]||Ss:e;o=H0(l,o)}r.push(o)}return r}function kX(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(hg(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=SX(e,r,i),l=o.length,c=h=>{if(a&&h<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(h<t[d+1]);d++);const f=Tv(t[d],t[d+1],h);return o[d](f)};return n?h=>c(po(t[0],t[s-1],h)):c}function AX(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Tv(0,e,r);t.push(Pt(n,1,i))}}function EX(t){const e=[0];return AX(e,t.length-1),e}function _X(t,e){return t.map(n=>n*e)}function CX(t,e){return t.map(()=>e||zU).splice(0,t.length-1)}function Hy({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=L7(r)?r.map(pM):pM(r),s={done:!1,value:e[0]},a=_X(n&&n.length===e.length?n:EX(e),t),o=kX(a,e,{ease:Array.isArray(i)?i:CX(e,i)});return{calculatedDuration:t,next:l=>(s.value=o(l),s.done=l>=t,s)}}const TX=t=>t!==null;function Dk(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(TX),o=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const PX={decay:oC,inertia:oC,tween:Hy,keyframes:Hy,spring:e1};function t4(t){typeof t.type=="string"&&(t.type=PX[t.type])}class oR{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const NX=t=>t/100;class t1 extends oR{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ir.now()&&this.tick(Ir.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;t4(e);const{type:n=Hy,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=e;let{keyframes:o}=e;const l=n||Hy;l!==Hy&&typeof o[0]!="number"&&(this.mixKeyframes=H0(NX,JU(o[0],o[1])),o=[0,100]);const c=l({...e,keyframes:o});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=aR(c));const{calculatedDuration:h}=c;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:h,repeat:d,repeatType:f,repeatDelay:p,type:m,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,k=r;if(d){const R=Math.min(this.currentTime,i)/o;let O=Math.floor(R),M=R%1;!M&&R>=1&&(M=1),M===1&&O--,O=Math.min(O,d+1),!!(O%2)&&(f==="reverse"?(M=1-M,p&&(M-=p/o)):f==="mirror"&&(k=a)),b=po(0,1,M)*o}let _;w?(this.delayState.value=h[0],_=this.delayState):_=k.next(b),s&&!w&&(_.value=s(_.value));let{done:C}=_;!w&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return P&&m!==oC&&(_.value=Dk(h,this.options,x,this.speed)),y&&y(_.value),P&&this.finish(),_}then(e,n){return this.finished.then(e,n)}get duration(){return bs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+bs(e)}get time(){return bs(this.currentTime)}set time(e){e=ii(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return e4(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Ir.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=bs(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=fX,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ir.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function RX(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const rh=t=>t*180/Math.PI,lC=t=>{const e=rh(Math.atan2(t[1],t[0]));return cC(e)},IX={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:lC,rotateZ:lC,skewX:t=>rh(Math.atan(t[1])),skewY:t=>rh(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},cC=t=>(t=t%360,t<0&&(t+=360),t),SM=lC,kM=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),AM=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),OX={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:kM,scaleY:AM,scale:t=>(kM(t)+AM(t))/2,rotateX:t=>cC(rh(Math.atan2(t[6],t[5]))),rotateY:t=>cC(rh(Math.atan2(-t[2],t[0]))),rotateZ:SM,rotate:SM,skewX:t=>rh(Math.atan(t[4])),skewY:t=>rh(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function uC(t){return t.includes("scale")?1:0}function hC(t,e){if(!t||t==="none")return uC(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=OX,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=IX,i=o}if(!i)return uC(e);const s=r[e],a=i[1].split(",").map(DX);return typeof s=="function"?s(a):a[s]}const MX=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return hC(n,e)};function DX(t){return parseFloat(t.trim())}const Pg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ng=new Set(Pg),EM=t=>t===Tg||t===se,LX=new Set(["x","y","z"]),jX=Pg.filter(t=>!LX.has(t));function FX(t){const e=[];return jX.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const iu={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const i=t.max-t.min;return r==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const i=t.max-t.min;return r==="border-box"?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>hC(e,"x"),y:(t,{transform:e})=>hC(e,"y")};iu.translateX=iu.x;iu.translateY=iu.y;const jd=new Set;let dC=!1,fC=!1,pC=!1;function n4(){if(fC){const t=Array.from(jd).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=FX(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))==null||o.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fC=!1,dC=!1,jd.forEach(t=>t.complete(pC)),jd.clear()}function r4(){jd.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fC=!0)})}function BX(){pC=!0,r4(),n4(),pC=!1}class lR{constructor(e,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(jd.add(this),dC||(dC=!0,pt.read(r4),pt.resolveKeyframes(n4))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),a=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const o=r.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&s===void 0&&i.set(e[0])}RX(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),jd.delete(this)}cancel(){this.state==="scheduled"&&(jd.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const $X=t=>t.startsWith("--");function i4(t,e,n){$X(e)?t.style.setProperty(e,n):t.style[e]=n}const UX={};function s4(t,e){const n=IU(t);return()=>UX[e]??n()}const zX=s4(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),a4=s4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ay=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,_M={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ay([0,.65,.55,1]),circOut:ay([.55,0,1,.45]),backIn:ay([.31,.01,.66,-.59]),backOut:ay([.33,1.53,.69,.99])};function o4(t,e){if(t)return typeof t=="function"?a4()?ZU(t,e):"ease-out":VU(t)?ay(t):Array.isArray(t)?t.map(n=>o4(n,e)||_M.easeOut):_M[t]}function VX(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c=void 0){const h={[e]:n};l&&(h.offset=l);const d=o4(o,i);Array.isArray(d)&&(h.easing=d);const f={delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(h,f)}function l4(t){return typeof t=="function"&&"applyToOptions"in t}function HX({type:t,...e}){return l4(t)&&a4()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class c4 extends oR{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=e,hg(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=HX(e);this.animation=VX(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const h=Dk(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(h),i4(n,r,h),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return bs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+bs(e)}get time(){return bs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ii(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&zX()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ss):i(this)}}const u4={anticipate:BU,backInOut:FU,circInOut:UU};function WX(t){return t in u4}function GX(t){typeof t.ease=="string"&&WX(t.ease)&&(t.ease=u4[t.ease])}const tE=10;class qX extends c4{constructor(e){GX(e),t4(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new t1({...a,autoplay:!1}),l=Math.max(tE,Ir.now()-this.startTime),c=po(0,tE,l-tE),h=o.sample(l).value,{name:d}=this.options;s&&d&&i4(s,d,h),n.setWithVelocity(o.sample(Math.max(0,l-c)).value,h,c),o.stop()}}const CM=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(oa.test(t)||t==="0")&&!t.startsWith("url("));function KX(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function YX(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],a=CM(i,e),o=CM(s,e);return Mk(a===o,`You are trying to animate ${e} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:KX(t)||(n==="spring"||l4(n))&&r}function mC(t){t.duration=0,t.type="keyframes"}const h4=new Set(["opacity","clipPath","filter","transform"]),XX=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function QX(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&XX.test(t[e]))return!0;return!1}const JX=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ZX=IU(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function eQ(t){var d;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:a,keyframes:o}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=e.owner.getProps();return ZX()&&n&&(h4.has(n)||JX.has(n)&&QX(o))&&(n!=="transform"||!h)&&!c&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const tQ=40;
258class nQ extends oR{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:l,motionValue:c,element:h,...d}){var m;super(),this.stop=()=>{var y,x;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Ir.now();const f={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:l,motionValue:c,element:h,...d},p=(h==null?void 0:h.KeyframeResolver)||lR;this.keyframeResolver=new p(o,(y,x,v)=>this.onKeyframesResolved(y,x,f,!v),l,c,h),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,i){var v,w;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:l,isHandoff:c,onUpdate:h}=r;this.resolvedAt=Ir.now();let d=!0;YX(e,s,a,o)||(d=!1,(Su.instantAnimations||!l)&&(h==null||h(Dk(e,r,n))),e[0]=e[e.length-1],mC(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>tQ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},m=d&&!c&&eQ(p),y=(w=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:w.current;let x;if(m)try{x=new qX({...p,element:y})}catch{x=new t1(p)}else x=new t1(p);x.finished.then(()=>{this.notifyFinished()}).catch(Ss),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),BX()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function d4(t,e,n,r=0,i=1){const s=Array.from(t).sort((c,h)=>c.sortNodePosition(h)).indexOf(e),a=t.size,o=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:o-s*r}const rQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function iQ(t){const e=rQ.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}const sQ=4;function f4(t,e,n=1){hg(n<=sQ,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=iQ(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const a=s.trim();return PU(a)?parseFloat(a):a}return nR(i)?f4(i,e,n+1):i}const aQ={type:"spring",stiffness:500,damping:25,restSpeed:10},oQ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),lQ={type:"keyframes",duration:.8},cQ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uQ=(t,{keyframes:e})=>e.length>2?lQ:Ng.has(t)?t.startsWith("scale")?oQ(e[1]):aQ:cQ;function p4(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function cR(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?p4(n,t):n}const hQ=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function dQ(t){for(const e in t)if(!hQ.has(e))return!0;return!1}const uR=(t,e,n,r={},i,s)=>a=>{const o=cR(r,t)||{},l=o.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ii(l);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-c,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:s?void 0:i};dQ(o)||Object.assign(h,uQ(t,h)),h.duration&&(h.duration=ii(h.duration)),h.repeatDelay&&(h.repeatDelay=ii(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(mC(h),h.delay===0&&(
vendor: 8,796 bytes, line 258
258d=!0)),(Su.instantAnimations||Su.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(d=!0,mC(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,d&&!s&&e.get()!==void 0){const f=Dk(h.keyframes,o);if(f!==void 0){pt.update(()=>{h.onUpdate(f),h.onComplete()});return}}return o.isSync?new t1(h):new nQ(h)};function TM(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function hR(t,e,n,r){if(typeof e=="function"){const[i,s]=TM(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=TM(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function Fd(t,e,n){const r=t.getProps();return hR(r,e,n!==void 0?n:r.custom,t)}const m4=new Set(["width","height","top","left","right","bottom",...Pg]),PM=30,fQ=t=>!isNaN(parseFloat(t));class pQ{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Ir.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ir.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fQ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ZN);const r=this.events[e].add(n);return e==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ir.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>PM)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,PM);return OU(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fg(t,e){return new pQ(t,e)}const gC=t=>Array.isArray(t);function mQ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,fg(n))}function gQ(t){return gC(t)?t[t.length-1]||0:t}function yQ(t,e){const n=Fd(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=gQ(s[a]);mQ(t,a,o)}}const nr=t=>!!(t&&t.getVelocity);function vQ(t){return!!(nr(t)&&t.add)}function yC(t,e){const n=t.getValue("willChange");if(vQ(n))return n.add(e);if(!n&&Su.WillChange){const r=new Su.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function dR(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const wQ="framerAppearId",g4="data-"+dR(wQ);function y4(t){return t.props[g4]}function bQ({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function v4(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();s=s?p4(s,l):l;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const h=[],d=i&&t.animationState&&t.animationState.getState()[i];for(const f in o){const p=t.getValue(f,t.latestValues[f]??null),m=o[f];if(m===void 0||d&&bQ(d,f))continue;const y={delay:n,...cR(s||{},f)},x=p.get();if(x!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===x&&!y.velocity){pt.update(()=>p.set(m));continue}let v=!1;if(window.MotionHandoffAnimation){const k=y4(t);if(k){const _=window.MotionHandoffAnimation(k,f,pt);_!==null&&(y.startTime=_,v=!0)}}yC(t,f);const w=c??t.shouldReduceMotion;p.start(uR(f,p,m,w&&m4.has(f)?{type:!1}:y,t,v));const b=p.animation;b&&h.push(b)}if(a){const f=()=>pt.update(()=>{a&&yQ(t,a)});h.length?Promise.all(h).then(f):f()}return h}function vC(t,e,n={}){var l;const r=Fd(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(v4(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:f}=i;return xQ(t,e,c,h,d,f,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[c,h]=o==="beforeChildren"?[s,a]:[a,s];return c().then(()=>h())}else return Promise.all([s(),a(n.delay)])}function xQ(t,e,n=0,r=0,i=0,s=1,a){const o=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),o.push(vC(l,e,{...a,delay:n+(typeof r=="function"?0:r)+d4(t.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function SQ(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>vC(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=vC(t,e,n);else{const i=typeof e=="function"?Fd(t,e,n.custom):e;r=Promise.all(v4(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const kQ={test:t=>t==="auto",parse:t=>t},w4=t=>e=>e.test(t),b4=[Tg,se,uo,zl,K7,q7,kQ],NM=t=>b4.find(w4(t));function AQ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||RU(t):!0}const EQ=new Set(["brightness","contrast","saturate","opacity"]);function _Q(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(rR)||[];if(!r)return t;const i=n.replace(r,"");let s=EQ.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const CQ=/\b([a-z-]*)\(.*?\)/gu,wC={...oa,getAnimatableNone:t=>{const e=t.match(CQ);return e?e.map(_Q).join(" "):t}},bC={...oa,getAnimatableNone:t=>{const e=oa.parse(t);return oa.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},RM={...Tg,transform:Math.round},TQ={rotate:zl,rotateX:zl,rotateY:zl,rotateZ:zl,scale:Pb,scaleX:Pb,scaleY:Pb,scaleZ:Pb,skew:zl,skewX:zl,skewY:zl,distance:se,translateX:se,translateY:se,translateZ:se,x:se,y:se,z:se,perspective:se,transformPerspective:se,opacity:Pv,originX:yM,originY:yM,originZ:se},fR={borderWidth:se,borderTopWidth:se,borderRightWidth:se,borderBottomWidth:se,borderLeftWidth:se,borderRadius:se,borderTopLeftRadius:se,borderTopRightRadius:se,borderBottomRightRadius:se,borderBottomLeftRadius:se,width:se,maxWidth:se,height:se,maxHeight:se,top:se,right:se,bottom:se,left:se,inset:se,insetBlock:se,insetBlockStart:se,insetBlockEnd:se,insetInline:se,insetInlineStart:se,insetInlineEnd:se,padding:se,paddingTop:se,paddingRight:se,paddingBottom:se,paddingLeft:se,paddingBlock:se,paddingBlockStart:se,paddingBlockEnd:se,paddingInline:se,paddingInlineStart:se,paddingInlineEnd:se,margin:se,marginTop:se,marginRight:se,marginBottom:se,marginLeft:se,marginBlock:se,marginBlockStart:se,marginBlockEnd:se,marginInline:se,marginInlineStart:se,marginInlineEnd:se,fontSize:se,backgroundPositionX:se,backgroundPositionY:se,...TQ,zIndex:RM,fillOpacity:Pv,strokeOpacity:Pv,numOctaves:RM},PQ={...fR,color:gn,backgroundColor:gn,outlineColor:gn,fill:gn,stroke:gn,borderColor:gn,borderTopColor:gn,borderRightColor:gn,borderBottomColor:gn,borderLeftColor:gn,filter:wC,WebkitFilter:wC,mask:bC,WebkitMask:bC},x4=t=>PQ[t],NQ=new Set([wC,bC]);function S4(t,e){let n=x4(t);return NQ.has(n)||(n=oa),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const RQ=new Set(["auto","none","0"]);function IQ(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!RQ.has(s)&&dg(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=S4(n,i)}class OQ extends lR{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let d=e[h];
vendor: 1,295 bytes, line 258
258if(typeof d=="string"&&(d=d.trim(),nR(d))){const f=f4(d,n.current);f!==void 0&&(e[h]=f),h===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!m4.has(r)||e.length!==2)return;const[i,s]=e,a=NM(i),o=NM(s),l=gM(i),c=gM(s);if(l!==c&&iu[r]){this.needsMeasurement=!0;return}if(a!==o)if(EM(a)&&EM(o))for(let h=0;h<e.length;h++){const d=e[h];typeof d=="string"&&(e[h]=parseFloat(d))}else iu[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||AQ(e[i]))&&r.push(i);r.length&&IQ(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=iu[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var o;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=iu[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEac
vendor: 49,882 bytes, line 258
258h(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function k4(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(r=>r!=null)}const A4=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function kx(t){return NU(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:pR,cancel:_pe}=HU(queueMicrotask,!1),Ms={x:!1,y:!1};function E4(){return Ms.x||Ms.y}function MQ(t){return t==="x"||t==="y"?Ms[t]?null:(Ms[t]=!0,()=>{Ms[t]=!1}):Ms.x||Ms.y?null:(Ms.x=Ms.y=!0,()=>{Ms.x=Ms.y=!1})}function _4(t,e){const n=k4(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function DQ(t){return!(t.pointerType==="touch"||E4())}function LQ(t,e,n={}){const[r,i,s]=_4(t,n);return r.forEach(a=>{let o=!1,l=!1,c;const h=()=>{a.removeEventListener("pointerleave",m)},d=x=>{c&&(c(x),c=void 0),h()},f=x=>{o=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,d(x))},p=()=>{o=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=x=>{if(x.pointerType!=="touch"){if(o){l=!0;return}d(x)}},y=x=>{if(!DQ(x))return;l=!1;const v=e(a,x);typeof v=="function"&&(c=v,a.addEventListener("pointerleave",m,i))};a.addEventListener("pointerenter",y,i),a.addEventListener("pointerdown",p,i)}),s}const C4=(t,e)=>e?t===e?!0:C4(t,e.parentElement):!1,mR=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,jQ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FQ(t){return jQ.has(t.tagName)||t.isContentEditable===!0}const BQ=new Set(["INPUT","SELECT","TEXTAREA"]);function $Q(t){return BQ.has(t.tagName)||t.isContentEditable===!0}const Ax=new WeakSet;function IM(t){return e=>{e.key==="Enter"&&t(e)}}function nE(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const UQ=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=IM(()=>{if(Ax.has(n))return;nE(n,"down");const i=IM(()=>{nE(n,"up")}),s=()=>nE(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function OM(t){return mR(t)&&!E4()}const MM=new WeakSet;function zQ(t,e,n={}){const[r,i,s]=_4(t,n),a=o=>{const l=o.currentTarget;if(!OM(o)||MM.has(o))return;Ax.add(l),n.stopPropagation&&MM.add(o);const c=e(l,o),h=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Ax.has(l)&&Ax.delete(l),OM(p)&&typeof c=="function"&&c(p,{success:m})},d=p=>{h(p,l===window||l===document||n.useGlobalTarget||C4(l,p.target))},f=p=>{h(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),kx(o)&&(o.addEventListener("focus",c=>UQ(c,i)),!FQ(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function gR(t){return NU(t)&&"ownerSVGElement"in t}const Ex=new WeakMap;let Vl;const T4=(t,e,n)=>(r,i)=>i&&i[0]?i[0][t+"Size"]:gR(r)&&"getBBox"in r?r.getBBox()[e]:r[n],VQ=T4("inline","width","offsetWidth"),HQ=T4("block","height","offsetHeight");function WQ({target:t,borderBoxSize:e}){var n;(n=Ex.get(t))==null||n.forEach(r=>{r(t,{get width(){return VQ(t,e)},get height(){return HQ(t,e)}})})}function GQ(t){t.forEach(WQ)}function qQ(){typeof ResizeObserver>"u"||(Vl=new ResizeObserver(GQ))}function KQ(t,e){Vl||qQ();const n=k4(t);return n.forEach(r=>{let i=Ex.get(r);i||(i=new Set,Ex.set(r,i)),i.add(e),Vl==null||Vl.observe(r)}),()=>{n.forEach(r=>{const i=Ex.get(r);i==null||i.delete(e),i!=null&&i.size||Vl==null||Vl.unobserve(r)})}}const _x=new Set;let Qf;function YQ(){Qf=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};_x.forEach(e=>e(t))},window.addEventListener("resize",Qf)}function XQ(t){return _x.add(t),Qf||YQ(),()=>{_x.delete(t),!_x.size&&typeof Qf=="function"&&(window.removeEventListener("resize",Qf),Qf=void 0)}}function DM(t,e){return typeof t=="function"?XQ(t):KQ(t,e)}function QQ(t){return gR(t)&&t.tagName==="svg"}const JQ=[...b4,gn,oa],ZQ=t=>JQ.find(w4(t)),LM=()=>({translate:0,scale:1,origin:0,originPoint:0}),Jf=()=>({x:LM(),y:LM()}),jM=()=>({min:0,max:0}),Cn=()=>({x:jM(),y:jM()}),eJ=new WeakMap;function Lk(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Nv(t){return typeof t=="string"||Array.isArray(t)}const yR=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vR=["initial",...yR];function jk(t){return Lk(t.animate)||vR.some(e=>Nv(t[e]))}function P4(t){return!!(jk(t)||t.variants)}function tJ(t,e,n){for(const r in e){const i=e[r],s=n[r];if(nr(i))t.addValue(r,i);else if(nr(s))t.addValue(r,fg(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(r);t.addValue(r,fg(a!==void 0?a:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const xC={current:null},N4={current:!1},nJ=typeof window<"u";function rJ(){if(N4.current=!0,!!nJ)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xC.current=t.matches;t.addEventListener("change",e),e()}else xC.current=!1}const FM=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let n1={};function R4(t){n1=t}function iJ(){return n1}class sJ{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=lR,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ir.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,pt.render(this.render,!1,!0))};const{latestValues:c,renderState:h}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=jk(n),this.isVariantNode=P4(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];c[p]!==void 0&&nr(m)&&m.set(c[p])}}mount(e){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,eJ.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(N4.current||rJ(),this.shouldReduceMotion=xC.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),ku(this.notifyUpdate),ku(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&h4.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:c,duration:h}=n.accelerate,d=new c4({element:this.current,name:e,keyframes:o,times:l,ease:c,duration:ii(h)}),f=a(d);this.valueSubscriptions.set(e,()=>{f(),d.cancel()});return}const r=Ng.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in n1){const n=n1[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<FM.length;r++){const i=FM[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=e[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=tJ(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=fg(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(PU(r)||RU(r))?r=parseFloat(r):!ZQ(r)&&oa.test(n)&&(r=S4(e,n)),this.setBaseTarget(e,nr(r)?r.get():r)),nr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=hR(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!nr(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ZN),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){pR.render(this.render)}}class I4 extends sJ{constructor(){super(...arguments),this.KeyframeResolver=OQ}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;nr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Iu{constructor(e){this.isMounted=!1,this.node=e}update(){}}function O4({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function aJ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function oJ(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function rE(t){return t===void 0||t===1}function SC({scale:t,scaleX:e,scaleY:n}){return!rE(t)||!rE(e)||!rE(n)}function zu(t){return SC(t)||M4(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function M4(t){return BM(t.x)||BM(t.y)}function BM(t){return t&&t!=="0%"}function r1(t,e,n){const r=t-n,i=e*r;return n+i}function $M(t,e,n,r,i){return i!==void 0&&(t=r1(t,i,r)),r1(t,n,r)+e}function kC(t,e=0,n=1,r,i){t.min=$M(t.min,e,n,r,i),t.max=$M(t.max,e,n,r,i)}function D4(t,{x:e,y:n}){kC(t.x,e.translate,e.scale,e.originPoint),kC(t.y,n.translate,n.scale,n.originPoint)}const UM=.999999999999,zM=1.0000000000001;function lJ(t,e,n,r=!1){var o;const i=n.length;if(!i)return;e.x=e.y=1;let s,a;for(let l=0;l<i;l++){s=n[l],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(eo(t.x,-s.scroll.offset.x),eo(t.y,-s.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,D4(t,a)),r&&zu(s.latestValues)&&Cx(t,s.latestValues,(o=s.layout)==null?void 0:o.layoutBox))}e.x<zM&&e.x>UM&&(e.x=1),e.y<zM&&e.y>UM&&(e.y=1)}function eo(t,e){t.min+=e,t.max+=e}function VM(t,e,n,r,i=.5){const s=Pt(t.min,t.max,i);kC(t,e,n,s,r)}function HM(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Cx(t,e,n){const r=n??t;VM(t.x,HM(e.x,r.x),e.scaleX,e.scale,e.originX),VM(t.y,HM(e.y,r.y),e.scaleY,e.scale,e.originY)}function L4(t,e){return O4(oJ(t.getBoundingClientRect(),e))}function cJ(t,e,n){const r=L4(t,n),{scroll:i}=e;return i&&(eo(r.x,i.offset.x),eo(r.y,i.offset.y)),r}const uJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hJ=Pg.length;function dJ(t,e,n){let r="",i=!0;for(let s=0;s<hJ;s++){const a=Pg[s],o=t[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const c=parseFloat(o);l=a.startsWith("scale")?c===1:c===0}if(!l||n){const c=A4(o,fR[a]);if(!l){i=!1;const h=uJ[a]||a;r+=`${h}(${c}) `}n&&(e[a]=c)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function wR(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let a=!1,o=!1;for(const l in e){const c=e[l];if(Ng.has(l)){a=!0;continue}else if(GU(l)){i[l]=c;continue}else{const h=A4(c,fR[l]);l.startsWith("origin")?(o=!0,s[l]=h):r[l]=h}}if(e.transform||(a||n?r.transform=dJ(e,t.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:c="50%",originZ:h=0}=s;r.transformOrigin=`${l} ${c} ${h}`}}function j4(t,{style:e,vars:n},r,i){const s=t.style;let a;for(a in e)s[a]=e[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function WM(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Gg={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(se.test(t))t=parseFloat(t);else return t;const n=WM(t,e.target.x),r=WM(t,e.target.y);return`${n}% ${r}%`}},fJ={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=oa.parse(t);if(i.length>5)return r;const s=oa.createTransformer(t),a=typeof i[0]!="number"?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const c=Pt(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}},AC={borderRadius:{...Gg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gg,borderTopRightRadius:Gg,borderBottomLeftRadius:Gg,borderBottomRightRadius:Gg,boxShadow:fJ};function F4(t,{layout:e,layoutId:n}){return Ng.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!AC[t]||t==="opacity")}function bR(t,e,n){var a;const r=t.style,i=e==null?void 0:e.style,s={};if(!r)return s;for(const o in r)(nr(r[o])||i&&nr(i[o])||F4(o,t)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function pJ(t){return window.getComputedStyle(t)}class mJ extends I4{constructor(){super(...arguments),this.type="html",this.renderInstance=j4}readValueFromInstance(e,n){var r;if(Ng.has(n))return(r=this.projection)!=null&&r.isProjecting?uC(n):MX(e,n);{const i=pJ(e),s=(GU(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return L4(e,n)}build(e,n,r){wR(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return bR(e,n,r)}}const gJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},yJ={offset:"strokeDashoffset",array:"strokeDasharray"};function vJ(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?gJ:yJ;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const wJ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function B4(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},l,c,h){if(wR(t,o,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f}=t;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete d.transformBox);for(const p of wJ)d[p]!==void 0&&(f[p]=d[p],delete d[p]);e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&vJ(d,i,s,a,!1)}const $4=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),U4=t=>typeof t=="string"&&t.toLowerCase()==="svg";function bJ(t,e,n,r){j4(t,e,void 0,r);for(const i in e.attrs)t.setAttribute($4.has(i)?i:dR(i),e.attrs[i])}function z4(t,e,n){const r=bR(t,e,n);for(const i in t)if(nr(t[i])||nr(e[i])){const s=Pg.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}class xJ extends I4{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ng.has(n)){const r=x4(n);return r&&r.default||0}return n=$4.has(n)?n:dR(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return z4(e,n,r)}build(e,n,r){B4(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){bJ(e,n,r,i)}mount(e){this.isSVGTag=U4(e.tagName),super.mount(e)}}const SJ=vR.length;function V4(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?V4(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<SJ;n++){const r=vR[n],i=t.props[r];(Nv(i)||i===!1)&&(e[r]=i)}return e}function H4(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const kJ=[...yR].reverse(),AJ=yR.length;function EJ(t){return e=>Promise.all(e.map(({animation:n,options:r})=>SQ(t,n,r)))}function _J(t){let e=EJ(t),n=GM(),r=!0,i=!1;const s=c=>(h,d)=>{var p;const f=Fd(t,d,c==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:y,...x}=f;h={...h,...x,...y}}return h};function a(c){e=c(t)}function o(c){const{props:h}=t,d=V4(t.parent)||{},f=[],p=new Set;let m={},y=1/0;for(let v=0;v<AJ;v++){const w=kJ[v],b=n[w],k=h[w]!==void 0?h[w]:d[w],_=Nv(k),C=w===c?b.isActive:null;C===!1&&(y=v);let P=k===d[w]&&k!==h[w]&&_;if(P&&(r||i)&&t.manuallyAnimateOnMount&&(P=!1),b.protectedKeys={...m},!b.isActive&&C===null||!k&&!b.prevProp||Lk(k)||typeof k=="boolean")continue;if(w==="exit"&&b.isActive&&C!==!0){b.prevResolvedValues&&(m={...m,...b.prevResolvedValues});continue}const R=CJ(b.prevProp,k);let O=R||w===c&&b.isActive&&!P&&_||v>y&&_,M=!1;const D=Array.isArray(k)?k:[k];let j=D.reduce(s(w),{});C===!1&&(j={});const{prevResolvedValues:U={}}=b,B={...U,...j},z=L=>{O=!0,p.has(L)&&(M=!0,p.delete(L)),b.needsAnimating[L]=!0;const V=t.getValue(L);V&&(V.liveStyle=!1)};for(const L in B){const V=j[L],N=U[L];if(m.hasOwnProperty(L))continue;let G=!1;gC(V)&&gC(N)?G=!H4(V,N):G=V!==N,G?V!=null?z(L):p.add(L):V!==void 0&&p.has(L)?z(L):b.protectedKeys[L]=!0}b.prevProp=k,b.prevResolvedValues=j,b.isActive&&(m={...m,...j}),(r||i)&&t.blockInitialAnimation&&(O=!1);const $=P&&R;O&&(!$||M)&&f.push(...D.map(L=>{const V={type:w};if(typeof L=="string"&&(r||i)&&!$&&t.manuallyAnimateOnMount&&t.parent){const{parent:N}=t,G=Fd(N,L);if(N.enteringChildren&&G){const{delayChildren:Y}=G.transition||{};V.delay=d4(N.enteringChildren,t,Y)}}return{animation:L,options:V}}))}if(p.size){const v={};if(typeof h.initial!="boolean"){const w=Fd(t,Array.isArray(h.initial)?h.initial[0]:h.initial);w&&w.transition&&(v.transition=w.transition)}p.forEach(w=>{const b=t.getBaseTarget(w),k=t.getValue(w);k&&(k.liveStyle=!0),v[w]=b??null}),f.push({animation:v})}let x=!!f.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,i=!1,x?e(f):Promise.resolve()}function l(c,h){var f;if(n[c].isActive===h)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(c,h)}),n[c].isActive=h;const d=o(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=GM(),i=!0}}}function CJ(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!H4(e,t):!1}function Lu(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function GM(){return{animate:Lu(!0),whileInView:Lu(),whileHover:Lu(),whileTap:Lu(),whileDrag:Lu(),whileFocus:Lu(),exit:Lu()}}function EC(t,e){t.min=e.min,t.max=e.max}function Ns(t,e){EC(t.x,e.x),EC(t.y,e.y)}function qM(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const W4=1e-4,TJ=1-W4,PJ=1+W4,G4=.01,NJ=0-G4,RJ=0+G4;function Or(t){return t.max-t.min}function IJ(t,e,n){return Math.abs(t-e)<=n}function KM(t,e,n,r=.5){t.origin=r,t.originPoint=Pt(e.min,e.max,t.origin),t.scale=Or(n)/Or(e),t.translate=Pt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=TJ&&t.scale<=PJ||isNaN(t.scale))&&(t.scale=1),(t.translate>=NJ&&t.translate<=RJ||isNaN(t.translate))&&(t.translate=0)}function Wy(t,e,n,r){KM(t.x,e.x,n.x,r?r.originX:void 0),KM(t.y,e.y,n.y,r?r.originY:void 0)}function YM(t,e,n,r=0){const i=r?Pt(n.min,n.max,r):n.min;t.min=i+e.min,t.max=t.min+Or(e)}function OJ(t,e,n,r){YM(t.x,e.x,n.x,r==null?void 0:r.x),YM(t.y,e.y,n.y,r==null?void 0:r.y)}function XM(t,e,n,r=0){const i=r?Pt(n.min,n.max,r):n.min;t.min=e.min-i,t.max=t.min+Or(e)}function i1(t,e,n,r){XM(t.x,e.x,n.x,r==null?void 0:r.x),XM(t.y,e.y,n.y,r==null?void 0:r.y)}function QM(t,e,n,r,i){return t-=e,t=r1(t,1/n,r),i!==void 0&&(t=r1(t,1/i,r)),t}function MJ(t,e=0,n=1,r=.5,i,s=t,a=t){if(uo.test(e)&&(e=parseFloat(e),e=Pt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=Pt(s.min,s.max,r);t===s&&(o-=e),t.min=QM(t.min,e,n,o,i),t.max=QM(t.max,e,n,o,i)}function JM(t,e,[n,r,i],s,a){MJ(t,e[n],e[r],e[i],e.scale,s,a)}const DJ=["x","scaleX","originX"],LJ=["y","scaleY","originY"];function ZM(t,e,n,r){JM(t.x,e,DJ,n?n.x:void 0,r?r.x:void 0),JM(t.y,e,LJ,n?n.y:void 0,r?r.y:void 0)}function eD(t){return t.translate===0&&t.scale===1}function q4(t){return eD(t.x)&&eD(t.y)}function tD(t,e){return t.min===e.min&&t.max===e.max}function jJ(t,e){return tD(t.x,e.x)&&tD(t.y,e.y)}function nD(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function K4(t,e){return nD(t.x,e.x)&&nD(t.y,e.y)}function rD(t){return Or(t.x)/Or(t.y)}function iD(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ea(t){return[t("x"),t("y")]}function FJ(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:h,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),h&&(r+=`rotate(${h}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const Y4=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],BJ=Y4.length,sD=t=>typeof t=="string"?parseFloat(t):t,aD=t=>typeof t=="number"||se.test(t);function $J(t,e,n,r,i,s){i?(t.opacity=Pt(0,n.opacity??1,UJ(r)),t.opacityExit=Pt(e.opacity??1,0,zJ(r))):s&&(t.opacity=Pt(e.opacity??1,n.opacity??1,r));for(let a=0;a<BJ;a++){const o=Y4[a];let l=oD(e,o),c=oD(n,o);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||aD(l)===aD(c)?(t[o]=Math.max(Pt(sD(l),sD(c),r),0),(uo.test(c)||uo.test(l))&&(t[o]+="%")):t[o]=c}(e.rotate||n.rotate)&&(t.rotate=Pt(e.rotate||0,n.rotate||0,r))}function oD(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const UJ=X4(0,.5,$U),zJ=X4(.5,.95,Ss);function X4(t,e,n){return r=>r<t?0:r>e?1:n(Tv(t,e,r))}function VJ(t,e,n){const r=nr(t)?t:fg(t);return r.start(uR("",r,e,n)),r.animation}function Rv(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const HJ=(t,e)=>t.depth-e.depth;class WJ{constructor(){this.children=[],this.isDirty=!1}add(e){JN(this.children,e),this.isDirty=!0}remove(e){QS(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(HJ),this.isDirty=!1,this.children.forEach(e)}}function GJ(t,e){const n=Ir.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(ku(r),t(s-e))};return pt.setup(r,!0),()=>ku(r)}function Tx(t){return nr(t)?t.get():t}class qJ{constructor(){this.members=[]}add(e){JN(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(QS(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(QS(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:a}=e.options;(s===void 0||s!==a)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,i,s,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(i=e.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||a.call(s)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Px={hasAnimatedSinceResize:!0,hasEverUpdated:!1},iE=["","X","Y","Z"],KJ=1e3;let YJ=0;function sE(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Q4(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=y4(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",pt,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Q4(r)}function J4({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=e==null?void 0:e()){this.id=YJ++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(JJ),this.nodes.forEach(iZ),this.nodes.forEach(sZ),this.nodes.forEach(ZJ)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new WJ)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new ZN),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=gR(a)&&!QQ(a),this.instance=a;const{layoutId:o,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),t){let h,d=0;const f=()=>this.root.updateBlockedByResize=!1;pt.read(()=>{d=window.innerWidth}),t(a,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,h&&h(),h=GJ(f,250),Px.hasAnimatedSinceResize&&(Px.hasAnimatedSinceResize=!1,this.nodes.forEach(uD)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&c&&(o||l)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||uZ,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=c.getProps(),v=!this.targetLayout||!K4(this.targetLayout,p),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...cR(m,"layout"),onPlay:y,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(h,w)}else d||uD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ku(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aZ),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Q4(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(tZ),this.nodes.forEach(lD);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(cD);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nZ),this.nodes.forEach(rZ),this.nodes.forEach(XJ),this.nodes.forEach(QJ)):this.nodes.forEach(cD),this.clearAllSnapshots();const o=Ir.now();Jn.delta=po(0,1e3/60,o-Jn.timestamp),Jn.timestamp=o,Jn.isProcessing=!0,XA.update.process(Jn),XA.preRender.process(Jn),XA.render.process(Jn),Jn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pR.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eZ),this.sharedNodes.forEach(oZ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Or(this.snapshot.measuredBox.x)&&!Or(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Cn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!q4(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,h=c!==this.prevTransformTemplateValue;a&&this.instance&&(o||zu(this.latestValues)||h)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),hZ(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return Cn();const o=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(dZ))){const{scroll:h}=this.root;h&&(eo(o.x,h.offset.x),eo(o.y,h.offset.y))}return o}removeElementScroll(a){var l;const o=Cn();if(Ns(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let c=0;c<this.path.length;c++){const h=this.path[c],{scroll:d,options:f}=h;h!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Ns(o,a),eo(o.x,d.offset.x),eo(o.y,d.offset.y))}return o}applyTransform(a,o=!1,l){var h,d;const c=l||Cn();Ns(c,a);for(let f=0;f<this.path.length;f++){const p=this.path[f];!o&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(eo(c.x,-p.scroll.offset.x),eo(c.y,-p.scroll.offset.y)),zu(p.latestValues)&&Cx(c,p.latestValues,(h=p.layout)==null?void 0:h.layoutBox)}return zu(this.latestValues)&&Cx(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(a){var l;const o=Cn();Ns(o,a);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!zu(h.latestValues))continue;let d;h.instance&&(SC(h.latestValues)&&h.updateSnapshot(),d=Cn(),Ns(d,h.measurePageBox())),ZM(o,h.latestValues,(l=h.snapshot)==null?void 0:l.layoutBox,d)}return zu(this.latestValues)&&ZM(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Jn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!this.layout||!(h||d))return;this.resolvedRelativeTargetAt=Jn.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Cn(),this.targetWithTransforms=Cn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ns(this.target,this.layout.layoutBox),D4(this.target,this.targetDelta)):Ns(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||SC(this.parent.latestValues)||M4(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Cn(),this.relativeTargetOrigin=Cn(),i1(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),Ns(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Jn.timestamp&&(l=!1),l)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;Ns(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;lJ(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Cn());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qM(this.prevProjectionDelta.x,this.projectionDelta.x),qM(this.prevProjectionDelta.y,this.projectionDelta.y)),Wy(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!iD(this.projectionDelta.x,this.prevProjectionDelta.x)||!iD(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Jf(),this.projectionDelta=Jf(),this.projectionDeltaWithTransform=Jf()}setAnimationOrigin(a,o=!1){const l=this.snapshot,c=l?l.latestValues:{},h={...this.latestValues},d=Jf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const f=Cn(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,y=p!==m,x=this.getStack(),v=!x||x.members.length<=1,w=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(cZ));this.animationProgress=0;let b;this.mixTargetDelta=k=>{const _=k/1e3;hD(d.x,a.x,_),hD(d.y,a.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(i1(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lZ(this.relativeTarget,this.relativeTargetOrigin,f,_),b&&jJ(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Cn()),Ns(b,this.relativeTarget)),y&&(this.animationValues=h,$J(h,c,this.latestValues,_,w,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,c;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(ku(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Px.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fg(0)),this.motionValue.jump(0,!1),this.currentAnimation=VJ(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KJ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:c,latestValues:h}=a;if(!(!o||!l||!c)){if(this!==a&&this.layout&&c&&Z4(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Cn();const d=Or(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=Or(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}Ns(o,l),Cx(o,h),Wy(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new qJ),this.sharedNodes.get(a).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const c={};l.z&&sE("z",a,c,this.animationValues);for(let h=0;h<iE.length;h++)sE(`rotate${iE[h]}`,a,c,this.animationValues),sE(`skew${iE[h]}`,a,c,this.animationValues);a.render();for(const h in c)a.setStaticValue(h,c[h]),this.animationValues&&(this.animationValues[h]=c[h]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Tx(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Tx(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!zu(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=FJ(this.projectionDeltaWithTransform,this.treeScale,h);l&&(d=l(h,d)),a.transform=d;const{x:f,y:p}=this.projectionDelta;a.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=c===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const m in AC){if(h[m]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:v}=AC[m],w=d==="none"?h[m]:y(h[m],c);if(x){const b=x.length;for(let k=0;k<b;k++)a[x[k]]=w}else v?this.options.visualElement.renderState.vars[m]=w:a[m]=w}this.options.layoutId&&(a.pointerEvents=c===this?Tx(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(lD),this.root.sharedNodes.clear()}}}function XJ(t){t.updateLayout()}function QJ(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,a=e.source!==t.layout.source;if(s==="size")Ea(d=>{const f=a?e.measuredBox[d]:e.layoutBox[d],p=Or(f);f.min=r[d].min,f.max=f.min+p});else if(s==="x"||s==="y"){const d=s==="x"?"y":"x";EC(a?e.measuredBox[d]:e.layoutBox[d],r[d])}else Z4(s,e.layoutBox,r)&&Ea(d=>{const f=a?e.measuredBox[d]:e.layoutBox[d],p=Or(r[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const o=Jf();Wy(o,r,e.layoutBox);const l=Jf();a?Wy(l,t.applyTransform(i,!0),e.measuredBox):Wy(l,r,e.layoutBox);const c=!q4(o);let h=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=t.options.layoutAnchor||void 0,y=Cn();i1(y,e.layoutBox,f.layoutBox,m);const x=Cn();i1(x,r,p.layoutBox,m),K4(y,x)||(h=!0),d.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=y,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function JJ(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
258isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ZJ(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eZ(t){t.clearSnapshot()}function lD(t){t.clearMeasurements()}function tZ(t){t.isLayoutDirty=!0,t.updateLayout()}function cD(t){t.isLayoutDirty=!1}function nZ(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function rZ(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function uD(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function iZ(t){t.resolveTargetDelta()}function sZ(t){t.calcProjection()}function aZ(t){t.resetSkewAndRotation()}function oZ(t){t.removeLeadSnapshot()}function hD(t,e,n){t.translate=Pt(e.translate,0,n),t.scale=Pt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function dD(t,e,n,r){t.min=Pt(e.min,n.min,r),t.max=Pt(e.max,n.max,r)}function lZ(t,e,n,r){dD(t.x,e.x,n.x,r),dD(t.y,e.y,n.y,r)}function cZ(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const uZ={duration:.45,ease:[.4,0,.1,1]},fD=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),pD=fD("applewebkit/")&&!fD("chrome/")?Math.round:Ss;function mD(t){t.min=pD(t.min),t.max=pD(t.max)}function hZ(t){mD(t.x),mD(t.y)}function Z4(t,e,n){return t==="position"||t==="preserve-aspect"&&!IJ(rD(e),rD(n),.2)}function dZ(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const fZ=J4({attachResizeListener:(t,e)=>Rv(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),aE={current:void 0},e3=J4({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!aE.current){const t=new fZ({});t.mount(window),t.setOptions({layoutScroll:!0}),aE.current=t}return aE.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xR=A.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function gD(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function pZ(...t){return e=>{let n=!1;const r=t.map(i=>{const s=gD(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():gD(t[i],null)}}}}function mZ(...t){return A.useCallback(pZ(...t),t)}class gZ extends A.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(kx(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=kx(r)&&r.offsetWidth||0,s=kx(r)&&r.offsetHeight||0,a=getComputedStyle(n),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=s-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function yZ({children:t,isPresent:e,anchorX:n,anchorY:r,root:i,pop:s}){var f;const a=A.useId(),o=A.useRef(null),l=A.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=A.useContext(xR),h=((f=t.props)==null?void 0:f.ref)??(t==null?void 0:t.ref),d=mZ(o,h);return A.useInsertionEffect(()=>{const{width:p,height:m,top:y,left:x,right:v,bottom:w}=l.current;if(e||s===!1||!o.current||!p||!m)return;const b=n==="left"?`left: ${x}`:`right: ${v}`,k=r==="bottom"?`bottom: ${w}`:`top: ${y}`;o.current.dataset.motionPopId=a;const _=document.createElement("style");c&&(_.nonce=c);const C=i??document.head;return C.appendChild(_),_.sheet&&_.sheet.insertRule(`
259          [data-motion-pop-id="${a}"] {
260            position: absolute !important;
261            width: ${p}px !important;
262            height: ${m}px !important;
263            ${b}px !important;
264            ${k}px !important;
265          }
266        `),()=>{var P;(P=o.current)==null||P.removeAttribute("data-motion-pop-id"),C.contains(_)&&C.removeChild(_)}},[e]),g.jsx(gZ,{isPresent:e,childRef:o,sizeRef:l,pop:s,children:s===!1?t:A.cloneElement(t,{ref:d})})}const vZ=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:l,root:c})=>{const h=QN(wZ),d=A.useId();let f=!0,p=A.useMemo(()=>(f=!1,{id:d,initial:e,isPresent:n,custom:i,onExitComplete:m=>{h.set(m,!0);for(const y of h.values())if(!y)return;r&&r()},register:m=>(h.set(m,!1),()=>h.delete(m))}),[n,h,r]);return s&&f&&(p={...p}),A.useMemo(()=>{h.forEach((m,y)=>h.set(y,!1))},[n]),A.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=g.jsx(yZ,{pop:a==="popLayout",isPresent:n,anchorX:o,anchorY:l,root:c,children:t}),g.jsx(Ok.Provider,{value:p,children:t})};function wZ(){return new Map}function t3(t=!0){const e=A.useContext(Ok);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=A.useId();A.useEffect(()=>{if(t)return i(s)},[t]);const a=A.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,a]:[!0]}const Nb=t=>t.key||"";function yD(t){const e=[];
vendor: 5,396 bytes, line 266
266return A.Children.forEach(t,n=>{A.isValidElement(n)&&e.push(n)}),e}const n3=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:c})=>{const[h,d]=t3(a),f=A.useMemo(()=>yD(t),[t]),p=a&&!h?[]:f.map(Nb),m=A.useRef(!0),y=A.useRef(f),x=QN(()=>new Map),v=A.useRef(new Set),[w,b]=A.useState(f),[k,_]=A.useState(f);TU(()=>{m.current=!1,y.current=f;for(let R=0;R<k.length;R++){const O=Nb(k[R]);p.includes(O)?(x.delete(O),v.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[k,p.length,p.join("-")]);const C=[];if(f!==w){let R=[...f];for(let O=0;O<k.length;O++){const M=k[O],D=Nb(M);p.includes(D)||(R.splice(O,0,M),C.push(M))}return s==="wait"&&C.length&&(R=C),_(yD(R)),b(f),null}const{forceRender:P}=A.useContext(XN);return g.jsx(g.Fragment,{children:k.map(R=>{const O=Nb(R),M=a&&!h?!1:f===k||p.includes(O),D=()=>{if(v.current.has(O))return;if(x.has(O))v.current.add(O),x.set(O,!0);else return;let j=!0;x.forEach(U=>{U||(j=!1)}),j&&(P==null||P(),_(y.current),a&&(d==null||d()),r&&r())};return g.jsx(vZ,{isPresent:M,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:M?void 0:D,anchorX:o,anchorY:l,children:R},O)})})},r3=A.createContext({strict:!1}),vD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let wD=!1;function bZ(){if(wD)return;const t={};for(const e in vD)t[e]={isEnabled:n=>vD[e].some(r=>!!n[r])};R4(t),wD=!0}function i3(){return bZ(),iJ()}function xZ(t){const e=i3();for(const n in t)e[n]={...e[n],...t[n]};R4(e)}const SZ=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function s1(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||SZ.has(t)}let s3=t=>!s1(t);function kZ(t){typeof t=="function"&&(s3=e=>e.startsWith("on")?!s1(e):t(e))}try{kZ(require("@emotion/is-prop-valid").default)}catch{}function AZ(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||nr(t[i])||(s3(i)||n===!0&&s1(i)||!e&&!s1(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const Fk=A.createContext({});function EZ(t,e){if(jk(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Nv(n)?n:void 0,animate:Nv(r)?r:void 0}}return t.inherit!==!1?e:{}}function _Z(t){const{initial:e,animate:n}=EZ(t,A.useContext(Fk));return A.useMemo(()=>({initial:e,animate:n}),[bD(e),bD(n)])}function bD(t){return Array.isArray(t)?t.join(" "):t}const SR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a3(t,e,n){for(const r in e)!nr(e[r])&&!F4(r,n)&&(t[r]=e[r])}function CZ({transformTemplate:t},e){return A.useMemo(()=>{const n=SR();return wR(n,e,t),Object.assign({},n.vars,n.style)},[e])}function TZ(t,e){const n=t.style||{},r={};return a3(r,n,t),Object.assign(r,CZ(t,e)),r}function PZ(t,e){const n={},r=TZ(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const o3=()=>({...SR(),attrs:{}});function NZ(t,e,n,r){const i=A.useMemo(()=>{const s=o3();return B4(s,e,U4(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};a3(s,t.style,t),i.style={...s,...i.style}}return i}const RZ=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function kR(t){return typeof t!="string"||t.includes("-")?!1:!!(RZ.indexOf(t)>-1||/[A-Z]/u.test(t))}function IZ(t,e,n,{latestValues:r},i,s=!1,a){const l=(a??kR(t)?NZ:PZ)(e,r,i,t),c=AZ(e,typeof t=="string",s),h=t!==A.Fragment?{...c,...l,ref:n}:{},{children:d}=e,f=A.useMemo(()=>nr(d)?d.get():d,[d]);return A.createElement(t,{...h,children:f})}function OZ({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:MZ(n,r,i,t),renderState:e()}}function MZ(t,e,n,r){const i={},s=r(t,{});for(const f in s)i[f]=Tx(s[f]);let{initial:a,animate:o}=t;const l=jk(t),c=P4(t);e&&c&&!l&&t.inherit!==!1&&(a===void 0&&(a=e.initial),o===void 0&&(o=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const d=h?o:a;if(d&&typeof d!="boolean"&&!Lk(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=hR(t,f[p]);if(m){const{transitionEnd:y,transition:x,...v}=m;for(const w in v){let b=v[w];if(Array.isArray(b)){const k=h?b.length-1:0;b=b[k]}b!==null&&(i[w]=b)}for(const w in y)i[w]=y[w]}}}return i}const l3=t=>
vendor: 21,972 bytes, line 266
266(e,n)=>{const r=A.useContext(Fk),i=A.useContext(Ok),s=()=>OZ(t,e,r,i);return n?s():QN(s)},DZ=l3({scrapeMotionValuesFromProps:bR,createRenderState:SR}),LZ=l3({scrapeMotionValuesFromProps:z4,createRenderState:o3}),jZ=Symbol.for("motionComponentSymbol");function FZ(t,e,n){const r=A.useRef(n);A.useInsertionEffect(()=>{r.current=n});const i=A.useRef(null);return A.useCallback(s=>{var o;s&&((o=t.onMount)==null||o.call(t,s));const a=r.current;if(typeof a=="function")if(s){const l=a(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const c3=A.createContext({});function kf(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function BZ(t,e,n,r,i,s){var b,k;const{visualElement:a}=A.useContext(Fk),o=A.useContext(r3),l=A.useContext(Ok),c=A.useContext(xR),h=c.reducedMotion,d=c.skipAnimations,f=A.useRef(null),p=A.useRef(!1);r=r||o.renderer,!f.current&&r&&(f.current=r(t,{visualState:e,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:h,skipAnimations:d,isSVG:s}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,y=A.useContext(c3);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&$Z(f.current,n,i,y);const x=A.useRef(!1);A.useInsertionEffect(()=>{m&&x.current&&m.update(n,l)});const v=n[g4],w=A.useRef(!!v&&typeof window<"u"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,v))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,v)));return TU(()=>{p.current=!0,m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),w.current&&m.animationState&&m.animationState.animateChanges())}),A.useEffect(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)==null||_.call(window,v)}),w.current=!1),m.enteringChildren=void 0)}),m}function $Z(t,e,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutAnchor:h,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:u3(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&kf(o),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:h})}function u3(t){if(t)return t.options.allowProjection!==!1?t.projection:u3(t.parent)}function oE(t,{forwardMotionProps:e=!1,type:n}={},r,i){r&&xZ(r);const s=n?n==="svg":kR(t),a=s?LZ:DZ;function o(c,h){let d;const f={...A.useContext(xR),...c,layoutId:UZ(c)},{isStatic:p}=f,m=_Z(c),y=a(c,p);if(!p&&typeof window<"u"){zZ();const x=VZ(f);d=x.MeasureLayout,m.visualElement=BZ(t,y,f,i,x.ProjectionNode,s)}return g.jsxs(Fk.Provider,{value:m,children:[d&&m.visualElement?g.jsx(d,{visualElement:m.visualElement,...f}):null,IZ(t,c,FZ(y,m.visualElement,h),y,p,e,s)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=A.forwardRef(o);return l[jZ]=t,l}function UZ({layoutId:t}){const e=A.useContext(XN).id;return e&&t!==void 0?e+"-"+t:t}function zZ(t,e){A.useContext(r3).strict}function VZ(t){const e=i3(),{drag:n,layout:r}=e;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function HZ(t,e){if(typeof Proxy>"u")return oE;const n=new Map,r=(s,a)=>oE(s,a,t,e),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,oE(a,void 0,t,e)),n.get(a))})}const WZ=(t,e)=>e.isSVG??kR(t)?new xJ(e):new mJ(e,{allowProjection:t!==A.Fragment});class GZ extends Iu{constructor(e){super(e),e.animationState||(e.animationState=_J(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Lk(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let qZ=0;class KZ extends Iu{constructor(){super(...arguments),this.id=qZ++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:a,custom:o}=this.node.getProps();if(typeof a=="string"){const l=Fd(this.node,a,o);if(l){const{transition:c,transitionEnd:h,...d}=l;for(const f in d)(s=this.node.getValue(f))==null||s.jump(d[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const YZ={animation:{Feature:GZ},exit:{Feature:KZ}};function q0(t){return{point:{x:t.pageX,y:t.pageY}}}const XZ=t=>e=>mR(e)&&t(e,q0(e));function Gy(t,e,n,r){return Rv(t,e,XZ(n),r)}const h3=({current:t})=>t?t.ownerDocument.defaultView:null,xD=(t,e)=>Math.abs(t-e);function QZ(t,e){const n=xD(t.x,e.x),r=xD(t.y,e.y);return Math.sqrt(n**2+r**2)}const SD=new Set(["auto","scroll"]);class d3{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Rb(this.lastRawMoveEventInfo,this.transformPagePoint));const p=lE(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,y=QZ(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!y)return;const{point:x}=p,{timestamp:v}=Jn;this.history.push({...x,timestamp:v});const{onStart:w,onMove:b}=this.handlers;m||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=Rb(m,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=lE(p.type==="pointercancel"?this.lastMoveEventInfo:Rb(m,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,w),x&&x(p,w)},!mR(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const l=q0(e),c=Rb(l,this.transformPagePoint),{point:h}=c,{timestamp:d}=Jn;this.history=[{...h,timestamp:d}];const{onSessionStart:f}=n;f&&f(e,lE(c,this.history)),this.removeListeners=H0(Gy(this.contextWindow,"pointermove",this.handlePointerMove),Gy(this.contextWindow,"pointerup",this.handlePointerUp),Gy(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(SD.has(r.overflowX)||SD.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,i),pt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ku(this.updatePoint)}}function Rb(t,e){return e?{point:e(t.point)}:t}function kD(t,e){return{x:t.x-e.x,y:t.y-e.y}}function lE({point:t},e){return{point:t,delta:kD(t,f3(e)),offset:kD(t,JZ(e)),velocity:ZZ(e,.1)}}function JZ(t){return t[0]}function f3(t){return t[t.length-1]}function ZZ(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=f3(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>ii(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&i.timestamp-r.timestamp>ii(e)*2&&(r=t[1]);const s=bs(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function eee(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Pt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Pt(n,t,r.max):Math.min(t,n)),t}function AD(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function tee(t,{top:e,left:n,bottom:r,right:i}){return{x:AD(t.x,n,i),y:AD(t.y,e,r)}}function ED(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function nee(t,e){return{x:ED(t.x,e.x),y:ED(t.y,e.y)}}function ree(t,e){let n=.5;const r=Or(t),i=Or(e);return i>r?n=Tv(e.min,e.max-r,t.min):r>i&&(n=Tv(t.min,t.max-i,e.min)),po(0,1,n)}function iee(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const _C=.35;function see(t=_C){return t===!1?t=0:t===!0&&(t=_C),{x:_D(t,"left","right"),y:_D(t,"top","bottom")}}function _D(t,e,n){return{min:CD(t,e),max:CD(t,n)}}function CD(t,e){return typeof t=="number"?t:t[e]||0}const aee=new WeakMap;class oee{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=d=>{n&&this.snapToCursor(q0(d).point),this.stopAnimation()},a=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MQ(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ea(v=>{let w=this.getAxisMotionValue(v).get()||0;if(uo.test(w)){const{projection:b}=this.visualElement;if(b&&b.layout){const k=b.layout.layoutBox[v];k&&(w=Or(k)*(parseFloat(w)/100))}}this.originPoint[v]=w}),y&&pt.update(()=>y(d,f),!1,!0),yC(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=cee(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&pt.update(()=>x(d,f),!1,!0)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new d3(e,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:h3(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&pt.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!Ib(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=eee(a,this.constraints[e],this.elastic[e])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&kf(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=tee(r.layoutBox,e):this.constraints=!1,this.elastic=see(n),i!==this.constraints&&!kf(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ea(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=iee(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!kf(e))return!1;const r=e.current;hg(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=cJ(r,i.root,this.visualElement.getTransformPagePoint());let a=nee(i.layout.layoutBox,s);if(n){const o=n(aJ(a));this.hasMutatedConstraints=!!o,o&&(a=O4(o))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},c=Ea(h=>{if(!Ib(h,n,this.currentDirection))return;let d=l&&l[h]||{};(a===!0||a===h)&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?e[h]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,m)});return Promise.all(c).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return yC(this.visualElement,e),r.start(uR(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ea(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Ea(n=>{const{drag:r}=this.getProps();if(!Ib(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n],l=s.get()||0;s.set(e[n]-Pt(a,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ea(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();i[a]=ree({min:l,max:l},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ea(a=>{if(!Ib(a,e,null))return;const o=this.getAxisMotionValue(a),{min:l,max:c}=this.constraints[a];o.set(Pt(l,c,i[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;aee.set(this.visualElement,this);const e=this.visualElement.current,n=Gy(e,"pointerdown",c=>{const{drag:h,dragListener:d=!0}=this.getProps(),f=c.target,p=f!==e&&$Q(f);h&&d&&!p&&this.start(c)});let r;const i=()=>{const{dragConstraints:c}=this.getProps();kf(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=lee(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(i);const o=Rv(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Ea(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=_C,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function TD(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function lee(t,e,n){const r=DM(t,TD(n)),i=DM(e,TD(n));return()=>{r(),i()}}function Ib(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function cee(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class uee extends Iu{constructor(e){super(e),this.removeGroupControls=Ss,this.removeListeners=Ss,this.controls=new oee(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ss}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const cE=t=>(e,n)=>{t&&pt.update(()=>t(e,n),!1,!0)};class hee extends Iu{constructor(){super(...arguments),this.removePointerDownListener=Ss}onPointerDown(e){this.session=new d3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:h3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:cE(e),onStart:cE(n),onMove:cE(r),onEnd:(s,a)=>{delete this.session,i&&pt.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Gy(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let uE=!1;class dee extends A.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),uE&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Px.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),uE=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==s?a.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?a.promote():a.relegate()||pt.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),pR.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;uE=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function p3(t){const[e,n]=t3(),r=A.useContext(XN);return g.jsx(dee,{...t,layoutGroup:r,switchLayoutGroup:A.useContext(c3),isPresent:e,safeToRemove:n})}const fee={pan:{Feature:hee},drag:{Feature:uee,ProjectionNode:e3,MeasureLayout:p3}};function PD(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&pt.postRender(()=>s(e,q0(e)))}class pee extends Iu{mount(){const{current:e}=this.node;e&&(this.unmount=LQ(e,(n,r)=>(PD(this.node,r,"Start"),i=>PD(this.node,i,"End"))))}unmount(){}}class mee extends Iu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=H0(Rv(this.node.current,"focus",()=>this.onFocus()),Rv(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ND(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&pt.postRender(()=>s(e,q0(e)))}class gee extends Iu{mount(){const{current:e}=this.node;if(!e)return;
266const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=zQ(e,(i,s)=>(ND(this.node,s,"Start"),(a,{success:o})=>ND(this.node,a,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const CC=new WeakMap,hE=new WeakMap,yee=t=>{const e=CC.get(t.target);e&&e(t)},vee=t=>{t.forEach(yee)};function wee({root:t,...e}){const n=t||document;hE.has(n)||hE.set(n,{});const r=hE.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(vee,{root:t,...e})),r[i]}function bee(t,e,n){const r=wee(e);return CC.set(t,n),r.observe(t),()=>{CC.delete(t),r.unobserve(t)}}const xee={some:0,all:1};class See extends Iu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:xee[i]},o=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=h?d:f;p&&p(c)};this.stopObserver=bee(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(kee(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function kee({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Aee={inView:{Feature:See},tap:{Feature:gee},focus:{Feature:mee},hover:{Feature:pee}},Eee={layout:{ProjectionNode:e3,MeasureLayout:p3}},_ee={...YZ,...Aee,...fee,...Eee},$e=HZ(_ee,WZ),Cee="/assets/hero-organic-BCaLjRqg.jpg",Tee=()=>{const t=rf(),e=n=>{var r;(r=document.getElementById(n))==null||r.scrollIntoView({behavior:"smooth"})};return g.jsxs("section",{className:"relative min-h-screen w-full overflow-hidden",children:[g.jsxs("div",{className:"absolute inset-0",children:[g.jsx("img",{src:Cee,alt:"",className:"w-full h-full object-cover scale-105",width:1920,height:1280}),g.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-background via-background/85 to-background/40"}),g.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-transparent to-background/60"})]}),g.jsxs("div",{className:"relative min-h-screen flex flex-col justify-center max-w-screen-2xl mx-auto px-6 lg:px-16 py-32",children:[g.jsxs($e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.8},className:"mb-10 flex items-center gap-4",children:[g.jsx("div",{className:"w-10 h-px bg-primary"}),g.jsx("span",{className:"eyebrow text-primary/80",children:"ZÜRICH"})]}),g.jsxs($e.h1,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:1,ease:[.22,1,.36,1]},className:"display text-[64px] sm:text-[88px] lg:text-[148px] xl:text-[176px] text-white mb-10 max-w-6xl",children:["Backing the",g.jsx("br",{}),g.jsxs("span",{className:"italic-accent",children:[" ","new World."]})]}),g.jsx($e.p,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:1,delay:.2},className:"max-w-xl text-lg md:text-xl text-white/65 mb-14 leading-relaxed font-light",children:"A venture firm for founders solving the systemic problems of the next decade: health, food, climate, and the infrastructure that sustains human life."}),g.jsxs($e.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:1,delay:.35},className:"flex flex-col sm:flex-row gap-3",children:[g.jsx("button",{onClick:()=>t("/assessment"),className:"group relative px-10 py-5 bg-primary text-primary-foreground text-xs font-medium uppercase tracking-[0.3em] mono hover:bg-primary-glow transition-all duration-500",style:{boxShadow:"var(--shadow-violet)"},children:g.jsx("span",{className:"relative z-10",children:"Pitch to us →"})}),g.jsx("button",{onClick:()=>e("mission"),className:"px-10 py-5 border border-white/15 text-white/80 text-xs font-medium uppercase tracking-[0.3em] mono hover:bg-white/5 hover:text-white transition-all duration-500",children:"Read the thesis"})]}),g.jsxs($e.div,{initial:{opacity:0}
266,animate:{opacity:1},transition:{duration:1.4,delay:.8},className:"absolute bottom-8 left-6 lg:left-16 right-6 lg:right-16 flex justify-between items-end text-[10px] uppercase tracking-[0.4em] mono text-white/30",children:[g.jsx("span",{children:"Pre-Seed · Seed · €150k–€1.5M"}),g.jsx("span",{className:"hidden sm:inline",children:"DACH · Nordics · Europe"}),g.jsx("span",{className:"animate-pulse",children:"​"})]})]})]})},Pee=[{n:"I",name:"Rebels",quote:"We back founders ready to do whatever it takes to build generational companies."},{n:"II",name:"Revolution",quote:"We look for market shifts that rewrite the rules of global industry and human life."},{n:"III",name:"Relationships",quote:"Capital is a commodity. Deep partnership, built early, is the only durable edge."},{n:"IV",name:"Risks",quote:"We underwrite asymmetry. Where others see uncertainty, we see the next decade."}],Nee=()=>g.jsx("section",{id:"mission",className:"relative border-t border-white/10 py-32 lg:py-40 px-6 lg:px-16",children:g.jsxs("div",{className:"max-w-screen-xl mx-auto",children:[g.jsxs("div",{className:"mb-24 max-w-2xl",children:[g.jsx("div",{className:"eyebrow mb-6",children:"The REAL Framework"}),g.jsxs("h2",{className:"display text-5xl lg:text-7xl text-white",children:["Four convictions",g.jsx("br",{}),"we ",g.jsx("span",{className:"italic-accent",children:"never compromise"}),"."]})]}),g.jsx("div",{className:"divide-y divide-white/10 border-y border-white/10",children:Pee.map((t,e)=>g.jsxs($e.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},transition:{duration:.7,delay:e*.08,ease:[.22,1,.36,1]},viewport:{once:!0,margin:"-80px"},className:"group grid grid-cols-12 gap-6 py-10 lg:py-14 items-baseline hover:bg-surface-1/50 transition-colors duration-500 px-2 lg:px-4 -mx-2 lg:-mx-4",children:[g.jsx("div",{className:"col-span-2 lg:col-span-1",children:g.jsx("span",{className:"display text-3xl lg:text-4xl italic-accent",children:t.n})}),g.jsx("div",{className:"col-span-10 lg:col-span-3",children:g.jsx("h3",{className:"display text-3xl lg:text-5xl text-white group-hover:translate-x-1 transition-transform duration-700",children:t.name})}),g.jsx("p",{className:"col-span-12 lg:col-span-7 lg:col-start-6 text-lg lg:text-xl text-white/55 leading-relaxed font-light max-w-2xl",children:t.quote})]},t.n))})]})}),Ree="/assets/editorial-topo-B2BFSpQl.jpg",Iee=[{n:"01",title:"Real problems.",body:"Health, food, climate, and the systemic infrastructure that holds modern life together. If tech is core to the solution, we pay attention."},{n:"02",title:"Founders first.",body:"We assess founder personalities with the same rigor as commercial diligence. Team composition is our #3 cause of failure to de-risk."},{n:"03",title:"Anchored in DACH & Nordics.",body:"Our core geography is DACH and the Nordics. We back companies elsewhere only when there's a strong strategic link back to the region."},{n:"04",title:"Lead, up to €1.5M.",body:"Pre-Seed and Seed checks targeting 8–12% ownership. Beyond capital: hands-on access to a network ready to solve real operational problems."}],Oee=()=>g.jsxs("section",{className:"relative py-32 lg:py-40 px-6 lg:px-16 border-t border-white/10 overflow-hidden",children:[g.jsxs("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none opacity-40",children:[g.jsx("img",{src:Ree,alt:"",loading:"lazy",className:"w-full object-cover",width:1600,height:1024}),g.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/80 to-transparent"})]}),g.jsxs("div",{className:"relative max-w-screen-xl mx-auto",children:[g.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 mb-24 items-end",children:[g.jsxs("div",{className:"lg:col-span-7",children:[g.jsx("div",{className:"eyebrow mb-6",children:"How we invest"}),g.jsxs("h2",{className:"display text-5xl lg:text-7xl text-white",children:["People first.",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"Backed early."})]})]}),g.jsx("p",{className:"lg:col-span-5 text-white/55 text-lg leading-relaxed font-light",children:"Four operating principles that shape every check we write and every founder we choose to back for the decade ahead."})]}),g.jsx("div",{className:"grid md:grid-cols-2 gap-px bg-white/10 border border-white/10",children:Iee.map((t,e)=>g.jsxs($e.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},transition:{duration:.7,delay:e*.1},viewport:{once:!0},className:"relative bg-background p-10 lg:p-14 min-h-[300px] flex flex-col justify-between group hover:bg-surface-1 transition-colors duration-700",children:[g.jsx("span",{className:"mono text-xs text-primary tracking-[0.3em]",children:t.n}),g.jsxs("div",{children:[g.jsx("h3",{className:"display text-3xl lg:text-4xl text-white mb-5 group-hover:translate-x-1 transition-transform duration-500",children:t.title}),g.jsx("p",{className:"text-base text-white/55 leading-relaxed font-light max-w-md",children:t.body})]})]},t.n))})]})]}),m3="/assets/editorial-team-risk-DiTlrfPX.jpg",Mee=[{title:"Discover your type",desc:"Identify your unique founder type and natural leadership style."},{title:"Build better teams",desc:"Find complementary co-founders that balance your strengths."},{title:"Drive success",desc:"Make sharper decisions by understanding your natural tendencies."}],Dee=()=>{const t=rf();return g.jsx("section",{id:"people-first",className:"py-32 lg:py-40 px-6 lg:px-16 border-t border-white/10",children:g.jsxs("div",{className:"max-w-screen-xl mx-auto grid lg:grid-cols-12 gap-12 lg:gap-20 items-start",children:[g.jsxs($e.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},transition:{duration:1},viewport:{once:!0},className:"lg:col-span-5 relative aspect-[3/4] overflow-hidden order-2 lg:order-1",children:[g.jsx("img",{src:m3,alt:"Organic cellular structure representing complementary founder teams",loading:"lazy",className:"absolute inset-0 w-full h-full object-cover",width:1080,height:1440}),g.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-background to-transparent"}),g.jsx("div",{className:"absolute bottom-6 left-6 right-6 mono text-[10px] uppercase tracking-[0.4em] text-white/50",children:"VFTI · Venture Founder Type Indicator"})]}),g.jsxs("div",{className:"lg:col-span-7 order-1 lg:order-2",children:[g.jsx("div",{className:"eyebrow mb-6",children:" The team risk"}),g.jsxs("h2",{className:"display text-5xl lg:text-7xl text-white mb-10",children:["Startups fail.",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"Certain teams fail less."})]}),g.jsxs("p",{className:"text-lg text-white/70 mb-6 leading-relaxed font-light",children:["Team is the ",g.jsx("span",{className:"text-white",children:"#3 cause"})," of startup failure, ahead of running out of cash, ahead of lacking PMF. We try to de-risk that."]}),g.jsxs("p",{className:"text-lg text-white/55 mb-6 leading-relaxed font-light",children:["We assess founders' personalities, looking for complementary team
266s of"," ",g.jsx("span",{className:"italic-accent",children:"Hustlers"}),","," ",g.jsx("span",{className:"italic-accent",children:"Hackers"}),", and"," ",g.jsx("span",{className:"italic-accent",children:"Hipsters"}),"."]}),g.jsxs("p",{className:"text-lg text-white/55 mb-14 leading-relaxed font-light whitespace-pre-wrap",children:["Startups with diverse and complementary founder types are ",g.jsx("span",{className:"text-white",children:"twice as likely to succeed"}),". The VFTI gives founders a tactical advantage by mapping how they think, decide, and lead.",`
267
268`,"Learn more about our founder assessment."]}),g.jsx("div",{className:"grid sm:grid-cols-3 gap-8 mb-14 border-t border-white/10 pt-10",children:Mee.map((e,n)=>g.jsxs($e.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},transition:{duration:.6,delay:n*.1},viewport:{once:!0},children:[g.jsxs("div",{className:"mono text-[10px] text-primary tracking-[0.3em] mb-3",children:["0",n+1]}),g.jsx("h3",{className:"display text-xl text-white mb-2 leading-tight",children:e.title}),g.jsx("p",{className:"text-sm text-white/50 leading-relaxed font-light",children:e.desc})]},e.title))}),g.jsxs("button",{onClick:()=>t("/vfti-quiz"),className:"group inline-flex items-center gap-3 px-10 py-5 bg-primary text-primary-foreground mono text-xs uppercase tracking-[0.3em] hover:bg-primary-glow transition-all duration-500",style:{boxShadow:"var(--shadow-violet)"},children:["Take the VFTI assessment",g.jsx("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})]})]})})},Lee=()=>g.jsxs("section",{id:"realr-journey",className:"relative py-32 lg:py-48 px-6 lg:px-16 border-t border-white/10 overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 pointer-events-none",children:g.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] rounded-full opacity-20",style:{background:"radial-gradient(circle, hsl(var(--primary) / 0.5), transparent 60%)"}})}),g.jsxs("div",{className:"relative max-w-screen-xl mx-auto text-center",children:[g.jsx($e.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},transition:{duration:.6},viewport:{once:!0},className:"eyebrow mb-8",children:"60-second thesis check · confidential · not stored"}),g.jsxs($e.h2,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},transition:{duration:1,ease:[.22,1,.36,1]},viewport:{once:!0},className:"display text-5xl md:text-7xl lg:text-[112px] text-white max-w-5xl mx-auto mb-12 leading-[0.95]",children:["Think you're a fit",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"for REALR?"})]}),g.jsx($e.p,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},transition:{duration:.8,delay:.15},viewport:{once:!0},className:"max-w-xl mx-auto text-lg text-white/55 leading-relaxed font-light mb-14",children:"Upload your deck or paste a short company description. Our thesis filter returns an honest fit read in under a minute."}),g.jsx($e.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},transition:{duration:.8,delay:.3},viewport:{once:!0},children:g.jsxs(Ca,{to:"/assessment",className:"group inline-flex items-center gap-5 bg-primary text-primary-foreground px-12 py-6 mono text-xs uppercase tracking-[0.35em] hover:bg-primary-glow transition-all duration-500",style:{boxShadow:"var(--shadow-violet)"},children:["Start the assessment",g.jsx("span",{className:"transition-transform duration-500 group-hover:translate-x-2",children:"→"})]})})]})]}),g3=[{id:"1",name:"David Hug",title:"Partner",imageUrl:"/lovable-uploads/aa6bfdc6-8168-470c-b085-11070fedcbcb.png",linkedinUrl:"https://www.linkedin.com/in/david-hug-53a5b783/"},{id:"2",name:"Andrea Annese",title:"Founding Principal",imageUrl:"/lovable-uploads/a0d004c6-f592-4e9d-8650-59c19a6d2dd7.png",linkedinUrl:"https://www.linkedin.com/in/anneseandrea/"},{id:"3",name:"Bea Knecht",title:"Partner",imageUrl:"/lovable-uploads/e9d258f0-aa1e-44d3-97af-32ac52ce159f.png",linkedinUrl:"https://www.linkedin.com/in/beaknecht/"}],y3=({member:t})=>g.jsxs("div",{className:"group",children:[g.jsxs("div",{className:"relative overflow-hidden aspect-[4/5] bg-surface-2 mb-6 grayscale group-hover:grayscale-0 transition-all duration-1000",children:[g.jsx("img",{src:t.imageUrl,alt:t.name,className:"w-full h-full object-cover object-center scale-100 group-hover:scale-105 transition-transform duration-[1400ms]"}),g.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/20 to-transparent opacity-80"})]}),g.jsxs("div",{className:"flex items-start justify-between gap-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"display text-3xl text-white mb-2 leading-tight",children:t.name}),g.jsx("p",{className:"mono text-[10px] text-white/50 uppercase tracking-[0.3em]",children:t.title})]}),g.jsx("a",{href:t.linkedinUrl,target:"_blank",rel:"noopener noreferrer",className:"text-white/30 hover:text-primary transition-colors mt-2","aria-label":`${t.name} on LinkedIn`,children:g.jsx(P$,{className:"w-4 h-4"})})]}),g.jsx("div",{className:"mt-5 h-px w-8 bg-primary group-hover:w-full transition-all duration-700"})]}),jee="https://purpose-driven-ventures.lovable.app",K0=({title:t,description:e,path:n,type:r="website",jsonLd:i})=>{const s=`${jee}${n}`;return g.jsxs(GG,{children:[g.jsx("title",{children:t}),g.jsx("meta",{name:"description",content:e}),g.jsx("link",{rel:"canonical",href:s}),g.jsx("meta",{property:"og:title",content:t}),g.jsx("meta",{property:"og:description",content:e}),g.jsx("meta",{property:"og:url",content:s}),g.jsx("meta",{property:"og:type",content:r}),g.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),g.jsx("meta",{name:"twitter:title",content:t}),g.jsx("meta",{name:"twitter:description",content:e}),i&&g.jsx("script",{type:"application/ld+json",children:JSON.stringify(i)})]})},Fee=()=>g.jsxs("div",{className:"bg-background overflow-x-hidden",children:[g.jsx(K0,{title:"Realr — Best Early-Stage VC for Switzerland, Germany & the Nordics",de
268scription:"Realr is an early-stage venture capital firm backing obsessed founders across Switzerland, Germany, Sweden, Norway, Finland and the wider Nordics. Pre-seed and seed checks (€150k–€1.5M) into health, food, climate and critical infrastructure.",path:"/",jsonLd:{"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:"What is Realr?",acceptedAnswer:{"@type":"Answer",text:"Realr is an early-stage venture capital firm headquartered in Zürich. We invest pre-seed and seed cheques of €150k to €1.5M into founders building category-defining companies in health, food, climate and critical infrastructure across Switzerland, Germany and the Nordics."}},{"@type":"Question",name:"Where does Realr invest?",acceptedAnswer:{"@type":"Answer",text:"Realr invests across the DACH region (Switzerland, Germany, Austria) and the Nordics (Sweden, Norway, Finland, Denmark), and selectively across the rest of Europe."}},{"@type":"Question",name:"What stage and cheque size?",acceptedAnswer:{"@type":"Answer",text:"Pre-seed and seed, with initial cheques between €150,000 and €1.5 million."}},{"@type":"Question",name:"Which sectors does Realr back?",acceptedAnswer:{"@type":"Answer",text:"Health, food, climate, and the systemic infrastructure that sustains modern life — including deep-tech where it is core to the solution."}}]}}),g.jsx(Tee,{}),g.jsx(Nee,{}),g.jsx(Oee,{}),g.jsx(Dee,{}),g.jsx("section",{id:"team",className:"py-32 lg:py-40 px-6 lg:px-16 border-t border-white/10",children:g.jsxs("div",{className:"max-w-screen-xl mx-auto",children:[g.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 items-end mb-24",children:[g.jsxs("div",{className:"lg:col-span-7",children:[g.jsx("div",{className:"eyebrow mb-6",children:"Our team"}),g.jsxs("h2",{className:"display text-5xl lg:text-7xl text-white",children:["Operators",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"and venture investors."})]})]}),g.jsx("p",{className:"lg:col-span-5 text-white/55 text-lg leading-relaxed font-light",children:"Uniquely suited to identify, evaluate, and back the next decade of category-defining founders."})]}),g.jsx("div",{className:"grid md:grid-cols-3 gap-10 lg:gap-16",children:g3.map((t,e)=>g.jsx($e.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},transition:{duration:.7,delay:e*.1},viewport:{once:!0},children:g.jsx(y3,{member:t})},t.id))})]})}),g.jsx(Lee,{})]}),Bee=()=>g.jsxs($e.div,{initial:{opacity:0}
268,animate:{opacity:1},transition:{duration:.5},className:"min-h-screen bg-background py-24 lg:py-32 px-6 lg:px-16",children:[g.jsx(K0,{title:"Team — Realr | Operators & Venture Investors in Zürich",description:"Meet the Realr team: operators and venture investors backing early-stage founders across Switzerland, Germany and the Nordics.",path:"/team"}),g.jsxs("div",{className:"max-w-screen-xl mx-auto",children:[g.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 items-end mb-24",children:[g.jsxs("div",{className:"lg:col-span-7",children:[g.jsx("div",{className:"eyebrow mb-6",children:"Our team"}),g.jsxs("h1",{className:"display text-5xl lg:text-7xl text-white",children:["Operators",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"and venture investors."})]})]}),g.jsx("p",{className:"lg:col-span-5 text-white/55 text-lg leading-relaxed font-light",children:"REALR's team brings together a unique combination of operators and VC backgrounds — uniquely suited to identify, evaluate, and back founders building to improve people's lives."})]}),g.jsx("div",{className:"grid md:grid-cols-3 gap-10 lg:gap-16",children:g3.map((t,e)=>g.jsx($e.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},transition:{duration:.7,delay:e*.1},viewport:{once:!0},children:g.jsx(y3,{member:t})},t.id))})]})]}),ih=A.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:Ue("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));ih.displayName="Card";const qy=A.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:Ue("flex flex-col space-y-1.5 p-6",t),...e}));qy.displayName="CardHeader";const Ky=A.forwardRef(({className:t,...e},n)=>g.jsx("h3",{ref:n,className:Ue("text-2xl font-semibold leading-none tracking-tight",t),...e}));Ky.displayName="CardTitle";const v3=A.forwardRef(({className:t,...e},n)=>g.jsx("p",{ref:n,className:Ue("text-sm text-muted-foreground",t),...e}));v3.displayName="CardDescription";const sh=A.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:Ue("p-6 pt-0",t),...e}));sh.displayName="CardContent";const $ee=A.forwardRef(({className:t,...e},n)=>g.jsx("div",{ref:n,className:Ue("flex items-center p-6 pt-0",t),...e}));$ee.displayName="CardFooter";const Uee=({title:t,subtitle:e,imageUrl:n,mediumUrl:r})=>g.jsx($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"h-full",children:g.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"block group h-full",children:g.jsxs(ih,{className:"overflow-hidden hover:shadow-lg transition-shadow duration-300 h-full flex flex-col",children:[g.jsx("div",{className:"aspect-[3/2] overflow-hidden w-full",children:g.jsx("img",{src:n,alt:t,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"})}),g.jsxs(sh,{className:"p-6 bg-white flex-grow",children:[g.jsx("h3",{className:"text-xl font-semibold text-primary mb-4 group-hover:text-primary/80 transition-colors",children:t}),g.jsx("p",{className:"text-gray-600",children:e})]})]})})}),zee=()=>{const t=[{title:"The exercise paradox",subtitle:"Why a little movement delivers massive health benefits, yet most people still do nothing",imageUrl:"/lovable-uploads/exercise-paradox.png",mediumUrl:"https://open.substack.com/pub/aannese/p/the-exercise-paradox?r=2343lk&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true"},{title:"Sweden's AI Reform Reignites a Proven Flywheel",subtitle:"How Sweden's approach to AI is revitalizing its innovation ecosystem",imageUrl:"/lovable-uploads/048d2339-44c3-4126-9781-0673314cfdce.png",mediumUrl:"https://medium.com/marcau-partners/swedens-ai-reform-reignites-a-proven-flywheel-e1050b7bae63"},{title:"Consumers are becoming more conscious, should VC change too?",subtitle:"Exploring the shift in consumer behavior and its impact on venture capital investment strategies",imageUrl:"https://miro.medium.com/v2/resize:fit:1100/format:webp/1*QKaSWd3UBRcFhyJ5AoA84Q.png",mediumUrl:"https://medium.com/marcau-partners/consumers-are-becoming-more-conscious-should-vc-change-too-f95219f52691"},{title:"The Nordics are the new SV? What is behind the success of the region in the startup ecosystem",subt
268itle:"Understanding the rise of Nordic countries in the global startup landscape",imageUrl:"https://miro.medium.com/v2/resize:fit:1100/format:webp/1*umeTaJM-TDdxWt_5ZJZgDw.jpeg",mediumUrl:"https://medium.com/marcau-partners/the-nordics-are-the-new-sv-what-is-behind-the-success-of-the-region-in-the-startup-ecosystem-ed44204958e9"},{title:"Rough sea for consumer startups: how to cope with it",subtitle:"Navigating challenges in the consumer startup space",imageUrl:"https://miro.medium.com/v2/resize:fit:1100/format:webp/0*9Hp51BHnsrAWjhQT.jpg",mediumUrl:"https://medium.com/marcau-partners/rough-sea-for-consumer-startups-how-to-cope-with-it-2091fb21e2e3"}];return g.jsxs($e.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},className:"min-h-screen bg-background py-24 lg:py-32 px-6 lg:px-16",children:[g.jsx(K0,{title:"Blog — Realr | Field notes on European early-stage venture",description:"Field notes from Realr on early-stage venture capital in Switzerland, Germany and the Nordics — covering health, food, climate, AI and the future of the European startup ecosystem.",path:"/blog"}),g.jsxs("div",{className:"max-w-screen-xl mx-auto",children:[g.jsxs("div",{className:"mb-20",children:[g.jsx("div",{className:"eyebrow mb-6",children:"Blog"}),g.jsxs("h1",{className:"display text-5xl lg:text-7xl text-white max-w-3xl",children:["Field notes",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"from the frontier."})]})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((e,n)=>g.jsx(Uee,{...e},n))})]})]})},Vee=()=>g.jsx($e.div,{initial:{opacity:0}
268,animate:{opacity:1},transition:{duration:.5},className:"min-h-screen bg-white py-16",children:g.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[g.jsx("h1",{className:"text-4xl font-bold mb-8 text-primary",children:"Imprint"}),g.jsxs("div",{className:"prose prose-lg max-w-none text-gray-800",children:[g.jsx("h2",{className:"text-2xl font-semibold mb-4 text-gray-900",children:"REALR is advised By Marcau Partners"}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"ADDRESS"}),g.jsxs("p",{className:"text-gray-800",children:["SCHIFFBAUSTRASSE 10",g.jsx("br",{}),"8005 ZURICH",g.jsx("br",{}),"SWITZERLAND"]})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"TRADE REGISTER"}),g.jsx("p",{className:"text-gray-800",children:"HRB ZURICH CHE-189.323.801"})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"VAT ID"}),g.jsx("p",{className:"text-gray-800",children:"SALES TAX IDENTIFICATION NUMBER ACCORDING TO SECT. 27 A OF THE SALES TAX LAW: CHE-189.323.801"})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"EU DISPUTE RESOLUTION"}),g.jsxs("p",{className:"text-gray-800",children:["THE EUROPEAN COMMISSION PROVIDES A PLATFORM FOR ONLINE DISPUTE RESOLUTION (ODR):"," ",g.jsx("a",{href:"https://ec.europa.eu/consumers/odr/",className:"text-blue-600 hover:underline",target:"_blank",rel:"noopener noreferrer",children:"HTTPS://EC.EUROPA.EU/CONSUMERS/ODR/"}),".",g.jsx("br",{}),"OUR E-MAIL ADDRESS CAN BE FOUND ABOVE IN THE SITE NOTICE."]})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"DISPUTE RESOLUTION PROCEEDINGS IN FRONT OF A CONSUMER ARBITRATION BOARD"}),g.jsx("p",{className:"text-gray-800",children:"WE ARE NOT WILLING OR OBLIGED TO PARTICIPATE IN DISPUTE RESOLUTION PROCEEDINGS IN FRONT OF A CONSUMER ARBITRATION BOARD."})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"BOARD OF DIRECTORS"}),g.jsx("p",{className:"text-gray-800",children:"THOMAS KAISER, DAVID HUG, BENJAMIN SOLENTHALER, THOMAS MEIER"})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"PRESIDENT OF THE BOARD OF DIRECTORS"}),g.jsx("p",{className:"text-gray-800",children:"THOMAS KAISER"})]}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-xl font-medium mb-2 text-gray-900",children:"CONTACT"}),g.jsx("p",{className:"text-gray-800",children:g.jsx("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"})})]})]})]})}),Hee=()=>g.jsx($e.div,{initial:{opacity:0}
268,animate:{opacity:1},transition:{duration:.5},className:"min-h-screen bg-white py-16",children:g.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[g.jsx("h1",{className:"text-4xl font-bold mb-8 text-primary",children:"Privacy Policy"}),g.jsxs("div",{className:"prose prose-lg max-w-none text-gray-800",children:[g.jsx("h2",{className:"text-2xl font-semibold mb-4 text-gray-900",children:"1. Introduction"}),g.jsx("p",{className:"text-gray-800",children:'This Privacy Policy explains how REALR ("we", "us", or "our") collects, uses, and shares your information when you visit our website. We respect your privacy and are committed to protecting your personal data. Please read this privacy policy carefully to understand how we handle your data.'}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"2. Information We Collect"}),g.jsx("p",{className:"text-gray-800",children:"We may collect the following types of information:"}),g.jsxs("ul",{className:"list-disc pl-6 mb-4 text-gray-800",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"Personal Information:"})," Such as your name, email address, and other contact information if you contact us or sign up for our newsletters."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Usage Data:"})," Information about how you use our website, including your IP address, browser type, time spent on pages, and pages visited."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Cookies and Similar Technologies:"})," We use cookies and similar tracking technologies to track activity on our website and hold certain information. You can control cookies through your browser settings."]})]}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"3. How We Use Your Information"}),g.jsx("p",{className:"text-gray-800",children:"We use the information we collect for various purposes, including:"}),g.jsxs("ul",{className:"list-disc pl-6 mb-4 text-gray-800",children:[g.jsx("li",{children:"To provide and maintain our website"}),g.jsx("li",{children:"To notify you about changes to our website"}),g.jsx("li",{children:"To allow you to participate in interactive features when you choose to do so"}),g.jsx("li",{children:"To provide customer support"}),g.jsx("li",{children:"To gather analysis or valuable information so that we can improve our website"}),g.jsx("li",{children:"To monitor the usage of our website"}),g.jsx("li",{children:"To detect, prevent and address technical issues"})]}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"4. Data Sharing and Disclosure"}),g.jsx("p",{className:"text-gray-800",children:"We may share your information with:"}),g.jsxs("ul",{className:"list-disc pl-6 mb-4 text-gray-800",children:[g.jsxs("li",{children:[g.jsx("strong",{children:"Service Providers:"})," We may employ third-party companies to facilitate our website, provide services on our behalf, or assist us in analyzing how our website is used."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Legal Requirements:"})," We may disclose your information if required to do so by law or in response to valid requests by public authorities."]}),g.jsxs("li",{children:[g.jsx("strong",{children:"Business Transfers:"})," In connection with any merger, sale of company assets, financing, or acquisition of all or a portion of our business."]})]}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"5. Data Security"}),g.jsx("p",{className:"text-gray-800",children:"We implement appropriate security measures to protect your personal information. However, please note that no method of transmission over the internet or electronic storage is 100% secure, and we cannot guarantee absolute security."}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"6. Your Data Protection Rights"}),g.jsx("p",{className:"text-gray-800",children:"Depending on your location, you may have the following data protection rights:"}),g.jsxs("ul",{className:"list-disc pl-6 mb-4 text-gray-800",children:[g.jsx("li",{children:"The right to access, update, or delete your personal information"}
268),g.jsx("li",{children:"The right to rectification if your information is inaccurate or incomplete"}),g.jsx("li",{children:"The right to object to our processing of your personal data"}),g.jsx("li",{children:"The right to request restriction of processing your personal data"}),g.jsx("li",{children:"The right to data portability"}),g.jsx("li",{children:"The right to withdraw consent"})]}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"7. Cookies Policy"}),g.jsx("p",{className:"text-gray-800",children:"Our website uses cookies to enhance your browsing experience. You can choose to disable cookies through your browser settings, but this may affect your experience on our website."}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"8. Changes to This Privacy Policy"}),g.jsx("p",{className:"text-gray-800",children:'We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page and updating the "Last Updated" date.'}),g.jsx("h2",{className:"text-2xl font-semibold mb-4 mt-8 text-gray-900",children:"9. Contact Us"}),g.jsxs("p",{className:"text-gray-800",children:["If you have any questions about this Privacy Policy, please contact us at:",g.jsx("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline ml-1",children:"[email protected]"})]}),g.jsx("p",{className:"mt-8 text-gray-700",children:g.jsx("em",{children:"Last Updated: August 28, 2023"})})]})]})}),yn=A.forwardRef(({className:t,type:e,...n},r)=>g.jsx("input",{type:e,className:Ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));yn.displayName="Input";var Wee="Label",w3=A.forwardRef((t,e)=>g.jsx(St.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));w3.displayName=Wee;var b3=w3;const Gee=Ak("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ro=A.forwardRef(({className:t,...e},n)=>g.jsx(b3,{ref:n,className:Ue(Gee(),t),...e}));ro.displayName=b3.displayName;function qee({onSubmit:t,initialData:e}){const[n,r]=A.useState({firstName:(e==null?void 0:e.firstName)||"",lastName:(e==null?void 0:e.lastName)||"",startupName:(e==null?void 0:e.startupName)||"",email:(e==null?void 0:e.email)||"",primaryProfileUrl:(e==null?void 0:e.primaryProfileUrl)||""}),[i,s]=A.useState({}),[a,o]=A.useState({}),[l,c]=A.useState(!1),h=A.useRef(null),d=(x,v)=>{switch(x){case"firstName":return v.trim()?void 0:"First name is required";case"lastName":return v.trim()?void 0:"Last name is required";case"startupName":return v.trim()?void 0:"Startup name is required";case"email":return v.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v)?void 0:"Please enter a valid email":"Email is required";case"primaryProfileUrl":if(!v.trim())return"Profile URL is required";try{new URL(v);return}catch{return"Please enter a valid URL"}default:return}},f=x=>{const{name:v,value:w}=x.target;r(b=>({...b,[v]:w})),a[v]&&s(b=>({...b,[v]:d(v,w)}))},p=x=>{const{name:v,value:w}=x.target;o(b=>({...b,[v]:!0})),s(b=>({...b,[v]:d(v,w)}))},m=x=>{if(x.preventDefault(),l)return;const v={};Object.keys(n).forEach(w=>{const b=d(w,n[w]);b&&(v[w]=b)}),s(v),o({firstName:!0,lastName:!0,startupName:!0,email:!0,primaryProfileUrl:!0}),Object.keys(v).length===0&&(c(!0),h.current&&clearTimeout(h.current),t(n),h.current=setTimeout(()=>{c(!1)},1e3))},y=Object.keys(n).every(x=>!d(x,n[x]));return g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-full max-w-lg mx-auto",children:[g.jsxs("div",{className:"text-center mb-8",children:[g.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:"Tell us about yourself"}),g.jsx("p",{className:"text-white/70",children:"We'll use this to personalize your results"})]}),g.jsxs("form",{onSubmit:m,className:"space-y-6 bg-white/5 backdrop-blur-sm rounded-2xl p-8 border border-white/10",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"firstName",className:"text-white",children:"First Name *"}),g.jsx(yn,{id:"firstName",name:"firstName",value:n.firstName,onChange:f,onBlur:p,className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 focus:border-purple focus:ring-purple/50 ${i.firstName&&a.firstName?"border-red-500":""}`,placeholder:"John"}),i.firstName&&a.firstName&&g.jsx("p",{className:"text-red-400 text-sm",children:i.firstName})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"lastName",className:"text-white",children:"Last Name *"}),g.jsx(yn,{id:"lastName",name:"lastName",value:n.lastName,onChange:f,onBlur:p,className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 focus:border-purple focus:ring-purple/50 ${i.lastName&&a.lastName?"border-red-500":""}`,placeholder:"Doe"}),i.lastName&&a.lastName&&g.jsx("p",{className:"text-red-400 text-sm",children:i.lastName})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"startupName",className:"text-white",children:"Startup Name *"}),g.jsx(yn,{id:"startupName",name:"startupName",value:n.startupName,onChange:f,onBlur:p,className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 focus:border-purple focus:ring-purple/50 ${i.startupName&&a.startupName?"border-red-500":""}`,placeholder:"Acme Inc."}),i.startupName&&a.startupName&&g.jsx("p",{className:"text-red-400 text-sm",children:i.startupName})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"email",className:"text-white",children:"Email *"}),g.jsx(yn,{id:"email",name:"email",type:"email",value:n.email,onChange:f,onBlur:p,className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 focus:border-purple focus:ring-purple/50 ${i.email&&a.email?"border-red-500":""}`,placeholder:"[email protected]"}),i.email&&a.email&&g.jsx("p",{className:"text-red-400 text-sm",children:i.email})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"primaryProfileUrl",className:"text-white",children:"Primary Profile URL *"}),g.jsx(yn,{id:"primaryProfileUrl",name:"primaryProfileUrl",type:"url",value:n.primaryProfileUrl,onChange:f,onBlur:p,className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 focus:border-purple focus:ring-purple/50 ${i.primaryProfileUrl&&a.primaryProfileUrl?"border-red-500":""}`,placeholder:"https://linkedin.com/in/johndoe"}),g.jsx("p",{className:"text-white/50 text-sm",children:"Website, LinkedIn, GitHub, or X profile. One link is enough."}),i.primaryProfileUrl&&a.primaryProfileUrl&&g.jsx("p",{className:"text-red-400 text-sm",children:i.primaryProfileUrl})]}),g.jsxs(Ye,{type:"submit",disabled:!y||l,className:"w-full bg-purple text-white hover:bg-purple/90 disabled:opacity-50 disabled:cursor-not-allowed",children:["Continue ",g.jsx(oo,{className:"ml-2 h-4 w-4"})]})]})]})}function Kee({onSubmit:t,onBack:e,initialData:n,profileReady:r}){const[i,s]=A.useState((n==null?void 0:n.type)||null),[a,o]=A.useState((n==null?void 0:n.pdfFile)||null),[l,c]=A.useState((n==null?void 0:n.link)||""),[h,d]=A.useState(),f=A.useRef(null),p=b=>{var _;
268const k=(_=b.target.files)==null?void 0:_[0];if(k){if(k.type!=="application/pdf"){alert("Please select a PDF file");return}if(k.size>20*1024*1024){alert("File size must be less than 20MB");return}o(k),s("pdf"),c("")}},m=b=>{const k=b.target.value;if(c(k),k){s("link"),o(null);try{new URL(k),d(void 0)}catch{d("Please enter a valid URL")}}else i==="link"&&s(null),d(void 0)},y=()=>{o(null),i==="pdf"&&s(null),f.current&&(f.current.value="")},x=()=>{c(""),i==="link"&&s(null),d(void 0)},v=()=>{i==="link"&&h||t({type:i,pdfFile:i==="pdf"&&a||void 0,link:i==="link"?l:void 0})},w=()=>{t({type:null})};return g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-full max-w-lg mx-auto",children:[g.jsxs("div",{className:"text-center mb-8",children:[g.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:r?"Want to pitch us?":"Share your pitch"}),g.jsx("p",{className:"text-white/70",children:r?"Your assessment is ready! If you'd like to share your deck with us, add it below.":"Optional: Upload a deck or provide a link"})]}),g.jsx("div",{className:"bg-white/5 backdrop-blur-sm rounded-2xl p-8 border border-white/10",children:g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:`space-y-3 ${i==="link"?"opacity-50 pointer-events-none":""}`,children:[g.jsxs(ro,{className:"text-white flex items-center gap-2",children:[g.jsx(K_,{className:"h-4 w-4 text-purple"})," Upload Pitch Deck (PDF)"]}),g.jsx("input",{ref:f,type:"file",accept:".pdf",onChange:p,className:"hidden",disabled:i==="link"}),a?g.jsxs("div",{className:"flex items-center justify-between p-4 bg-purple/10 rounded-lg border border-purple/30",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Ek,{className:"h-8 w-8 text-purple"}),g.jsxs("div",{children:[g.jsx("p",{className:"text-white font-medium truncate max-w-[200px]",children:a.name}),g.jsxs("p",{className:"text-white/50 text-sm",children:[(a.size/1024/1024).toFixed(2)," MB"]})]})]}),g.jsx(Ye,{variant:"ghost",size:"icon",onClick:y,className:"text-white/70 hover:text-white hover:bg-white/10",children:g.jsx(lg,{className:"h-5 w-5"})})]}):g.jsx(Ye,{type:"button",variant:"outline",onClick:()=>{var b;return(b=f.current)==null?void 0:b.click()},disabled:i==="link",className:"w-full h-24 border-dashed border-2 border-purple/30 bg-transparent text-white hover:bg-purple/10 hover:border-purple/50",children:g.jsxs("div",{className:"flex flex-col items-center gap-2",children:[g.jsx(K_,{className:"h-6 w-6 text-purple"}),g.jsx("span",{children:"Click to upload PDF (max 20MB)"})]})})]}),g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx("div",{className:"flex-1 h-px bg-white/20"}),g.jsx("span",{className:"text-white/50 text-sm",children:"OR"}),g.jsx("div",{className:"flex-1 h-px bg-white/20"})]}),g.jsxs("div",{className:`space-y-3 ${i==="pdf"?"opacity-50 pointer-events-none":""}`,children:[g.jsxs(ro,{className:"text-white flex items-center gap-2",children:[g.jsx(q9,{className:"h-4 w-4 text-purple"})," Pitch Deck Link"]}),g.jsxs("div",{className:"relative",children:[g.jsx(yn,{type:"url",value:l,onChange:m,disabled:i==="pdf",className:`bg-white/10 border-white/20 text-white placeholder:text-white/50 pr-10 focus:border-purple focus:ring-purple/50 ${h?"border-red-500":""}`,placeholder:"https://docs.google.com/presentation/..."}),l&&g.jsx(Ye,{variant:"ghost",size:"icon",onClick:x,className:"absolute right-1 top-1/2 -translate-y-1/2 text-white/70 hover:text-white hover:bg-transparent h-8 w-8",children:g.jsx(lg,{className:"h-4 w-4"})})]}),h&&g.jsx("p",{className:"text-red-400 text-sm",children:h})]}),g.jsxs("div",{className:"flex gap-4 pt-4",children:[g.jsxs(Ye,{type:"button",variant:"outline",onClick:e,className:"flex-1 border-purple/30 text-white hover:bg-purple/10",children:[g.jsx(A$,{className:"mr-2 h-4 w-4"})," Back"]}),i?g.jsxs(Ye,{type:"button",onClick:v,disabled:i==="link"&&!!h,className:"flex-1 bg-purple text-white hover:bg-purple/90 disabled:opacity-50",children:[r?"Submit & See Results":"Continue"," ",g.jsx(oo,{className:"ml-2 h-4 w-4"})]}):g.jsxs(Ye,{type:"button",onClick:w,className:"flex-1 bg-purple text-white hover:bg-purple/90",children:[r?"Skip & See Results":"Skip"," ",g.jsx(oo,{className:"ml-2 h-4 w-4"})]})]})]})})]})}function Yee({current:t,total:e}){const n=(t+1)/e*100;return g.jsxs("div",{className:"w-full max-w-lg mx-auto mb-8",children:[g.jsxs("div",{className:"flex justify-between text-white/70 text-sm mb-2",children:[g.jsxs("span",{children:["Question ",t+1," of ",e]}),g.jsxs("span",{children:[Math.round(n),"% complete"]})]}),g.jsx("div",{className:"h-2 bg-white/10 rounded-full overflow-hidden border border-white/10",children:g.jsx($e.div,{className:"h-full bg-gradient-to-r from-purple to-purple/80 rounded-full",initial:{width:0},animate:{width:`${n}%`},transition:{duration:.3}})})]})}function Xee({questions:t,currentIndex:e,answers:n,onAnswer:r,onNext:i,onBack:s,onComplete:a}){const o=t[e],l=A.useRef(!1),c=A.useRef(0),[h,d]=A.useState(null),f=o?n.find(P=>P.questionId===o.id):void 0,p=A.useMemo(()=>o?o.id.split("").reduce((R,O)=>R+O.charCodeAt(0),0)%2===0:!1,[o==null?void 0:o.id]);if(A.useEffect(()=>{d((f==null?void 0:f.optionIndex)??null)},[f]),!o)return null;const m=p?[{...o.option2,originalIndex:1},{...o.option1,originalIndex:0}]:[{...o.option1,originalIndex:0},{...o.option2,originalIndex:1}],y=A.useCallback((P,R,O)=>{const M=Date.now();M-c.current<300||l.current||(c.current=M,d(O),r({questionId:o.id,dimension:o.dimension,selectedTrait:R,optionIndex:O}),e<t.length-1&&(l.current=!0,setTimeout(()=>{i(),l.current=!1},400)))},[o,e,t.length,r,i]),x=A.useCallback(()=>{l.current||(l.current=!0,s(),setTimeout(()=>{l.current=!1},300))},[s]),v=A.useCallback(()=>{l.current||(l.current=!0,i(),setTimeout(()=>{l.current=!1},300))},[i]),w=A.useCallback(()=>{l.current||(l.current=!0,a())},[a]),b=e===t.length-1,k=e>0,_=h!==null&&!b,C=h!==null&&b;return g.jsxs($e.div,{initial:{opacity:0}
268,animate:{opacity:1},className:"w-full max-w-2xl mx-auto",children:[g.jsx(Yee,{current:e,total:t.length}),g.jsx(n3,{mode:"wait",children:g.jsxs($e.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},className:"space-y-8",children:[g.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white text-center",children:o.text}),g.jsx("div",{className:"space-y-4",children:m.map((P,R)=>g.jsx($e.button,{onClick:()=>y(R,P.trait,P.originalIndex),className:`w-full p-6 rounded-xl text-left transition-all ${h===P.originalIndex?"bg-purple text-white ring-4 ring-purple/50":"bg-white/10 text-white hover:bg-purple/20 border border-white/20 hover:border-purple/40"}`,whileHover:{scale:1.01},whileTap:{scale:.99},children:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-lg font-medium",children:P.text}),h===P.originalIndex&&g.jsx(E$,{className:"h-6 w-6 flex-shrink-0"})]})},R))})]},o.id)}),g.jsxs("div",{className:"flex justify-between mt-8",children:[g.jsxs(Ye,{variant:"outline",onClick:x,disabled:!k,className:"border-purple/30 text-white hover:bg-purple/10 disabled:opacity-30",children:[g.jsx(A$,{className:"mr-2 h-4 w-4"})," Back"]}),b?g.jsxs(Ye,{onClick:w,disabled:!C,className:"bg-purple text-white hover:bg-purple/90 disabled:opacity-30",children:["See Results ",g.jsx(oo,{className:"ml-2 h-4 w-4"})]}):g.jsxs(Ye,{onClick:v,disabled:!_,className:"bg-purple text-white hover:bg-purple/90 disabled:opacity-30",children:["Next ",g.jsx(oo,{className:"ml-2 h-4 w-4"})]})]})]})}const fp=A.forwardRef(({className:t,...e},n)=>g.jsx("textarea",{className:Ue("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
268ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));fp.displayName="Textarea";const Qee={hustler:{label:"Hustler",icon:"TrendingUp",description:"The business driver who spots opportunities, closes deals, and keeps the vision alive. They excel at sales, fundraising, and building strategic partnerships.",personalities:["Leader","Accomplisher"],lookFor:"Someone who thrives in sales, partnerships, and strategic positioning. They should be comfortable with ambiguity, rejection, and have a natural ability to inspire others."},hacker:{label:"Hacker",icon:"Code",description:"The builder who turns ideas into reality through technical execution and problem-solving. They love diving deep into complex challenges and shipping fast.",personalities:["Fighter","Developer"],lookFor:"A technical mind who loves solving complex problems and shipping products fast. Look for someone who can build MVPs quickly and iterate based on feedback."},hipster:{label:"Hipster",icon:"Palette",description:"The designer and architect who ensures the product is delightful, scalable, and user-centric. They focus on quality, experience, and sustainable systems.",personalities:["Engineer","Operator"],lookFor:"Someone focused on quality, user experience, and system architecture. They should care deeply about how things work and feel, not just that they work."}};function Jee(t){const e=t.toLowerCase();let n=null;return e.includes("hustler")?n="hustler":e.includes("hacker")?n="hacker":e.includes("hipster")&&(n="hipster"),["hustler","hacker","hipster"].filter(s=>s!==n).map(s=>Qee[s])}function Zee(t){const e=t.toLowerCase();return e.includes("hustler")?"hustler":e.includes("hacker")?"hacker":e.includes("hipster")?"hipster":null}const ete={TrendingUp:nq,Code:V9,Palette:Y9};function tte({hhhClassification:t}){const e=Jee(t),n=Zee(t),r={hustler:"Hustler",hacker:"Hacker",hipster:"Hipster"};return g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.7},className:"w-full",children:[g.jsxs("div",{className:"flex items-center justify-center gap-3 mb-6",children:[g.jsx("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-[#d2c3ea]/20",children:g.jsx(R$,{className:"h-5 w-5 text-[#d2c3ea]"})}),g.jsx("h3",{className:"text-2xl font-bold text-white",children:"Build Your Dream Team"})]}),g.jsxs("p",{className:"text-white/70 text-center mb-6",children:["As a ",g.jsx("span",{className:"text-[#d2c3ea] font-semibold",children:n?r[n]:"founder"}),", here's who you should look for to complete your founding team:"]}),g.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.map((i,s)=>{const a=ete[i.icon];return g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.8+s*.15},className:"bg-white/10 backdrop-blur-sm rounded-xl p-6 border border-white/20 hover:border-[#d2c3ea]/40 transition-colors",children:[g.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[g.jsx("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-[#d2c3ea]/20",children:g.jsx(a,{className:"h-5 w-5 text-[#d2c3ea]"})}),g.jsxs("h4",{className:"text-xl font-bold text-white",children:["Look for a ",i.label]})]}),g.jsx("p",{className:"text-white/80 text-sm mb-4 leading-relaxed",children:i.description}),g.jsxs("div",{className:"mb-4",children:[g.jsx("span",{className:"text-[#d2c3ea] text-xs font-semibold uppercase tracking-wider",children:"Personalities to look for:"}),g.jsx("div",{className:"flex gap-2 mt-2",children:i.personalities.map(o=>g.jsx("span",{className:"px-3 py-1 rounded-full bg-[#d2c3ea]/20 text-[#d2c3ea] text-sm font-medium",children:o},o))})]}),g.jsx("div",{className:"pt-4 border-t border-white/10",children:g.jsx("p",{className:"text-white/60 text-sm italic",children:i.lookFor})})]},i.label)})})]})}function nte({personality:t,hhh:e}){const{toast:n}=Ag(),r=`${window.location.origin}/vfti-quiz`,i=`I just discovered I'm a ${t} (${e})! Take this founder assessment to find out your profile and see if we'd make great co-founders.`,s=async()=>
268{if(navigator.share)try{await navigator.share({title:"Founder Type Assessment",text:i,url:r})}catch(o){o.name!=="AbortError"&&a()}else a()},a=async()=>{try{await navigator.clipboard.writeText(r),n({title:"Link copied!",description:"Share it with your potential co-founders."})}catch{n({title:"Failed to copy",description:"Please copy the link manually.",variant:"destructive"})}};return g.jsx($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1},className:"w-full",children:g.jsxs("div",{className:"bg-gradient-to-br from-[#d2c3ea]/20 to-white/5 backdrop-blur-sm rounded-2xl p-8 border border-[#d2c3ea]/30",children:[g.jsx("div",{className:"flex items-center justify-center gap-3 mb-4",children:g.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-[#d2c3ea]/20",children:g.jsx(iq,{className:"h-6 w-6 text-[#d2c3ea]"})})}),g.jsx("h3",{className:"text-2xl font-bold text-white text-center mb-3",children:"Want help assessing your next co-founder or team member?"}),g.jsx("p",{className:"text-white/70 text-center mb-6 max-w-md mx-auto",children:"Share the test with them to see how they complement your profile and build a balanced founding team."}),g.jsx("div",{className:"flex justify-center",children:g.jsxs(Ye,{onClick:s,className:"bg-purple text-white hover:bg-purple/90 font-semibold",children:[g.jsx(eq,{className:"mr-2 h-4 w-4"}),"Share Assessment"]})})]})})}const rte="https://zxrwbxfnrabiojjksbct.supabase.co",ite="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp4cndieGZucmFiaW9qamtzYmN0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc4Nzk2NzIsImV4cCI6MjA4MzQ1NTY3Mn0.NUf5gRWCA5fcbrMAS8vadKp6KiN7w_FyKsjkb-O03Ok",RD=2e3;function ste({profile:t,founderName:e,onRetake:n,submissionId:r}){const i=rf(),[s,a]=A.useState(""),[o,l]=A.useState(!1),[c,h]=A.useState(!1),d=async()=>{const f=s.trim();if(!f){zy({title:"Feedback is empty",description:"Please write a few words before sending.",variant:"destructive"});return}if(!r){zy({title:"Cannot send feedback",description:"Your submission reference is missing. Please retake the assessment.",variant:"destructive"});return}l(!0);try{const p=await fetch(`${rte}/functions/v1/submit-feedback`,{method:"POST",headers:{Authorization:`Bearer ${ite}`,"Content-Type":"application/json"},body:JSON.stringify({submissionId:r,feedback:f})});if(!p.ok){const m=await p.json().catch(()=>({}));throw new Error(m.error||"Failed to send feedback")}h(!0)}catch{zy({title:"Could not send feedback",description:"Please try again in a moment.",variant:"destructive"})}finally{l(!1)}};return g.jsxs($e.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.5},className:"w-full max-w-4xl mx-auto text-center",children:[g.jsx($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"mb-8",children:g.jsxs("h1",{className:"text-4xl md:text-5xl font-bold text-white mb-4",children:[e,", you are a"]})}),g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"bg-white/10 backdrop-blur-sm rounded-2xl p-8 md:p-12 mb-8 border border-white/20",children:[g.jsxs("div",{className:"mb-6",children:[g.jsx("span",{className:"inline-block px-4 py-2 rounded-full bg-[#d2c3ea]/20 text-[#d2c3ea] text-sm font-medium mb-4",children:t.hhh}),g.jsx("h2",{className:"text-5xl md:text-6xl font-bold text-white mb-2",children:t.personality})]}),g.jsx("p",{className:"text-xl text-white/90 leading-relaxed",children:t.description})]}),g.jsx($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},className:"bg-white/5 rounded-xl p-6 mb-8 border border-white/10",children:g.jsx("p",{className:"text-white/70 text-sm leading-relaxed",children:"This assessment is a qualitative, non-judgmental tool designed to help you understand your natural founder tendencies. It's used to analyze team composition and identify complementary strengths — not as an exclusion criterion. Every founder type brings unique value to a startup."})}),g.jsx("div",{className:"mb-8",children:g.jsx(tte,{hhhClassification:t.hhh})}),g.jsx("div",{className:"mb-8",children:g.jsx(nte,{personality:t.personality,hhh:t.hhh})}),g.jsxs($e.div,{initial:{opacity:0,y:20}
268,animate:{opacity:1,y:0},transition:{delay:.8},className:"relative bg-gradient-to-br from-purple/30 via-purple/10 to-[#d2c3ea]/20 backdrop-blur-md rounded-2xl p-6 md:p-10 mb-8 border-2 border-purple/40 shadow-[0_0_40px_-10px_rgba(168,132,255,0.5)] text-left ring-1 ring-purple/20",children:[g.jsx("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-purple/30 border border-purple/40 text-[#d2c3ea] text-xs font-semibold uppercase tracking-wider mb-3",children:"We want your feedback"}),g.jsx("h3",{className:"text-3xl md:text-4xl font-bold text-white mb-2",children:"Does this resonate with you?"}),g.jsx("p",{className:"text-white/80 text-base mb-5",children:"Share your thoughts on the result and the assessment process — your feedback helps us improve."}),c?g.jsxs("div",{className:"flex items-center gap-3 text-white/90 bg-white/5 border border-white/10 rounded-lg p-4",children:[g.jsx(_$,{className:"h-5 w-5 text-[#d2c3ea]"}),g.jsx("span",{children:"Thanks for your feedback — it means a lot."})]}):g.jsxs(g.Fragment,{children:[g.jsx(fp,{value:s,onChange:f=>a(f.target.value.slice(0,RD)),placeholder:"Tell us what resonated, what didn't, and any other thoughts…",disabled:o||!r,className:"min-h-[140px] bg-white/5 border-white/20 text-white placeholder:text-white/40 focus-visible:ring-purple"}),g.jsxs("div",{className:"flex items-center justify-between mt-3",children:[g.jsxs("span",{className:"text-xs text-white/50",children:[s.length,"/",RD]}),g.jsx(Ye,{onClick:d,disabled:o||!s.trim()||!r,className:"bg-purple text-white hover:bg-purple/90",children:o?g.jsxs(g.Fragment,{children:[g.jsx(bl,{className:"mr-2 h-4 w-4 animate-spin"})," Sending…"]}):"Send feedback"})]}),!r&&g.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Feedback unavailable — submission reference missing."})]})]}),g.jsxs($e.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1.2},className:"flex flex-col sm:flex-row gap-4 justify-center",children:[g.jsxs(Ye,{variant:"outline",onClick:n,className:"border-purple/30 text-white hover:bg-purple/10",children:[g.jsx(Q9,{className:"mr-2 h-4 w-4"})," Retake Assessment"]}),g.jsxs(Ye,{onClick:()=>i("/"),className:"bg-purple text-white hover:bg-purple/90",children:[g.jsx(W9,{className:"mr-2 h-4 w-4"})," Return Home"]})]})]})}const ate=[{id:"ve1",dimension:"VE",text:"When approaching a new venture, I prefer to:",option1:{text:"Set the long-term direction and inspire others to follow",trait:"V"},option2:{text:"Focus on immediate actions and measurable results",trait:"E"}},{id:"ve2",dimension:"VE",text:"My team values me most for:",option1:{text:"Seeing opportunities others miss and painting the big picture",trait:"V"},option2:{text:"Getting things done efficiently and solving practical problems",trait:"E"}},{id:"ve3",dimension:"VE",text:"When making decisions, I typically:",option1:{text:"Consider how this fits into our 5-year vision",trait:"V"},option2:{text:"Focus on what will have the most impact this quarter",trait:"E"}},{id:"ve4",dimension:"VE",text:"I get most energized when:",option1:{text:"Crafting and communicating a compelling future state",trait:"V"},option2:{text:"Completing tasks and hitting milestones",trait:"E"}}
268,{id:"ve5",dimension:"VE",text:"Others would describe my leadership style as:",option1:{text:"Visionary and strategic",trait:"V"},option2:{text:"Practical and results-oriented",trait:"E"}}],ote=[{id:"ac1",dimension:"AC",text:"When market conditions change, I prefer to:",option1:{text:"Quickly pivot and adapt our approach",trait:"A"},option2:{text:"Stay the course and trust our original strategy",trait:"C"}},{id:"ac2",dimension:"AC",text:"My approach to planning is:",option1:{text:"Keep plans flexible and adjust as we learn",trait:"A"},option2:{text:"Set a clear plan and execute with discipline",trait:"C"}},{id:"ac3",dimension:"AC",text:"When facing uncertainty, I tend to:",option1:{text:"Experiment with multiple approaches simultaneously",trait:"A"},option2:{text:"Double down on what's been working",trait:"C"}},{id:"ac4",dimension:"AC",text:"I believe startup success comes from:",option1:{text:"Being nimble and responding to feedback quickly",trait:"A"},option2:{text:"Persistence and unwavering commitment to a vision",trait:"C"}},{id:"ac5",dimension:"AC",text:"My decision-making style is:",option1:{text:"Iterative - I make decisions and adjust as needed",trait:"A"},option2:{text:"Deliberate - I make decisions carefully and stick with them",trait:"C"}}],lte=[{id:"ic1",dimension:"IC",text:"When solving complex problems, I prefer to:",option1:{text:"Work through them independently first",trait:"I"},option2:{text:"Brainstorm with the team from the start",trait:"C"}},{id:"ic2",dimension:"IC",text:"My best ideas come when I am:",option1:{text:"Working alone in deep focus",trait:"I"},option2:{text:"Bouncing ideas off others",trait:"C"}},{id:"ic3",dimension:"IC",text:"In team settings, I typically:",option1:{text:"Take ownership of decisions in my domain",trait:"I"},option2:{text:"Seek consensus and shared ownership",trait:"C"}},{id:"ic4",dimension:"IC",text:"I feel most productive when:",option1:{text:"I have autonomy to make decisions without lengthy discussions",trait:"I"},option2:{text:"The team is aligned and working together closely",trait:"C"}},{id:"ic5",dimension:"IC",text:"My leadership approach emphasizes:",option1:{text:"Clear individual accountability and ownership",trait:"I"},option2:{text:"Collective responsibility and team decision-making",trait:"C"}}],cte=[{id:"mp1",dimension:"MP",text:"I believe the key to startup success is:",option1:{text:"Finding and dominating the right market",trait:"M"},option2:{text:"Building an exceptional product that speaks for itself",trait:"P"}},{id:"mp2",dimension:"MP",text:"When prioritizing features, I focus on:",option1:{text:"What will drive sales and market adoption",trait:"M"},option2:{text:"What will make the product truly excellent",trait:"P"}},{id:"mp3",dimension:"MP",text:"I spend most of my time thinking about:",option1:{text:"Customer acquisition, positioning, and go-to-market",trait:"M"},option2:{text:"Product quality, user experience, and technical excellence",trait:"P"}},{id:"mp4",dimension:"MP",text:"My natural instinct is to:",option1:{text:"Talk to customers and understand market dynamics",trait:"M"},option2:{text:"Refine and perfect the product experience",trait:"P"}},{id:"mp5",dimension:"MP",text:"I believe our competitive advantage will come from:",option1:{text:"Superior market positioning and sales execution",trait:"M"},option2:{text:"A product that users genuinely love",trait:"P"}}],ute={VE:ate,AC:ote,IC:lte,MP:cte};function hte(t){const e=[...t];for(let n=e.length-1;n>0;n--){const r=Math.floor(Math.random()*(n+1));[e[n],e[r]]=[e[r],e[n]]}return e}function ID(){return["VE","AC","IC","MP"].flatMap(e=>hte(ute[e]))}const dte={VAIM:{personality:"Leader",hhh:"Pure Hustler",description:"You are a trailblazing pioneer who spots market gaps early and moves fast. You prefer to chart the strategic path alone, pivoting quickly to seize new opportunities."},VACM:{personality:"Leader",hhh:"Pure Hustler",description:"You are an inspiring captain who rallies the tribe around a shifting vision. You thrive on collective brainstorming to navigate market changes and keep morale high."},VCIM:{personality:"Leader",hhh:"Pure Hustler",description:"You are a determined strategist with a clear, unwavering view of the future. You lead from the front, trusting your instincts and tenacity to stay the course."},VCCM:{personality:"Leader",hhh:"Pure Hustler",description:"You are a unifying figurehead focused on long-term stability and trust. You excel at keeping the team aligned with a steady, shared mission."},EAIM:{personality:"Accomplisher",hhh:"Technology-Focused Hustler",description:"You are a tactical expert who executes market maneuvers with speed and autonomy, adjusting on the fly to get results."},EACM:{personality:"Accomplisher",hhh:"Technology-Focused Hustler",description:"You are a flexible operations manager who keeps the team moving through chaos and coordinates efforts efficie
268ntly."},ECIM:{personality:"Accomplisher",hhh:"Technology-Focused Hustler",description:"You are a disciplined producer focused on hitting targets with precision, owning execution end to end."},ECCM:{personality:"Accomplisher",hhh:"Technology-Focused Hustler",description:"You are the operational anchor of the startup, ensuring structure, teamwork, and predictable growth."},VAIP:{personality:"Fighter",hhh:"Pure Hacker",description:"You are a creative disruptor who thrives in high-stakes technical environments, hacking novel solutions independently."},EAIP:{personality:"Fighter",hhh:"Pure Hacker",description:"You are a resilient troubleshooter who pushes through technical obstacles until the product works."},VACP:{personality:"Developer",hhh:"Pure Hacker",description:"You are an agile innovator who iterates on features with a team, combining vision with real-time feedback."},EACP:{personality:"Developer",hhh:"Pure Hacker",description:"You are a collaborative implementer who turns feedback into practical, continuous improvements."},VCIP:{personality:"Engineer",hhh:"Pure Hipster",description:"You are a deep-tech architect focused on technical perfection and long-term system design."},VCCP:{personality:"Engineer",hhh:"Pure Hipster",description:"You are a technical visionary who guides the team toward a high-quality, coherent product architecture."},ECIP:{personality:"Operator",hhh:"Operations-Focused Hipster",description:"You are a methodical stabilizer optimizing systems quietly for peak efficiency."},ECCP:{personality:"Operator",hhh:"Operations-Focused Hipster",description:"You are a structured process manager ensuring reliability, standards, and operational excellence."}};function fte(t){return dte[t]||{personality:"Innovator",hhh:"Versatile Founder",description:"You have a unique blend of traits that defies easy categorization. Your diverse skill set allows you to adapt to various challenges."}}const a1=()=>{const t=A.useRef(null);return A.useEffect(()=>{const e=t.current;if(!e)return;const n=e.getContext("2d");if(!n)return;let r,i=[];const s={purple:{main:"rgba(160, 100, 200, 0.8)",glow:"rgba(160, 100, 200, 0.3)"},magenta:{main:"rgba(200, 80, 180, 0.7)",glow:"rgba(200, 80, 180, 0.25)"},blue:{main:"rgba(80, 140, 220, 0.7)",glow:"rgba(80, 140, 220, 0.25)"},deepPurple:{main:"rgba(120, 80, 180, 0.75)",glow:"rgba(120, 80, 180, 0.28)"}},a=Object.keys(s),o=()=>{e.width=window.innerWidth,e.height=window.innerHeight*3,l()},l=()=>{const f=Math.floor(e.width*e.height/25e3);i=[];for(let p=0;p<f;p++){const m=a[Math.floor(Math.random()*a.length)],y=s[m];i.push({x:Math.random()*e.width,y:Math.random()*e.height,vx:(Math.random()-.5)*.3,vy:(Math.random()-.5)*.3,radius:Math.random()*3+1.5,color:y.main,glow:y.glow})}},c=f=>{const p=n.createRadialGradient(f.x,f.y,0,f.x,f.y,f.radius*8);p.addColorStop(0,f.glow),p.addColorStop(1,"transparent"),n.fillStyle=p,n.beginPath(),n.arc(f.x,f.y,f.radius*8,0,Math.PI*2),n.fill(),n.fillStyle=f.color,n.beginPath(),n.arc(f.x,f.y,f.radius,0,Math.PI*2),n.fill()},h=()=>{for(let p=0;p<i.length;p++)for(let m=p+1;m<i.length;m++){const y=i[p].x-i[m].x,x=i[p].y-i[m].y,v=Math.sqrt(y*y+x*x);if(v<180){const w=(1-v/180)*.15,b=n.createLinearGradient(i[p].x,i[p].y,i[m].x,i[m].y);b.addColorStop(0,i[p].color.replace(/[\d.]+\)$/,`${w})`)),b.addColorStop(1,i[m].color.replace(/[\d.]+\)$/,`${w})`)),n.strokeStyle=b,n.lineWidth=1,n.beginPath(),n.moveTo(i[p].x,i[p].y),n.lineTo(i[m].x,i[m].y),n.stroke()}}},d=()=>{n.fillStyle="rgba(8, 10, 15, 1)",n.fillRect(0,0,e.width,e.height);const f=n.createRadialGradient(e.width*.3,e.height*.2,0,e.width*.3,e.height*.2,e.width*.8);f.addColorStop(0,"rgba(80, 40, 120, 0.15)"),f.addColorStop(.5,"rgba(60, 40, 100, 0.1)"),f.addColorStop(1,"transparent"),n.fillStyle=f,n.fillRect(0,0,e.width,e.height);const p=n.createRadialGradient(e.width*.7,e.height*.6,0,e.width*.7,e.height*.6,e.width*.6);p.addColorStop(0,"rgba(100, 40, 120, 0.12)"),p.addColorStop(1,"transparent"),n.fillStyle=p,n.fillRect(0,0,e.width,e.height),h(),i.forEach(m=>{m.x+=m.vx,m.y+=m.vy,(m.x<0||m.x>e.width)&&(m.vx*=-1),(m.y<0||m.y>e.height)&&(m.vy*=-1),c(m)}),r=requestAnimationFrame(d)};return o(),window.addEventListener("resize",o),d(),()=>{window.removeEventListener("resize",o),cancelAnimationFrame(r)}},[]),g.jsx("canvas",{ref:t,className:"fixed inset-0 -z-10 pointer-events-none",style:{background:"rgb(8, 10, 15)"}})},OD="https://zxrwbxfnrabiojjksbct.supabase.co",MD="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp4cndieGZucmFiaW9qamtzYmN0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc4Nzk2NzIsImV4cCI6MjA4MzQ1NTY3Mn0.NUf5gRWCA5fcbrMAS8vadKp6KiN7w_FyKsjkb-O03Ok";function pte(){const[t,e]=A.useState({step:"identity",identity:null,pitch:{type:null},answers:[],currentQuestionIndex:0,shuffledQuestions:[]}),[n,r]=A.useState(null),[i,s]=A.useState(!1),[a,o]=A.useState(null);A.useEffect(()=>{e(x=>({...x,shuffledQuestions:ID()}))},[]);const l=x=>{const v=["VE","AC","IC","MP"],w={VE:["V","E"],AC:["A","C"],IC:["I","C"],MP:["M","P"]};let b="";for(const k of v){const C=x.filter(P=>P.dimension===k).filter(P=>P.selectedTrait===w[k][0]).length;b+=C>=3?w[k][0]:w[k][1]}return b},c=async x=>{try{const v=new FormData;v.append("file",x);const w=await fetch(`${OD}/functions/v1/upload-pitch-deck`,{method:"POST",headers:{Authorization:`Bearer ${MD}`},body:v});if(!w.ok){const k=await w.json();throw new Error(k.error||"Upload failed")}const{path:b}=await w.json();return b}catch{return null}},h=async(x,v)=>{if(t.identity){s(!0);try{let w=null;t.pitch.type==="pdf"&&t.pitch.pdfFile&&(w=await c(t.pitch.pdfFile));const b={first_name:t.identity.firstName,last_name:t.identity.lastName,startup_name:t.identity.startupName,email:t.identity.email,primary_profile_url:t.identity.primaryProfileUrl,pitch_pdf_path:w,pitch_link:t.pitch.type==="link"?t.pitch.link:null,vfti_code:x,personality_label:v.personality,hhh_classification:v.hhh,narrative_description:v.description,answers:t.answers},k=await fetch(`${OD}/functions/v1/submit-quiz`,{method:"POST",headers:{Authorization:`Bearer ${MD}`,"Content-Type":"application/json"},body:JSON.stringify(b)});if(!k.ok){const C=await k.json();throw new Error(C.error||"Submission failed")}const _=await k.json().catch(()=>({}));_!=null&&_.id&&o(_.id),r(v),e(C=>({...C,step:"results"})),typeof window<"u"&&window.scrollTo({top:0,behavior:"auto"})}catch{zy({title:"Submission Error",description:"There was an error saving your results. Please try again.",variant:"destructive"})}finally{s(!1)}}},d=x=>{e(v=>({...v,identity:x,step:"quiz"}))},f=x=>{if(e(v=>({...v,pitch:x}
268)),n){const v=l(t.answers);h(v,n)}},p=x=>{e(v=>{const w=v.answers.findIndex(k=>k.questionId===x.questionId),b=w>=0?v.answers.map((k,_)=>_===w?x:k):[...v.answers,x];return{...v,answers:b}})},m=()=>{const x=l(t.answers),v=fte(x);r(v),e(w=>({...w,step:"pitch"}))},y=()=>{e({step:"identity",identity:null,pitch:{type:null},answers:[],currentQuestionIndex:0,shuffledQuestions:ID()}),r(null),o(null)};return i?g.jsxs("div",{className:"min-h-screen relative flex items-center justify-center",children:[g.jsx(a1,{}),g.jsxs("div",{className:"text-center relative z-10",children:[g.jsx(bl,{className:"h-12 w-12 text-purple animate-spin mx-auto mb-4"}),g.jsx("p",{className:"text-white text-lg",children:"Analyzing your profile..."})]})]}):g.jsxs("div",{className:"min-h-screen relative py-16 px-4",children:[g.jsx(a1,{}),g.jsx("div",{className:"container mx-auto relative z-10",children:g.jsxs(n3,{mode:"wait",children:[t.step==="identity"&&g.jsx(qee,{onSubmit:d,initialData:t.identity},"identity"),t.step==="pitch"&&n&&g.jsx(Kee,{onSubmit:f,onBack:()=>e(x=>({...x,step:"quiz",currentQuestionIndex:t.shuffledQuestions.length-1})),initialData:t.pitch,profileReady:!0},"pitch"),t.step==="quiz"&&t.shuffledQuestions.length>0&&g.jsx(Xee,{questions:t.shuffledQuestions,currentIndex:t.currentQuestionIndex,answers:t.answers,onAnswer:p,onNext:()=>e(x=>({...x,currentQuestionIndex:x.currentQuestionIndex+1})),onBack:()=>e(x=>({...x,currentQuestionIndex:Math.max(0,x.currentQuestionIndex-1)})),onComplete:m},"quiz"),t.step==="results"&&n&&t.identity&&g.jsx(ste,{profile:n,founderName:t.identity.firstName,onRetake:y,submissionId:a},"results")]})})]})}const mte=()=>{const t=()=>{var e;(e=document.getElementById("vfti-quiz-start"))==null||e.scrollIntoView({behavior:"smooth"})};return g.jsxs("div",{className:"bg-background",children:[g.jsx(K0,{title:"VFTI — Venture Founder Type Indicator | Realr",description:"Take Realr's VFTI assessment: discover whether your founding team combines complementary Hustlers, Hackers and Hipsters — the team composition twice as likely to succeed.",path:"/vfti-quiz"}),g.jsx("section",{className:"py-24 lg:py-32 px-6 lg:px-16 border-b border-white/10",children:g.jsxs("div",{className:"max-w-screen-xl mx-auto grid lg:grid-cols-12 gap-12 lg:gap-20 items-start",children:[g.jsxs($e.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:1},className:"lg:col-span-5 relative aspect-[3/4] overflow-hidden order-2 lg:order-1",children:[g.jsx("img",{src:m3,alt:"Organic cellular structure representing complementary founder teams",className:"absolute inset-0 w-full h-full object-cover",width:1080,height:1440}),g.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-background to-transparent"}),g.jsx("div",{className:"absolute bottom-6 left-6 right-6 mono text-[10px] uppercase tracking-[0.4em] text-white/50",children:"VFTI · Venture Founder Type Indicator"})]}),g.jsxs("div",{className:"lg:col-span-7 order-1 lg:order-2",children:[g.jsx("div",{className:"eyebrow mb-6",children:"The team risk"}),g.jsxs("h1",{className:"display text-5xl lg:text-7xl text-white mb-10",children:["Startups fail.",g.jsx("br",{}),g.jsx("span",{className:"italic-accent",children:"Certain teams fail less."})]}),g.jsxs("p",{className:"text-lg text-white/70 mb-6 leading-relaxed font-light",children:["Team is the ",g.jsx("span",{className:"text-white",children:"#3 cause"})," of startup failure, ahead of running out of cash, ahead of lacking PMF. We try to de-risk that."]}),g.jsxs("p",{className:"text-lg text-white/55 mb-6 leading-relaxed font-light",children:["We assess founders' personalities, looking for complementary teams of"," ",g.jsx("span",{className:"italic-accent",children:"Hustlers"}),","," ",g.jsx("span",{className:"italic-accent",children:"Hackers"}),", and"," ",g.jsx("span",{className:"italic-accent",children:"Hipsters"}),"."]}),g.jsxs("p",{className:"text-lg text-white/55 mb-12 leading-relaxed font-light whitespace-pre-wrap",children:["Startups with diverse and complementary founder types are ",g.jsx("span",{className:"text-white",children:"twice as likely to succeed"}),". The VFTI gives founders a tactical advantage by mapping how they think, decide, and lead.",`
269
270`,"Learn more about our founder assessment."]}),g.jsxs("button",{onClick:t,className:"group inline-flex items-center gap-3 px-10 py-5 bg-primary text-primary-foreground mono text-xs uppercase tracking-[0.3em] hover:bg-primary-glow transition-all duration-500",style:{boxShadow:"var(--shadow-violet)"},children:["Start the assessment",g.jsx("span",{className:"transition-transform group-hover:translate-x-1",children:"↓"})]})]})]})}),g.jsx("div",{id:"vfti-quiz-start",children:g.jsx(pte,{})})]})};function gte(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}
270return new(n||(n=Promise))(function(s,a){function o(h){try{c(r.next(h))}catch(d){a(d)}}function l(h){try{c(r.throw(h))}catch(d){a(d)}}function c(h){h.done?s(h.value):i(h.value).then(o,l)}c((r=r.apply(t,e||[])).next())})}const yte=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class AR extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class vte extends AR{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class DD extends AR{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class LD extends AR{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var TC;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(TC||(TC={}));class wte{constructor(e,{headers:n={},customFetch:r,region:i=TC.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=yte(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return gte(this,arguments,void 0,function*(n,r={}){var i;let s,a;try{const{headers:o,method:l,body:c,signal:h,timeout:d}=r;let f={},{region:p}=r;p||(p=this.region);const m=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,m.searchParams.set("forceFunctionRegion",p));let y;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",y=c):typeof c=="string"?(f["Content-Type"]="text/plain",y=c):typeof FormData<"u"&&c instanceof FormData?y=c:(f["Content-Type"]="application/json",y=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?y=JSON.stringify(c):y=c;let x=h;d&&(a=new AbortController,s=setTimeout(()=>a.abort(),d),h?(x=a.signal,h.addEventListener("abort",()=>a.abort())):x=a.signal);const v=yield this.fetch(m.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:y,signal:x}).catch(_=>{throw new vte(_)}),w=v.headers.get("x-relay-error");if(w&&w==="true")throw new DD(v);if(!v.ok)throw new LD(v);let b=((i=v.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),k;return b==="application/json"?k=yield v.json():b==="application/octet-stream"||b==="application/pdf"?k=yield v.blob():b==="text/event-stream"?k=v:b==="multipart/form-data"?k=yield v.formData():k=yield v.text(),{data:k,error:null,response:v}}catch(o){return{data:null,error:o,response:o instanceof LD||o instanceof DD?o.context:void 0}}finally{s&&clearTimeout(s)}})}}const x3=3,jD=t=>Math.min(1e3*2**t,3e4),bte=[520,503],S3=["GET","HEAD","OPTIONS"];var xte=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
270de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function FD(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",i),n()},t);function i(){clearTimeout(r),n()}e==null||e.addEventListener("abort",i)})}function Ste(t,e,n,r){return!(!r||n>=x3||!S3.includes(t)||!bte.includes(e))}var kte=class{constructor(t){var e,n,r,i,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=t.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(i=t.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(s=t.retry)!==null&&s!==void 0?s:!0,t.fetch?this.fetch=t.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(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var n=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 r=this.fetch;let s=(async()=>{let a=0;for(;;){const c=new Headers(n.headers);a>0&&c.set("X-Retry-Count",String(a));let h;try{h=await r(n.url.toString(),{method:n.method,headers:c,body:JSON.stringify(n.body,(d,f)=>typeof f=="bigint"?f.toString():f),signal:n.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!S3.includes(n.method))throw d;if(n.retryEnabled&&a<x3){const f=jD(a);a++,await FD(f,n.signal);continue}throw d}if(Ste(n.method,h.status,a,n.retryEnabled)){var o,l;const d=(o=(l=h.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&o!==void 0?o:null,f=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:jD(a);await h.text(),a++,await FD(f,n.signal);continue}return await n.processResponse(h)}})();return this.shouldThrowOnError||(s=s.catch(a=>{var o;let l="",c="",h="";const d=a==null?void 0:a.cause;if(d){var f,p,m,y;const w=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",b=(p=d==null?void 0:d.code)!==null&&p!==void 0?p:"";l=`${(m=a==null?void 0:a.name)!==null&&m!==void 0?m:"FetchError"}: ${a==null?void 0:a.message}`,l+=`
271
272Caused by: ${(y=d==null?void 0:d.name)!==null&&y!==void 0?y:"Error"}: ${w}`,b&&(l+=` (${b})`),d!=null&&d.stack&&(l+=`
273${d.stack}`)}else{var x;l=(x=a==null?void 0:a.stack)!==null&&x!==void 0?x:""}const v=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(h="",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.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(h="",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:h},data:null,count:null,status:0,statusText:""}}
273)),s.then(t,e)}async processResponse(t){var e=this;let n=null,r=null,i=null,s=t.status,a=t.statusText;if(t.ok){var o,l;if(e.method!=="HEAD"){var c;const f=await t.text();f===""||(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"))?r=f:r=JSON.parse(f))}const h=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),d=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");h&&d&&d.length>1&&(i=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,i=null,s=406,a="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const h=await t.text();try{n=JSON.parse(h),Array.isArray(n)&&t.status===404&&(r=[],n=null,s=200,a="OK")}catch{t.status===404&&h===""?(s=204,a="No Content"):n={message:h}}if(n&&e.shouldThrowOnError)throw new xte(n)}return{success:n===null,error:n,data:r,count:i,status:s,statusText:a}}returns(){return this}overrideTypes(){return this}},Ate=class extends kte{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,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:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var a;const o=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,i?"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+${s}; for="${l}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const BD=new RegExp("[,()]");var Af=class extends Ate{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&BD.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&BD.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${i}fts${s}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>
273n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},Ete=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:s}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},i=n?"HEAD":"GET";let s=!1;const a=(t??"*").split("").map(c=>/\s/.test(c)&&!s?"":(c==='"'&&(s=!s),c)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",a),r&&l.append("Prefer",`count=${r}`),new Af({method:i,url:o,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),n||a.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);s.searchParams.set("columns",l.join(","))}}return new Af({method:i,url:s,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),r&&l.append("Prefer",`count=${r}`),i||l.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((h,d)=>h.concat(Object.keys(d)),[]);if(c.length>0){const h=[...new Set(c)].map(d=>`"${d}"`);o.searchParams.set("columns",h.join(","))}}return new Af({method:a,url:o,headers:l,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var n;const r="PATCH",{url:i,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Af({method:r,url:i,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Af({method:n,url:r,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Iv(t){"@babel/helpers - typeof";
273return Iv=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},Iv(t)}function _te(t,e){if(Iv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cte(t){var e=_te(t,"string");return Iv(e)=="symbol"?e:e+""}function Tte(t,e,n){return(e=Cte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ob(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$D(Object(n),!0).forEach(function(r){Tte(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Pte=class k3{constructor(e,{headers:n={},schema:r,fetch:i,timeout:s,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;const l=i??globalThis.fetch;s!==void 0&&s>0?this.fetch=(c,h)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),s),p=h==null?void 0:h.signal;if(p){if(p.aborted)return clearTimeout(f),l(c,h);const m=()=>{clearTimeout(f),d.abort()};return p.addEventListener("abort",m,{once:!0}),l(c,Ob(Ob({},h),{},{signal:d.signal})).finally(()=>{clearTimeout(f),p.removeEventListener("abort",m)})}return l(c,Ob(Ob({},h),{},{signal:d.signal})).finally(()=>clearTimeout(f))}: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 Ete(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 k3(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,n={},{head:r=!1,get:i=!1,count:s}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let c;const h=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(h)),d=r&&Object.values(n).some(h);d?(o="POST",c=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([p,m])=>m!==void 0).map(([p,m])=>[p,Array.isArray(m)?`{${m.join(",")}}`:`${m}`]).forEach(([p,m])=>{l.searchParams.append(p,m)})):(o="POST",c=n);const f=new Headers(this.headers);return d?f.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&f.set("Prefer",`count=${s}`),new Af({method:o,url:l,headers:f,schema:this.schemaName,body:c,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Nte{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 n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
274import ws from "ws"
275new 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 n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`
276
277Suggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Rte="2.104.1",Ite=`realtime-js/${Rte}`,Ote="1.0.0",A3="2.0.0",Mte=A3,Dte=1e4,Lte=100,Zl={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},E3={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},PC={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class jte{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,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,n,r){var i,s;const a=e.topic,o=(i=e.ref)!==null&&i!==void 0?i:"",l=(s=e.join_ref)!==null&&s!==void 0?s:"",c=e.payload.event,h=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(h).length===0?"":JSON.stringify(h);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(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+c.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let m=new DataView(p),y=0;m.setUint8(y++,this.KINDS.userBroadcastPush),m.setUint8(y++,l.length),m.setUint8(y++,o.length),m.setUint8(y++,a.length),m.setUint8(y++,c.length),m.setUint8(y++,d.length),m.setUint8(y++,n),Array.from(l,v=>m.setUint8(y++,v.charCodeAt(0))),Array.from(o,v=>m.setUint8(y++,v.charCodeAt(0))),Array.from(a,v=>m.setUint8(y++,v.charCodeAt(0))),Array.from(c,v=>m.setUint8(y++,v.charCodeAt(0))),Array.from(d,v=>m.setUint8(y++,v.charCodeAt(0)));var x=new Uint8Array(p.byteLength+r.byteLength);return x.set(new Uint8Array(p),0),x.set(new Uint8Array(r),p.byteLength),x.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[i,s,a,o,l]=r;
277return n({join_ref:i,ref:s,topic:a,event:o,payload:l})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,i)}}_decodeUserBroadcast(e,n,r){const i=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),o=n.getUint8(4);let l=this.HEADER_LENGTH+4;const c=r.decode(e.slice(l,l+i));l=l+i;const h=r.decode(e.slice(l,l+s));l=l+s;const d=r.decode(e.slice(l,l+a));l=l+a;const f=e.slice(l,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,m={type:this.BROADCAST_EVENT,event:h,payload:p};return a>0&&(m.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}var gt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(gt||(gt={}));const UD=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=Fte(a,t,e,i),s),{}):{}},Fte=(t,e,n,r)=>{const i=e.find(o=>o.name===t),s=i==null?void 0:i.type,a=n[t];return s&&!r.includes(s)?_3(s,a):NC(a)},_3=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return zte(e,n)}switch(t){case gt.bool:return Bte(e);case gt.float4:case gt.float8:case gt.int2:case gt.int4:case gt.int8:case gt.numeric:case gt.oid:return $te(e);case gt.json:case gt.jsonb:return Ute(e);case gt.timestamp:return Vte(e);case gt.abstime:case gt.date:case gt.daterange:case gt.int4range:case gt.int8range:case gt.money:case gt.reltime:case gt.text:case gt.time:case gt.timestamptz:case gt.timetz:case gt.tsrange:case gt.tstzrange:return NC(e);default:return NC(e)}},NC=t=>t,Bte=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},$te=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},Ute=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},zte=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const a=t.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>_3(e,o))}return t},Vte=t=>typeof t=="string"?t.replace(" ","T"):t,C3=t=>{const e=new URL(t);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 Yy=t=>typeof t=="function"?t:function(){return t},Hte=typeof self<"u"?self:null,Ef=typeof window<"u"?window:null,Ta=Hte||Ef||globalThis,Wte="2.0.0",Gte=1e4,qte=1e3,to={connecting:0,open:1,closing:2,closed:3},zr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},To={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},RC={longpoll:"longpoll",websocket:"websocket"},Kte={complete:4},IC="base64url.bearer.phx.",Mb=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,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(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}
vendor: 20,339 bytes, lines 277-278
277matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.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,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},T3=class{constructor(t,e){this.callback=t,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))}},Yte=class{constructor(t,e,n){this.state=zr.closed,this.topic=t,this.params=Yy(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Mb(this,To.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new T3(()=>{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=zr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=zr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=zr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=zr.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 Mb(this,To.leave,Yy({}),this.timeout).send(),this.state=zr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(To.reply,(r,i)=>{this.trigger(this.replyEventName(i),r)})}join(t=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=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=zr.closed,this.bindings=[]}onClose(t){this.on(To.close,t)}onError(t){return this.on(To.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Mb(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=zr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(To.close,"leave")},n=new Mb(this,To.leave,Yy({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=zr.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let i=this.onMessage(t,e,n,r);if(e&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(a=>a.event===t&&this.filterBindings(a,e,n));for(let a=0;a<s.length;a++)s[a].callback(i,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===zr.closed}isErrored(){return this.state===zr.errored}isJoined(){return this.state===zr.joined}isJoining(){return this.state===zr.joining}isLeaving(){return this.state===zr.leaving}},o1=class{static request(t,e,n,r,i,s,a){if(Ta.XDomainRequest){let o=new Ta.XDomainRequest;return this.xdomainRequest(o,t,e,r,i,s,a)}else if(Ta.XMLHttpRequest){let o=new Ta.XMLHttpRequest;return this.xhrRequest(o,t,e,n,r,i,s,a)}else{if(Ta.fetch&&Ta.AbortController)return this.fetchRequest(t,e,n,r,i,s,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,r,i,s,a){let o={method:t,headers:n,body:r},l=null;return i&&(l=new AbortController,setTimeout(()=>l.abort(),i),o.signal=l.signal),Ta.fetch(e,o).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>a&&a(c)).catch(c=>{c.name==="AbortError"&&s?s():a&&a(null)}),l}static xdomainRequest(t,e,n,r,i,s,a){return t.timeout=i,t.open(e,n),t.onload=()=>{let o=this.parseJSON(t.responseText);a&&a(o)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,i,s,a,o){t.open(e,n,!0),t.timeout=s;for(let[l,c]of Object.entries(r))t.setRequestHeader(l,c);return t.onerror=()=>o&&o(null),t.onreadystatechange=()=>{if(t.readyState===Kte.complete&&o){let l=this.parseJSON(t.responseText);o(l)}},a&&(t.ontimeout=a),t.send(i),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=e?`${e}[${r}]`:r,s=t[r];typeof s=="object"?n.push(this.serialize(s,i)):n.push(encodeURIComponent(i)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},Xte=t=>{let e="",n=new Uint8Array(t),r=n.byteLength;for(let i=0;i<r;i++)e+=String.fromCharCode(n[i]);return btoa(e)},hf=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(IC)&&(this.authToken=atob(e[1].slice(IC.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(t),this.readyState=to.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+RC.websocket),"$1/"+RC.longpoll)}endpointURL(){return o1.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=to.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===to.open||this.readyState===to.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:r,messages:i}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:i.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=to.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 ${n}`)}})}send(t){typeof t!="string"&&(t=Xte(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
278`),()=>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(t,e,n){for(let i of this.reqs)i.abort();this.readyState=to.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(t,e,n,r,i){let s,a=()=>{this.reqs.delete(s),r()};s=o1.request(t,this.endpointURL(),e,n,this.timeout,a,o=>{this.reqs.delete(s),this.isActive()&&i(o)}),this.reqs.add(s)}},Qte=class oy{constructor(e,n={}){let r=n.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(r.state,i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=oy.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=oy.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],o()}),this.channel.on(r.diff,i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=oy.syncDiff(this.state,i,s,a),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return oy.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,i){let s=this.clone(e),a={},o={};return this.map(s,(l,c)=>{n[l]||(o[l]=c)}),this.map(n,(l,c)=>{let h=s[l];if(h){let d=c.metas.map(y=>y.phx_ref),f=h.metas.map(y=>y.phx_ref),p=c.metas.filter(y=>f.indexOf(y.phx_ref)<0),m=h.metas.filter(y=>d.indexOf(y.phx_ref)<0);p.length>0&&(a[l]=c,a[l].metas=p),m.length>0&&(o[l]=this.clone(h),o[l].metas=m)}else a[l]=c}),this.syncDiff(s,{joins:a,leaves:o},r,i)}static syncDiff(e,n,r,i){let{joins:s,leaves:a}=this.clone(n);return r||(r=function(){}),i||(i=function(){}),this.map(s,(o,l)=>{let c=e[o];if(e[o]=this.clone(l),c){let h=e[o].metas.map(f=>f.phx_ref),d=c.metas.filter(f=>h.indexOf(f.phx_ref)<0);e[o].metas.unshift(...d)}r(o,c,l)}),this.map(a,(o,l)=>{let c=e[o];if(!c)return;let h=l.metas.map(d=>d.phx_ref);c.metas=c.metas.filter(d=>h.indexOf(d.phx_ref)<0),i(o,c,l),c.metas.length===0&&delete e[o]}),e}static list(e,n){return n||(n=function(r,i){return i}),this.map(e,(r,i)=>n(r,i))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Db={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,i,s,a]=JSON.parse(t);return e({join_ref:n,ref:r,topic:i,event:s,payload:a})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:i,payload:s}=t,a=this.META_LENGTH+e.length+n.length+i.length+r.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++,n.length),l.setUint8(c++,i.length),l.setUint8(c++,r.length),Array.from(e,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(i,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(c++,d.charCodeAt(0)));var h=new Uint8Array(o.byteLength+s.byteLength);return h.set(new Uint8Array(o),0),h.set(new Uint8Array(s),o.byteLength),h.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),i=e.getUint8(2),s=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=n.decode(t.slice(a,a+r));a=a+r;let l=n.decode(t.slice(a,a+i));a=a+i;let c=n.decode(t.slice(a,a+s));a=a+s;let h=t.slice(a,t.byteLength);return{join_ref:o,ref:null,topic:l,event:c,payload:h}},decodeReply(t,e,n){let r=e.getUint8(1),i=e.getUint8(2),s=e.getUint8(3),a=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(t.slice(o,o+r));o=o+r;let c=n.decode(t.slice(o,o+i));o=o+i;let h=n.decode(t.slice(o,o+s));o=o+s;let d=n.decode(t.slice(o,o+a));o=o+a;let f=t.slice(o,t.byteLength),p={status:d,response:f};return{join_ref:l,ref:c,topic:h,event:To.reply,payload:p}},decodeBroadcast(t,e,n){let r=e.getUint8(1),i=e.getUint8(2),s=this.HEADER_LENGTH+2,a=n.decode(t.slice(s,s+r));s=s+r;let o=n.decode(t.slice(s,s+i));s=s+i;let l=t.slice(s,t.byteLength);return{join_ref:null,ref:null,topic:a,event:o,payload:l}}},Jte=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||Gte,this.transport=e.transport||Ta.WebSocket||hf,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||Ta&&Ta.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Db.encode.bind(Db),this.defaultDecoder=Db.decode.bind(Db),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!==hf?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Ef&&Ef.addEventListener&&(Ef.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Ef.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Ef.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=r=>e.rejoinAfterMs?e.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>e.reconnectAfterMs?e.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(r,i,s)=>{console.log(`${r}: ${i}`,s)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Yy(e.params||{}),this.endPoint=`${t}/${RC.websocket}`,this.vsn=e.vsn||Wte,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new T3(()=>{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 hf}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=o1.appendParams(o1.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Yy(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==hf?this.connectWithFallback(hf,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(i=>{i.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){switch(t){case hf:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${IC}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),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(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,s,a=this.transportName(t),o=l=>{this.log("transport",`falling back to ${a}...`,l),this.off([i,s]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),s=this.onError(l=>{this.log("transport","error",l),r&&!n&&(clearTimeout(this.fallbackTimer),o(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let l=this.transportName(t);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(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),qte,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){}
278,this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===to.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",t,e,n),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(To.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case to.connecting:return"connecting";case to.open:return"open";case to.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new Yte(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:i,join_ref:s}=t;this.log("push",`${e} ${n} (${s}, ${i})`,r)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}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(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:r,payload:i,ref:s,join_ref:a}=e;if(s&&s===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.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",`${i.status||""} ${n} ${r} ${s&&"("+s+")"||""}`.trim(),i);for(let o=0;o<this.channels.length;o++){const l=this.channels[o];l.isMember(n,r,i,a)&&l.trigger(r,i,s,a)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class Xy{constructor(e,n){const r=ene(n);this.presence=new Qte(e.getChannel(),r),this.presence.onJoin((i,s,a)=>{const o=Xy.onJoinPayload(i,s,a);e.getChannel().trigger("presence",o)}),this.presence.onLeave((i,s,a)=>{const o=Xy.onLeavePayload(i,s,a);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Xy.transformState(this.presence.state)}static transformState(e){return e=Zte(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return n[r]=Nx(i),n},{})}static onJoinPayload(e,n,r){const i=zD(n),s=Nx(r);return{event:"join",key:e,currentPresences:i,newPresences:s}}static onLeavePayload(e,n,r){const i=zD(n),s=Nx(r);return{event:"leave",key:e,currentPresences:i,leftPresences:s}}}function Nx(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function Zte(t){return JSON.parse(JSON.stringify(t))}function ene(t){return(t==null?void 0:t.events)&&{events:t.events}}function zD(t){return t!=null&&t.metas?Nx(t):[]}var VD;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(VD||(VD={}));class tne{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new Xy(this.channel.channelAdapter,n)}}class nne{constructor(e,n,r){const i=rne(r);this.channel=e.getSocket().channel(n,i),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,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}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,n,r){let i;try{i=this.channel.push(e,n,r)}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>Lte){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return i}updateJoinPayload(e){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===Zl.joined}isJoined(){return this.state===Zl.joined}isJoining(){return this.state===Zl.joining}isClosed(){return this.state===Zl.closed}isLeaving(){return this.state===Zl.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function rne(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var HD;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
278E="DELETE"})(HD||(HD={}));var Zf;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Zf||(Zf={}));var Po;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Po||(Po={}));class Qy{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,n={config:{}},r){var i,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new nne(this.socket.socketAdapter,e,this.params),this.presence=new tne(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=C3(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,n=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:a,presence:o,private:l}}=this.params,c=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&i!==void 0?i:[],h=!!this.bindings[Zf.PRESENCE]&&this.bindings[Zf.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},f={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:h}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(Po.CHANNEL_ERROR,p)}),this._onClose(()=>e==null?void 0:e(Po.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(Po.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=Zl.errored,e==null||e(Po.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Po.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;const i=this.bindings.postgres_changes,s=(r=i==null?void 0:i.length)!==null&&r!==void 0?r:0,a=[];for(let o=0;o<s;o++){const l=i[o],{filter:{event:c,schema:h,table:d,filter:f}}=l,p=e&&e[o];if(p&&p.event===c&&Qy.isFilterValueEqual(p.schema,h)&&Qy.isFilterValueEqual(p.table,d)&&Qy.isFilterValueEqual(p.filter,f))a.push(Object.assign(Object.assign({},l),{id:p.id}));else{this.unsubscribe(),this.state=Zl.errored,n==null||n(Po.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=a,this.state!=Zl.errored&&n&&n(Po.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===Zf.PRESENCE||e===Zf.POSTGRES_CHANGES;if(i&&s)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,n,r)}async httpSend(e,n,r={}){var i;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;
278try{const c=await o.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(e,n={}){var r,i;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,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:s,payload:a,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,l;const c=this.channelAdapter.push(e.type,e,n.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)&&s("ok"),c.receive("ok",()=>s("ok")),c.receive("error",()=>s("error")),c.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_on(e,n,r){const i=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),a={type:i,filter:n,callback:r,ref:s};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var i,s,a,o,l,c,h;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,r))return!1;const f=(i=this.bindings[d])===null||i===void 0?void 0:i.find(p=>p.ref===e.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in f){const p=f.id,m=(s=f.filter)===null||s===void 0?void 0:s.event;return p&&((a=n.ids)===null||a===void 0?void 0:a.includes(p))&&(m==="*"||(m==null?void 0:m.toLocaleLowerCase())===((o=n.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const p=(c=(l=f==null?void 0:f.filter)===null||l===void 0?void 0:l.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return p==="*"||p===((h=n==null?void 0:n.event)===null||h===void 0?void 0:h.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,n){const{close:r,error:i,leave:s,join:a}=E3;return n&&[r,i,s,a].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n=="object"&&"ids"in n){const i=n.data,{schema:s,table:a,commit_timestamp:o,type:l,errors:c}=i;return Object.assign(Object.assign({},{schema:s,table:a,commit_timestamp:o,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(i))}return n})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in e.bindings)for(const r of e.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=UD(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=UD(e.columns,e.old_record)),n}}class ine{constructor(e,n){this.socket=new Jte(e,n)}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,n,r,i=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),i),this.socket.disconnect(()=>{e(),s("ok")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}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()==PC.connecting}isDisconnecting(){return this.socket.connectionState()==PC.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const sne={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},ane=[1e3,2e3,5e3,1e4],one=1e4,lne=`
279  addEventListener("message", (e) => {
280    if (e.data.event === "start") {
281      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
282    }
283  });`;class cne{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,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
283,this.ref=0,this.serializer=new jte,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const i=this._initializeOptions(n);this.socketAdapter=new ine(e,i),this.httpEndpoint=C3(e),this.fetch=this._resolveFetch(n==null?void 0:n.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 n=e.message;throw n.includes("Node.js")?new Error(`${n}
284
285To use Realtime in Node.js, you need to provide a WebSocket implementation:
286
287Option 1: Use Node.js 22+ which has native WebSocket support
288Option 2: Install and provide the "ws" package:
289
290  npm install ws
291
292  import ws from "ws"
293  const client = new RealtimeClient(url, {
294    ...options,
295    transport: ws
296  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return n==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=this.channels.map(async r=>{const i=await r.unsubscribe();return r.teardown(),i}),n=await Promise.all(e);return this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}connectionState(){return this.socketAdapter.connectionState()||PC.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new Qy(`realtime:${e}`,n,this);return this.channels.push(s),s}}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(n=>n.topic!==e.topic)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(i=>{const s={access_token:n,version:Ite};n&&i.updateJoinPayload(s),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(E3.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),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(n,r)=>{n=="sent"&&this._setAuthSafely(),e&&e(n,r)}}_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=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.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 n;if(e)n=e;else{const r=new Blob([lne],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,i,s,a,o,l,c,h;this.worker=(n=e==null?void 0:e.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const d={};d.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:Dte,d.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:sne.HEARTBEAT_INTERVAL,d.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:Nte.getWebSocketConstructor(),d.params=e==null?void 0:e.params,d.logger=e==null?void 0:e.logger,d.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),d.reconnectAfterMs=(o=e==null?void 0:e.reconnectAfterMs)!==null&&o!==void 0?o:y=>ane[y-1]||one;let f,p;const m=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:Mte;switch(m){case Ote:f=(y,x)=>x(JSON.stringify(y)),p=(y,x)=>x(JSON.parse(y));break;case A3:f=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${d.vsn}`)}if(d.vsn=m,d.encode=(c=e==null?void 0:e.encode)!==null&&c!==void 0?c:f,d.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:p,d.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,d.params=Object.assign(Object.assign({},d.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,d.autoSendHeartbeat=!this.worker}return d}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
296var Ov=class extends Error{constructor(t,e){var n;super(t),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)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function une(t,e,n){const r=new URL(e,t);if(n)for(const[i,s]of Object.entries(n))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function hne(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function dne(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=une(t.baseUrl,r,i),l=await hne(t.auth),c=await e(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),h=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),f=d&&h?JSON.parse(h):h;if(!c.ok){const p=d?f:void 0,m=p==null?void 0:p.error;throw new Ov((m==null?void 0:m.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:p})}return{status:c.status,headers:c.headers,data:f}}}}function Lb(t){return t.join("�")}var fne=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Lb(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Lb(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Lb(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Lb(t.namespace)}`}),!0}catch(e){if(e instanceof Ov&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof Ov&&n.status===409)return;throw n}}};function df(t){return t.join("�")}var pne=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${df(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof Ov&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof Ov&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},mne=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=dne({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new fne(this.client,e),this.tableOps=new pne(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}
296async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function Mv(t){"@babel/helpers - typeof";return Mv=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},Mv(t)}function gne(t,e){if(Mv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Mv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yne(t){var e=gne(t,"string");return Mv(e)=="symbol"?e:e+""}function vne(t,e,n){return(e=yne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ge(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?WD(Object(n),!0).forEach(function(r){vne(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):WD(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Bk=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function $k(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var OC=class extends Bk{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return ge({},super.toJSON())}},P3=class extends Bk{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function ER(t,e,n){const r=ge({},t),i=e.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===i&&delete r[s];return r[i]=n,r}function wne(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}const bne=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),xne=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},MC=t=>{if(Array.isArray(t))return t.map(n=>MC(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=MC(r)}),e},Sne=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),GD=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},kne=async(t,e,n,r)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const i=t;let s=parseInt(i.status,10);Number.isFinite(s)||(s=500),i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";e(new OC(GD(a),s,o,r))}).catch(()=>{const a=s+"";e(new OC(i.statusText||`HTTP ${s} error`,s,a,r))})}else e(new P3(GD(t),t,r))},Ane=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!r)return ge(ge({},i),n);if(xne(r)){var s;const a=(e==null?void 0:e.headers)||{};let o;for(const[l,c]of Object.entries(a))l.toLowerCase()==="content-type"&&(o=c);i.headers=ER(a,"Content-Type",(s=o)!==null&&s!==void 0?s:"application/json"),i.body=JSON.stringify(r)}else i.body=r;return e!=null&&e.duplex&&(i.duplex=e.duplex),ge(ge({},i),n)};async function qg(t,e,n,r,i,s,a){return new Promise((o,l)=>{t(n,Ane(e,r,i,s)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;if(a==="vectors"){const h=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};
296if(!h||!h.includes("application/json"))return{}}return c.json()}).then(c=>o(c)).catch(c=>kne(c,l,r,a))})}function N3(t="storage"){return{get:async(e,n,r,i)=>qg(e,"GET",n,r,i,void 0,t),post:async(e,n,r,i,s)=>qg(e,"POST",n,i,s,r,t),put:async(e,n,r,i,s)=>qg(e,"PUT",n,i,s,r,t),head:async(e,n,r,i)=>qg(e,"HEAD",n,ge(ge({},r),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,n,r,i,s)=>qg(e,"DELETE",n,i,s,r,t)}}const Ene=N3("storage"),{get:Dv,post:Fs,put:DC,head:_ne,remove:_R}=Ene,$i=N3("vectors");var Rg=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=wne(e),this.fetch=bne(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=ER(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if($k(n))return{data:null,error:n};throw n}}},Cne=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if($k(e))return{data:null,error:e};throw e}}};let R3;R3=Symbol.toStringTag;var Tne=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[R3]="BlobDownloadBuilder",this.promise=null}asStream(){return new Cne(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if($k(e))return{data:null,error:e};throw e}}};const Pne={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},qD={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Nne=class extends Rg{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var i=this;return i.handleOperation(async()=>{let s;const a=ge(ge({},qD),r);let o=ge(ge({},i.headers),t==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;if(typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers)for(const[f,p]of Object.entries(r.headers))o=ER(o,f,p);const c=i._removeEmptyFolders(e),h=i._getFinalPath(c),d=await(t=="PUT"?DC:Fs)(i.fetch,`${i.url}/object/${h}`,s,ge({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:c,id:d.Id,fullPath:d.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var i=this;const s=i._removeEmptyFolders(t),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),i.handleOperation(async()=>{let l;const c=ge(ge({},qD),r),h=ge(ge({},i.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",c.cacheControl)):(l=n,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType),{path:s,fullPath:(await DC(i.fetch,o.toString(),l,{headers:h})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const i=ge({},n.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const s=await Fs(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(n.url+s.url),o=a.searchParams.get("token");if(!o)throw new Bk("No token returned by API");return{signedUrl:a.toString(),path:t,token:o}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await Fs(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await Fs(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(t);const s=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let a=await Fs(r.fetch,`${r.url}/object/sign/${i}
296`,ge({expiresIn:e},s?{transform:n.transform}:{}),{headers:r.headers});const o=new URLSearchParams;n!=null&&n.download&&o.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&o.set("cacheNonce",String(n.cacheNonce));const l=o.toString();return{signedUrl:encodeURI(`${r.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const i=await Fs(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=new URLSearchParams;n!=null&&n.download&&s.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&s.set("cacheNonce",String(n.cacheNonce));const a=s.toString();return i.map(o=>ge(ge({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${a?`&${a}`:""}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(i,e.transform),(e==null?void 0:e.cacheNonce)!=null&&i.set("cacheNonce",String(e.cacheNonce));const s=i.toString(),a=this._getFinalPath(t),o=()=>Dv(this.fetch,`${this.url}/${r}/${a}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new Tne(o,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>MC(await Dv(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await _ne(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;if($k(i)){var r;const s=i instanceof OC?i.status:i instanceof P3?(r=i.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:i}}throw i}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const i=r.toString(),s=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}/${s}/public/${n}`)+(i?`?${i}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await _R(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const i=ge(ge(ge({},Pne),e),{},{prefix:t||""});return await Fs(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=ge({},t);return await Fs(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Rne="2.104.1",Y0={"X-Client-Info":`storage-js/${Rne}`};var Ine=class extends Rg{constructor(t,e={},n,r){const i=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const s=i.href.replace(/\/$/,""),a=ge(ge({},Y0),e);super(s,a,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await Dv(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Dv(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await Fs(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await DC(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Fs(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await _R(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},One=class extends Rg{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=ge(ge({},Y0),e);super(r,i,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Fs(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),i=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await Dv(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await _R(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!Sne(t))throw new Bk("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 n=new mne({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
296),r=this.shouldThrowOnError;return new Proxy(n,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},Mne=class extends Rg{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=ge(ge({},Y0),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await $i.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await $i.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},Dne=class extends Rg{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=ge(ge({},Y0),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Lne=class extends Rg{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=ge(ge({},Y0),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await $i.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},jne=class extends Lne{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Fne(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},Fne=class extends Mne{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new Bne(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},Bne=class extends Dne{constructor(t,e,n,r,i){super(t,e,i),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,ge(ge({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},$ne=class extends Ine{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new Nne(this.url,this.headers,t,this.fetch)}get vectors(){return new jne(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new One(this.url+"/iceberg",this.headers,this.fetch)}};function Uk(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}const I3="2.104.1",_f=30*1e3,LC=3,dE=LC*_f,Une="http://localhost:9999",zne="supabase.auth.token",Vne={"X-Client-Info":`gotrue-js/${I3}`},jC="X-Supabase-Api-Version",O3={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Hne=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Wne=10*60*1e3;
296class Lv extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function ae(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class Gne extends Lv{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function qne(t){return ae(t)&&t.name==="AuthApiError"}class Ku extends Lv{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Ml extends Lv{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class hi extends Ml{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function jb(t){return ae(t)&&t.name==="AuthSessionMissingError"}class ff extends Ml{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Fb extends Ml{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Bb extends Ml{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Kne(t){return ae(t)&&t.name==="AuthImplicitGrantRedirectError"}class KD extends Ml{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Yne extends Ml{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 FC extends Ml{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function fE(t){return ae(t)&&t.name==="AuthRetryableFetchError"}class YD extends Ml{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class BC extends Ml{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const l1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),XD=` 	
297\r=`.split(""),Xne=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<XD.length;e+=1)t[XD[e].charCodeAt(0)]=-2;for(let e=0;e<l1.length;e+=1)t[l1[e].charCodeAt(0)]=e;return t})();function QD(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(l1[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(l1[r]),e.queuedBits-=6}}function M3(t,e,n){const r=Xne[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function JD(t){const e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{Zne(a,r,n)};for(let a=0;a<t.length;a+=1)M3(t.charCodeAt(a),i,s);return e.join("")}function Qne(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function Jne(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}Qne(r,e)}}function Zne(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function pp(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)M3(t.charCodeAt(i),n,r);return new Uint8Array(e)}function ere(t){const e=[];return Jne(t,n=>e.push(n)),new Uint8Array(e)}function ah(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};return t.forEach(i=>
297QD(i,n,r)),QD(null,n,r),e.join("")}function tre(t){return Math.round(Date.now()/1e3)+t}function nre(){return Symbol("auth-callback")}const Vn=()=>typeof window<"u"&&typeof document<"u",ju={tested:!1,writable:!1},D3=()=>{if(!Vn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ju.tested)return ju.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ju.tested=!0,ju.writable=!0}catch{ju.tested=!0,ju.writable=!1}return ju.writable};function rre(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,s)=>{e[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const L3=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),ire=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Cf=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},Fu=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},zn=async(t,e)=>{await t.removeItem(e)};class zk{constructor(){this.promise=new zk.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}zk.promiseConstructor=Promise;function $b(t){const e=t.split(".");if(e.length!==3)throw new BC("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!Hne.test(e[r]))throw new BC("JWT not in base64url format");return{header:JSON.parse(JD(e[0])),payload:JSON.parse(JD(e[1])),signature:pp(e[2]),raw:{header:e[0],payload:e[1]}}}async function sre(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function are(t,e){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await t(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function ore(t){return("0"+t.toString(16)).substr(-2)}function lre(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,ore).join("")}async function cre(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function ure(t){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."),t;const n=await cre(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function pf(t,e,n=!1){const r=lre();let i=r;n&&(i+="/recovery"),await Cf(t,`${e}-code-verifier`,i);const s=await ure(r);return[s,r===s?"plain":"s256"]}const hre=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dre(t){const e=t.headers.get(jC);if(!e||!e.match(hre))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function fre(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function pre(t){switch(t){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 mre=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function mf(t){if(!mre.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function pE(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function gre(t,e){return new Proxy(t,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;
297if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!e.value&&typeof r=="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(n,r,i)}})}function ZD(t){return JSON.parse(JSON.stringify(t))}const Vu=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),yre=[502,503,504,520,521,522,523,524,530];async function e2(t){var e;if(!ire(t))throw new FC(Vu(t),0);if(yre.includes(t.status))throw new FC(Vu(t),t.status);let n;try{n=await t.json()}catch(s){throw new Ku(Vu(s),s)}let r;const i=dre(t);if(i&&i.getTime()>=O3["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new YD(Vu(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new hi}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new YD(Vu(n),t.status,n.weak_password.reasons);throw new Gne(Vu(n),t.status||500,r)}const vre=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function de(t,e,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[jC]||(s[jC]=O3["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await wre(t,e,n+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function wre(t,e,n,r,i,s){const a=vre(e,r,i,s);let o;try{o=await t(n,Object.assign({},a))}catch(l){throw console.error(l),new FC(Vu(l),0)}if(o.ok||await e2(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await e2(l)}}function Is(t){var e;let n=null;Sre(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=tre(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function t2(t){const e=Is(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function ec(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function bre(t){return{data:t,error:null}}function xre(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=t,a=Uk(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function n2(t){return t}function Sre(t){return t.access_token&&t.refresh_token&&t.expires_in}const mE=["global","local","others"];class kre{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=L3(r),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)}}
vendor: 4,781 bytes, line 297
297async signOut(e,n=mE[0]){if(mE.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${mE.join(", ")}`);try{return await de(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ae(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await de(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:ec})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Uk(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await de(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:xre,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ae(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await de(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:ec})}catch(n){if(ae(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,s,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},h=await de(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:n2});if(h.error)throw h.error;const d=await h.json(),f=(a=h.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(l=(o=h.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(m=>{const y=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(m.split(";")[1].split("=")[1]);c[`${x}Page`]=y}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ae(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){mf(e);try{return await de(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:ec})}catch(n){if(ae(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){mf(e);try{return await de(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:ec})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){mf(e);try{return await de(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:ec})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){mf(e.userId);try{const{data:n,error:r}=await de(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _deleteFactor(e){mf(e.userId),mf(e.id);try{return{data:await de(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,i,s,a,o,l;try{const c={nextPage:null,lastPage:0,total:0},h=await de(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:n2});if(h.error)throw h.error;const d=await h.json(),f=(a=h.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(l=(o=h.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(m=>{const y=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(m.split(";")[1].split("=")[1]);c[`${x}Page`]=y}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ae(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await de(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await de(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await de(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ae(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await de(this.fetch,"DELET
297E",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await de(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await de(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var i;return{data:{providers:(i=r==null?void 0:r.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(n){if(ae(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await de(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await de(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await de(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ae(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await de(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ae(n))return{data:null,error:n};throw n}}}function r2(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const wa={debug:!!(globalThis&&D3()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class j3 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class i2 extends j3{}async function Are(t,e,n){wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{r.abort(),wa.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){clearTimeout(i),wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new i2(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(wa.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(i),await n()}})}catch(s){if(e>0&&clearTimeout(i),(s==null?void 0:s.name)==="AbortError"&&e>0){if(r.signal.aborted)return wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" 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(t,{mode:"exclusive",steal:!0},async a=>{if(a){wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,a.name);try{return await n()}finally{wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,a.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw wa.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new i2(`Lock "${t}" was released because another request stole it`)}throw s}}function Ere(){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 F3(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
297" is invalid.`);return t.toLowerCase()}function _re(t){return parseInt(t,16)}function Cre(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function Tre(t){var e;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:l,resources:c,scheme:h,uri:d,version:f}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)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(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
298`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=F3(t.address),m=h?`${h}://${r}`:r,y=t.statement?`${t.statement}
299`:"",x=`${m} wants you to sign in with your Ethereum account:
300${p}
301
302${y}`;let v=`URI: ${d}
303Version: ${f}
304Chain ID: ${n}${a?`
305Nonce: ${a}`:""}
306Issued At: ${s.toISOString()}`;if(i&&(v+=`
307Expiration Time: ${i.toISOString()}`),o&&(v+=`
308Not Before: ${o.toISOString()}`),l&&(v+=`
309Request ID: ${l}`),c){let w=`
310Resources:`;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+=`
311- ${b}`}v+=w}return`${x}
312${v}`}class mn extends Error{constructor({message:e,code:n,cause:r,name:i}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class c1 extends mn{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Pre({error:t,options:e}){var n,r,i;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new mn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new mn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new mn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new mn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new mn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new mn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new mn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new mn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(B3(a)){if(s.rp.id!==a)return new mn({message:`The RP ID "${s.rp.id}
312" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new mn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new mn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new mn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new mn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Nre({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new mn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new mn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(B3(r)){if(n.rpId!==r)return new mn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new mn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new mn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new mn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Rre{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}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 Ire=new Rre;function Ore(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,i=Uk(t,["challenge","user","excludeCredentials"]),s=pp(e).buffer,a=Object.assign(Object.assign({},n),{id:pp(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const c=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:pp(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function Mre(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=Uk(t,["challenge","allowCredentials"]),i=pp(e).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:pp(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function Dre(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:ah(new Uint8Array(t.response.attestationObject)),clientDataJSON:ah(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Lre(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:ah(new Uint8Array(i.authenticatorData)),clientDataJSON:ah(new Uint8Array(i.clientDataJSON)),signature:ah(new Uint8Array(i.signature)),userHandle:i.userHandle?ah(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function B3(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function s2(){var t,e;return!!(Vn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function jre(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new c1("Browser returned unexpected credential type",e)}:{data:null,error:new c1("Empty credential response",e)}}catch(e){return{data:null,error:Pre({error:e,options:t})}}}async function Fre(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new c1("Browser returned unexpected credential type",e)}:{data:null,error:new c1("Empty credential response",e)}}catch(e){return{data:null,error:Nre({error:e,options:t})}}}const Bre={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},$re={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function u1(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of t)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(e(a)){const o=r[s];e(o)?r[s]=u1(o,a):r[s]=u1(a)}else r[s]=a}return r}function Ure(t,e){return u1(Bre,t,e||{})}function zre(t,e){return u1($re,t,e||{})}class Vre{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:n,friendlyName:r,signal:i},s){var a;try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!o)return{data:null,error:l};const c=i??Ire.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:h}=o.webauthn.credential_options.publicKey;if(!h.name){const d=r;if(d)h.name=`${h.id}:${d}`;else{const p=(await this.client.getUser()).data.user,m=((a=p==null?void 0:p.user_metadata)===null||a===void 0?void 0:a.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";h.name=`${h.id}:${m}`}}h.displayName||(h.displayName=h.name)}switch(o.webauthn.type){case"create":{const h=Ure(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:f}=await jre({publicKey:h,signal:c});return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const h=zre(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:f}=await Fre(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:h,signal:c}));return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(o){return ae(o)?{data:null,error:o}:{data:null,error:new Ku("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new Lv("rpId is required for WebAuthn authentication")};try{if(!s2())return{data:null,error:new Ku("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return ae(a)?{data:null,error:a}:{data:null,error:new Ku("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new Lv("rpId is required for WebAuthn registration")};try{if(!s2())return{data:null,error:new Ku("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(h=>{var d;return(d=h.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:o};const{data:l,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(a){return ae(a)?{data:null,error:a}:{data:null,error:new Ku("Unexpected error in register",a)}}}}Ere();const Hre={url:Une,storageKey:zne,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Vne,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function a2(t,e,n){return await n()}const gf={};class jv{get jwks(){var e,n;return(n=(e=gf[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){gf[this.storageKey]=Object.assign(Object.assign({},gf[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=gf[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){gf[this.storageKey]=Object.assign(Object.assign({},gf[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,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 s=Object.assign(Object.assign({},Hre),e);if(this.storageKey=s.storageKey,this.instanceID=(n=jv.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,jv.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&Vn()){const a=`${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(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new kre({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=L3(s.fetch),this.lock=s.lock||a2,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&Vn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=Are:this.lock=a2,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 Vre(this)}
312,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.persistSession?(s.storage?this.storage=s.storage:D3()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=r2(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=r2(this.memoryStorage)),Vn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}s.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${I3}) ${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 n={},r="none";if(Vn()&&(n=rre(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Vn()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),Kne(s)){const l=(e=s.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:s}}return{error:s}}const{session:a,redirectType:o}=i;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(n){return ae(n)?this._returnResult({error:n}):this._returnResult({error:new Ku("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const s=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:Is}),{data:a,error:o}=s;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(s){if(ae(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,i;try{let s;if("email"in e){const{email:h,password:d,options:f}=e;let p=null,m=null;this.flowType==="pkce"&&([p,m]=await pf(this.storage,this.storageKey)),s=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:h,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:m},xform:Is})}else if("phone"in e){const{phone:h,password:d,options:f}=e;s=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Is})}else throw new Fb("You must provide either an email or phone number and a password");const{data:a,error:o}=s;
312if(o||!a)return await zn(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(s){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:a,options:o}=e;n=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:t2})}else if("phone"in e){const{phone:s,password:a,options:o}=e;n=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:t2})}else throw new Fb("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new ff;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(ae(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,i,s,a,o,l,c,h,d,f;let p,m;if("message"in e)p=e.message,m=e.signature;else{const{chain:y,wallet:x,statement:v,options:w}=e;let b;if(Vn())if(typeof x=="object")b=x;else{const O=window;if("ethereum"in O&&typeof O.ethereum=="object"&&"request"in O.ethereum&&typeof O.ethereum.request=="function")b=O.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 x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=x}const k=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),_=await b.request({method:"eth_requestAccounts"}).then(O=>O).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=F3(_[0]);let P=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!P){const O=await b.request({method:"eth_chainId"});P=_re(O)}const R={domain:k.host,address:C,statement:v,uri:k.href,version:"1",chainId:P,nonce:(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.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:(h=w==null?void 0:w.signInWithEthereum)===null||h===void 0?void 0:h.resources};
312p=Tre(R),m=await b.request({method:"personal_sign",params:[Cre(p),C]})}try{const{data:y,error:x}=await de(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:m},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Is});if(x)throw x;if(!y||!y.session||!y.user){const v=new ff;return this._returnResult({data:{user:null,session:null},error:v})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:x})}catch(y){if(ae(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(e){var n,r,i,s,a,o,l,c,h,d,f,p;let m,y;if("message"in e)m=e.message,y=e.signature;else{const{chain:x,wallet:v,statement:w,options:b}=e;let k;if(Vn())if(typeof v=="object")k=v;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))k=C.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.");k=v}const _=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href);
312if("signIn"in k&&k.signIn){const C=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),w?{statement:w}:null));let P;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")P=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)P=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)m=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),y=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${_.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(i=(r=b==null?void 0:b.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=b==null?void 0:b.signInWithSolana)===null||s===void 0)&&s.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}`]:[],...!((d=(h=b==null?void 0:b.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||d===void 0)&&d.length?["Resources",...b.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(`
313`);const C=await k.signMessage(new TextEncoder().encode(m),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=C}}try{const{data:x,error:v}=await de(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:ah(y)},!((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:Is});if(v)throw v;if(!x||!x.session||!x.user){const w=new ff;return this._returnResult({data:{user:null,session:null},error:w})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:v})}catch(x){if(ae(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(e){const n=await Fu(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new Yne;const{data:s,error:a}=await de(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Is});if(await zn(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new ff;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers(i==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=e,o=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Is}),{data:l,error:c}=o;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const h=new ff;return this._returnResult({data:{user:null,session:null},error:h})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(n){if(ae(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,i,s,a;try{if("email"in e){const{email:o,options:l}=e;let c=null,h=null;this.flowType==="pkce"&&([c,h]=await pf(this.storage,this.storageKey));const{error:d}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:o,options:l}=e,{data:c,error:h}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!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:h})}throw new Fb("You must provide either an email or phone number.")}catch(o){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var n,r;try{let i,s;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await de(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Is});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(i){if(ae(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var n,r,i,s,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await pf(this.storage,this.storageKey));const c=await de(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:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
313:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:bre});return!((s=c.data)===null||s===void 0)&&s.url&&Vn()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(o){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(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:n},error:r}=e;if(r)throw r;if(!n)throw new hi;const{error:i}=await de(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(ae(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:s}=e,{error:a}=await de(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:i,options:s}=e,{data:a,error:o}=await de(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new Fb("You must provide either an email or phone number and a type")}catch(n){if(ae(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}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 n=await this.__loadSession();return await e(n)}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 n=await Fu(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<dE:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const a=await Fu(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=pE()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=gre(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ec}):await this._useSession(async n=>{var r,i,s;const{data:a,error:o}=n;
313if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new hi}:await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:ec})})}catch(n){if(ae(n))return jb(n)&&(await this._removeSession(),await zn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new hi;const a=i.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await pf(this.storage,this.storageKey));const{data:c,error:h}=await de(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:ec});if(h)throw h;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(r))return this._returnResult({data:{user:null},error:r});throw r}}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 hi;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=$b(e.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){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};s=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});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(ae(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}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 n=>{var r;if(!e){const{data:a,error:o}=n;if(o)throw o;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new hi;const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ae(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){var r;try{if(!Vn())throw new Bb("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Bb(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new KD("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Bb("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new KD("No code detected.");const{data:b,error:k}=await this._exchangeCodeForSession(e.code);if(k)throw k;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:b.session,redirectType:(r=b.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:i,provider_refresh_token:s,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:h}=e;if(!a||!l||!o||!h)throw new Bb("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let p=d+f;c&&(p=parseInt(c));const m=p-d;
313m*1e3<=_f&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const y=p-f;d-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,d):d-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,d);const{data:x,error:v}=await this._getUser(a);if(v)throw v;const w={provider_token:i,provider_refresh_token:s,access_token:a,expires_in:f,expires_at:p,refresh_token:o,token_type:h,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:e.type},error:null})}catch(i){if(ae(i))return this._returnResult({data:{session:null,redirectType:null},error:i});throw i}}_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 n=await Fu(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}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 n=>{var r;const{data:i,error:s}=n;if(s&&!jb(s))return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(qne(o)&&(o.status===404||o.status===401||o.status===403)||jb(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await zn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=nre(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),jb(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await pf(this.storage,this.storageKey,!0));try{return await de(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,l,c,h;const{data:d,error:f}=s;if(f)throw f;const p=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 de(this.fetch,"GET",p,{headers:this.headers,jwt:(h=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&h!==void 0?h:void 0})});if(i)throw i;return Vn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(ae(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:s}}=n;
313if(i)throw i;const{options:a,provider:o,token:l,access_token:c,nonce:h}=e,d=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:l,access_token:c,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Is}),{data:f,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new ff}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(i){if(await zn(this.storage,`${this.storageKey}-code-verifier`),ae(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await de(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await are(async i=>(i>0&&await sre(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await de(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Is})),(i,s)=>{const a=200*Math.pow(2,i);return s&&fE(s)&&Date.now()+a-r<_f})}catch(r){if(this._debug(n,"error",r),ae(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Vn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await Fu(this.storage,this.storageKey);if(i&&this.userStorage){let a=await Fu(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await Cf(this.userStorage,this.storageKey+"-user",a)),i.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:pE()}else if(i&&!i.user&&!i.user){const a=await Fu(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await zn(this.storage,this.storageKey+"-user"),await Cf(this.storage,this.storageKey,i)):i.user=pE()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<dE;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${dE}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),fE(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new hi;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new zk;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new hi;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),ae(s)){const a={data:null,error:s};return fE(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,n)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await zn(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Cf(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=ZD(i);await Cf(this.storage,this.storageKey,s)}else{const i=ZD(n);await Cf(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await zn(this.storage,this.storageKey),await zn(this.storage,this.storageKey+"-code-verifier"),await zn(this.storage,this.storageKey+"-user"),this.userStorage&&await zn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Vn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
313catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),_f);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}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 n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/_f);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${_f}ms, refresh threshold is ${LC} ticks`),i<=LC&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof j3)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Vn()||!(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 n=`#_onVisibilityChanged(${e})`;this._debug(n,"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(n,"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,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await pf(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?this._returnResult({data:null,error:s}):await de(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;
313if(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 de(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Dre(e.webauthn.credential_response):Lre(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await de(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.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(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=await de(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.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:Ore(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:Mre(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,i,s;if(e)try{const{payload:p}=$b(e);let m=null;p.aal&&(m=p.aal);let y=m;const{data:{user:x},error:v}=await this.getUser(e);if(v)return this._returnResult({data:null,error:v});((r=(n=x==null?void 0:x.factors)===null||n===void 0?void 0:n.filter(k=>k.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(y="aal2");const b=p.amr||[];return{data:{currentLevel:m,nextLevel:y,currentAuthenticationMethods:b},error:null}}catch(p){if(ae(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:a},error:o}
313=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}=$b(a.access_token);let c=null;l.aal&&(c=l.aal);let h=c;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(p=>p.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(h="aal2");const f=l.amr||[];return{data:{currentLevel:c,nextLevel:h,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await de(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new hi})})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new hi});const a=await de(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&Vn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(ae(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new hi});const a=await de(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&Vn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(ae(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await de(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new hi})})}catch(e){if(ae(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await de(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new hi})})}catch(n){if(ae(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+Wne>i)return r;const{data:s,error:a}=await de(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:p,error:m}
313=await this.getSession();if(m||!p.session)return this._returnResult({data:null,error:m});r=p.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:l}}=$b(r);n!=null&&n.allowExpired||fre(s.exp);const c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:s,header:i,signature:a},error:null}}const h=pre(i.alg),d=await crypto.subtle.importKey("jwk",c,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,a,ere(`${o}.${l}`)))throw new BC("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(ae(r))return this._returnResult({data:null,error:r});throw r}}}jv.nextInstanceID={};const Wre=jv,Gre="2.104.1";let ly="";typeof Deno<"u"?ly="deno":typeof document<"u"?ly="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ly="react-native":ly="node";const qre={"X-Client-Info":`supabase-js-${ly}/${Gre}`},Kre={headers:qre},Yre={schema:"public"},Xre={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Qre={};function Fv(t){"@babel/helpers - typeof";return Fv=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},Fv(t)}function Jre(t,e){if(Fv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Fv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zre(t){var e=Jre(t,"string");return Fv(e)=="symbol"?e:e+""}function eie(t,e,n){return(e=Zre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function en(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?o2(Object(n),!0).forEach(function(r){eie(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o2(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const tie=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),nie=()=>Headers,rie=(t,e,n)=>{const r=tie(n),i=nie();return async(s,a)=>{var o;const l=(o=await e())!==null&&o!==void 0?o:t;let c=new i(a==null?void 0:a.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(s,en(en({},a),{},{headers:c}))}};function iie(t){return t.endsWith("/")?t:t+"/"}function sie(t,e){var n,r;const{db:i,auth:s,realtime:a,global:o}=t,{db:l,auth:c,realtime:h,global:d}=e,f={db:en(en({},l),i),auth:en(en({},c),s),realtime:en(en({},h),a),storage:{},global:en(en(en({},d),o),{},{headers:en(en({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function aie(t){const e=t==null?void 0:t.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(iie(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var oie=class extends Wre{constructor(t){super(t)}},lie=class{constructor(t,e,n){var r,i;this.supabaseUrl=t,this.supabaseKey=e;const s=aie(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const a=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:Yre,realtime:Qre,auth:en(en({},Xre),{},{storageKey:a}),global:Kre},l=sie(n??{},o);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(h,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} 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=rie(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(en({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new Pte(new 
313URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new $ne(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new wte(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:a,lock:o,debug:l,throwOnError:c},h,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new oie({url:this.authUrl.href,headers:en(en({},f),h),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:l,throwOnError:c,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new cne(this.realtimeUrl.href,en(en({},t),{},{params:en(en({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const cie=(t,e,n)=>new lie(t,e,n);function uie(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}uie()&&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 hie(){var x,v;if(typeof window>"u")return;const t=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(w=>t===w||t.endsWith("."+w)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",i=n?((x=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:x[1])??((v=t.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:v[1]):void 0,s=window.parent&&window.parent!==window;if(!i||!s)return localStorage;const a=t.endsWith(".lovableproject-dev.com")||t.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"],h="lovable-preview-auth:result",d=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(w,b,k)=>new Promise(_=>{const C=f();let P=!1,R;const O=j=>{P||(P=!0,clearTimeout(R),window.removeEventListener("message",M),_(j))},M=j=>{if(c.indexOf(j.origin)<0)return;const U=j.data;U&&U.type===h&&U.requestId===C&&O(U)};window.addEventListener("message",M);const D={type:w,requestId:C,projectId:i,key:b};k!==void 0&&(D.value=k);for(const j of c)window.parent.postMessage(D,j);R=setTimeout(()=>O(null),d)});let m=!0;const y=250;return{getItem:async w=>{let b=await p("lovable-preview-auth:get",w);return!b&&m&&(await new Promise(k=>setTimeout(k,y)),b=await p("lovable-preview-auth:get",w)),m=!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),p("lovable-preview-auth:set",w,b).then(()=>{})),removeItem:w=>(localStorage.removeItem(w),p("lovable-preview-auth:remove",w).then(()=>{}))}}const die="https://zxrwbxfnrabiojjksbct.supabase.co",fie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp4cndieGZucmFiaW9qamtzYmN0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc4Nzk2NzIsImV4cCI6MjA4MzQ1NTY3Mn0.NUf5gRWCA5fcbrMAS8vadKp6KiN7w_FyKsjkb-O03Ok",Zr=cie(die,fie,{auth:{storage:hie(),persistSession:!0,autoRefreshToken:!0}});function pie(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mie=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gie=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yie={};function l2(t,e){return(yie.jsx?gie:mie).test(t)}const vie=/[ \t\n\f\r]/g;function wie(t){return typeof t=="object"?t.type==="text"?c2(t.value):!1:c2(t)}
vendor: 5,390 bytes, line 313
313function c2(t){return t.replace(vie,"")===""}class X0{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}X0.prototype.normal={};X0.prototype.property={};X0.prototype.space=void 0;function $3(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new X0(n,r,e)}function $C(t){return t.toLowerCase()}class oi{constructor(e,n){this.attribute=n,this.property=e}}oi.prototype.attribute="";oi.prototype.booleanish=!1;oi.prototype.boolean=!1;oi.prototype.commaOrSpaceSeparated=!1;oi.prototype.commaSeparated=!1;oi.prototype.defined=!1;oi.prototype.mustUseProperty=!1;oi.prototype.number=!1;oi.prototype.overloadedBoolean=!1;oi.prototype.property="";oi.prototype.spaceSeparated=!1;oi.prototype.space=void 0;let bie=0;const Ne=sf(),pn=sf(),UC=sf(),X=sf(),vt=sf(),mp=sf(),di=sf();function sf(){return 2**++bie}const zC=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:pn,commaOrSpaceSeparated:di,commaSeparated:mp,number:X,overloadedBoolean:UC,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),gE=Object.keys(zC);class CR extends oi{constructor(e,n,r,i){let s=-1;if(super(e,n),u2(this,"space",i),typeof r=="number")for(;++s<gE.length;){const a=gE[s];u2(this,gE[s],(r&zC[a])===zC[a])}}}CR.prototype.defined=!0;function u2(t,e,n){n&&(t[e]=n)}function Ig(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new CR(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[$C(r)]=r,n[$C(s.attribute)]=r}return new X0(e,n,t.space)}const U3=Ig({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:vt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:X,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:vt,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:pn,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function z3(t,e){return e in t?t[e]:e}function V3(t,e){return z3(t,e.toLowerCase())}const xie=Ig({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mp,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:vt,autoFocus:Ne,autoPlay:Ne,blocking:vt,capture:null,charSet:null,checked:Ne,cite:null,className:vt,cols:X,colSpan:null,content:null,contentEditable:pn,controls:Ne,controlsList:vt,coords:X|mp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:UC,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:vt,height:X,hidden:UC,high:X,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:vt,itemRef:vt,itemScope:Ne,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ne,optimum:X,pattern:null,ping:vt,placeholder:null,playsInl
313ine:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:vt,required:Ne,reversed:Ne,rows:X,rowSpan:X,sandbox:vt,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:Ne,useMap:null,value:pn,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:V3}),Sie=Ig({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
313-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:di,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:Ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:mp,g2:mp,glyphName:mp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 4,377 bytes, lines 313-314
313Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:z3}),H3=Ig({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),W3=Ig({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:V3}),G3=Ig({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),kie={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Aie=/[A-Z]/g,h2=/-[a-z]/g,Eie=/^data[-\w.:]+$/i;function _ie(t,e){const n=$C(e);let r=e,i=oi;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Eie.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(h2,Tie);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!h2.test(s)){let a=s.replace(Aie,Cie);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=CR}return new i(r,e)}function Cie(t){return"-"+t.toLowerCase()}function Tie(t){return t.charAt(1).toUpperCase()}const Pie=$3([U3,xie,H3,W3,G3],"html"),TR=$3([U3,Sie,H3,W3,G3],"svg");function Nie(t){return t.join(" ").trim()}var PR={},d2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Rie=/\n/g,Iie=/^\s*/,Oie=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Mie=/^:\s*/,Die=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Lie=/^[;\s]*/,jie=/^\s+|\s+$/g,Fie=`
314`,f2="/",p2="*",Yu="",Bie="comment",$ie="declaration";function Uie(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(m){var y=m.match(Rie);y&&(n+=y.length);var x=m.lastIndexOf(Fie);r=~x?m.length-x:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new a(m),c(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function o(m){var y=new Error(e.source+":"+n+":"+r+": "+m);
vendor: 4,615 bytes, line 314
314if(y.reason=m,y.filename=e.source,y.line=n,y.column=r,y.source=t,!e.silent)throw y}function l(m){var y=m.exec(t);if(y){var x=y[0];return i(x),t=t.slice(x.length),y}}function c(){l(Iie)}function h(m){var y;for(m=m||[];y=d();)y!==!1&&m.push(y);return m}function d(){var m=s();if(!(f2!=t.charAt(0)||p2!=t.charAt(1))){for(var y=2;Yu!=t.charAt(y)&&(p2!=t.charAt(y)||f2!=t.charAt(y+1));)++y;if(y+=2,Yu===t.charAt(y-1))return o("End of comment missing");var x=t.slice(2,y-2);return r+=2,i(x),t=t.slice(y),r+=2,m({type:Bie,comment:x})}}function f(){var m=s(),y=l(Oie);if(y){if(d(),!l(Mie))return o("property missing ':'");var x=l(Die),v=m({type:$ie,property:m2(y[0].replace(d2,Yu)),value:x?m2(x[0].replace(d2,Yu)):Yu});return l(Lie),v}}function p(){var m=[];h(m);for(var y;y=f();)y!==!1&&(m.push(y),h(m));return m}return c(),p()}function m2(t){return t?t.replace(jie,Yu):Yu}var zie=Uie,Vie=wS&&wS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(PR,"__esModule",{value:!0});PR.default=Wie;const Hie=Vie(zie);function Wie(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,Hie.default)(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?e(a,o,s):o&&(n=n||{},n[a]=o)}),n}var Vk={};Object.defineProperty(Vk,"__esModule",{value:!0});Vk.camelCase=void 0;var Gie=/^--[a-zA-Z0-9_-]+$/,qie=/-([a-z])/g,Kie=/^[^-]+$/,Yie=/^-(webkit|moz|ms|o|khtml)-/,Xie=/^-(ms)-/,Qie=function(t){return!t||Kie.test(t)||Gie.test(t)},Jie=function(t,e){return e.toUpperCase()},g2=function(t,e){return"".concat(e,"-")},Zie=function(t,e){return e===void 0&&(e={}),Qie(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(Xie,g2):t=t.replace(Yie,g2),t.replace(qie,Jie))};Vk.camelCase=Zie;var ese=wS&&wS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},tse=ese(PR),nse=Vk;function VC(t,e){var n={};return!t||typeof t!="string"||(0,tse.default)(t,function(r,i){r&&i&&(n[(0,nse.camelCase)(r,e)]=i)}),n}VC.default=VC;var rse=VC;const ise=Jd(rse),q3=K3("end"),NR=K3("start");function K3(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function sse(t){const e=NR(t),n=q3(t);if(e&&n)return{start:e,end:n}}function Jy(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?y2(t.position):"start"in t||"end"in t?y2(t):"line"in t||"column"in t?HC(t):""}function HC(t){return v2(t&&t.line)+":"+v2(t&&t.column)}function y2(t){return HC(t&&t.start)+"-"+HC(t&&t.end)}function v2(t){return t&&typeof t=="number"?t:1}class vr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Jy(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vr.prototype.file="";vr.prototype.name="";vr.prototype.reason="";vr.prototype.message="";vr.prototype.stack="";vr.prototype.column=void 0;vr.prototype.line=void 0;vr.prototype.ancestors=void 0;vr.prototype.cause=void 0;vr.prototype.fatal=void 0;vr.prototype.place=void 0;vr.prototype.ruleId=void 0;vr.prototype.source=void 0;const RR={}.hasOwnProperty,ase=new Map,ose=/[A-Z]/g,lse=new Set(["table","tbody","thead","tfoot","tr"]),cse=new Set(["td","th"]),Y3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function use(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=vse(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,060 bytes, line 314
314if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yse(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?TR:Pie,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=X3(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function X3(t,e,n){if(e.type==="element")return hse(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return dse(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return pse(t,e,n);if(e.type==="mdxjsEsm")return fse(t,e);if(e.type==="root")return mse(t,e,n);if(e.type==="text")return gse(t,e)}function hse(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=TR,t.schema=i),t.ancestors.push(e);const s=J3(t,e.tagName,!1),a=wse(t,e);let o=OR(t,e);return lse.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!wie(l):!0})),Q3(t,a,s,e),IR(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function dse(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}Bv(t,e.position)}function fse(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Bv(t,e.position)}function pse(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=TR,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:J3(t,e.name,!0),a=bse(t,e),o=OR(t,e);return Q3(t,a,s,e),IR(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function mse(t,e,n){const r={};return IR(r,OR(t,e)),t.create(e,t.Fragment,r,n)}function gse(t,e){return e.value}function Q3(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function IR(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function yse(t,e,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:e;return o?c(s,a,o):c(s,a)}}function vse(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=NR(r);return e(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function wse(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&RR.call(e.properties,i)){const s=xse(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&cse.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bse(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else Bv(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else Bv(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function OR(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:ase;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const o=X3(t,s,a);o!==void 0&&n.push(o)}return n}function xse(t,e,n){const r=_ie(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pie(n):Nie(n)),r.property==="style"){let i=typeof n=="object"?n:Sse(t,String(n));return t.stylePropertyNameCase==="css"&&(i=kse(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?kie[r.property]||r.property:r.attribute,n]}}function Sse(t,e){try{return ise(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new vr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Y3+"#cannot-parse-style-attribute",i}}function J3(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=l2(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=l2(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return RR.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);Bv(t)}function Bv(t,e){const n=new vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Y3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kse(t){const e={};let n;for(n in t)RR.call(t,n)&&(e[Ase(n)]=t[n]);return e}function Ase(t){let e=t.replace(ose,Ese);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Ese(t){return"-"+t.toLowerCase()}const yE={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_se={};function Cse(t,e){const n=_se,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Z3(t,r,i)}function Z3(t,e,n){if(Tse(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return w2(t.children,e,n)}
vendor: 11,212 bytes, line 314
314return Array.isArray(t)?w2(t,e,n):""}function w2(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Z3(t[i],e,n);return r.join("")}function Tse(t){return!!(t&&typeof t=="object")}const b2=document.createElement("i");function MR(t){const e="&"+t+";";b2.innerHTML=e;const n=b2.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function mo(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function ys(t,e){return t.length>0?(mo(t,t.length,0,e),t):e}const x2={}.hasOwnProperty;function Pse(t){const e={};let n=-1;for(;++n<t.length;)Nse(e,t[n]);return e}function Nse(t,e){let n;for(n in e){const i=(x2.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){x2.call(i,a)||(i[a]=[]);const o=s[a];Rse(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Rse(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);mo(t,0,0,r)}function ez(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function gp(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const io=Ou(/[A-Za-z]/),zi=Ou(/[\dA-Za-z]/),Ise=Ou(/[#-'*+\--9=?A-Z^-~]/);function WC(t){return t!==null&&(t<32||t===127)}const GC=Ou(/\d/),Ose=Ou(/[\dA-Fa-f]/),Mse=Ou(/[!-/:-@[-`{-~]/);function ye(t){return t!==null&&t<-2}function si(t){return t!==null&&(t<0||t===32)}function Xe(t){return t===-2||t===-1||t===32}const Dse=Ou(new RegExp("\\p{P}|\\p{S}","u")),Lse=Ou(/\s/);function Ou(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Og(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&zi(t.charCodeAt(n+1))&&zi(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function bt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return Xe(l)?(t.enter(n),o(l)):e(l)}function o(l){return Xe(l)&&s++<i?(t.consume(l),o):(t.exit(n),e(l))}}const jse={tokenize:Fse};function Fse(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),bt(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return ye(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const Bse={tokenize:$se},S2={tokenize:Use};function $se(t){const e=this,n=[];let r=0,i,s,a;return o;function o(b){if(r<n.length){const k=n[r];return e.containerState=k[1],t.attempt(k[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();const k=e.events.length;let _=k,C;for(;_--;)if(e.events[_][0]==="exit"&&e.events[_][1].type==="chunkFlow"){C=e.events[_][1].end;break}v(r);let P=k;for(;P<e.events.length;)e.events[P][1].end={...C},P++;return mo(e.events,_+1,0,e.events.slice(k)),e.events.length=P,c(b)}return o(b)}function c(b){if(r===n.length){if(!i)return f(b);if(i.currentConstruct&&i.currentConstruct.concrete)return m(b);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(S2,h,d)(b)}function h(b){return i&&w(),v(r),f(b)}function d(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,m(b)}function f(b){return e.containerState={},t.attempt(S2,p,m)(b)}function p(b){return r++,n.push([e.currentConstruct,e.containerState]),f(b)}function m(b){if(b===null){i&&w(),v(0),t.consume(b);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(b)}function y(b){if(b===null){x(t.exit("chunkFlow"),!0),v(0),t.consume(b);return}return ye(b)?(t.consume(b),x(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(b),y)}function x(b,k){const _=e.sliceStream(b);if(k&&_.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(_),e.parser.lazy[b.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const P=e.events.length;let R=P,O,M;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){if(O){M=e.events[R][1].end;break}O=!0}for(v(r),C=P;C<e.events.length;)e.events[C][1].end={...M},C++;mo(e.events,R+1,0,e.events.slice(P)),e.events.length=C}}function v(b){let k=n.length;for(;k-- >b;){const _=n[k];e.containerState=_[1],_[0].exit.call(e,t)}n.length=b}function w(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Use(t,e,n){return bt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function k2(t){if(t===null||si(t)||Lse(t))return 1;if(Dse(t))return 2}function DR(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const qC={name:"attention",resolveAll:zse,tokenize:Vse};function zse(t,e){let n=-1,r,i,s,a,o,l,c,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[r][1].end},f={...t[n][1].start};A2(d,-l),A2(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=ys(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=ys(c,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),c=ys(c,DR(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=ys(c,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,c=ys(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,mo(t,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Vse(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=k2(r);let s;return a;function a(l){return s=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===s)return t.consume(l),o;const c=t.exit("attentionSequence"),h=k2(l),d=!h||h===2&&i||n.includes(l),f=!i||i===2&&h||n.includes(r);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(h||!d)),e(l)}}function A2(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Hse={name:"autolink",tokenize:Wse};function Wse(t,e,n){let r=0;return i;function i(p){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(p){return io(p)?(t.consume(p),a):p===64?n(p):c(p)}function a(p){return p===43||p===45||p===46||zi(p)?(r=1,o(p)):c(p)}function o(p){return p===58?(t.consume(p),r=0,l):(p===43||p===45||p===46||zi(p))&&r++<32?(t.consume(p),o):(r=0,c(p))}function l(p){return p===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):p===null||p===32||p===60||WC(p)?n(p):(t.consume(p),l)}function c(p){return p===64?(t.consume(p),h):Ise(p)?(t.consume(p),c):n(p)}function h(p){return zi(p)?d(p):n(p)}function d(p){return p===46?(t.consume(p),r=0,h):p===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):f(p)}function f(p){if((p===45||zi(p))&&r++<63){const m=p===45?f:d;return t.consume(p),m}return n(p)}}const Hk={partial:!0,tokenize:Gse};function Gse(t,e,n){return r;function r(s){return Xe(s)?bt(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||ye(s)?e(s):n(s)}}const tz={continuation:{tokenize:Kse},exit:Yse,name:"blockQuote",tokenize:qse};function qse(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Xe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Kse(t,e,n){const r=this;return i;function i(a){return Xe(a)?bt(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(tz,e,n)(a)}}function Yse(t){t.exit("blockQuote")}const nz={name:"characterEscape",tokenize:Xse};function Xse(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return Mse(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const rz={name:"characterReference",tokenize:Qse};function Qse(t,e,n){const r=this;let i=0,s,a;return o;function o(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),s=31,a=zi,h(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=Ose,h):(t.enter("characterReferenceValue"),s=7,a=GC,h(d))}function h(d){if(d===59&&i){const f=t.exit("characterReferenceValue");return a===zi&&!MR(r.sliceSerialize(f))?n(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(d)&&i++<s?(t.consume(d),h):n(d)}}const E2={partial:!0,tokenize:Zse},_2={concrete:!0,name:"codeFenced",tokenize:Jse};function Jse(t,e,n){const r=this,i={partial:!0,tokenize:_};let s=0,a=0,o;return l;function l(C){return c(C)}function c(C){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,o=C,t.enter("co
314deFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(C)}function h(C){return C===o?(a++,t.consume(C),h):a<3?n(C):(t.exit("codeFencedFenceSequence"),Xe(C)?bt(t,d,"whitespace")(C):d(C))}function d(C){return C===null||ye(C)?(t.exit("codeFencedFence"),r.interrupt?e(C):t.check(E2,y,k)(C)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||ye(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(C)):Xe(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),bt(t,p,"whitespace")(C)):C===96&&C===o?n(C):(t.consume(C),f)}function p(C){return C===null||ye(C)?d(C):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ye(C)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(C)):C===96&&C===o?n(C):(t.consume(C),m)}function y(C){return t.attempt(i,k,x)(C)}function x(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),v}function v(C){return s>0&&Xe(C)?bt(t,w,"linePrefix",s+1)(C):w(C)}function w(C){return C===null||ye(C)?t.check(E2,y,k)(C):(t.enter("codeFlowValue"),b(C))}function b(C){return C===null||ye(C)?(t.exit("codeFlowValue"),w(C)):(t.consume(C),b)}function k(C){return t.exit("codeFenced"),e(C)}function _(C,P,R){let O=0;return M;function M(z){return C.enter("lineEnding"),C.consume(z),C.exit("lineEnding"),D}function D(z){return C.enter("codeFencedFence"),Xe(z)?bt(C,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):j(z)}function j(z){return z===o?(C.enter("codeFencedFenceSequence"),U(z)):R(z)}function U(z){return z===o?(O++,C.consume(z),U):O>=a?(C.exit("codeFencedFenceSequence"),Xe(z)?bt(C,B,"whitespace")(z):B(z)):R(z)}function B(z){return z===null||ye(z)?(C.exit("codeFencedFence"),P(z)):R(z)}}}function Zse(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const vE={name:"codeIndented",tokenize:tae},eae={partial:!0,tokenize:nae};function tae(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),bt(t,s,"linePrefix",5)(c)}function s(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ye(c)?t.attempt(eae,a,l)(c):(t.enter("codeFlowValue"),o(c))}function o(c){return c===null||ye(c)?(t.exit("codeFlowValue"),a(c)):(t.consume(c),o)}function l(c){return t.exit("codeIndented"),e(c)}}function nae(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ye(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):bt(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ye(a)?i(a):n(a)}}const rae={name:"codeText",previous:sae,resolve:iae,tokenize:aae};function iae(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function sae(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aae(t,e,n){let r=0,i,s;return a;function a(d){return t.enter("codeText"),t.enter("codeTextSequence"),o(d)}function o(d){return d===96?(t.consume(d),r++,o):(t.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),l):d===96?(s=t.enter("codeTextSequence"),i=0,h(d)):ye(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ye(d)?(t.exit("codeTextData"),l(d)):(t.consume(d),c)}function h(d){return d===96?(t.consume(d),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(s.type="codeTextData",c(d))}}class oae{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Kg(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Kg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Kg(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Kg(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Kg(this.left,n.reverse())}}}function Kg(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function iz(t){const e={};let n=-1,r,i,s,a,o,l,c;const h=new oae(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,lae(h,n)),n=e[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return mo(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function lae(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],c={};let h,d,f=-1,p=n,m=0,y=0;const x=[y];for(;p;){for(;t.get(++i)[1]!==p;);s.push(i),p._tokenizer||(h=r.sliceStream(p),p.next||h.push(null),d&&a.defineSki
vendor: 22,887 bytes, line 314
314p(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(y=f+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),f=x.length;f--;){const v=o.slice(x[f],x[f+1]),w=s.pop();l.push([w,w+v.length-1]),t.splice(w,2,v)}for(l.reverse(),f=-1;++f<l.length;)c[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return c}const cae={resolve:hae,tokenize:dae},uae={partial:!0,tokenize:fae};function hae(t){return iz(t),t}function dae(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ye(o)?t.check(uae,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function fae(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),bt(t,s,"linePrefix")}function s(a){if(a===null||ye(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function sz(t,e,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(v){return v===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(v),t.exit(s),f):v===null||v===32||v===41||WC(v)?n(v):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),y(v))}function f(v){return v===62?(t.enter(s),t.consume(v),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(t.exit("chunkString"),t.exit(o),f(v)):v===null||v===60||ye(v)?n(v):(t.consume(v),v===92?m:p)}function m(v){return v===60||v===62||v===92?(t.consume(v),p):p(v)}function y(v){return!h&&(v===null||v===41||si(v))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(v)):h<c&&v===40?(t.consume(v),h++,y):v===41?(t.consume(v),h--,y):v===null||v===32||v===40||WC(v)?n(v):(t.consume(v),v===92?x:y)}function x(v){return v===40||v===41||v===92?(t.consume(v),y):y(v)}}function az(t,e,n,r,i,s){const a=this;let o=0,l;return c;function c(p){return t.enter(r),t.enter(i),t.consume(p),t.exit(i),t.enter(s),h}function h(p){return o>999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(t.exit(s),t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):ye(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ye(p)||o++>999?(t.exit("chunkString"),h(p)):(t.consume(p),l||(l=!Xe(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),o++,d):d(p)}}function oz(t,e,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(t.enter(r),t.enter(i),t.consume(f),t.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):(t.enter(s),c(f))}function c(f){return f===a?(t.exit(s),l(a)):f===null?n(f):ye(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),bt(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||ye(f)?(t.exit("chunkString"),c(f)):(t.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(t.consume(f),h):h(f)}}function Zy(t,e){let n;return r;function r(i){return ye(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Xe(i)?bt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const pae={name:"definition",tokenize:gae},mae={partial:!0,tokenize:yae};function gae(t,e,n){const r=this;let i;return s;function s(p){return t.enter("definition"),a(p)}function a(p){return az.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=gp(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),l):n(p)}function l(p){return si(p)?Zy(t,c)(p):c(p)}function c(p){return sz(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return t.attempt(mae,d,d)(p)}function d(p){return Xe(p)?bt(t,f,"whitespace")(p):f(p)}function f(p){return p===null||ye(p)?(t.exit("definition"),r.parser.defined.push(i),e(p)):n(p)}}function yae(t,e,n){return r;function r(o){return si(o)?Zy(t,i)(o):n(o)}function i(o){return oz(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Xe(o)?bt(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ye(o)?e(o):n(o)}}const vae={name:"hardBreakEscape",tokenize:wae};function wae(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return ye(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const bae={name:"headingAtx",resolve:xae,tokenize:Sae};function xae(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},mo(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function Sae(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),s(h)}function s(h){return t.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(t.consume(h),a):h===null||si(h)?(t.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||ye(h)?(t.exit("atxHeading"),e(h)):Xe(h)?bt(t,o,"whitespace")(h):(t.enter("atxHeadingText"),c(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||si(h)?(t.exit("atxHeadingText"),o(h)):(t.consume(h),c)}}const kae=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],C2=["pre","script","style","textarea"],Aae={concrete:!0,name:"htmlFlow",resolveTo:Cae,tokenize:Tae},Eae={partial:!0,tokenize:Nae},_ae={partial:!0,tokenize:Pae};function Cae(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Tae(t,e,n){const r=this;let i,s,a,o,l;return c;function c(I){return h(I)}function h(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),d}function d(I){return I===33?(t.consume(I),f):I===47?(t.consume(I),s=!0,y):I===63?(t.consume(I),i=3,r.interrupt?e:N):io(I)?(t.consume(I),a=String.fromCharCode(I),x):n(I)}function f(I){return I===45?(t.consume(I),i=2,p):I===91?(t.consume(I),i=5,o=0,m):io(I)?(t.consume(I),i=4,r.interrupt?e:N):n(I)}function p(I){return I===45?(t.consume(I),r.interrupt?e:N):n(I)}function m(I){const we="CDATA[";return I===we.charCodeAt(o++)?(t.consume(I),o===we.length?r.interrupt?e:j:m):n(I)}function y(I){return io(I)?(t.consume(I),a=String.fromCharCode(I),x):n(I)}function x(I){if(I===null||I===47||I===62||si(I)){const we=I===47,Oe=a.toLowerCase();return!we&&!s&&C2.includes(Oe)?(i=1,r.interrupt?e(I):j(I)):kae.includes(a.toLowerCase())?(i=6,we?(t.consume(I),v):r.interrupt?e(I):j(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?w(I):b(I))}return I===45||zi(I)?(t.consume(I),a+=String.fromCharCode(I),x):n(I)}function v(I){return I===62?(t.consume(I),r.interrupt?e:j):n(I)}function w(I){return Xe(I)?(t.consume(I),w):M(I)}function b(I){return I===47?(t.consume(I),M):I===58||I===95||io(I)?(t.consume(I),k):Xe(I)?(t.consume(I),b):M(I)}function k(I){return I===45||I===46||I===58||I===95||zi(I)?(t.consume(I),k):_(I)}function _(I){return I===61?(t.consume(I),C):Xe(I)?(t.consume(I),_):b(I)}function C(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),l=I,P):Xe(I)?(t.consume(I),C):R(I)}function P(I){return I===l?(t.consume(I),l=null,O):I===null||ye(I)?n(I):(t.consume(I),P)}function R(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||si(I)?_(I):(t.consume(I),R)}function O(I){return I===47||I===62||Xe(I)?b(I):n(I)}function M(I){return I===62?(t.consume(I),D):n(I)}function D(I){return I===null||ye(I)?j(I):Xe(I)?(t.consume(I),D):n(I)}function j(I){return I===45&&i===2?(t.consume(I),$):I===60&&i===1?(t.consume(I),W):I===62&&i===4?(t.consume(I),G):I===63&&i===3?(t.consume(I),N):I===93&&i===5?(t.consume(I),V):ye(I)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Eae,Y,U)(I)):I===null||ye(I)?(t.exit("htmlFlowData"),U(I)):(t.consume(I),j)}function U(I){return t.check(_ae,B,Y)(I)}function B(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),z}function z(I){return I===null||ye(I)?U(I):(t.enter("htmlFlowData"),j(I))}function $(I){return I===45?(t.consume(I),N):j(I)}function W(I){return I===47?(t.consume(I),a="",L):j(I)}function L(I){if(I===62){const we=a.toLowerCase();return C2.includes(we)?(t.consume(I),G):j(I)}return io(I)&&a.length<8?(t.consume(I),a+=String.fromCharCode(I),L):j(I)}function V(I){return I===93?(t.consume(I),N):j(I)}function N(I){return I===62?(t.consume(I),G):I===45&&i===2?(t.consume(I),N):j(I)}function G(I){return I===null||ye(I)?(t.exit("htmlFlowData"),Y(I)):(t.consume(I),G)}function Y(I){return t.exit("htmlFlow"),e(I)}}function Pae(t,e,n){const r=this;return i;function i(a){return ye(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function Nae(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Hk,e,n)}}const Rae={name:"htmlText",tokenize:Iae};function Iae(t,e,n){const r=this;let i,s,a;return o;function o(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),l}function l(N){return N===33?(t.consume(N),c):N===47?(t.consume(N),_):N===63?(t.consume(N),b):io(N)?(t.consume(N),R):n(N)}function c(N){return N===45?(t.consume(N),h):N===91?(t.consume(N),s=0,m):io(N)?(t.consume(N),w):n(N)}function h(N){return N===45?(t.consume(N),p):n(N)}function d(N){return N===null?n(N):N===45?(t.consume(N),f):ye(N)?(a=d,W(N)):(t.consume(N),d)}function f(N){return N===45?(t.consume(N),p):d(N)}function p(N){return N===62?$(N):N===45?f(N):d(N)}function m(N){const G="CDATA[";return N===G.charCodeAt(s++)?(t.consume(N),s===G.length?y:m):n(N)}function y(N){return N===null?n(N):N===93?(t.consume(N),x):ye(N)?(a=y,W(N)):(t.consume(N),y)}function x(N){return N===93?(t.consume(N),v):y(N)}function v(N){return N===62?$(N):N===93?(t.consume(N),v):y(N)}function w(N){return N===null||N===62?$(N):ye(N)?(a=w,W(N)):(t.consume(N),w)}function b(N){return N===null?n(N):N===63?(t.consume(N),k):ye(N)?(a=b,W(N)):(t.consume(N),b)}function k(N){return N===62?$(N):b(N)}function _(N){return io(N)?(t.consume(N),C):n(N)}function C(N){return N===45||zi(N)?(t.consume(N),C):P(N)}function P(N){return ye(N)?(a=P,W(N)):Xe(N)?(t.consume(N),P):$(N)}function R(N){return N===45||zi(N)?(t.consume(N),R):N===47||N===62||si(N)?O(N):n(N)}function O(N){return N===47?(t.consume(N),$):N===58||N===95||io(N)?(t.consume(N),M):ye(N)?(a=O,W(N)):Xe(N)?(t.consume(N),O):$(N)}function M(N){return N===45||N===46||N===58||N===95||zi(N)?(t.consume(N),M):D(N)}function D(N){return N===61?(t.consume(N),j):ye(N)?(a=D,W(N)):Xe(N)?(t.consume(N),D):O(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,U):ye(N)?(a=j,W(N)):Xe(N)?(t.consume(N),j):(t.consume(N),B)}function U(N){return N===i?(t.consume(N),i=void 0,z):N===null?n(N):ye(N)?(a=U,W(N)):(t.consume(N),U)}function B(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||si(N)?O(N):(t.consume(N),B)}function z(N){return N===47||N===62||si(N)?O(N):n(N)}function $(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function W(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),L}function L(N){return Xe(N)?bt(t,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):V(N)}function V(N){return t.enter("htmlTextData"),a(N)}}const LR={name:"labelEnd",resolveAll:Lae,resolveTo:jae,tokenize:Fae},Oae={tokenize:Bae},Mae={tokenize:$ae},Dae={tokenize:Uae};function Lae(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&mo(t,0,t.length,n),t}function jae(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},h={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",l,e],["enter",c,e]],o=ys(o,t.slice(s+1,s+r+3)),o=ys(o,[["enter",h,e]]),o=ys(o,DR(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=ys(o,[["exit",h,e],t[a-2],t[a-1],["exit",c,e]]),o=ys(o,t.slice(a+1)),o=ys(o,[["exit",l,e]]),mo(t,s,t.length,o),t}function Fae(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(f){return s?s._inactive?d(f):(a=r.parser.defined.includes(gp(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelEnd"),l):n(f)}function l(f){return f===40?t.attempt(Oae,h,a?h:d)(f):f===91?t.attempt(Mae,h,a?c:d)(f):a?h(f):d(f)}function c(f){return t.attempt(Dae,h,d)(f)}function h(f){return e(f)}function d(f){return s._balanced=!0,n(f)}}function Bae(t,e,n){return r;function r(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),i}function i(d){return si(d)?Zy(t,s)(d):s(d)}function s(d){return d===41?h(d):sz(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return si(d)?Zy(t,l)(d):h(d)}function o(d){return n(d)}function l(d){return d===34||d===39||d===40?oz(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return si(d)?Zy(t,h)(d):h(d)}function h(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}function $ae(t,e,n){const r=this;return i;function i(o){return az.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(gp(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function Uae(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const zae={name:"labelStartImage",resolveAll:LR.resolveAll,tokenize:Vae};function Vae(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const Hae={name:"labelStartLink",resolveAll:LR.resolveAll,tokenize:Wae};function Wae(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const wE={name:"lineEnding",tokenize:Gae};function Gae(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),bt(t,e,"linePrefix")}}const Rx={name:"thematicBreak",tokenize:qae};function qae(t,e,n){let r=0,i;return s;function s(c){return t.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(t.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ye(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),Xe(c)?bt(t,o,"whitespace")(c):o(c))}}const Vr={continuation:{tokenize:Qae},exit:Zae,name:"list",tokenize:Xae},Kae={partial:!0,tokenize:eoe},Yae={partial:!0,tokenize:Jae};function Xae(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:GC(p)){if(r.containerState.type||(r.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(Rx,n,c)(p):c(p);if(!r.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(p)}return n(p)}function l(p){return GC(p)&&++a<10?(t.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),c(p)):n(p)}function c(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,t.check(Hk,r.interrupt?n:h,t.attempt(Kae,f,d))}function h(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return Xe(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function Qae(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Hk,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,bt(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Yae,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,bt(t,t.attempt(Vr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Jae(t,e,n){const r=this;return bt(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function Zae(t){t.exit(this.containerState.type)}function eoe(t,e,n){const r=this;return bt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Xe(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const T2={name:"setextUnderline",resolveTo:toe,tokenize:noe};function toe(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function noe(t,e,n){const r=this;let i;return s;function s(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(t.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return t.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(t.consume(c),o):(t.exit("setextHeadingLineSequence"),Xe(c)?bt(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ye(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const roe={tokenize:ioe};function ioe(t){const e=this,n=t.attempt(Hk,r,t.attempt(this.parser.constructs.flowInitial,i,bt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(cae,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const soe={resolveAll:cz()},aoe=lz("string"),ooe=lz("text");function lz(t){return{resolveAll:cz(t==="text"?loe:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(h){return c(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),l}function l(h){return c(h)?(n.exit("data"),s(h)):(n.consume(h),l)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function cz(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function loe(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;
vendor: 5,729 bytes, lines 314-316
314c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const c={type:n===t.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const coe={42:Vr,43:Vr,45:Vr,48:Vr,49:Vr,50:Vr,51:Vr,52:Vr,53:Vr,54:Vr,55:Vr,56:Vr,57:Vr,62:tz},uoe={91:pae},hoe={[-2]:vE,[-1]:vE,32:vE},doe={35:bae,42:Rx,45:[T2,Rx],60:Aae,61:T2,95:Rx,96:_2,126:_2},foe={38:rz,92:nz},poe={[-5]:wE,[-4]:wE,[-3]:wE,33:zae,38:rz,42:qC,60:[Hse,Rae],91:Hae,92:[vae,nz],93:LR,95:qC,96:rae},moe={null:[qC,soe]},goe={null:[42,95]},yoe={null:[]},voe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:goe,contentInitial:uoe,disable:yoe,document:coe,flow:doe,flowInitial:hoe,insideSpan:moe,string:foe,text:poe},Symbol.toStringTag,{value:"Module"}));function woe(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:P(_),check:P(C),consume:w,enter:b,exit:k,interrupt:P(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:t,previous:null,sliceSerialize:f,sliceStream:p,write:d};let h=e.tokenize.call(c,l);return e.resolveAll&&s.push(e),c;function d(D){return a=ys(a,D),x(),a[a.length-1]!==null?[]:(R(e,0),c.events=DR(s,c.events,c),c.events)}function f(D,j){return xoe(p(D),j)}function p(D){return boe(a,D)}function m(){const{_bufferIndex:D,_index:j,line:U,column:B,offset:z}=r;return{_bufferIndex:D,_index:j,line:U,column:B,offset:z}}function y(D){i[D.line]=D.column,M()}function x(){let D;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<j.length;)v(j.charCodeAt(r._bufferIndex));else v(j)}}function v(D){h=h(D)}function w(D){ye(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,M()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function b(D,j){const U=j||{};return U.type=D,U.start=m(),c.events.push(["enter",U,c]),o.push(U),U}function k(D){const j=o.pop();return j.end=m(),c.events.push(["exit",j,c]),j}function _(D,j){R(D,j.from)}function C(D,j){j.restore()}function P(D,j){return U;function U(B,z,$){let W,L,V,N;return Array.isArray(B)?Y(B):"tokenize"in B?Y([B]):G(B);function G(oe){return he;function he(rn){const kn=rn!==null&&oe[rn],sn=rn!==null&&oe.null,wr=[...Array.isArray(kn)?kn:kn?[kn]:[],...Array.isArray(sn)?sn:sn?[sn]:[]];return Y(wr)(rn)}}function Y(oe){return W=oe,L=0,oe.length===0?$:I(oe[L])}function I(oe){return he;function he(rn){return N=O(),V=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?Oe():oe.tokenize.call(j?Object.assign(Object.create(c),j):c,l,we,Oe)(rn)}}function we(oe){return D(V,N),z}function Oe(oe){return N.restore(),++L<W.length?I(W[L]):$}}}function R(D,j){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&mo(c.events,j,c.events.length-j,D.resolve(c.events.slice(j),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function O(){const D=m(),j=c.previous,U=c.currentConstruct,B=c.events.length,z=Array.from(o);return{from:B,restore:$};function $(){r=D,c.previous=j,c.currentConstruct=U,c.events.length=B,o=z,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function boe(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function xoe(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
315`;break}case-3:{a=`\r
316`;break}case-2:{a=e?" ":"	";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Soe(t){const r={constructs:Pse([voe,...(t||{}).extensions||[]]),content:i(jse),defined:[],document:i(Bse),flow:i(roe),lazy:{},string:i(aoe),text:i(ooe)};return r;function i(s){return a;function a(o){return woe(r,s,o)}}}function koe(t){for(;!iz(t););return t}const P2=/[\0\t\n\r]/g;function Aoe(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const l=[];let c,h,d,f,p;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,e="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(P2.lastIndex=d,c=P2.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){e=s.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),t+=f-d),p){case 0:{l.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,l.push(-2);t++<h;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}d=f+1}return o&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Eoe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _oe(t){return t.replace(Eoe,Coe)}function Coe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return ez(n.slice(s?2:1),s?16:10)}return MR(n)||t}const uz={}.hasOwnProperty;function Toe(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),Poe(n)(koe(Soe(n).document().write(Aoe()(t,e,!0))))}function Poe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter
vendor: 8,244 bytes, line 316
316:{autolink:s(be),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(me),blockQuote:s(sn),characterEscape:O,characterReference:O,codeFenced:s(wr),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(wr,a),codeText:s(Br,a),codeTextData:O,data:O,codeFlowValue:O,definition:s($r),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Ts),hardBreakEscape:s(Me),hardBreakTrailing:s(Me),htmlFlow:s(De,a),htmlFlowData:O,htmlText:s(De,a),htmlTextData:O,image:s(Rt),label:a,link:s(be),listItem:s(Ur),listItemValue:f,listOrdered:s(It,d),listUnordered:s(It),paragraph:s(Rn),reference:I,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(me),strong:s(li),thematicBreak:s(nb)},exit:{atxHeading:l(),atxHeadingSequence:_,autolink:l(),autolinkEmail:kn,autolinkProtocol:rn,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Oe,characterReferenceMarkerNumeric:Oe,characterReferenceValue:oe,characterReference:he,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:M,codeIndented:l(v),codeText:l(z),codeTextData:M,data:M,definition:l(),definitionDestinationString:k,definitionLabelString:w,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(U),htmlFlowData:M,htmlText:l(B),htmlTextData:M,image:l(W),label:V,labelText:L,lineEnding:D,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:we,resourceDestinationString:N,resourceTitleString:G,resource:Y,setextHeading:l(R),setextHeadingLineSequence:P,setextHeadingText:C,strong:l(),thematicBreak:l()}};hz(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(H){let Z={type:"root",children:[]};const ve={stack:[Z],tokenStack:[],config:e,enter:o,exit:c,buffer:a,resume:h,data:n},Ce=[];let Qe=-1;for(;++Qe<H.length;)if(H[Qe][1].type==="listOrdered"||H[Qe][1].type==="listUnordered")if(H[Qe][0]==="enter")Ce.push(Qe);else{const ci=Ce.pop();Qe=i(H,ci,Qe)}for(Qe=-1;++Qe<H.length;){const ci=e[H[Qe][0]];uz.call(ci,H[Qe][1].type)&&ci[H[Qe][1].type].call(Object.assign({sliceSerialize:H[Qe][2].sliceSerialize},ve),H[Qe][1])}if(ve.tokenStack.length>0){const ci=ve.tokenStack[ve.tokenStack.length-1];(ci[1]||N2).call(ve,void 0,ci[0])}for(Z.position={start:Bl(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Bl(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<e.transforms.length;)Z=e.transforms[Qe](Z)||Z;return Z}function i(H,Z,ve){let Ce=Z-1,Qe=-1,ci=!1,ma,Qi,Mu,bo;for(;++Ce<=ve;){const qt=H[Ce];switch(qt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qt[0]==="enter"?Qe++:Qe--,bo=void 0;break}case"lineEndingBlank":{qt[0]==="enter"&&(ma&&!bo&&!Qe&&!Mu&&(Mu=Ce),bo=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bo=void 0}if(!Qe&&qt[0]==="enter"&&qt[1].type==="listItemPrefix"||Qe===-1&&qt[0]==="exit"&&(qt[1].type==="listUnordered"||qt[1].type==="listOrdered")){if(ma){let Dl=Ce;for(Qi=void 0;Dl--;){const fe=H[Dl];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;Qi&&(H[Qi][1].type="lineEndingBlank",ci=!0),fe[1].type="lineEnding",Qi=Dl}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}Mu&&(!Qi||Mu<Qi)&&(ma._spread=!0),ma.end=Object.assign({},Qi?H[Qi][1].start:qt[1].end),H.splice(Qi||Ce,0,["exit",ma,qt[2]]),Ce++,ve++}if(qt[1].type==="listItemPrefix"){const Dl={type:"listItem",_spread:!1,start:Object.assign({},qt[1].start),end:void 0};ma=Dl,H.splice(Ce,0,["enter",Dl,qt[2]]),Ce++,ve++,Mu=void 0,bo=!0}}}return H[Z][1]._spread=ci,ve}function s(H,Z){return ve;function ve(Ce){o.call(this,H(Ce),Ce),Z&&Z.call(this,Ce)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(H,Z,ve){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([Z,ve||void 0]),H.position={start:Bl(Z.start),end:void 0}}function l(H){return Z;function Z(ve){H&&H.call(this,ve),c.call(this,ve)}}function c(H,Z){const ve=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==H.type&&(Z?Z.call(this,H,Ce[0]):(Ce[1]||N2).call(this,H,Ce[0]));else throw new Error("Cannot close `"+H.type+"` ("+Jy({start:H.start,end:H.end})+"): it’s not open");ve.position.end=Bl(H.end)}function h(){return Cse(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(H){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function p(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=H}function m(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=H}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.value=H.replace(/(\r?\n|\r)$/g,"")}function w(H){const Z=this.resume(),ve=this.stack[this.stack.length-1];ve.label=Z,ve.identifier=gp(this.sliceSerialize(H)).toLowerCase()}function b(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.title=H}function k(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.url=H}function _(H){const Z=this.stack[this.stack.length-1];if(!Z.depth){const ve=this.sliceSerialize(H).length;Z.depth=ve}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function P(H){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function O(H){const ve=this.stack[this.stack.length-1].children;let Ce=ve[ve.length-1];(!Ce||Ce.type!=="text")&&(Ce=lf(),Ce.position={start:Bl(H.start),end:void 0},ve.push(Ce)),this.stack.push(Ce)}function M(H){const Z=this.stack.pop();Z.value+=this.sliceSerialize(H),Z.position.end=Bl(H.end)}function D(H){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=Z.children[Z.children.length-1];ve.position.end=Bl(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Z.type)&&(O.call(this,H),M.call(this,H))}function j(){this.data.atHardBreak=!0}function U(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.value=H}function B(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.value=H}function z(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.value=H}function $(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Z,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function W(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Z,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function L(H){const Z=this.sliceSerialize(H),ve=this.stack[this.stack.length-2];ve.label=_oe(Z),ve.identifier=gp(Z).toLowerCase()}function V(){const H=this.stack[this.stack.length-1],Z=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Ce=H.children;ve.children=Ce}else ve.alt=Z}function N(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.url=H}function G(){const H=this.resume(),Z=this.stack[this.stack.length-1];Z.title=H}function Y(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function we(H){const Z=this.resume(),ve=this.stack[this.stack.length-1];ve.label=Z,ve.identifier=gp(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function Oe(H){this.data.characterReferenceType=H.type}function oe(H){const Z=this.sliceSerialize(H),ve=this.data.characterReferenceType;let Ce;ve?(Ce=ez(Z,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=MR(
vendor: 6,129 bytes, lines 316-319
316Z);const Qe=this.stack[this.stack.length-1];Qe.value+=Ce}function he(H){const Z=this.stack.pop();Z.position.end=Bl(H.end)}function rn(H){M.call(this,H);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(H)}function kn(H){M.call(this,H);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(H)}function sn(){return{type:"blockquote",children:[]}}function wr(){return{type:"code",lang:null,meta:null,value:""}}function Br(){return{type:"inlineCode",value:""}}function $r(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ts(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function De(){return{type:"html",value:""}}function Rt(){return{type:"image",title:null,url:"",alt:null}}function be(){return{type:"link",title:null,url:"",children:[]}}function It(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Ur(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Rn(){return{type:"paragraph",children:[]}}function li(){return{type:"strong",children:[]}}function lf(){return{type:"text",value:""}}function nb(){return{type:"thematicBreak"}}}function Bl(t){return{line:t.line,column:t.column,offset:t.offset}}function hz(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?hz(t,r):Noe(t,r)}}function Noe(t,e){let n;for(n in e)if(uz.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function N2(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Jy({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Jy({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Jy({start:e.start,end:e.end})+") is still open")}function Roe(t){const e=this;e.parser=n;function n(r){return Toe(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Ioe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Ooe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
317`}]}function Moe(t,e){const n=e.value?e.value+`
318`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Doe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Loe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function joe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Og(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function Foe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Boe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function dz(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function $oe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return dz(t,e);const i={src:Og(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function Uoe(t,e){const n={src:Og(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function zoe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Voe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return dz(t,e);const i={href:Og(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function Hoe(t,e){const n={href:Og(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Woe(t,e,n){const r=t.all(e),i=n?Goe(n):fz(e),s={},a=[];if(typeof e.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
319`}
vendor: 4,261 bytes, lines 319-320
319),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
320`});const c={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,c),t.applyData(e,c)}function Goe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=fz(n[r])}return e}function fz(t){const e=t.spread;return e??t.children.length>1}function qoe(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function Koe(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Yoe(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Xoe(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Qoe(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=NR(e.children[1]),l=q3(e.children[e.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function Joe(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const d=e.children[l],f={},p=a?a[l]:void 0;p&&(f.align=p);let m={type:"element",tagName:s,properties:f,children:[]};d&&(m.children=t.all(d),t.patch(d,m),m=t.applyData(d,m)),c.push(m)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,h),t.applyData(e,h)}function Zoe(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const R2=9,I2=32;function ele(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(O2(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(O2(e.slice(i),i>0,!1)),s.join("")}function O2(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===R2||s===I2;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===R2||s===I2;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function tle(t,e){const n={type:"text",value:ele(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function nle(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const rle={blockquote:Ioe,break:Ooe,code:Moe,delete:Doe,emphasis:Loe,footnoteReference:joe,heading:Foe,html:Boe,imageReference:$oe,image:Uoe,inlineCode:zoe,linkReference:Voe,link:Hoe,listItem:Woe,list:qoe,paragraph:Koe,root:Yoe,strong:Xoe,table:Qoe,tableCell:Zoe,tableRow:Joe,text:tle,thematicBreak:nle,toml:Ub,yaml:Ub,definition:Ub,footnoteDefinition:Ub};function Ub(){}const pz=-1,Wk=0,ev=1,h1=2,jR=3,FR=4,BR=5,$R=6,mz=7,gz=8,ile=typeof self=="object"?self:globalThis,M2=(t,e)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new ile[t](e)},sle=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Wk:case pz:return n(a,i);case ev:{const o=n([],i);for(const l of a)o.push(r(l));return o}case h1:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case jR:return n(new Date(a),i);case FR:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case BR:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case $R:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case mz:{const{name:o,message:l}=a;return n(M2(o,l),i)}case gz:return n(BigInt(a),i);
vendor: 3,838 bytes, lines 320-321
320case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(M2(s,a),i)};return r},D2=t=>sle(new Map,t)(0),yf="",{toString:ale}={},{keys:ole}=Object,Yg=t=>{const e=typeof t;if(e!=="object"||!t)return[Wk,e];const n=ale.call(t).slice(8,-1);switch(n){case"Array":return[ev,yf];case"Object":return[h1,yf];case"Date":return[jR,yf];case"RegExp":return[FR,yf];case"Map":return[BR,yf];case"Set":return[$R,yf];case"DataView":return[ev,n]}return n.includes("Array")?[ev,n]:n.includes("Error")?[mz,n]:[h1,n]},zb=([t,e])=>t===Wk&&(e==="function"||e==="symbol"),lle=(t,e,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Yg(a);switch(o){case Wk:{let h=a;switch(l){case"bigint":o=gz,h=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([pz],a)}return i([o,h],a)}case ev:{if(l){let f=a;return l==="DataView"?f=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(a)),i([l,[...f]],a)}const h=[],d=i([o,h],a);for(const f of a)h.push(s(f));return d}case h1:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const h=[],d=i([o,h],a);for(const f of ole(a))(t||!zb(Yg(a[f])))&&h.push([s(f),s(a[f])]);return d}case jR:return i([o,a.toISOString()],a);case FR:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case BR:{const h=[],d=i([o,h],a);for(const[f,p]of a)(t||!(zb(Yg(f))||zb(Yg(p))))&&h.push([s(f),s(p)]);return d}case $R:{const h=[],d=i([o,h],a);for(const f of a)(t||!zb(Yg(f)))&&h.push(s(f));return d}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},L2=(t,{json:e,lossy:n}={})=>{const r=[];return lle(!(e||n),!!e,new Map,r)(t),r},d1=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?D2(L2(t,e)):structuredClone(t):(t,e)=>D2(L2(t,e));function cle(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function ule(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function hle(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||cle,r=t.options.footnoteBackLabel||ule,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[l]);if(!c)continue;const h=t.all(c),d=String(c.identifier).toUpperCase(),f=Og(d.toLowerCase());let p=0;const m=[],y=t.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){m.length>0&&m.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,p);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=h[h.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...m)}else h.push(...m);const v={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:t.wrap(h,!0)};t.patch(c,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...d1(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
321`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)}
vendor: 19,170 bytes, lines 321-326
321,{type:"text",value:`
322`}]}}const yz=function(t){if(t==null)return mle;if(typeof t=="function")return Gk(t);if(typeof t=="object")return Array.isArray(t)?dle(t):fle(t);if(typeof t=="string")return ple(t);throw new Error("Expected function, string, or object as test")};function dle(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=yz(t[n]);return Gk(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function fle(t){const e=t;return Gk(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function ple(t){return Gk(e);function e(n){return n&&n.type===t}}function Gk(t){return e;function e(n,r,i){return!!(gle(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function mle(){return!0}function gle(t){return t!==null&&typeof t=="object"&&"type"in t}const vz=[],yle=!0,j2=!1,vle="skip";function wle(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=yz(i),a=r?-1:1;o(t,void 0,[])();function o(l,c,h){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=vz,m,y,x;if((!e||s(l,c,h[h.length-1]||void 0))&&(p=ble(n(l,h)),p[0]===j2))return p;if("children"in l&&l.children){const v=l;if(v.children&&p[0]!==vle)for(y=(r?v.children.length:-1)+a,x=h.concat(v);y>-1&&y<v.children.length;){const w=v.children[y];if(m=o(w,y,x)(),m[0]===j2)return m;y=typeof m[1]=="number"?m[1]:y+a}}return p}}}function ble(t){return Array.isArray(t)?t:typeof t=="number"?[yle,t]:t==null?vz:[t]}function wz(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),wle(t,s,o,i);function o(l,c){const h=c[c.length-1],d=h?h.children.indexOf(l):void 0;return a(l,d,h)}}const KC={}.hasOwnProperty,xle={};function Sle(t,e){const n=e||xle,r=new Map,i=new Map,s=new Map,a={...rle,...n.handlers},o={all:c,applyData:Ale,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:kle,wrap:_le};return wz(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,f=String(h.identifier).toUpperCase();d.has(f)||d.set(f,h)}}),o;function l(h,d){const f=h.type,p=o.handlers[f];if(KC.call(o.handlers,f)&&p)return p(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:y,...x}=h,v=d1(x);return v.children=o.all(h),v}return d1(h)}return(o.options.unknownHandler||Ele)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let p=-1;for(;++p<f.length;){const m=o.one(f[p],h);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=F2(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=F2(y.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function kle(t,e){t.position&&(e.position=sse(t))}function Ale(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,d1(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ele(t,e){const n=e.data||{},r="value"in e&&!(KC.call(n,"hProperties")||KC.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function _le(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
323`});++r<t.length;)r&&n.push({type:"text",value:`
324`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
325`}),n}function F2(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function B2(t,e){const n=Sle(t,e),r=n.one(t,void 0),i=hle(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
326`},i),s}function Cle(t,e){return t&&"run"in t?async function(n,r){const i=B2(n,{file:r,...e});await t.run(i,r)}:function(n,r){return B2(n,{file:r,...t||e})}}function $2(t){if(t)throw t}var Ix=Object.prototype.hasOwnProperty,bz=Object.prototype.toString,U2=Object.defineProperty,z2=Object.getOwnPropertyDescriptor,V2=function(e){return typeof Array.isArray=="function"?Array.isArray(e):bz.call(e)==="[object Array]"},H2=function(e){if(!e||bz.call(e)!=="[object Object]")return!1;var n=Ix.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Ix.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||Ix.call(e,i)},W2=function(e,n){U2&&n.name==="__proto__"?U2(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},G2=function(e,n){if(n==="__proto__")if(Ix.call(e,n)){if(z2)return z2(e,n).value}else return;return e[n]},Tle=function t(){var e,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(e=arguments[l],e!=null)for(n in e)r=G2(o,n),i=G2(e,n),o!==i&&(h&&i&&(H2(i)||(s=V2(i)))?(s?(s=!1,a=r&&V2(r)?r:[]):a=r&&H2(r)?r:{},W2(o,{name:n,newValue:t(h,a,i)})):typeof i<"u"&&W2(o,{name:n,newValue:i}));return o};const bE=Jd(Tle);function YC(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ple(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...c){const h=t[++s];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?Nle(h,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Nle(t,e){let n;return r;function r(...a){const o=t.length>a.length;let l;o&&a.push(i);try{l=t.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const _a={basename:Rle,dirname:Ile,extname:Ole,join:Mle,sep:"/"};function Rle(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Q0(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function Ile(t){if(Q0(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Ole(t){Q0(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Mle(...t){let e=-1,n;for(;++e<t.length;)Q0(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Dle(n)}function Dle(t){Q0(t);const e=t.codePointAt(0)===47;let n=Lle(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Lle(t,e){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Q0(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const jle={cwd:Fle};function Fle(){return"/"}function XC(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Ble(t){if(typeof t=="string")t=new URL(t);else if(!XC(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return $le(t)}function $le(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const xE=["history","path","basename","stem","extname","dirname"];class xz{constructor(e){let n;e?XC(e)?n={path:e}:typeof e=="string"||Ule(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":jle.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xE.length;){const s=xE[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)xE.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?_a.basename(this.path):void 0}set basename(e){kE(e,"basename"),SE(e,"basename"),this.path=_a.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?_a.dirname(this.path):void 0}set dirname(e){q2(this.basename,"dirname"),this.path=_a.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?_a.extname(this.path):void 0}set extname(e){if(SE(e,"extname"),q2(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_a.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){XC(e)&&(e=Ble(e)),kE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?_a.basename(this.path,this.extname):void 0}set stem(e){kE(e,"stem"),SE(e,"stem"),this.path=_a.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new vr(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function SE(t,e){if(t&&t.includes(_a.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+_a.sep+"`")}function kE(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function q2(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Ule(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const zle=function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Vle={}.hasOwnProperty;class UR extends zle{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ple()}copy(){const e=new UR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(bE(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(_E("data",this.frozen),this.namespace[e]=n,this):Vle.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_E("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Vb(e),r=this.parser||this.Parser;return AE("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),AE("process",this.parser||this.Parser),EE("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Vb(e),l=r.parse(o);r.run(l,o,function(h,d,f){if(h||!d||!f)return c(h);const p=d,m=r.stringify(p,f);Gle(m)?f.value=m:f.result=m,c(h,f)});function c(h,d){h||!d?a(h):s?s(d):n(void 0,d)}}}processSync(e){let n=!1,r;return this.freeze(),AE("processSync",this.parser||this.Parser),EE("processSync",this.compiler||this.Compiler),this.process(e,i),Y2("processSync","process",n),r;function i(s,a){n=!0,$2(s),r=a}}run(e,n,r){K2(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=Vb(n);i.run(e,l,c);function c(h,d,f){const p=d||e;h?o(h):a?a(p):r(void 0,p,f)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),Y2("runSync","run",r),i;function s(a,o){$2(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=Vb(n),i=this.compiler||this.Compiler;return EE("stringify",i),K2(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(_E("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;l(h,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=bE(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[p,...m]=h;const y=r[f][1];YC(y)&&YC(p)&&(p=bE(!0,y,p)),r[f]=[c,p,...m]}}}}const Hle=new UR().freeze();function AE(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function EE(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function _E(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function K2(t){if(!YC(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Y2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Vb(t){return Wle(t)?t:new xz(t)}function Wle(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Gle(t){return typeof t=="string"||qle(t)}function qle(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Kle="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",X2=[],Q2={allowDangerousHtml:!0},Yle=/^(https?|ircs?|mailto|xmpp)$/i,Xle=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Qle(t){const e=Jle(t),n=Zle(t);return ece(e.runSync(e.parse(n),n),t)}function Jle(t){const e=t.rehypePlugins||X2,n=t.remarkPlugins||X2,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Q2}:Q2;return Hle().use(Roe).use(n).use(Cle,r).use(e)}function Zle(t){const e=t.children||"",n=new xz;return typeof e=="string"&&(n.value=e),n}function ece(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||tce;for(const h of Xle)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+Kle+h.id,void 0);return wz(t,c),use(t,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function c(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return a?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in yE)if(Object.hasOwn(yE,p)&&Object.hasOwn(h.properties,p)){const m=h.properties[p],y=yE[p];(y===null||y.includes(h.tagName))&&(h.properties[p]=l(String(m||""),p,h))}}if(h.type==="element"){let p=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(h,d,f)),p&&f&&typeof d=="number")return o&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function tce(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||Yle.test(t.slice(0,e))?t:""}const Li=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),vl=[1/0,1/0,-1/0,-1/0],oh=new Float32Array(vl),QC=[.001,0,0,.001,0,0],CE=1.35,Mi={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},tc={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},$v="pdfjs_internal_editor_",xe={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102}
326,Te={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},nce={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},An={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_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},Ox={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},dn={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},Tf={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},qk={ERRORS:0,WARNINGS:1,INFOS:5},Oo={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},Xg={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},rce={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Kk=qk.WARNINGS;function ice(t){Number.isInteger(t)&&(Kk=t)}function sce(){return Kk}function Yk(t){Kk>=qk.INFOS&&console.info(`Info: ${t}`)}function _e(t){Kk>=qk.WARNINGS&&console.warn(`Warning: ${t}`)}function Ze(t){throw new Error(t)}function Vt(t,e){t||Ze(e)}function ace(t){switch(t==null?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Sz(t,e=null,n=null){if(!t)return null;if(n&&typeof t=="string"){if(n.addDefaultProtocol&&t.startsWith("www.")){const i=t.match(/\./g);(i==null?void 0:i.length)>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=uce(t)}catch{}}const r=e?URL.parse(t,e):URL.parse(t);return ace(r)?r:null}function kz(t,e,n=!1){const r=URL.parse(t);return r?(r.hash=e,r.href):n&&Sz(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function JC(t){return t.substring(t.lastIndexOf("/")+1)}function Se(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const af=function(){function e(n,r){this.message=n,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class J2 extends af{constructor(e,n){super(e,"PasswordException"),this.code=n}}class TE extends af{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class ZC extends af{constructor(e){super(e,"InvalidPDFException")}}class f1 extends af{constructor(e,n,r){super(e,"ResponseException"),this.status=n,this.missing=r}}class oce extends af{constructor(e){super(e,"FormatError")}}class Au extends af{constructor(e){super(e,"AbortException")}}function lce(t){(typeof t!="object"||(t==null?void 0:t.length)===void 0)&&Ze("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let i=0;i<e;i+=n){const s=Math.min(i+n,e),a=t.subarray(i,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function Xk(t){typeof t!="string"&&Ze("Invalid argument for stringToBytes");const e=t.length,n=new Uint8Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r)&255;return n}function cce(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}class bn{static get isLittleEndian(){return Se(this,"isLittleEndian",cce())}static get isOffscreenCanvasSupported(){return Se(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Se(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Se(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Se(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:n}=navigator;return Se(this,"platform",{isAndroid:n.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:n.includes("Firefox")})}static get isCSSRoundSupported(){var e,n;return Se(this,"isCSSRoundSupported",(n=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:n.call(e,"width: round(1.5px, 1px)"))}static get isAlphaColorInputSupported(){return Se(this,"isAlphaColorInputSupported",(()=>{if(typeof document>"u")return!1;const e=document.createElement("input");return e.type="color",e.setAttribute("alpha",""),e.value="#ff000080",e.value!=="#ff0000"})())}}var xl,Mx,eT;class Q{static get hexNums(){return Se(this,"hexNums",Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0")))}static makeHexColor(e,n,r){return`#${this.hexNums[e]}${this.hexNums[n]}${this.hexNums[r]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,n){let r;e[0]?(e[0]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[0],n[2]*=e[0],e[3]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[3],n[3]*=e[3]):(r=n[0],n[0]=n[1],n[1]=r,r=n[2],n[2]=n[3],n[3]=r,e[1]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=e[1],n[3]*=e[1],e[2]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=e[2],n[2]*=e[2]),n[0]+=e[4],n[1]+=e[5],n[2]+=e[4],n[3]+=e[5]}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static multiplyByDOMMatrix(e,n){return[e[0]*n.a+e[2]*n.b,e[1]*n.a+e[3]*n.b,e[0]*n.c+e[2]*n.d,e[1]*n.c+e[3]*n.d,e[0]*n.e+e[2]*n.f+e[4],e[1]*n.e+e[3]*n.f+e[5]]}static applyTransform(e,n,r=0){const i=e[r],s=e[r+1];e[r]=i*n[0]+s*n[2]+n[4],e[r+1]=i*n[1]+s*n[3]+n[5]}
326static applyTransformToBezier(e,n,r=0){const i=n[0],s=n[1],a=n[2],o=n[3],l=n[4],c=n[5];for(let h=0;h<6;h+=2){const d=e[r+h],f=e[r+h+1];e[r+h]=d*i+f*a+l,e[r+h+1]=d*s+f*o+c}}static applyInverseTransform(e,n){const r=e[0],i=e[1],s=n[0]*n[3]-n[1]*n[2];e[0]=(r*n[3]-i*n[2]+n[2]*n[5]-n[4]*n[3])/s,e[1]=(-r*n[1]+i*n[0]+n[4]*n[1]-n[5]*n[0])/s}static axialAlignedBoundingBox(e,n,r){const i=n[0],s=n[1],a=n[2],o=n[3],l=n[4],c=n[5],h=e[0],d=e[1],f=e[2],p=e[3];let m=i*h+l,y=m,x=i*f+l,v=x,w=o*d+c,b=w,k=o*p+c,_=k;if(s!==0||a!==0){const C=s*h,P=s*f,R=a*d,O=a*p;m+=R,v+=R,x+=O,y+=O,w+=C,_+=C,k+=P,b+=P}r[0]=Math.min(r[0],m,x,y,v),r[1]=Math.min(r[1],w,k,b,_),r[2]=Math.max(r[2],m,x,y,v),r[3]=Math.max(r[3],w,k,b,_)}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static singularValueDecompose2dScale(e,n){const r=e[0],i=e[1],s=e[2],a=e[3],o=r**2+i**2,l=r*s+i*a,c=s**2+a**2,h=(o+c)/2,d=Math.sqrt(h**2-(o*c-l**2));n[0]=Math.sqrt(h+d||1),n[1]=Math.sqrt(h-d||1)}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){const r=Math.max(Math.min(e[0],e[2]),Math.min(n[0],n[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(n[0],n[2]));if(r>i)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(n[1],n[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(n[1],n[3]));return s>a?null:[r,s,i,a]}static pointBoundingBox(e,n,r){r[0]=Math.min(r[0],e),r[1]=Math.min(r[1],n),r[2]=Math.max(r[2],e),r[3]=Math.max(r[3],n)}static rectBoundingBox(e,n,r,i,s){s[0]=Math.min(s[0],e,r),s[1]=Math.min(s[1],n,i),s[2]=Math.max(s[2],e,r),s[3]=Math.max(s[3],n,i)}static bezierBoundingBox(e,n,r,i,s,a,o,l,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],n,l),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],n,l),T(this,xl,eT).call(this,e,r,s,o,n,i,a,l,3*(-e+3*(r-s)+o),6*(e-2*r+s),3*(r-e),c),T(this,xl,eT).call(this,e,r,s,o,n,i,a,l,3*(-n+3*(i-a)+l),6*(n-2*i+a),3*(i-n),c)}}xl=new WeakSet,Mx=function(e,n,r,i,s,a,o,l,c,h){if(c<=0||c>=1)return;const d=1-c,f=c*c,p=f*c,m=d*(d*(d*e+3*c*n)+3*f*r)+p*i,y=d*(d*(d*s+3*c*a)+3*f*o)+p*l;h[0]=Math.min(h[0],m),h[1]=Math.min(h[1],y),h[2]=Math.max(h[2],m),h[3]=Math.max(h[3],y)},eT=function(e,n,r,i,s,a,o,l,c,h,d,f){if(Math.abs(c)<1e-12){Math.abs(h)>=1e-12&&T(this,xl,Mx).call(this,e,n,r,i,s,a,o,l,-d/h,f);return}const p=h**2-4*d*c;if(p<0)return;const m=Math.sqrt(p),y=2*c;T(this,xl,Mx).call(this,e,n,r,i,s,a,o,l,(-h+m)/y,f),T(this,xl,Mx).call(this,e,n,r,i,s,a,o,l,(-h-m)/y,f)},E(Q,xl);function uce(t){return decodeURIComponent(escape(t))}let PE=null,Z2=null;function hce(t){return PE||(PE=/([\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,Z2=new Map([["ſt","ſt"]])),t.replaceAll(PE,(e,n,r)=>n?n.normalize("NFKC"):Z2.get(r))}function Az(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),lce(t)}const ep="pdfjs_internal_id_";function dce(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;const[r,i,...s]=n;if(!t(r)&&!Number.isInteger(r)||!e(i))return!1;const a=s.length;let o=!0;switch(i.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of s)if(!(typeof l=="number"||o&&l===null))return!1;return!0}const zR=()=>[],VR=()=>new Map,tT=()=>Object.create(null);function Dt(t,e,n){return Math.min(Math.max(t,e),n)}class Uv{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function i(s){var l;if(!s)return;let a=null;const o=s.name;if(o==="#text")a=s.value;else if(Uv.shouldBuildText(o))(l=s==null?void 0:s.attributes)!=null&&l.textContent?a=s.attributes.textContent:s.value&&(
326a=s.value);else return;if(a!==null&&n.push({str:a}),!!s.children)for(const c of s.children)i(c)}return i(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class Ez{static setupStorage(e,n,r,i,s){const a=i.getValue(n,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(n,{value:o.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",o=>{i.setValue(n,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),s==="print")break;e.addEventListener("input",o=>{i.setValue(n,{value:o.target.value})})}break;case"select":if(a.value!==null){e.setAttribute("value",a.value);for(const o of r.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;i.setValue(n,{value:c})});break}}static setAttributes({html:e,element:n,storage:r=null,intent:i,linkService:s}){const{attributes:a}=n,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${i}`);for(const[l,c]of Object.entries(a))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}o&&s.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(e){var d,f;const n=e.annotationStorage,r=e.linkService,i=e.xfaHtml,s=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:s,linkService:r});const o=s!=="richText",l=e.div;if(l.append(a),e.viewport){const p=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=p}o&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(i.children.length===0){if(i.value){const p=document.createTextNode(i.value);a.append(p),o&&Uv.shouldBuildText(i.name)&&c.push(p)}return{textDivs:c}}const h=[[i,-1,a]];for(;h.length>0;){const[p,m,y]=h.at(-1);if(m+1===p.children.length){h.pop();continue}const x=p.children[++h.at(-1)[1]];if(x===null)continue;const{name:v}=x;if(v==="#text"){const b=document.createTextNode(x.value);c.push(b),y.append(b);continue}const w=(d=x==null?void 0:x.attributes)!=null&&d.xmlns?document.createElementNS(x.attributes.xmlns,v):document.createElement(v);if(y.append(w),x.attributes&&this.setAttributes({html:w,element:x,storage:n,intent:s,linkService:r}),((f=x.children)==null?void 0:f.length)>0)h.push([x,-1,w]);else if(x.value){const b=document.createTextNode(x.value);o&&Uv.shouldBuildText(v)&&c.push(b),w.append(b)}}for(const p of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))p.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const Ao="http://www.w3.org/2000/svg",Xu=class Xu{};F(Xu,"CSS",96),F(Xu,"PDF",72),F(Xu,"PDF_TO_CSS_UNITS",Xu.CSS/Xu.PDF);let Eu=Xu;async function HR(t,e="text"){if(tv(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"blob":return n.blob();case"bytes":return n.bytes();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType=e==="bytes"?"arraybuffer":e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"bytes":n(new Uint8Array(i.response));return;case"blob":case"json":n(i.response);return}n(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}class J0{constructor({viewBox:e,userUnit:n,scale:r,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=n,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=a,r*=n;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let h,d,f,p;switch(i%=360,i<0&&(i+=360),i){case 180:h=-1,d=0,f=0,p=1;break;case 90:h=0,d=1,f=1,p=0;break;case 270:h=0,d=-1,f=-1,p=0;break;case 0:h=1,d=0,f=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(f=-f,p=-p);let m,y,x,v;h===0?(m=Math.abs(c-e[1])*r+s,y=Math.abs(l-e[0])*r+a,x=(e[3]-e[1])*r,v=(e[2]-e[0])*r):(m=Math.abs(l-e[0])*r+s,y=Math.abs(c-e[1])*r+a,x=(e[2]-e[0])*r,v=(e[3]-e[1])*r),this.transform=[h*r,d*r,f*r,p*r,m-h*r*l-f*r*c,y-d*r*l-p*r*c],this.width=x,this.height=v}get rawDims(){const e=this.viewBox;return Se(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}={}){return new J0({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:n,offsetX:r,offsetY:i,dontFlip:s}
326)}convertToViewportPoint(e,n){const r=[e,n];return Q.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const n=[e[0],e[1]];Q.applyTransform(n,this.transform);const r=[e[2],e[3]];return Q.applyTransform(r,this.transform),[n[0],n[1],r[0],r[1]]}convertToPdfPoint(e,n){const r=[e,n];return Q.applyInverseTransform(r,this.transform),r}}class WR extends af{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function Qk(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function GR(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function fce(t){return[t]=t.split(/[#?]/,1),JC(t)}function pce(t,e="document.pdf"){if(typeof t!="string")return e;if(Qk(t))return _e('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const r=(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}}}}})(t);if(!r)return e;const i=o=>{try{let l=decodeURIComponent(o);return l.includes("/")&&(l=JC(l),/^\.pdf$/i.test(l))?o:l}catch{return o}},s=/\.pdf$/i,a=JC(r.pathname);if(s.test(a))return i(a);if(r.searchParams.size>0){const o=c=>[...c].findLast(h=>s.test(h)),l=o(r.searchParams.values())??o(r.searchParams.keys());if(l)return i(l)}if(r.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(l)return i(l[0])}return e}var oc;class eL{constructor(){E(this,oc,new Map);F(this,"times",[])}time(e){u(this,oc).has(e)&&_e(`Timer is already running for ${e}`),u(this,oc).set(e,Date.now())}timeEnd(e){u(this,oc).has(e)||_e(`Timer has not been started for ${e}`),this.times.push({name:e,start:u(this,oc).get(e),end:Date.now()}),u(this,oc).delete(e)}toString(){const e=Math.max(...this.times.map(n=>n.name.length));return this.times.map(n=>`${n.name.padEnd(e)} ${n.end-n.start}ms
327`).join("")}}oc=new WeakMap;function tv(t,e){const n=e?URL.parse(t,e):URL.parse(t);return/https?:/.test((n==null?void 0:n.protocol)??"")}function _s(t){t.preventDefault()}function zt(t){t.preventDefault(),t.stopPropagation()}function mce(t){console.log("Deprecated API usage: "+t)}var Jv;class p1{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;u(this,Jv)||S(this,Jv,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=u(this,Jv).exec(e);if(!n)return null;const r=parseInt(n[1],10);let i=parseInt(n[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(n[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(n[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(n[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(n[6],10);l=l>=0&&l<=59?l:0;const c=n[7]||"Z";let h=parseInt(n[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(n[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(a+=h,o+=d):c==="+"&&(a-=h,o-=d),new Date(Date.UTC(r,i,s,a,o,l))}}Jv=new WeakMap,E(p1,Jv);function gce(t,{scale:e=1,rotation:n=0}){const{width:r,height:i}=t.attributes.style,s=[0,0,parseInt(r,10),parseInt(i,10)];return new J0({viewBox:s,userUnit:1,scale:e,rotation:n})}function qR(t){if(t.startsWith("#")){const n=t.slice(1);return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),n.length>=8?parseInt(n.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){const[n,r,i]=t.slice(4,-1).split(",").map(s=>parseInt(s,10));return[n,r,i,1]}if(t.startsWith("rgba(")){const n=t.slice(5,-1).split(",");return[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10),parseFloat(n[3])]}const e=t.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 Z0(t){const e=qR(t);return e?e.slice(0,3):(_e(`Not a valid color format: "${t}"`),[0,0,0])}function yce(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const n of t.keys()){e.style.color=n;const r=window.getComputedStyle(e).color;t.set(n,Z0(r))}e.remove()}function Tt(t){const{a:e,b:n,c:r,d:i,e:s,f:a}=t.getTransform();return[e,n,r,i,s,a]}function ba(t){const{a:e,b:n,c:r,d:i,e:s,f:a}=t.getTransform().invertSelf();return[e,n,r,i,s,a]}function Gd(t,e,n=!1,r=!0){if(e instanceof J0){const{pageWidth:i,pageHeight:s}=e.rawDims,{style:a}=t,o=bn.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${s}px`,h=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,d=o?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!n||e.rotation%180===0?(a.width=h,a.height=d):(a.width=d,a.height=h)}r&&t.setAttribute("data-main-rotation",e.rotation)}class go{constructor(){const{pixelRatio:e}=go;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,n,r,i,s=-1){let a=1/0,o=1/0,l=1/0;r=go.capPixels(r,s),r>0&&(a=Math.sqrt(r/(e*n))),i!==-1&&(o=i/e,l=i/n);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,n){if(n>
327=0){const r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+n/100));return e>0?Math.min(e,r):r}return e}}const nT=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class vce{static get isDarkMode(){var e;return Se(this,"isDarkMode",!!((e=window==null?void 0:window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches))}}class wce{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:n}=e;n.width=n.height="0",n.display="none",n.color="var(--comment-fg-color)",document.body.append(e);const{color:r}=window.getComputedStyle(e);return e.remove(),Se(this,"commentForegroundColor",Z0(r))}}function bce(t,e){e=Dt(e??1,0,1);const n=255*(1-e);return t.map(r=>Math.round(r*e+n))}function tL(t,e){const n=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=(s+a)/2;if(s===a)e[0]=e[1]=0;else{const l=s-a;switch(e[1]=o<.5?l/(s+a):l/(2-s-a),s){case n:e[0]=((r-i)/l+(r<i?6:0))*60;break;case r:e[0]=((i-n)/l+2)*60;break;case i:e[0]=((n-r)/l+4)*60;break}}e[2]=o}function rT(t,e){const n=t[0],r=t[1],i=t[2],s=(1-Math.abs(2*i-1))*r,a=s*(1-Math.abs(n/60%2-1)),o=i-s/2;switch(Math.floor(n/60)){case 0:e[0]=s+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=s+o,e[2]=o;break;case 2:e[0]=o,e[1]=s+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=s+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=s+o;break;case 5:case 6:e[0]=s+o,e[1]=o,e[2]=a+o;break}}function nL(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function rL(t,e,n){rT(t,n),n.map(nL);const r=.2126*n[0]+.7152*n[1]+.0722*n[2];rT(e,n),n.map(nL);const i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}const iL=new Map;function xce(t,e){const n=t[0]+t[1]*256+t[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let r=iL.get(n);if(r)return r;const i=new Float32Array(9),s=i.subarray(0,3),a=i.subarray(3,6);tL(t,a);const o=i.subarray(6,9);tL(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]),rL(a,o,s)<c){let h,d;l?(h=a[2],d=1):(h=0,d=a[2]);const f=.005;for(;d-h>f;){const p=a[2]=(h+d)/2;l===rL(a,o,s)<c?h=p:d=p}a[2]=l?d:h}return rT(a,s),r=Q.makeHexColor(Math.round(s[0]*255),Math.round(s[1]*255),Math.round(s[2]*255)),iL.set(n,r),r}function _z({html:t,dir:e,className:n},r){const i=document.createDocumentFragment();if(typeof t=="string"){const s=document.createElement("p");s.dir=e||"auto";const a=t.split(/(?:\r\n?|\n)/);for(let o=0,l=a.length;o<l;++o){const c=a[o];s.append(document.createTextNode(c)),o<l-1&&s.append(document.createElement("br"))}i.append(s)}else Ez.render({xfaHtml:t,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",n),r.append(i)}function Cz(t){const e=new Path2D;if(!t)return e;for(let n=0,r=t.length;n<r;)switch(t[n++]){case Xg.moveTo:e.moveTo(t[n++],t[n++]);break;case Xg.lineTo:e.lineTo(t[n++],t[n++]);break;case Xg.curveTo:e.bezierCurveTo(t[n++],t[n++],t[n++],t[n++],t[n++],t[n++]);break;case Xg.quadraticCurveTo:e.quadraticCurveTo(t[n++],t[n++],t[n++],t[n++]);break;case Xg.closePath:e.closePath();break;default:_e(`Unrecognized drawing path operator: ${t[n-1]}`);break}return e}var lc,cc,ns,rs,Zv,uc,Tp,Pp,ew,N1,Tz,tr,Pz,Nz,Pf,cy;const No=class No{constructor(e){E(this,tr);E(this,lc,null);E(this,cc,null);E(this,ns);E(this,rs,null);E(this,Zv,null);E(this,uc,null);E(this,Tp,null);E(this,Pp,null);S(this,ns,e),u(No,ew)||S(No,ew,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=S(this,lc,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const n=u(this,ns)._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(e.addEventListener("contextmenu",_s,{signal:n}),e.addEventListener("pointerdown",T(No,N1,Tz),{signal:n}));const r=S(this,rs,document.createElement("div"));r.className="buttons",e.append(r);const i=u(this,ns).toolbarPosition;if(i){const{style:s}=e,a=u(this,ns)._uiManager.direction==="ltr"?1-i[0]:i[0];s.insetInlineEnd=`${100*a}%`,s.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return u(this,lc)}hide(){var e;u(this,lc).classList.add("hidden"),(e=u(this,cc))==null||e.hideDropdown()}show(){var e,n;u(this,lc).classList.remove("hidden"),(e=u(this,Zv))==null||e.shown(),(n=u(this,uc))==null||n.shown()}
327addDeleteButton(){const{editorType:e,_uiManager:n}=u(this,ns),r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",u(No,ew)[e]),T(this,tr,Pf).call(this,r)&&r.addEventListener("click",i=>{n.delete()},{signal:n._signal}),u(this,rs).append(r)}async addAltText(e){const n=await e.render();T(this,tr,Pf).call(this,n),u(this,rs).append(n,u(this,tr,cy)),S(this,Zv,e)}addComment(e,n=null){if(u(this,uc))return;const r=e.renderForToolbar();if(!r)return;T(this,tr,Pf).call(this,r);const i=S(this,Tp,u(this,tr,cy));n?(u(this,rs).insertBefore(r,n),u(this,rs).insertBefore(i,n)):u(this,rs).append(r,i),S(this,uc,e),e.toolbar=this}addColorPicker(e){if(u(this,cc))return;S(this,cc,e);const n=e.renderButton();T(this,tr,Pf).call(this,n),u(this,rs).append(n,u(this,tr,cy))}async addEditSignatureButton(e){const n=S(this,Pp,await e.renderEditButton(u(this,ns)));T(this,tr,Pf).call(this,n),u(this,rs).append(n,u(this,tr,cy))}removeButton(e){var n,r;switch(e){case"comment":(n=u(this,uc))==null||n.removeToolbarCommentButton(),S(this,uc,null),(r=u(this,Tp))==null||r.remove(),S(this,Tp,null);break}}async addButton(e,n){switch(e){case"colorPicker":n&&this.addColorPicker(n);break;case"altText":n&&await this.addAltText(n);break;case"editSignature":n&&await this.addEditSignatureButton(n);break;case"delete":this.addDeleteButton();break;case"comment":n&&this.addComment(n);break}}async addButtonBefore(e,n,r){if(!n&&e==="comment")return;const i=u(this,rs).querySelector(r);i&&e==="comment"&&this.addComment(n,i)}updateEditSignatureButton(e){u(this,Pp)&&(u(this,Pp).title=e)}remove(){var e;u(this,lc).remove(),(e=u(this,cc))==null||e.destroy(),S(this,cc,null)}};lc=new WeakMap,cc=new WeakMap,ns=new WeakMap,rs=new WeakMap,Zv=new WeakMap,uc=new WeakMap,Tp=new WeakMap,Pp=new WeakMap,ew=new WeakMap,N1=new WeakSet,Tz=function(e){e.stopPropagation()},tr=new WeakSet,Pz=function(e){u(this,ns)._focusEventsAllowed=!1,zt(e)},Nz=function(e){u(this,ns)._focusEventsAllowed=!0,zt(e)},Pf=function(e){const n=u(this,ns)._uiManager._signal;return!(n instanceof AbortSignal)||n.aborted?!1:(e.addEventListener("focusin",T(this,tr,Pz).bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",T(this,tr,Nz).bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",_s,{signal:n}),!0)},cy=function(){const e=document.createElement("div");return e.className="divider",e},E(No,N1),E(No,ew,null);let iT=No;var tw,fh,Mo,Nl,Rz,Iz,sT;class Sce{constructor(e){E(this,Nl);E(this,tw,null);E(this,fh,null);E(this,Mo);S(this,Mo,e)}show(e,n,r){const[i,s]=T(this,Nl,Iz).call(this,n,r),{style:a}=u(this,fh)||S(this,fh,T(this,Nl,Rz).call(this));e.append(u(this,fh)),a.insetInlineEnd=`${100*i}%`,a.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){u(this,fh).remove()}}tw=new WeakMap,fh=new WeakMap,Mo=new WeakMap,Nl=new WeakSet,Rz=function(){const e=S(this,fh,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const n=u(this,Mo)._signal;n instanceof AbortSignal&&!n.aborted&&e.addEventListener("contextmenu",_s,{signal:n});const r=S(this,tw,document.createElement("div"));return r.className="buttons",e.append(r),u(this,Mo).hasCommentManager()&&T(this,Nl,sT).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{u(this,Mo).commentSelection("floating_button")}),T(this,Nl,sT).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{u(this,Mo).highlightSelection("floating_button")}),e},Iz=function(e,n){let r=0,i=0;for(const s of e){const a=s.y+s.height;if(a<r)continue;const o=s.x+(n?s.width:0);if(a>r){i=o,r=a;continue}n?o>i&&(i=o):o<i&&(i=o)}return[n?1-i:i,r]},sT=function(e,n,r,i){const s=document.createElement("button");s.classList.add("basic",e),s.tabIndex=0,s.setAttribute("data-l10n-id",n);const a=document.createElement("span");s.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",r);const o=u(this,Mo)._signal;o instanceof AbortSignal&&!o.aborted&&(s.addEventListener("contextmenu",_s,{signal:o}),s.addEventListener("click",i,{signal:o})),u(this,tw).append(s)};function Oz(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}var ph,mh,Np,gh;const ot=class ot{static initializeAndAddPointerId(e){(u(ot,mh)||S(ot,mh,new Set)).add(e)}static setPointer(e,n){u(ot,ph)||S(ot,ph,n),u(ot,gh)??S(ot,gh,e)}static setTimeStamp(e){S(ot,Np,e)}static isSamePointerId(e){return u(ot,ph)===e}static isSamePointerIdOrRemove(e){var n;return u(ot,ph)===e?!0:((n=u(ot,mh))==null||n.delete(e),!1)}static isSamePointerType(e){return u(ot,gh)===e}static isInitializedAndDifferentPointerType(e){return u(ot,gh)!==null&&!ot.isSamePointerType(e)}static isSameTimeStamp(e){return u(ot,Np)===e}static isUsingMultiplePointers(){var e;return((e=u(ot,mh))==null?void 0:e.size)>=1}static clearPointerType(){S(ot,gh,null)}static clearPointerIds(){S(ot,ph,NaN),S(ot,mh,null)}static clearTimeStamp(){S(ot,Np,NaN)}};ph=new WeakMap,mh=new WeakMap,Np=new WeakMap,gh=new WeakMap,E(ot,ph,NaN),E(ot,mh,null),E(ot,Np,NaN),E(ot,gh,null);let cr=ot;var R1;class kce{constructor(){E(this,R1,0)}get id(){return`${$v}${jt(this,R1)._++}`}}R1=new WeakMap;var Rp,nw,hr,Ip,Dx;const aI=class aI{constructor(){E(this,Ip);E(this,Rp,Az());E(this,nw,0);E(this,hr,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;const s=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Se(this,"_isSVGFittingCanvas",s)}async getFromFile(e){const{lastModified:n,name:r,size:i,type:s}=e;return T(this,Ip,Dx).call(this,`${n}_${r}_${i}_${s}`,e)}async getFromUrl(e){return T(this,Ip,Dx).call(this,e,e)}async getFromBlob(e,n){const r=await n;return T(this,Ip,Dx).call(this,e,r)}async getFromId(e){u(this,hr)||S(this,hr,new Map);const n=u(this,hr).get(e);if(!n)return null;if(n.bitmap)return n.refCounter+=1,n;if(n.file)return this.getFromFile(n.file);if(n.blobPromise){const{blobPromise:r}=n;return delete n.blobPromise,this.getFromBlob(n.id,r)}return this.getFromUrl(n.url)}getFromCanvas(e,n){u(this,hr)||S(this,hr,new Map);let r=u(this,hr).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const i=new OffscreenCanvas(n.width,n.height);
327return i.getContext("2d").drawImage(n,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${u(this,Rp)}_${jt(this,nw)._++}`,refCounter:1,isSvg:!1},u(this,hr).set(e,r),u(this,hr).set(r.id,r),r}getSvgUrl(e){const n=u(this,hr).get(e);return n!=null&&n.isSvg?n.svgUrl:null}deleteId(e){var i;u(this,hr)||S(this,hr,new Map);const n=u(this,hr).get(e);if(!n||(n.refCounter-=1,n.refCounter!==0))return;const{bitmap:r}=n;if(!n.url&&!n.file){const s=new OffscreenCanvas(r.width,r.height);s.getContext("bitmaprenderer").transferFromImageBitmap(r),n.blobPromise=s.convertToBlob()}(i=r.close)==null||i.call(r),n.bitmap=null}isValidId(e){return e.startsWith(`image_${u(this,Rp)}_`)}};Rp=new WeakMap,nw=new WeakMap,hr=new WeakMap,Ip=new WeakSet,Dx=async function(e,n){u(this,hr)||S(this,hr,new Map);let r=u(this,hr).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${u(this,Rp)}_${jt(this,nw)._++}`,refCounter:0,isSvg:!1});let i;if(typeof n=="string"?(r.url=n,i=await HR(n,"blob")):n instanceof File?i=r.file=n:n instanceof Blob&&(i=n),i.type==="image/svg+xml"){const s=aI._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((c,h)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,c()},a.onload=async()=>{const d=r.svgUrl=a.result;o.src=await s?`${d}#svgView(preserveAspectRatio(none))`:d},o.onerror=a.onerror=h});a.readAsDataURL(i),await l}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){_e(i),r=null}return u(this,hr).set(e,r),r&&u(this,hr).set(r.id,r),r};let aT=aI;var an,hc,rw,Ft;class Ace{constructor(e=128){E(this,an,[]);E(this,hc,!1);E(this,rw);E(this,Ft,-1);S(this,rw,e)}add({cmd:e,undo:n,post:r,mustExec:i,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(i&&e(),u(this,hc))return;const l={cmd:e,undo:n,post:r,type:s};if(u(this,Ft)===-1){u(this,an).length>0&&(u(this,an).length=0),S(this,Ft,0),u(this,an).push(l);return}if(a&&u(this,an)[u(this,Ft)].type===s){o&&(l.undo=u(this,an)[u(this,Ft)].undo),u(this,an)[u(this,Ft)]=l;return}const c=u(this,Ft)+1;c===u(this,rw)?u(this,an).splice(0,1):(S(this,Ft,c),c<u(this,an).length&&u(this,an).splice(c)),u(this,an).push(l)}undo(){if(u(this,Ft)===-1)return;S(this,hc,!0);const{undo:e,post:n}=u(this,an)[u(this,Ft)];e(),n==null||n(),S(this,hc,!1),S(this,Ft,u(this,Ft)-1)}redo(){if(u(this,Ft)<u(this,an).length-1){S(this,Ft,u(this,Ft)+1),S(this,hc,!0);const{cmd:e,post:n}=u(this,an)[u(this,Ft)];e(),n==null||n(),S(this,hc,!1)}}hasSomethingToUndo(){return u(this,Ft)!==-1}hasSomethingToRedo(){return u(this,Ft)<u(this,an).length-1}cleanType(e){if(u(this,Ft)!==-1){for(let n=u(this,Ft);n>=0;n--)if(u(this,an)[n].type!==e){u(this,an).splice(n+1,u(this,Ft)-n),S(this,Ft,n);return}u(this,an).length=0,S(this,Ft,-1)}}destroy(){S(this,an,null)}}an=new WeakMap,hc=new WeakMap,rw=new WeakMap,Ft=new WeakMap;var I1,Mz;class eb{constructor(e){E(this,I1);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=bn.platform;for(const[r,i,s={}]of e)for(const a of r){const o=a.startsWith("mac+");n&&o?(this.callbacks.set(a.slice(4),{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1))):!n&&!o&&(this.callbacks.set(a,{callback:i,options:s}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(T(this,I1,Mz).call(this,n));if(!r)return;const{callback:i,options:{bubbles:s=!1,args:a=[],checker:o=null}}=r;o&&!o(e,n)||(i.bind(e,...a,n)(),s||zt(n))}}I1=new WeakSet,Mz=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 n=this.buffer.join("+");return this.buffer.length=0,n};const O1=class O1{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return yce(e),Se(this,"_colors",e)}convert(e){const n=Z0(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,i]of this._colors)if(i.every((s,a)=>s===n[a]))return O1._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?Q.makeHexColor(...n):e}};F(O1,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let oT=O1;var Op,gi,Mp,Xt,Bt,Dp,Lp,kr,jp,is,In,dc,fc,pc,mc,Ia,ss,yh,iw,sw,Fp,aw,Oa,gc,Bp,yc,Ma,M1,Do,$p,ow,vc,vh,Up,wc,lw,fn,tt,Lo,bc,xc,cw,zp,uw,Sc,Da,jo,hw,dw,as,ee,Lx,lT,Dz,Lz,jz,uy,Fz,Bz,$z,cT,Uz,zz,Vz,Hz,br,Eo,Wz,Gz,uT,qz,hy,hT;
327const tp=class tp{constructor(e,n,r,i,s,a,o,l,c,h,d,f,p,m,y,x){E(this,ee);E(this,Op,new AbortController);E(this,gi,null);E(this,Mp,null);E(this,Xt,new Map);E(this,Bt,new Map);E(this,Dp,null);E(this,Lp,null);E(this,kr,null);E(this,jp,null);E(this,is,new Ace);E(this,In,null);E(this,dc,null);E(this,fc,null);E(this,pc,0);E(this,mc,new Set);E(this,Ia,null);E(this,ss,null);E(this,yh,new Set);F(this,"_editorUndoBar",null);E(this,iw,!1);E(this,sw,!1);E(this,Fp,!1);E(this,aw,null);E(this,Oa,null);E(this,gc,null);E(this,Bp,null);E(this,yc,!1);E(this,Ma,null);E(this,M1,new kce);E(this,Do,!1);E(this,$p,!1);E(this,ow,!1);E(this,vc,null);E(this,vh,null);E(this,Up,null);E(this,wc,null);E(this,lw,null);E(this,fn,xe.NONE);E(this,tt,new Set);E(this,Lo,null);E(this,bc,null);E(this,xc,null);E(this,cw,null);E(this,zp,null);E(this,uw,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});E(this,Sc,[0,0]);E(this,Da,null);E(this,jo,null);E(this,hw,null);E(this,dw,null);E(this,as,null);const v=this._signal=u(this,Op).signal;S(this,jo,e),S(this,hw,n),S(this,dw,r),S(this,Lp,i),S(this,In,s),S(this,bc,a),S(this,zp,l),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:v}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:v}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:v}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:v}),o._on("setpreference",this.onSetPreference.bind(this),{signal:v}),o._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:v}),window.addEventListener("pointerdown",()=>{S(this,$p,!0)},{capture:!0,signal:v}),window.addEventListener("pointerup",()=>{S(this,$p,!1)},{capture:!0,signal:v}),window.addEventListener("beforeunload",T(this,ee,Dz).bind(this),{capture:!0,signal:v}),T(this,ee,Fz).call(this),T(this,ee,Hz).call(this),T(this,ee,cT).call(this),S(this,kr,l.annotationStorage),S(this,aw,l.filterFactory),S(this,xc,c),S(this,Bp,h||null),S(this,iw,d),S(this,sw,f),S(this,Fp,p),S(this,lw,m||null),this.viewParameters={realScale:Eu.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=y||null,this._supportsPinchToZoom=x!==!1,s==null||s.setSidebarUiManager(this)}static get _keyboardManager(){const e=tp.prototype,n=a=>u(a,jo).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:l}=o;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Se(this,"_keyboardManager",new eb([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["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:r}
327],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&u(a,jo).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&u(a,jo).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:n}]]))}destroy(){var e,n,r,i,s,a,o,l,c;(e=u(this,as))==null||e.resolve(),S(this,as,null),(n=u(this,Op))==null||n.abort(),S(this,Op,null),this._signal=null;for(const h of u(this,Bt).values())h.destroy();u(this,Bt).clear(),u(this,Xt).clear(),u(this,yh).clear(),(r=u(this,wc))==null||r.clear(),S(this,gi,null),u(this,tt).clear(),u(this,is).destroy(),(i=u(this,Lp))==null||i.destroy(),(s=u(this,In))==null||s.destroy(),(a=u(this,bc))==null||a.destroy(),(o=u(this,Ma))==null||o.hide(),S(this,Ma,null),(l=u(this,Up))==null||l.destroy(),S(this,Up,null),S(this,Mp,null),u(this,Oa)&&(clearTimeout(u(this,Oa)),S(this,Oa,null)),u(this,Da)&&(clearTimeout(u(this,Da)),S(this,Da,null)),(c=this._editorUndoBar)==null||c.destroy(),S(this,zp,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return u(this,lw)}get useNewAltTextFlow(){return u(this,sw)}get useNewAltTextWhenAddingImage(){return u(this,Fp)}get hcmFilter(){return Se(this,"hcmFilter",u(this,xc)?u(this,aw).addHCMFilter(u(this,xc).foreground,u(this,xc).background):"none")}get direction(){return Se(this,"direction",getComputedStyle(u(this,jo)).direction)}get _highlightColors(){return Se(this,"_highlightColors",u(this,Bp)?new Map(u(this,Bp).split(",").map(e=>(e=e.split("=").map(n=>n.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return Se(this,"highlightColors",null);const n=new Map,r=!!u(this,xc);for(const[i,s]of e){const a=i.endsWith("_HCM");if(r&&a){n.set(i.replace("_HCM",""),s);continue}!r&&!a&&n.set(i,s)}return Se(this,"highlightColors",n)}get highlightColorNames(){return Se(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const n=this.highlightColorNames.get(e);return this._highlightColors.get(n)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),S(this,fc,e)}setMainHighlightColorPicker(e){S(this,Up,e)}editAltText(e,n=!1){var r;(r=u(this,Lp))==null||r.editAltText(this,e,n)}hasCommentManager(){return!!u(this,In)}editComment(e,n,r,i){var s;(s=u(this,In))==null||s.showDialog(this,e,n,r,i)}selectComment(e,n){const r=u(this,Bt).get(e),i=r==null?void 0:r.getEditorByUID(n);i==null||i.toggleComment(!0,!0)}updateComment(e){var n;(n=u(this,In))==null||n.updateComment(e.getData())}updatePopupColor(e){var n;(n=u(this,In))==null||n.updatePopupColor(e)}removeComment(e){var n;(n=u(this,In))==null||n.removeComments([e.uid])}deleteComment(e,n){const r=()=>{e.comment=n},i=()=>{var s;(s=this._editorUndoBar)==null||s.show(r,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:i,undo:r,mustExec:!0})}toggleComment(e,n,r=void 0){var i;(i=u(this,In))==null||i.toggleCommentPopup(e,n,r)}makeCommentColor(e,n){var r;return e&&((r=u(this,In))==null?void 0:r.makeCommentColor(e,n))||null}getCommentDialogElement(){var e;return((e=u(this,In))==null?void 0:e.dialogElement)||null}async waitForEditorsRendered(e){if(u(this,Bt).has(e-1))return;const{resolve:n,promise:r}=Promise.withResolvers(),i=s=>{s.pageNumber===e&&(this._eventBus._off("editorsrendered",i),n())};this._eventBus.on("editorsrendered",i),await r}getSignature(e){var n;(n=u(this,bc))==null||n.getSignature({uiManager:this,editor:e})}get signatureManager(){return u(this,bc)}switchToMode(e,n){this._eventBus.on("annotationeditormodechanged",n,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,n){this._eventBus.dispatch("setpreference",{source:this,name:e,value:n})}onSetPreference({name:e,value:n}){switch(e){case"enableNewAltTextWhenAddingImage":S(this,Fp,n);break}}onPageChanging({pageNumber:e}){S(this,pc,e-1)}deletePage(e){for(const n of this.getEditors(e))n.remove();u(this,Bt).delete(e),u(this,pc)===e&&S(this,pc,0)}focusMainContainer(){u(this,jo).focus()}findParent(e,n){for(const r of u(this,Bt).values()){const{x:i,y:s,width:a,height:o}=r.div.getBoundingClientRect();if(e>=i&&e<=i+a&&n>=s&&n<=s+o)return r}return null}disableUserSelect(e=!1){u(this,hw).classList.toggle("noUserSelect",e)}addShouldRescale(e){u(this,yh).add(e)}removeShouldRescale(e){u(this,yh).delete(e)}onScaleChanging({scale:e}){var n;this.commitOrRemove(),this.viewParameters.realScale=e*Eu.PDF_TO_CSS_UNITS;for(const r of u(this,yh))r.onScaleChanging();(n=u(this,fc))==null||n.onScaleChanging()}
327onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",n=!1){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o}=r,l=r.toString(),h=T(this,ee,Lx).call(this,r).closest(".textLayer"),d=this.getSelectionBoxes(h);if(!d)return;r.empty();const f=T(this,ee,lT).call(this,h),p=u(this,fn)===xe.NONE,m=()=>{const y=f==null?void 0:f.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:d,anchorNode:i,anchorOffset:s,focusNode:a,focusOffset:o,text:l});p&&this.showAllEditors("highlight",!0,!0),n&&(y==null||y.editComment())};if(p){this.switchToMode(xe.HIGHLIGHT,m);return}m()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!u(this,kr))return null;const n=`${$v}${e}`,r=u(this,kr).getRawValue(n);return r&&u(this,kr).remove(n),r}addToAnnotationStorage(e){!e.isEmpty()&&u(this,kr)&&!u(this,kr).has(e.id)&&u(this,kr).setValue(e.id,e)}a11yAlert(e,n=null){const r=u(this,dw);r&&(r.setAttribute("data-l10n-id",e),n?r.setAttribute("data-l10n-args",JSON.stringify(n)):r.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,u(this,yc)&&(S(this,yc,!1),T(this,ee,uy).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of u(this,tt))if(n.div.contains(e)){S(this,vh,[n,e]),n._focusEventsAllowed=!1;break}}focus(){if(!u(this,vh))return;const[e,n]=u(this,vh);S(this,vh,null),n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}addEditListeners(){T(this,ee,cT).call(this),this.setEditingState(!0)}removeEditListeners(){T(this,ee,Uz).call(this),this.setEditingState(!1)}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of u(this,ss))if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of u(this,ss))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=u(this,gi))==null||r.commitOrRemove(),!this.hasSelection)return;const n=[];for(const i of u(this,tt)){const s=i.serialize(!0);s&&n.push(s)}n.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:n}=e;for(const s of n.items)for(const a of u(this,ss))if(a.isHandlingMimeForPasting(s.type)){a.paste(s,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(s){_e(`paste: "${s.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const s=[];for(const l of r){const c=await i.deserialize(l);if(!c)return;s.push(c)}const a=()=>{for(const l of s)T(this,ee,uT).call(this,l);T(this,ee,hT).call(this,s)},o=()=>{for(const l of s)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(s){_e(`paste: "${s.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),u(this,fn)!==xe.NONE&&!this.isEditorHandlingKeyboard&&tp._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,u(this,yc)&&(S(this,yc,!1),T(this,ee,uy).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,n){for(const i of this.getEditors(e))i.pageIndex=n;const r=u(this,Dp).get(e);r&&(r.pageIndex=n,u(this,Bt).set(n,r),u(this,Do)?r.enable():r.disable())}startUpdatePages(){S(this,Dp,new Map(u(this,Bt))),u(this,Bt).clear()}endUpdatePages(){S(this,Dp,null)}clonePage(e,n){for(const r of this.getEditors(e)){const i=r.serialize(r.mode!==xe.HIGHLIGHT);i&&(i.pageIndex=n,i.id=this.getId(),i.isClone=!0,delete i.popupRef,u(this,kr).setValue(i.id,i))}}findClonesForPage(e){const n=[],{pageIndex:r}=e;for(const[i,s]of u(this,kr))s.pageIndex===r&&s.isClone&&(u(this,kr).remove(i),n.push(e.deserialize(s).then(a=>{a&&(a.isClone=!0,e.addOrRebuild(a))})));return Promise.all(n)}setEditingState(e){e?(T(this,ee,Bz).call(this),T(this,ee,zz).call(this),T(this,ee,br).call(this,{isEditing:u(this,fn)!==xe.NONE,isEmpty:T(this,ee,hy).call(this),hasSomethingToUndo:u(this,is).hasSomethingToUndo(),hasSomethingToRedo:u(this,is).hasSomethingToRedo(),hasSelectedEditor:!1})):(T(this,ee,$z).call(this),T(this,ee,Vz).call(this),T(this,ee,br).call(this,{isEditing:!1}),this.disableUserSelect(!1))}
327registerEditorTypes(e){if(!u(this,ss)){S(this,ss,e);for(const n of u(this,ss))T(this,ee,Eo).call(this,n.defaultPropertiesToUpdate)}}getId(){return u(this,M1).id}get currentLayer(){return u(this,Bt).get(u(this,pc))}getLayer(e){return u(this,Bt).get(e)}get currentPageIndex(){return u(this,pc)}addLayer(e){u(this,Bt).set(e.pageIndex,e),u(this,Do)?e.enable():e.disable()}removeLayer(e){u(this,Bt).delete(e.pageIndex)}async updateMode(e,n=null,r=!1,i=!1,s=!1,a=!1){var o,l,c,h,d,f;if(u(this,fn)!==e&&!(u(this,as)&&(await u(this,as).promise,!u(this,as)))){if(S(this,as,Promise.withResolvers()),(o=u(this,fc))==null||o.commitOrRemove(),u(this,fn)===xe.POPUP&&((l=u(this,In))==null||l.hideSidebar()),(c=u(this,In))==null||c.destroyPopup(),S(this,fn,e),e===xe.NONE){this.setEditingState(!1),T(this,ee,Gz).call(this);for(const p of u(this,Xt).values())p.hideStandaloneCommentButton();(h=this._editorUndoBar)==null||h.hide(),this.toggleComment(null),u(this,as).resolve();return}for(const p of u(this,Xt).values())p.addStandaloneCommentButton();e===xe.SIGNATURE&&await((d=u(this,bc))==null?void 0:d.loadSignatures()),r&&cr.clearPointerType(),this.setEditingState(!0),await T(this,ee,Wz).call(this),this.unselectAll();for(const p of u(this,Bt).values())p.updateMode(e);if(e===xe.POPUP){u(this,Mp)||S(this,Mp,await u(this,zp).getAnnotationsByType(new Set(u(this,ss).map(y=>y._editorType))));const p=new Set,m=[];for(const y of u(this,Xt).values()){const{annotationElementId:x,hasComment:v,deleted:w}=y;x&&p.add(x),v&&!w&&m.push(y.getData())}for(const y of u(this,Mp)){const{id:x,popupRef:v,contentsObj:w}=y;v&&(w!=null&&w.str)&&!p.has(x)&&!u(this,mc).has(x)&&m.push(y)}(f=u(this,In))==null||f.showSidebar(m)}if(!n){i&&this.addNewEditorFromKeyboard(),u(this,as).resolve();return}for(const p of u(this,Xt).values())p.uid===n?(this.setSelected(p),a?p.editComment():s?p.enterInEditMode():p.focus()):p.unselect();u(this,as).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==u(this,fn)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,n){if(u(this,ss)){switch(e){case Te.CREATE:this.currentLayer.addNewEditor(n);return;case Te.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(u(this,cw)||S(this,cw,new Map)).set(e,n),this.showAllEditors("highlight",n);break}if(this.hasSelection)for(const r of u(this,tt))r.updateParams(e,n);else for(const r of u(this,ss))r.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){var s;for(const a of u(this,Xt).values())a.editorType===e&&a.show(n);(((s=u(this,cw))==null?void 0:s.get(Te.HIGHLIGHT_SHOW_ALL))??!0)!==n&&T(this,ee,Eo).call(this,[[Te.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(u(this,ow)!==e){S(this,ow,e);for(const n of u(this,Bt).values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}*getEditors(e){for(const n of u(this,Xt).values())n.pageIndex===e&&(yield n)}getEditor(e){return u(this,Xt).get(e)}addEditor(e){u(this,Xt).set(e.id,e)}removeEditor(e){var n,r;e.div.contains(document.activeElement)&&(u(this,Oa)&&clearTimeout(u(this,Oa)),S(this,Oa,setTimeout(()=>{this.focusMainContainer(),S(this,Oa,null)},0))),u(this,Xt).delete(e.id),e.annotationElementId&&((n=u(this,wc))==null||n.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!u(this,mc).has(e.annotationElementId))&&((r=u(this,kr))==null||r.remove(e.id))}addDeletedAnnotationElement(e){u(this,mc).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return u(this,mc).has(e)}removeDeletedAnnotationElement(e){u(this,mc).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){u(this,gi)!==e&&(S(this,gi,e),e&&T(this,ee,Eo).call(this,e.propertiesToUpdate))}updateUI(e){u(this,ee,qz)===e&&T(this,ee,Eo).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){T(this,ee,Eo).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(u(this,tt).has(e)){u(this,tt).delete(e),e.unselect(),T(this,ee,br).call(this,{hasSelectedEditor:this.hasSelection});return}
327u(this,tt).add(e),e.select(),T(this,ee,Eo).call(this,e.propertiesToUpdate),T(this,ee,br).call(this,{hasSelectedEditor:!0})}setSelected(e){var n,r;this.updateToolbar({mode:e.mode,editId:e.uid}),(n=u(this,fc))==null||n.commitOrRemove();for(const i of u(this,tt))i!==e&&i.unselect();(r=u(this,In))==null||r.destroyPopup(),u(this,tt).clear(),u(this,tt).add(e),e.select(),T(this,ee,Eo).call(this,e.propertiesToUpdate),T(this,ee,br).call(this,{hasSelectedEditor:!0})}isSelected(e){return u(this,tt).has(e)}get firstSelectedEditor(){return u(this,tt).values().next().value}unselect(e){e.unselect(),u(this,tt).delete(e),T(this,ee,br).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return u(this,tt).size!==0}get isEnterHandled(){return u(this,tt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;u(this,is).undo(),T(this,ee,br).call(this,{hasSomethingToUndo:u(this,is).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:T(this,ee,hy).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){u(this,is).redo(),T(this,ee,br).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:u(this,is).hasSomethingToRedo(),isEmpty:T(this,ee,hy).call(this)})}addCommands(e){u(this,is).add(e),T(this,ee,br).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:T(this,ee,hy).call(this)})}cleanUndoStack(e){u(this,is).cleanType(e)}delete(){var s;this.commitOrRemove();const e=(s=this.currentLayer)==null?void 0:s.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const n=e?[e]:[...u(this,tt)],r=()=>{var a;(a=this._editorUndoBar)==null||a.show(i,n.length===1?n[0].editorType:n.length);for(const o of n)o.remove()},i=()=>{for(const a of n)T(this,ee,uT).call(this,a)};this.addCommands({cmd:r,undo:i,mustExec:!0})}commitOrRemove(){var e;(e=u(this,gi))==null||e.commitOrRemove()}hasSomethingToControl(){return u(this,gi)||this.hasSelection}selectAll(){for(const e of u(this,tt))e.commit();T(this,ee,hT).call(this,u(this,Xt).values())}unselectAll(){var e,n;if(!(u(this,gi)&&(u(this,gi).commitOrRemove(),u(this,fn)!==xe.NONE))&&!((e=u(this,fc))!=null&&e.commitOrRemove())&&((n=u(this,In))==null||n.destroyPopup(),!!this.hasSelection)){for(const r of u(this,tt))r.unselect();u(this,tt).clear(),T(this,ee,br).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;u(this,Sc)[0]+=e,u(this,Sc)[1]+=n;const[i,s]=u(this,Sc),a=[...u(this,tt)],o=1e3;u(this,Da)&&clearTimeout(u(this,Da)),S(this,Da,setTimeout(()=>{S(this,Da,null),u(this,Sc)[0]=u(this,Sc)[1]=0,this.addCommands({cmd:()=>{for(const l of a)u(this,Xt).has(l.id)&&(l.translateInPage(i,s),l.translationDone())},undo:()=>{for(const l of a)u(this,Xt).has(l.id)&&(l.translateInPage(-i,-s),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(e,n),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),S(this,Ia,new Map);for(const e of u(this,tt))u(this,Ia).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!u(this,Ia))return!1;this.disableUserSelect(!1);const e=u(this,Ia);S(this,Ia,null);let n=!1;for(const[{x:i,y:s,pageIndex:a},o]of e)o.newX=i,o.newY=s,o.newPageIndex=a,n||(n=i!==o.savedX||s!==o.savedY||a!==o.savedPageIndex);if(!n)return!1;const r=(i,s,a,o)=>{if(u(this,Xt).has(i.id)){const l=u(this,Bt).get(o);l?i._setParentAndPosition(l,s,a):(i.pageIndex=o,i.x=s,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:s,newY:a,newPageIndex:o}]of e)r(i,s,a,o)},undo:()=>{for(const[i,{savedX:s,savedY:a,savedPageIndex:o}]of e)r(i,s,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(u(this,Ia))for(const r of u(this,Ia).keys())r.drag(e,n)}rebuild(e){if(e.parent===null){const n=this.getLayer(e.pageIndex);n?(n.changeParent(e),n.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||u(this,tt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return u(this,gi)===e}getActive(){return u(this,gi)}getMode(){return u(this,fn)}isEditingMode(){return u(this,fn)!==xe.NONE}get imageManager(){return Se(this,"imageManager",new aT)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let c=0,h=n.rangeCount;c<h;c++)if(!e.contains(n.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:i,width:s,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(c,h,d,f)=>({x:(h-i)/a,y:1-(c+d-r)/s,width:f/a,height:d/s});break;case"180":o=(c,h,d,f)=>({x:1-(c+d-r)/s,y:1-(h+f-i)/a,width:d/s,height:f/a});break;case"270":o=(c,h,d,f)=>({x:1-(h+f-i)/a,y:(c-r)/s,width:f/a,height:d/s});break;default:o=(c,h,d,f)=>({x:(c-r)/s,y:(h-i)/a,width:d/s,height:f/a});break}const l=[];for(let c=0,h=n.rangeCount;c<h;c++){const d=n.getRangeAt(c);if(!d.collapsed)for(const{x:f,y:p,width:m,height:y}of d.getClientRects())m===0||y===0||l.push(o(f,p,m,y))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:n}){(u(this,jp)||S(this,jp,new Map)).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){var n;(n=u(this,jp))==null||n.delete(e)}renderAnnotationElement(e){var i;const n=(i=u(this,jp))==null?void 0:i.get(e.data.id);if(!n)return;const r=u(this,kr).getRawValue(n);r&&(u(this,fn)===xe.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}setMissingCanvas(e,n,r){var s;const i=(s=u(this,wc))==null?void 0:s.get(e);i&&(i.setCanvas(n,r),u(this,wc).delete(e))}addMissingCanvas(e,n){(u(this,wc)||S(this,wc,new Map)).set(e,n)}};Op=new WeakMap,gi=new WeakMap,Mp=new WeakMap,Xt=new WeakMap,Bt=new WeakMap,Dp=new WeakMap,Lp=new WeakMap,kr=new WeakMap,jp=new WeakMap,is=new WeakMap,In=new WeakMap,dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,mc=new WeakMap,Ia=new WeakMap,ss=new WeakMap,yh=new WeakMap,iw=new WeakMap,sw=new WeakMap,Fp=new WeakMap,aw=new WeakMap,Oa=new WeakMap,gc=new WeakMap,Bp=new WeakMap,yc=new WeakMap,Ma=new WeakMap,M1=new WeakMap,Do=new WeakMap,$p=new WeakMap,ow=new WeakMap,vc=new WeakMap,vh=new WeakMap,Up=new WeakMap,wc=new WeakMap,lw=new WeakMap,fn=new WeakMap,tt=new WeakMap,Lo=new WeakMap,bc=new WeakMap,xc=new WeakMap,cw=new WeakMap,zp=new WeakMap,uw=new WeakMap,Sc=new WeakMap,Da=new WeakMap,jo=new WeakMap,hw=new WeakMap,dw=new WeakMap,as=new WeakMap,ee=new WeakSet,Lx=function({anchorNode:e}
327){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},lT=function(e){const{currentLayer:n}=this;if(n.hasTextLayer(e))return n;for(const r of u(this,Bt).values())if(r.hasTextLayer(e))return r;return null},Dz=function(e){var n;this.commitOrRemove(),(n=this.currentLayer)==null||n.endDrawingSession(!1)},Lz=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=T(this,ee,Lx).call(this,e).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(u(this,Ma)||S(this,Ma,new Sce(this)),u(this,Ma).show(r,i,this.direction==="ltr"))},jz=function(){var s,a,o;const e=document.getSelection();if(!e||e.isCollapsed){u(this,Lo)&&((s=u(this,Ma))==null||s.hide(),S(this,Lo,null),T(this,ee,br).call(this,{hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===u(this,Lo))return;const i=T(this,ee,Lx).call(this,e).closest(".textLayer");if(!i){u(this,Lo)&&((a=u(this,Ma))==null||a.hide(),S(this,Lo,null),T(this,ee,br).call(this,{hasSelectedText:!1}));return}if((o=u(this,Ma))==null||o.hide(),S(this,Lo,n),T(this,ee,br).call(this,{hasSelectedText:!0}),!(u(this,fn)!==xe.HIGHLIGHT&&u(this,fn)!==xe.NONE)&&(u(this,fn)===xe.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),S(this,yc,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=u(this,fn)===xe.HIGHLIGHT?T(this,ee,lT).call(this,i):null;if(l==null||l.toggleDrawing(),u(this,$p)){const c=new AbortController,h=this.combinedSignal(c),d=f=>{f.type==="pointerup"&&f.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),f.type==="pointerup"&&T(this,ee,uy).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:h}),window.addEventListener("blur",d,{signal:h})}else l==null||l.toggleDrawing(!0),T(this,ee,uy).call(this,"main_toolbar")}},uy=function(e=""){u(this,fn)===xe.HIGHLIGHT?this.highlightSelection(e):u(this,iw)&&T(this,ee,Lz).call(this)},Fz=function(){document.addEventListener("selectionchange",T(this,ee,jz).bind(this),{signal:this._signal})},Bz=function(){if(u(this,gc))return;S(this,gc,new AbortController);const e=this.combinedSignal(u(this,gc));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},$z=function(){var e;(e=u(this,gc))==null||e.abort(),S(this,gc,null)},cT=function(){if(u(this,vc))return;S(this,vc,new AbortController);const e=this.combinedSignal(u(this,vc));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},Uz=function(){var e;(e=u(this,vc))==null||e.abort(),S(this,vc,null)},zz=function(){if(u(this,dc))return;S(this,dc,new AbortController);const e=this.combinedSignal(u(this,dc));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})},Vz=function(){var e;(e=u(this,dc))==null||e.abort(),S(this,dc,null)},Hz=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},br=function(e){Object.entries(e).some(([r,i])=>u(this,uw)[r]!==i)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(u(this,uw),e)}),u(this,fn)===xe.HIGHLIGHT&&e.hasSelectedEditor===!1&&T(this,ee,Eo).call(this,[[Te.HIGHLIGHT_FREE,!0]]))},Eo=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},Wz=async function(){if(!u(this,Do)){S(this,Do,!0);const e=[];for(const n of u(this,Bt).values())e.push(n.enable());await Promise.all(e);for(const n of u(this,Xt).values())n.enable()}},Gz=function(){if(this.unselectAll(),u(this,Do)){S(this,Do,!1);for(const e of u(this,Bt).values())e.disable();for(const e of u(this,Xt).values())e.disable()}},uT=function(e){const n=u(this,Bt).get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},qz=function(){let e=null;for(e of u(this,tt));return e},hy=function(){if(u(this,Xt).size===0)return!0;if(u(this,Xt).size===1)for(const e of u(this,Xt).values())return e.isEmpty();return!1},hT=function(e){for(const n of u(this,tt))n.unselect();u(this,tt).clear();for(const n of e)n.isEmpty()||(u(this,tt).add(n),n.select());T(this,ee,br).call(this,{hasSelectedEditor:this.hasSelection})},F(tp,"TRANSLATE_SMALL",1),F(tp,"TRANSLATE_BIG",10);let qd=tp;var On,La,$s,Vp,ja,yi,Hp,Fa,Gr,Fo,wh,Ba,kc,ra,dy,jx;const xr=class xr{constructor(e){E(this,ra);E(this,On,null);E(this,La,!1);E(this,$s,null);E(this,Vp,null);E(this,ja,null);E(this,yi,null);E(this,Hp,!1);E(this,Fa,null);E(this,Gr,null);E(this,Fo,null);E(this,wh,null);E(this,Ba,!1);S(this,Gr,e),S(this,Ba,e._uiManager.useNewAltTextFlow),u(xr,kc)||S(xr,kc,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){xr._l10n??(xr._l10n=e)}async render(){const e=S(this,$s,document.createElement("button"));e.className="altText",e.tabIndex="0";
327const n=S(this,Vp,document.createElement("span"));e.append(n),u(this,Ba)?(e.classList.add("new"),e.setAttribute("data-l10n-id",u(xr,kc).missing),n.setAttribute("data-l10n-id",u(xr,kc)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=u(this,Gr)._uiManager._signal;e.addEventListener("contextmenu",_s,{signal:r}),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});const i=s=>{s.preventDefault(),u(this,Gr)._uiManager.editAltText(u(this,Gr)),u(this,Ba)&&u(this,Gr)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:u(this,ra,dy)}})};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(S(this,Hp,!0),i(s))},{signal:r}),await T(this,ra,jx).call(this),e}finish(){u(this,$s)&&(u(this,$s).focus({focusVisible:u(this,Hp)}),S(this,Hp,!1))}isEmpty(){return u(this,Ba)?u(this,On)===null:!u(this,On)&&!u(this,La)}hasData(){return u(this,Ba)?u(this,On)!==null||!!u(this,Fo):this.isEmpty()}get guessedText(){return u(this,Fo)}async setGuessedText(e){u(this,On)===null&&(S(this,Fo,e),S(this,wh,await xr._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),T(this,ra,jx).call(this))}toggleAltTextBadge(e=!1){var n;if(!u(this,Ba)||u(this,On)){(n=u(this,Fa))==null||n.remove(),S(this,Fa,null);return}if(!u(this,Fa)){const r=S(this,Fa,document.createElement("div"));r.className="noAltTextBadge",u(this,Gr).div.append(r)}u(this,Fa).classList.toggle("hidden",!e)}serialize(e){let n=u(this,On);return!e&&u(this,Fo)===n&&(n=u(this,wh)),{altText:n,decorative:u(this,La),guessedText:u(this,Fo),textWithDisclaimer:u(this,wh)}}get data(){return{altText:u(this,On),decorative:u(this,La)}}set data({altText:e,decorative:n,guessedText:r,textWithDisclaimer:i,cancel:s=!1}){r&&(S(this,Fo,r),S(this,wh,i)),!(u(this,On)===e&&u(this,La)===n)&&(s||(S(this,On,e),S(this,La,n)),T(this,ra,jx).call(this))}toggle(e=!1){u(this,$s)&&(!e&&u(this,yi)&&(clearTimeout(u(this,yi)),S(this,yi,null)),u(this,$s).disabled=!e)}shown(){u(this,Gr)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:u(this,ra,dy)}})}destroy(){var e,n;(e=u(this,$s))==null||e.remove(),S(this,$s,null),S(this,Vp,null),S(this,ja,null),(n=u(this,Fa))==null||n.remove(),S(this,Fa,null)}};On=new WeakMap,La=new WeakMap,$s=new WeakMap,Vp=new WeakMap,ja=new WeakMap,yi=new WeakMap,Hp=new WeakMap,Fa=new WeakMap,Gr=new WeakMap,Fo=new WeakMap,wh=new WeakMap,Ba=new WeakMap,kc=new WeakMap,ra=new WeakSet,dy=function(){return u(this,On)&&"added"||u(this,On)===null&&this.guessedText&&"review"||"missing"},jx=async function(){var i,s,a;const e=u(this,$s);if(!e)return;if(u(this,Ba)){if(e.classList.toggle("done",!!u(this,On)),e.setAttribute("data-l10n-id",u(xr,kc)[u(this,ra,dy)]),(i=u(this,Vp))==null||i.setAttribute("data-l10n-id",u(xr,kc)[`${u(this,ra,dy)}-label`]),!u(this,On)){(s=u(this,ja))==null||s.remove();return}}else{if(!u(this,On)&&!u(this,La)){e.classList.remove("done"),(a=u(this,ja))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=u(this,ja);if(!n){S(this,ja,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${u(this,Gr).id}`;const o=100,l=u(this,Gr)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(u(this,yi)),S(this,yi,null)},{once:!0}),e.addEventListener("mouseenter",()=>{S(this,yi,setTimeout(()=>{S(this,yi,null),u(this,ja).classList.add("show"),u(this,Gr)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var c;u(this,yi)&&(clearTimeout(u(this,yi)),S(this,yi,null)),(c=u(this,ja))==null||c.classList.remove("show")},{signal:l})}u(this,La)?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=u(this,On)),n.parentNode||e.append(n);const r=u(this,Gr).getElementForAltText();r==null||r.setAttribute("aria-describedby",n.id)},E(xr,kc,null),F(xr,"_l10n",null);let m1=xr;var Wn,os,bh,yt,fw,Ac,ls,Ec,_c,xh,pw,dT;class Hb{constructor(e){E(this,pw);E(this,Wn,null);E(this,os,null);E(this,bh,!1);E(this,yt,null);E(this,fw,null);E(this,Ac,null);E(this,ls,null);E(this,Ec,null);E(this,_c,!1);E(this,xh,null);S(this,yt,e)}renderForToolbar(){const e=S(this,os,document.createElement("button"));
327return e.className="comment",T(this,pw,dT).call(this,e,!1)}renderForStandalone(){const e=S(this,Wn,document.createElement("button"));e.className="annotationCommentButton";const n=u(this,yt).commentButtonPosition;if(n){const{style:r}=e;r.insetInlineEnd=`calc(${100*(u(this,yt)._uiManager.direction==="ltr"?1-n[0]:n[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*n[1]}% - var(--comment-button-dim))`;const i=u(this,yt).commentButtonColor;i&&(r.backgroundColor=i)}return T(this,pw,dT).call(this,e,!0)}focusButton(){setTimeout(()=>{var e;(e=u(this,Wn)??u(this,os))==null||e.focus()},0)}onUpdatedColor(){if(!u(this,Wn))return;const e=u(this,yt).commentButtonColor;e&&(u(this,Wn).style.backgroundColor=e),u(this,yt)._uiManager.updatePopupColor(u(this,yt))}get commentButtonWidth(){var e;return(((e=u(this,Wn))==null?void 0:e.getBoundingClientRect().width)??0)/u(this,yt).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(u(this,xh))return u(this,xh);if(!u(this,Wn))return null;const{x:e,y:n,height:r}=u(this,Wn).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=u(this,yt).parent.boundingClientRect;return[(e-i)/a,(n+r-s)/o]}set commentPopupPositionInLayer(e){S(this,xh,e)}hasDefaultPopupPosition(){return u(this,xh)===null}removeStandaloneCommentButton(){var e;(e=u(this,Wn))==null||e.remove(),S(this,Wn,null)}removeToolbarCommentButton(){var e;(e=u(this,os))==null||e.remove(),S(this,os,null)}setCommentButtonStates({selected:e,hasPopup:n}){u(this,Wn)&&(u(this,Wn).classList.toggle("selected",e),u(this,Wn).ariaExpanded=n)}edit(e){const n=this.commentPopupPositionInLayer;let r,i;if(n)[r,i]=n;else{[r,i]=u(this,yt).commentButtonPosition;const{width:h,height:d,x:f,y:p}=u(this,yt);r=f+r*h,i=p+i*d}const s=u(this,yt).parent.boundingClientRect,{x:a,y:o,width:l,height:c}=s;u(this,yt)._uiManager.editComment(u(this,yt),a+r*l,o+i*c,{...e,parentDimensions:s})}finish(){u(this,os)&&(u(this,os).focus({focusVisible:u(this,bh)}),S(this,bh,!1))}isDeleted(){return u(this,_c)||u(this,ls)===""}isEmpty(){return u(this,ls)===null}hasBeenEdited(){return this.isDeleted()||u(this,ls)!==u(this,fw)}serialize(){return this.data}get data(){return{text:u(this,ls),richText:u(this,Ac),date:u(this,Ec),deleted:this.isDeleted()}}set data(e){if(e!==u(this,ls)&&S(this,Ac,null),e===null){S(this,ls,""),S(this,_c,!0);return}S(this,ls,e),S(this,Ec,new Date),S(this,_c,!1)}restoreData({text:e,richText:n,date:r}){S(this,ls,e),S(this,Ac,n),S(this,Ec,r),S(this,_c,!1)}setInitialText(e,n=null){S(this,fw,e),this.data=e,S(this,Ec,null),S(this,Ac,n)}shown(){}destroy(){var e,n;(e=u(this,os))==null||e.remove(),S(this,os,null),(n=u(this,Wn))==null||n.remove(),S(this,Wn,null),S(this,ls,""),S(this,Ac,null),S(this,Ec,null),S(this,yt,null),S(this,bh,!1),S(this,_c,!1)}}Wn=new WeakMap,os=new WeakMap,bh=new WeakMap,yt=new WeakMap,fw=new WeakMap,Ac=new WeakMap,ls=new WeakMap,Ec=new WeakMap,_c=new WeakMap,xh=new WeakMap,pw=new WeakSet,dT=function(e,n){if(!u(this,yt)._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",n?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[u(this,yt)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const r=u(this,yt)._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return e;e.addEventListener("contextmenu",_s,{signal:r}),n&&(e.addEventListener("focusin",s=>{u(this,yt)._focusEventsAllowed=!1,zt(s)},{capture:!0,signal:r}),e.addEventListener("focusout",s=>{u(this,yt)._focusEventsAllowed=!0,zt(s)},{capture:!0,signal:r})),e.addEventListener("pointerdown",s=>s.stopPropagation(),{signal:r});const i=s=>{s.preventDefault(),e===u(this,os)?this.edit():u(this,yt).toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:r}),e.addEventListener("keydown",s=>{s.target===e&&s.key==="Enter"&&(S(this,bh,!0),i(s))},{signal:r}),e.addEventListener("pointerenter",()=>{u(this,yt).toggleComment(!1,!0)},{signal:r}),e.addEventListener("pointerleave",()=>{u(this,yt).toggleComment(!1,!1)},{signal:r}),e};var Wp,Sh,mw,gw,yw,vw,ww,Bo,kh,$o,Ah,Uo,Tu,Kz,Yz,Xz;const oI=class oI{constructor({container:e,isPinchingDisabled:n=null,isPinchingStopped:r=null,onPinchStart:i=null,onPinching:s=null,onPinchEnd:a=null,signal:o}){E(this,Tu);E(this,Wp);E(this,Sh,!1);E(this,mw,null);E(this,gw);E(this,yw);E(this,vw);E(this,ww);E(this,Bo,null);E(this,kh);E(this,$o,null);E(this,Ah);E(this,Uo,null);S(this,Wp,e),S(this,mw,r),S(this,gw,n),S(this,yw,i),S(this,vw,s),S(this,ww,a),S(this,Ah,new AbortController),S(this,kh,AbortSignal.any([o,u(this,Ah).signal])),e.addEventListener("touchstart",T(this,Tu,Kz).bind(this),{passive:!1,signal:u(this,kh)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/go.pixelRatio}destroy(){var e,n;(e=u(this,Ah))==null||e.abort(),S(this,Ah,null),(n=u(this,Bo))==null||n.abort(),S(this,Bo,null)}};Wp=new WeakMap,Sh=new WeakMap,mw=new WeakMap,gw=new WeakMap,yw=new WeakMap,vw=new WeakMap,ww=new WeakMap,Bo=new WeakMap,kh=new WeakMap,$o=new WeakMap,Ah=new WeakMap,Uo=new WeakMap,Tu=new WeakSet,Kz=function(e){var i,s,a;if((i=u(this,gw))!=null&&i.call(this))return;if(e.touches.length===1){if(u(this,Bo))return;const o=S(this,Bo,new AbortController),l=AbortSignal.any([u(this,kh),o.signal]),c=u(this,Wp),h={capture:!0,signal:l,passive:!1},d=f=>{var p;f.pointerType==="touch"&&((p=u(this,Bo))==null||p.abort(),S(this,Bo,null))};c.addEventListener("pointerdown",f=>{f.pointerType==="touch"&&(zt(f),d(f))},h),c.addEventListener("pointerup",d,h),c.addEventListener("pointercancel",d,h);return}if(!u(this,Uo)){S(this,Uo,new AbortController);const o=AbortSignal.any([u(this,kh),u(this,Uo).signal]),l=u(this,Wp),c={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",T(this,Tu,Yz).bind(this),c);const h=T(this,Tu,Xz).bind(this);l.addEventListener("touchend",h,c),l.addEventListener("touchcancel",h,c),c.capture=!0,l.addEventListener("pointerdown",zt,c),l.addEventListener("pointermove",zt,c),l.addEventListener("pointercancel",zt,c),l.addEventListener("pointerup",zt,c),(s=u(this,yw))==null||s.call(this)}if(zt(e),e.touches.length!==2||(a=u(this,mw))!=null&&a.call(this)){S(this,$o,null);return}let[n,r]=e.touches;n.identifier>r.identifier&&([n,r]=[r,n]),S(this,$o,{touch0X:n.screenX,touch0Y:n.screenY,touch1X:r.screenX,touch1Y:r.screenY})},Yz=function(e){var k;if(!u(this,$o)||e.touches.length!==2)return;zt(e);let[n,r]=e.touches;n.identifier>r.identifier&&([n,r]=[r,n]);const{screenX:i,screenY:s}=n,{screenX:a,screenY:o}=r,l=u(this,$o),{touch0X:c,touch0Y:h,touch1X:d,touch1Y:f}=l,p=d-c,m=f-h,y=a-i,x=o-s,v=Math.hypot(y,x)||1,w=Math.hypot(p,m)||1;if(!u(this,Sh)&&Math.abs(w-v)<=oI.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=s,l.touch1X=a,l.touch1Y=o,!u(this,Sh)){S(this,Sh,!0);return}const b=[(i+a)/2,(s+o)/2];
327(k=u(this,vw))==null||k.call(this,b,w,v)},Xz=function(e){var n;e.touches.length>=2||(u(this,Uo)&&(u(this,Uo).abort(),S(this,Uo,null),(n=u(this,ww))==null||n.call(this)),u(this,$o)&&(zt(e),S(this,$o,null),S(this,Sh,!1)))};let g1=oI;var Eh,Us,Ot,nt,zo,Gp,Cc,bw,Gn,_h,Vo,cs,Tc,xw,Ch,vi,Sw,Th,Ho,$a,qp,Kp,us,Ph,kw,D1,pe,fT,Aw,pT,Fx,Qz,Jz,mT,Bx,gT,Zz,e5,t5,yT,n5,vT,r5,i5,s5,wT,fy;const Ee=class Ee{constructor(e){E(this,pe);E(this,Eh,null);E(this,Us,null);E(this,Ot,null);E(this,nt,null);E(this,zo,null);E(this,Gp,!1);E(this,Cc,null);E(this,bw,"");E(this,Gn,null);E(this,_h,null);E(this,Vo,null);E(this,cs,null);E(this,Tc,null);E(this,xw,"");E(this,Ch,!1);E(this,vi,null);E(this,Sw,!1);E(this,Th,!1);E(this,Ho,!1);E(this,$a,null);E(this,qp,0);E(this,Kp,0);E(this,us,null);E(this,Ph,null);F(this,"isSelected",!1);F(this,"_isCopy",!1);F(this,"_editToolbar",null);F(this,"_initialOptions",Object.create(null));F(this,"_initialData",null);F(this,"_isVisible",!0);F(this,"_uiManager",null);F(this,"_focusEventsAllowed",!0);E(this,kw,!1);E(this,D1,Ee._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:n,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=Ee.prototype._resizeWithKeyboard,n=qd.TRANSLATE_SMALL,r=qd.TRANSLATE_BIG;return Se(this,"_resizerKeyboardManager",new eb([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],Ee.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 Se(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new Ece({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n){if(Ee._l10n??(Ee._l10n=e),Ee._l10nResizer||(Ee._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"})),Ee._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);Ee._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Ze("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return u(this,kw)}set _isDraggable(e){var n;S(this,kw,e),(n=this.div)==null||n.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(e*2),this.y+=this.width*e/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(e*2),this.y-=this.width*e/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}
327setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=u(this,D1)}setParent(e){var n;e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(T(this,pe,fy).call(this),(n=u(this,cs))==null||n.remove(),S(this,cs,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(u(this,Ch)?S(this,Ch,!1):this.parent.setSelected(this))}focusout(e){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const n=e.relatedTarget;n!=null&&n.closest(`#${this.id}`)||(e.preventDefault(),(r=this.parent)!=null&&r.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,n,r,i){const[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(e+r)/s,this.y=(n+i)/a,this.fixAndSetPosition()}_moveAfterPaste(e,n){if(this.isClone){delete this.isClone;return}const[r,i]=this.parentDimensions;this.setAt(e*r,n*i,this.width*r,this.height*i),this._onTranslated()}translate(e,n){T(this,pe,fT).call(this,this.parentDimensions,e,n)}translateInPage(e,n){u(this,vi)||S(this,vi,[this.x,this.y,this.width,this.height]),T(this,pe,fT).call(this,this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,n){u(this,vi)||S(this,vi,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[i,s]}=this;if(this.x+=e/i,this.y+=n/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,c]=this.getBaseTranslation();a+=l,o+=c;const{style:h}=r;h.left=`${(100*a).toFixed(2)}%`,h.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),r.scrollIntoView({block:"nearest"})}_onTranslating(e,n){}_onTranslated(e,n){}get _hasBeenMoved(){return!!u(this,vi)&&(u(this,vi)[0]!==this.x||u(this,vi)[1]!==this.y)}get _hasBeenResized(){return!!u(this,vi)&&(u(this,vi)[2]!==this.width||u(this,vi)[3]!==this.height)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=Ee,i=r/e,s=r/n;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:n},pageDimensions:[r,i]}=this;let{x:s,y:a,width:o,height:l}=this;if(o*=r,l*=i,s*=r,a*=i,this._mustFixPosition)switch(e){case 0:s=Dt(s,0,r-o),a=Dt(a,0,i-l);break;case 90:s=Dt(s,0,r-l),a=Dt(a,o,i);break;case 180:s=Dt(s,o,r),a=Dt(a,l,i);break;case 270:s=Dt(s,l,r),a=Dt(a,0,i-o);break}this.x=s/=r,this.y=a/=i;const[c,h]=this.getBaseTranslation();s+=c,a+=h,n.left=`${(100*s).toFixed(2)}%`,n.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,n){var r;return T(r=Ee,Aw,pT).call(r,e,n,this.parentRotation)}pageTranslationToScreen(e,n){var r;return T(r=Ee,Aw,pT).call(r,e,n,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:[n,r]}=this;return[n*e,r*e]}setDims(){const{div:{style:e},width:n,height:r}=this;e.width=`${(100*n).toFixed(2)}%`,e.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=u(this,Ot))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||u(this,Th))return this._editToolbar;this._editToolbar=new iT(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[n,r]of e)await this._editToolbar.addButton(n,r);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")}
327removeCommentButtonFromToolbar(){var e;(e=this._editToolbar)==null||e.removeButton("comment")}removeEditToolbar(){var e,n;(e=this._editToolbar)==null||e.remove(),this._editToolbar=null,(n=u(this,Ot))==null||n.destroy()}addContainer(e){var r;const n=(r=this._editToolbar)==null?void 0:r.div;n?n.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return u(this,Ot)||(m1.initialize(Ee._l10n),S(this,Ot,new m1(this)),u(this,Eh)&&(u(this,Ot).data=u(this,Eh),S(this,Eh,null))),u(this,Ot)}get altTextData(){var e;return(e=u(this,Ot))==null?void 0:e.data}set altTextData(e){u(this,Ot)&&(u(this,Ot).data=e)}get guessedAltText(){var e;return(e=u(this,Ot))==null?void 0:e.guessedText}async setGuessedAltText(e){var n;await((n=u(this,Ot))==null?void 0:n.setGuessedText(e))}serializeAltText(e){var n;return(n=u(this,Ot))==null?void 0:n.serialize(e)}hasAltText(){return!!u(this,Ot)&&!u(this,Ot).isEmpty()}hasAltTextData(){var e;return((e=u(this,Ot))==null?void 0:e.hasData())??!1}focusCommentButton(){var e;(e=u(this,nt))==null||e.focusButton()}addCommentButton(){return this.canAddComment?u(this,nt)||S(this,nt,new Hb(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(u(this,zo)){this._uiManager.isEditingMode()&&u(this,zo).classList.remove("hidden");return}this.hasComment&&(S(this,zo,u(this,nt).renderForStandalone()),this.div.append(u(this,zo)))}}removeStandaloneCommentButton(){u(this,nt).removeStandaloneCommentButton(),S(this,zo,null)}hideStandaloneCommentButton(){var e;(e=u(this,zo))==null||e.classList.add("hidden")}get comment(){if(!u(this,nt))return null;const{data:{richText:e,text:n,date:r,deleted:i}}=u(this,nt);return{text:n,richText:e,date:r,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){u(this,nt)||S(this,nt,new Hb(this)),typeof e=="object"&&e!==null?u(this,nt).restoreData(e):u(this,nt).data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:n,richText:r}){if(!n||(u(this,nt)||S(this,nt,new Hb(this)),u(this,nt).setInitialText(e,r),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){var e;return(e=u(this,nt))==null?void 0:e.hasBeenEdited()}get hasDeletedComment(){var e;return(e=u(this,nt))==null?void 0:e.isDeleted()}get hasComment(){return!!u(this,nt)&&!u(this,nt).isEmpty()&&!u(this,nt).isDeleted()}async editComment(e){u(this,nt)||S(this,nt,new Hb(this)),u(this,nt).edit(e)}toggleComment(e,n=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,n)}setSelectedCommentButton(e){u(this,nt).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,i]=e.rect,[s]=this.pageDimensions,[a]=this.pageTranslation,o=a+s+1,l=i-100,c=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,c,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:n}}){u(this,nt).data=n?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=u(this,Gp)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),T(this,pe,vT).call(this);const[n,r]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*r/n).toFixed(2)}%`,e.style.maxHeight=`${(100*n/r).toFixed(2)}%`);const[i,s]=this.getInitialTranslation();return this.translate(i,s),Oz(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(u(this,Ph)||S(this,Ph,new g1({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:T(this,pe,Zz).bind(this),onPinching:T(this,pe,e5).bind(this),onPinchEnd:T(this,pe,t5).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),e}pointerdown(e){const{isMac:n}=bn.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if(S(this,Ch,!0),this._isDraggable){T(this,pe,n5).call(this,e);return}T(this,pe,yT).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){u(this,$a)&&clearTimeout(u(this,$a)),S(this,$a,setTimeout(()=>{var e;S(this,$a,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,n,r){e.changeParent(this),this.x=n,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,n,r=this.rotation){const i=this.parentScale,[s,a]=this.pageDimensions,[o,l]=this.pageTranslation,c=e/i,h=n/i,d=this.x*s,f=this.y*a,p=this.width*s,m=this.height*a;switch(r){case 0:return[d+c+o,a-f-h-m+l,d+c+p+o,a-f-h+l];case 90:return[d+h+o,a-f+c+l,d+h+m+o,a-f+c+p+l];case 180:return[d-c-p+o,a-f+h+l,d-c+o,a-f+h+m+l];case 270:return[d-h-m+o,a-f-c-p+l,d-h+o,a-f-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,i,s,a]=e,o=s-r,l=a-i;switch(this.rotation){case 0:return[r,n-a,o,l];case 90:return[r,n-i,l,o];case 180:return[s,n-i,o,l];case 270:return[s,n-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&Ee._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var e;(e=u(this,nt))==null||e.onUpdatedColor()}getData(){const{comment:{text:e,color:n,date:r,opacity:i,deleted:s,richText:a},uid:o,pageIndex:l,creationDate:c,modificationDate:h}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:r||h,popupRef:!s,color:n,opacity:i}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),S(this,Th,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),S(this,Th,!1),!0):!1}isInEditMode(){return u(this,Th)}shouldGetKeyboardEvents(){return u(this,Ho)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:n,bottom:r,right:i}=this.getClientDimensions(),{innerHeight:s,innerWidth:a}=window;return n<a&&i>0&&e<s&&r>0}rebuild(){T(this,pe,vT).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,n=null){var r;return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:((r=this._initialData)==null?void 0:r.popupRef)||""}}static async deserialize(e,n,r){const i=new this.prototype.constructor({parent:n,id:r.getId(),uiManager:r,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,S(i,Eh,e.accessibilityData),i._isCopy=e.isCopy||!1;const[s,a]=i.pageDimensions,[o,l,c,h]=i.getRectInCurrentCoords(e.rect,a);return i.x=o/s,i.y=l/a,i.width=c/s,i.height=h/a,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,n,r;if((e=u(this,Tc))==null||e.abort(),S(this,Tc,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),u(this,$a)&&(clearTimeout(u(this,$a)),S(this,$a,null)),T(this,pe,fy).call(this),this.removeEditToolbar(),u(this,us)){for(const i of u(this,us).values())clearTimeout(i);S(this,us,null)}this.parent=null,(n=u(this,Ph))==null||n.destroy(),S(this,Ph,null),(r=u(this,cs))==null||r.remove(),S(this,cs,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(T(this,pe,Qz).call(this),u(this,Gn).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,n]}=this,[r,i,s,a]=this.getPDFRect();return[Ee._round(r+(s-r)*e),Ee._round(i+(a-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return u(this,nt).commentPopupPositionInLayer}set commentPopupPosition(e){u(this,nt).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return u(this,nt).hasDefaultPopupPosition()}get commentButtonWidth(){return u(this,nt).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){var n;(n=u(this,nt))==null||n.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),S(this,Vo,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=u(this,Gn).children;if(!u(this,Us)){S(this,Us,Array.from(n));const a=T(this,pe,r5).bind(this),o=T(this,pe,i5).bind(this),l=this._uiManager._signal;for(const c of u(this,Us)){const h=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",a,{signal:l}),c.addEventListener("blur",o,{signal:l}),c.addEventListener("focus",T(this,pe,s5).bind(this,h),{signal:l}),c.setAttribute("data-l10n-id",Ee._l10nResizer[h])}}const r=u(this,Us)[0];let i=0;for(const a of n){if(a===r)break;
327i++}const s=(360-this.rotation+this.parentRotation)%360/90*(u(this,Us).length/4);if(s!==i){if(s<i)for(let o=0;o<i-s;o++)u(this,Gn).append(u(this,Gn).firstElementChild);else if(s>i)for(let o=0;o<s-i;o++)u(this,Gn).firstElementChild.before(u(this,Gn).lastElementChild);let a=0;for(const o of n){const c=u(this,Us)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",Ee._l10nResizer[c])}}T(this,pe,wT).call(this,0),S(this,Ho,!0),u(this,Gn).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,n){u(this,Ho)&&T(this,pe,gT).call(this,u(this,xw),{deltaX:e,deltaY:n,fromKeyboard:!0})}_stopResizingWithKeyboard(){T(this,pe,fy).call(this),this.div.focus()}select(){var e,n,r;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 i,s;(i=this.div)!=null&&i.classList.contains("selectedEditor")&&((s=this._editToolbar)==null||s.show())});return}(n=this._editToolbar)==null||n.show(),(r=u(this,Ot))==null||r.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,n,r,i,s;this.isSelected&&(this.isSelected=!1,(e=u(this,Gn))==null||e.classList.add("hidden"),(n=this.div)==null||n.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(i=this._editToolbar)==null||i.hide(),(s=u(this,Ot))==null||s.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,n){}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 u(this,Sw)}set isEditing(e){S(this,Sw,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,n=!1){if(n){u(this,us)||S(this,us,new Map);const{action:r}=e;let i=u(this,us).get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),u(this,us).delete(r),u(this,us).size===0&&S(this,us,null)},Ee._telemetryTimeout),u(this,us).set(r,i);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),S(this,Gp,!1)}disable(){this.div&&(this.div.tabIndex=-1),S(this,Gp,!0)}updateFakeAnnotationElement(e){if(!u(this,cs)&&!this.deleted){S(this,cs,e.addFakeAnnotation(this));return}if(this.deleted){u(this,cs).remove(),S(this,cs,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&u(this,cs).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let n=e.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),e.container.prepend(n);else if(n.nodeName==="CANVAS"){const r=n;n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),r.before(n)}return n}resetAnnotationElement(e){const{firstElementChild:n}=e.container;(n==null?void 0:n.nodeName)==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}};Eh=new WeakMap,Us=new WeakMap,Ot=new WeakMap,nt=new WeakMap,zo=new WeakMap,Gp=new WeakMap,Cc=new WeakMap,bw=new WeakMap,Gn=new WeakMap,_h=new WeakMap,Vo=new WeakMap,cs=new WeakMap,Tc=new WeakMap,xw=new WeakMap,Ch=new WeakMap,vi=new WeakMap,Sw=new WeakMap,Th=new WeakMap,Ho=new WeakMap,$a=new WeakMap,qp=new WeakMap,Kp=new WeakMap,us=new WeakMap,Ph=new WeakMap,kw=new WeakMap,D1=new WeakMap,pe=new WeakSet,fT=function([e,n],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/e,this.y+=i/n,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Aw=new WeakSet,pT=function(e,n,r){switch(r){case 90:return[n,-e];case 180:return[-e,-n];case 270:return[-n,e];default:return[e,n]}},Fx=function(e){switch(e){case 90:{const[n,r]=this.pageDimensions;return[0,-n/r,r/n,0]}case 180:return[-1,0,0,-1];case 270:{const[n,r]=this.pageDimensions;return[0,n/r,-r/n,0]}default:return[1,0,0,1]}},Qz=function(){if(u(this,Gn))return;S(this,Gn,document.createElement("div")),u(this,Gn).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],n=this._uiManager._signal;for(const r of e){const i=document.createElement("div");u(this,Gn).append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",T(this,pe,Jz).bind(this,r),{signal:n}),i.addEventListener("contextmenu",_s,{signal:n}),i.tabIndex=-1}this.div.prepend(u(this,Gn))},Jz=function(e,n){var h;n.preventDefault();const{isMac:r}=bn.platform;if(n.button!==0||n.ctrlKey&&r)return;(h=u(this,Ot))==null||h.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,S(this,_h,[n.screenX,n.screenY]);const s=new AbortController,a=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",T(this,pe,gT).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",zt,{passive:!1,signal:a}),window.addEventListener("contextmenu",_s,{signal:a}),S(this,Vo,{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(n.target).cursor;const c=()=>{var d;s.abort(),this.parent.togglePointerEvents(!0),(d=u(this,Ot))==null||d.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=o,this.div.style.cursor=l,T(this,pe,Bx).call(this)};window.addEventListener("pointerup",c,{signal:a}),window.addEventListener("blur",c,{signal:a})},mT=function(e,n,r,i){this.width=r,this.height=i,this.x=e,this.y=n,this.setDims(),this.fixAndSetPosition(),this._onResized()},Bx=function(){if(!u(this,Vo))return;
vendor: 4,294 bytes, line 327
327const{savedX:e,savedY:n,savedWidth:r,savedHeight:i}=u(this,Vo);S(this,Vo,null);const s=this.x,a=this.y,o=this.width,l=this.height;s===e&&a===n&&o===r&&l===i||this.addCommands({cmd:T(this,pe,mT).bind(this,s,a,o,l),undo:T(this,pe,mT).bind(this,e,n,r,i),mustExec:!0})},gT=function(e,n){const[r,i]=this.parentDimensions,s=this.x,a=this.y,o=this.width,l=this.height,c=Ee.MIN_SIZE/r,h=Ee.MIN_SIZE/i,d=T(this,pe,Fx).call(this,this.rotation),f=($,W)=>[d[0]*$+d[2]*W,d[1]*$+d[3]*W],p=T(this,pe,Fx).call(this,360-this.rotation),m=($,W)=>[p[0]*$+p[2]*W,p[1]*$+p[3]*W];let y,x,v=!1,w=!1;switch(e){case"topLeft":v=!0,y=($,W)=>[0,0],x=($,W)=>[$,W];break;case"topMiddle":y=($,W)=>[$/2,0],x=($,W)=>[$/2,W];break;case"topRight":v=!0,y=($,W)=>[$,0],x=($,W)=>[0,W];break;case"middleRight":w=!0,y=($,W)=>[$,W/2],x=($,W)=>[0,W/2];break;case"bottomRight":v=!0,y=($,W)=>[$,W],x=($,W)=>[0,0];break;case"bottomMiddle":y=($,W)=>[$/2,W],x=($,W)=>[$/2,0];break;case"bottomLeft":v=!0,y=($,W)=>[0,W],x=($,W)=>[$,0];break;case"middleLeft":w=!0,y=($,W)=>[0,W/2],x=($,W)=>[$,W/2];break}const b=y(o,l),k=x(o,l);let _=f(...k);const C=Ee._round(s+_[0]),P=Ee._round(a+_[1]);let R=1,O=1,M,D;if(n.fromKeyboard)({deltaX:M,deltaY:D}=n);else{const{screenX:$,screenY:W}=n,[L,V]=u(this,_h);[M,D]=this.screenToPageTranslation($-L,W-V),u(this,_h)[0]=$,u(this,_h)[1]=W}if([M,D]=m(M/r,D/i),v){const $=Math.hypot(o,l);R=O=Math.max(Math.min(Math.hypot(k[0]-b[0]-M,k[1]-b[1]-D)/$,1/o,1/l),c/o,h/l)}else w?R=Dt(Math.abs(k[0]-b[0]-M),c,1)/o:O=Dt(Math.abs(k[1]-b[1]-D),h,1)/l;const j=Ee._round(o*R),U=Ee._round(l*O);_=f(...x(j,U));const B=C-_[0],z=P-_[1];u(this,vi)||S(this,vi,[this.x,this.y,this.width,this.height]),this.width=j,this.height=U,this.x=B,this.y=z,this.setDims(),this.fixAndSetPosition(),this._onResizing()},Zz=function(){var e;S(this,Vo,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=u(this,Ot))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},e5=function(e,n,r){let s=.7*(r/n)+1-.7;if(s===1)return;const a=T(this,pe,Fx).call(this,this.rotation),o=(C,P)=>[a[0]*C+a[2]*P,a[1]*C+a[3]*P],[l,c]=this.parentDimensions,h=this.x,d=this.y,f=this.width,p=this.height,m=Ee.MIN_SIZE/l,y=Ee.MIN_SIZE/c;s=Math.max(Math.min(s,1/f,1/p),m/f,y/p);const x=Ee._round(f*s),v=Ee._round(p*s);if(x===f&&v===p)return;u(this,vi)||S(this,vi,[h,d,f,p]);const w=o(f/2,p/2),b=Ee._round(h+w[0]),k=Ee._round(d+w[1]),_=o(x/2,v/2);this.x=b-_[0],this.y=k-_[1],this.width=x,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()},t5=function(){var e;(e=u(this,Ot))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),T(this,pe,Bx).call(this)},yT=function(e){const{isMac:n}=bn.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)},n5=function(e){const{isSelected:n}=this;this._uiManager.setUpDragSession();let r=!1;const i=new AbortController,s=this._uiManager.combinedSignal(i),a={capture:!0,passive:!1,signal:s},o=c=>{i.abort(),S(this,Cc,null),S(this,Ch,!1),this._uiManager.endDragSession()||T(this,pe,yT).call(this,c),r&&this._onStopDragging()};n&&(S(this,qp,e.clientX),S(this,Kp,e.clientY),S(this,Cc,e.pointerId),S(this,bw,e.pointerType),window.addEventListener("pointermove",c=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:h,clientY:d,pointerId:f}=c;if(f!==u(this,Cc)){zt(c);return}const[p,m]=this.screenToPageTranslation(h-u(this,qp),d-u(this,Kp));S(this,qp,h),S(this,Kp,d),this._uiManager.dragSelectedEditors(p,m)},a),window.addEventListener("touchmove",zt,a),window.addEventListener("pointerdown",c=>{c.pointerType===u(this,bw)&&(u(this,Ph)||c.isPrimary)&&o(c),zt(c)},a));const l=c=>{if(!u(this,Cc)||u(this,Cc)===c.pointerId){o(c);return}zt(c)};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})},vT=function(){if(u(this,Tc)||!this.div)return;S(this,Tc,new AbortController);const e=this._uiManager.combinedSignal(u(this,Tc));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},r5=function(e){Ee._resizerKeyboardManager.exec(this,e)},i5=function(e){var n;u(this,Ho)&&((n=e.relatedTarget)==null?void 0:n.parentNode)!==u(this,Gn)&&T(this,pe,fy).call(this)}
327,s5=function(e){S(this,xw,u(this,Ho)?e:"")},wT=function(e){if(u(this,Us))for(const n of u(this,Us))n.tabIndex=e},fy=function(){S(this,Ho,!1),T(this,pe,wT).call(this,-1),T(this,pe,Bx).call(this)},E(Ee,Aw),F(Ee,"_l10n",null),F(Ee,"_l10nResizer",null),F(Ee,"_borderLineWidth",-1),F(Ee,"_colorManager",new oT),F(Ee,"_zIndex",1),F(Ee,"_telemetryTimeout",1e3);let xt=Ee;class Ece extends xt{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const sL=3285377520,Ji=4294901760,xa=65535;class bT{constructor(e){this.h1=e?e&4294967295:sL,this.h2=e?e&4294967295:sL}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let y=0,x=e.length;y<x;y++){const v=e.charCodeAt(y);v<=255?n[r++]=v:(n[r++]=v>>>8,n[r++]=v&255)}}else if(ArrayBuffer.isView(e))n=e.slice(),r=n.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=r>>2,s=r-i*4,a=new Uint32Array(n.buffer,0,i);let o=0,l=0,c=this.h1,h=this.h2;const d=3432918353,f=461845907,p=d&xa,m=f&xa;for(let y=0;y<i;y++)y&1?(o=a[y],o=o*d&Ji|o*p&xa,o=o<<15|o>>>17,o=o*f&Ji|o*m&xa,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(l=a[y],l=l*d&Ji|l*p&xa,l=l<<15|l>>>17,l=l*f&Ji|l*m&xa,h^=l,h=h<<13|h>>>19,h=h*5+3864292196);switch(o=0,s){case 3:o^=n[i*4+2]<<16;case 2:o^=n[i*4+1]<<8;case 1:o^=n[i*4],o=o*d&Ji|o*p&xa,o=o<<15|o>>>17,o=o*f&Ji|o*m&xa,i&1?c^=o:h^=o}this.h1=c,this.h2=h}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&Ji|e*36045&xa,n=n*4283543511&Ji|((n<<16|e>>>16)*2950163797&Ji)>>>16,e^=n>>>1,e=e*444984403&Ji|e*60499&xa,n=n*3301882366&Ji|((n<<16|e>>>16)*3120437893&Ji)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const zv=Object.freeze({map:null,hash:"",transfer:void 0});var Nh,Rh,Wo,qn,L1,a5;class KR{constructor(){E(this,L1);E(this,Nh,!1);E(this,Rh,null);E(this,Wo,null);E(this,qn,new Map);F(this,"onSetModified",null);F(this,"onResetModified",null);F(this,"onAnnotationEditor",null)}getValue(e,n){const r=u(this,qn).get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return u(this,qn).get(e)}remove(e){var r;const n=u(this,qn).get(e);n!==void 0&&(n instanceof xt&&u(this,Wo).delete(n.annotationElementId),u(this,qn).delete(e),u(this,qn).size===0&&this.resetModified(),!u(this,qn).values().some(i=>i instanceof xt)&&((r=this.onAnnotationEditor)==null||r.call(this,null)))}setValue(e,n){var s;const r=u(this,qn).get(e);let i=!1;if(r!==void 0)for(const[a,o]of Object.entries(n))r[a]!==o&&(i=!0,r[a]=o);else i=!0,u(this,qn).set(e,n);i&&T(this,L1,a5).call(this),n instanceof xt&&((u(this,Wo)||S(this,Wo,new Map)).set(n.annotationElementId,n),(s=this.onAnnotationEditor)==null||s.call(this,n.constructor._type))}has(e){return u(this,qn).has(e)}get size(){return u(this,qn).size}resetModified(){var e;u(this,Nh)&&(S(this,Nh,!1),(e=this.onResetModified)==null||e.call(this))}get print(){return new o5(this)}get serializable(){if(u(this,qn).size===0)return zv;const e=new Map,n=new bT,r=[],i=Object.create(null);let s=!1;for(const[a,o]of u(this,qn)){const l=o instanceof xt?o.serialize(!1,i):o;o.page&&(o.pageIndex=o.page._pageIndex,delete o.page),l&&(e.set(a,l),n.update(`${a}:${JSON.stringify(l)}`),s||(s=!!l.bitmap))}if(s)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:zv}get editorStats(){let e=null;const n=new Map;let r=0,i=0;for(const s of u(this,qn).values()){if(!(s instanceof xt)){s.popup&&(s.popup.deleted?i+=1:r+=1);continue}s.isCommentDeleted?i+=1:s.hasEditedComment&&(r+=1);const a=s.telemetryFinalData;if(!a)continue;const{type:o}=a;n.has(o)||n.set(o,Object.getPrototypeOf(s).constructor),e||(e=Object.create(null));const l=e[o]||(e[o]=new Map);for(const[c,h]of Object.entries(a)){if(c==="type")continue;const d=l.getOrInsertComputed(c,VR);d.set(h,(d.get(h)??0)+1)}}if((i>0||r>0)&&(e||(e=Object.create(null)),e.comments={deleted:i,edited:r}),!e)return null;for(const[s,a]of n)e[s]=a.computeTelemetryFinalData(e[s]);return e}resetModifiedIds(){S(this,Rh,null)}updateEditor(e,n){var i;const r=(i=u(this,Wo))==null?void 0:i.get(e);return r?(r.updateFromAnnotationLayer(n),!0):!1}getEditor(e){var n;return((n=u(this,Wo))==null?void 0:n.get(e))||null}get modifiedIds(){if(u(this,Rh))return u(this,Rh);const e=[];
327if(u(this,Wo))for(const r of u(this,Wo).values())r.serialize()&&e.push(r.annotationElementId);let n="";if(e.length){const r=new bT;r.update(e.join(",")),n=r.hexdigest()}return S(this,Rh,{ids:new Set(e),hash:n})}[Symbol.iterator](){return u(this,qn).entries()}}Nh=new WeakMap,Rh=new WeakMap,Wo=new WeakMap,qn=new WeakMap,L1=new WeakSet,a5=function(){var e;u(this,Nh)||(S(this,Nh,!0),(e=this.onSetModified)==null||e.call(this))};var Ew;class o5 extends KR{constructor(n){super();E(this,Ew,zv);const{serializable:r}=n;if(r===zv)return;const{map:i,hash:s,transfer:a}=r,o=structuredClone(i,a?{transfer:a}:null);S(this,Ew,{map:o,hash:s,transfer:[]})}get print(){Ze("Should not call PrintAnnotationStorage.print")}get serializable(){return u(this,Ew)}get modifiedIds(){return Se(this,"modifiedIds",{ids:new Set,hash:""})}}Ew=new WeakMap;const vf="__forcedDependency",{floor:aL,ceil:oL}=Math;function lL(t,e,n,r,i,s){t[e*4+0]=Math.min(t[e*4+0],n),t[e*4+1]=Math.min(t[e*4+1],r),t[e*4+2]=Math.max(t[e*4+2],i),t[e*4+3]=Math.max(t[e*4+3],s)}const xT=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var Yp,Pc;class _ce{constructor(e,n){E(this,Yp);E(this,Pc);S(this,Yp,e),S(this,Pc,n)}get length(){return u(this,Yp).length}isEmpty(e){return u(this,Yp)[e]===xT}minX(e){return u(this,Pc)[e*4+0]/256}minY(e){return u(this,Pc)[e*4+1]/256}maxX(e){return(u(this,Pc)[e*4+2]+1)/256}maxY(e){return(u(this,Pc)[e*4+3]+1)/256}}Yp=new WeakMap,Pc=new WeakMap;const cL=(t,e)=>t==null?void 0:t.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));var Go,Je,Ct,Ih,Oh,Mh,dr,_w,ST;class Cce{constructor(e,n){E(this,_w);E(this,Go,[[1,0,0,1,0,0]]);E(this,Je,[-1/0,-1/0,1/0,1/0]);E(this,Ct,new Float64Array(vl));F(this,"_pendingBBoxIdx",-1);E(this,Ih);E(this,Oh);E(this,Mh);E(this,dr);F(this,"_savesStack",[]);F(this,"_markedContentStack",[]);S(this,Ih,e.width),S(this,Oh,e.height),T(this,_w,ST).call(this,n)}growOperationsCount(e){e>=u(this,dr).length&&T(this,_w,ST).call(this,e,u(this,dr))}get clipBox(){return u(this,Je)}save(e){return S(this,Je,{__proto__:u(this,Je)}),this._savesStack.push(e),this}restore(e,n){const r=Object.getPrototypeOf(u(this,Je));if(r===null)return this;S(this,Je,r);const i=this._savesStack.pop();return i!==void 0&&(n==null||n(i,e),u(this,dr)[e]=u(this,dr)[i]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,n){const r=this._savesStack.pop();return r!==void 0&&(n==null||n(r,e),u(this,dr)[e]=u(this,dr)[r]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,n){const r=this._markedContentStack.pop();return r!==void 0&&(n==null||n(r,e),u(this,dr)[e]=u(this,dr)[r]),this}pushBaseTransform(e){return u(this,Go).push(Q.multiplyByDOMMatrix(u(this,Go).at(-1),e.getTransform())),this}popBaseTransform(){return u(this,Go).length>1&&u(this,Go).pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,u(this,Ct).set(vl,0)),this}recordClipBox(e,n,r,i,s,a){const o=Q.multiplyByDOMMatrix(u(this,Go).at(-1),n.getTransform()),l=vl.slice();Q.axialAlignedBoundingBox([r,s,i,a],o,l);const c=Q.intersect(u(this,Je),l);return c?(u(this,Je)[0]=c[0],u(this,Je)[1]=c[1],u(this,Je)[2]=c[2],u(this,Je)[3]=c[3]):(u(this,Je)[0]=u(this,Je)[1]=1/0,u(this,Je)[2]=u(this,Je)[3]=-1/0),this}recordBBox(e,n,r,i,s,a){const o=u(this,Je);if(o[0]===1/0)return this;const l=Q.multiplyByDOMMatrix(u(this,Go).at(-1),n.getTransform());if(o[0]===-1/0)return Q.axialAlignedBoundingBox([r,s,i,a],l,u(this,Ct)),this;const c=vl.slice();return Q.axialAlignedBoundingBox([r,s,i,a],l,c),u(this,Ct)[0]=Dt(c[0],o[0],u(this,Ct)[0]),u(this,Ct)[1]=Dt(c[1],o[1],u(this,Ct)[1]),u(this,Ct)[2]=Dt(c[2],u(this,Ct)[2],o[2]),u(this,Ct)[3]=Dt(c[3],u(this,Ct)[3],o[3]),this}recordFullPageBBox(e){return u(this,Ct)[0]=Math.max(0,u(this,Je)[0]),u(this,Ct)[1]=Math.max(0,u(this,Je)[1]),u(this,Ct)[2]=Math.min(u(this,Ih),u(this,Je)[2]),u(this,Ct)[3]=Math.min(u(this,Oh),u(this,Je)[3]),this}recordOperation(e,n=!1,r){if(this._pendingBBoxIdx!==e)return this;const i=aL(u(this,Ct)[0]*256/u(this,Ih)),s=aL(u(this,Ct)[1]*256/u(this,Oh)),a=oL(u(this,Ct)[2]*256/u(this,Ih)),o=oL(u(this,Ct)[3]*256/u(this,Oh));if(lL(u(this,Mh),e,i,s,a,o),r)for(const l of r)for(const c of l)c!==e&&lL(u(this,Mh),c,i,s,a,o);
327return n||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,u(this,Je)[0]=Math.max(u(this,Je)[0],u(this,Ct)[0]),u(this,Je)[1]=Math.max(u(this,Je)[1],u(this,Ct)[1]),u(this,Je)[2]=Math.min(u(this,Je)[2],u(this,Ct)[2]),u(this,Je)[3]=Math.min(u(this,Je)[3],u(this,Ct)[3])),this}take(){return new _ce(u(this,dr),u(this,Mh))}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(e,n){return this}recordIncrementalData(e,n){return this}resetIncrementalData(e,n){return this}recordNamedData(e,n){return this}recordSimpleDataFromNamed(e,n,r){return this}recordFutureForcedDependency(e,n){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,n,r,i=1,s=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,n){return this}recordNamedDependency(e,n){return this}recordShowTextOperation(e,n=!1){return this}}Go=new WeakMap,Je=new WeakMap,Ct=new WeakMap,Ih=new WeakMap,Oh=new WeakMap,Mh=new WeakMap,dr=new WeakMap,_w=new WeakSet,ST=function(e,n){const r=new ArrayBuffer(e*4);S(this,Mh,new Uint8ClampedArray(r)),S(this,dr,new Uint32Array(r)),n&&n.length>0?(u(this,dr).set(n),u(this,dr).fill(xT,n.length)):u(this,dr).fill(xT)};var qr,Kr,Dh,zs,Xp,Nc,Rc,lt;class Tce{constructor(e,n=!1){E(this,qr,{__proto__:null});E(this,Kr,{__proto__:null,transform:[],moveText:[],sameLineText:[],[vf]:[]});E(this,Dh,new Map);E(this,zs,new Set);E(this,Xp,new Map);E(this,Nc);E(this,Rc);E(this,lt);S(this,lt,e),n&&(S(this,Nc,new Map),S(this,Rc,(r,i)=>{cL(u(this,Nc),i).dependencies.add(r)}))}get clipBox(){return u(this,lt).clipBox}growOperationsCount(e){u(this,lt).growOperationsCount(e)}save(e){return S(this,qr,{__proto__:u(this,qr)}),S(this,Kr,{__proto__:u(this,Kr),transform:{__proto__:u(this,Kr).transform},moveText:{__proto__:u(this,Kr).moveText},sameLineText:{__proto__:u(this,Kr).sameLineText},[vf]:{__proto__:u(this,Kr)[vf]}}),u(this,lt).save(e),this}restore(e){u(this,lt).restore(e,u(this,Rc));const n=Object.getPrototypeOf(u(this,qr));return n===null?this:(S(this,qr,n),S(this,Kr,Object.getPrototypeOf(u(this,Kr))),this)}recordOpenMarker(e){return u(this,lt).recordOpenMarker(e,u(this,Rc)),this}getOpenMarker(){return u(this,lt).getOpenMarker()}recordCloseMarker(e){return u(this,lt).recordCloseMarker(e,u(this,Rc)),this}beginMarkedContent(e){return u(this,lt).beginMarkedContent(e),this}endMarkedContent(e){return u(this,lt).endMarkedContent(e,u(this,Rc)),this}pushBaseTransform(e){return u(this,lt).pushBaseTransform(e),this}popBaseTransform(){return u(this,lt).popBaseTransform(),this}recordSimpleData(e,n){return u(this,qr)[e]=n,this}recordIncrementalData(e,n){return u(this,Kr)[e].push(n),this}resetIncrementalData(e,n){return u(this,Kr)[e].length=0,this}recordNamedData(e,n){return u(this,Dh).set(e,n),this}recordSimpleDataFromNamed(e,n,r){u(this,qr)[e]=u(this,Dh).get(n)??r}recordFutureForcedDependency(e,n){return this.recordIncrementalData(vf,n),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const n of e)n in u(this,qr)&&this.recordFutureForcedDependency(n,u(this,qr)[n]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of u(this,zs))this.recordFutureForcedDependency(vf,e);return this}resetBBox(e){return u(this,lt).resetBBox(e),this}recordClipBox(e,n,r,i,s,a){return u(this,lt).recordClipBox(e,n,r,i,s,a),this}recordBBox(e,n,r,i,s,a){return u(this,lt).recordBBox(e,n,r,i,s,a),this}recordCharacterBBox(e,n,r,i=1,s=0,a=0,o){const l=r.bbox;let c,h;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&u(this,Xp).get(r),c!==!1&&(h=[0,0,0,0],Q.axialAlignedBoundingBox(l,r.fontMatrix,h),(i!==1||s!==0||a!==0)&&Q.scaleMinMax([i,0,0,-i,s,a],h),c)))return this.recordBBox(e,n,h[0],h[2],h[1],h[3]);if(!o)return this.recordFullPageBBox(e);const d=o();return l&&h&&c===void 0&&(c=h[0]<=s-d.actualBoundingBoxLeft&&h[2]>=s+d.actualBoundingBoxRight&&h[1]<=a-d.actualBoundingBoxAscent&&h[3]>=a+d.actualBoundingBoxDescent,u(this,Xp).set(r,c),c)?this.recordBBox(e,n,h[0],h[2],h[1],h[3]):this.recordBBox(e,n,s-d.actualBoundingBoxLeft,s+d.actualBoundingBoxRight,a-d.actualBoundingBoxAscent,a+d.actualBoundingBoxDescent)}recordFullPageBBox(e){return u(this,lt).recordFullPageBBox(e),this}getSimpleIndex(e){return u(this,qr)[e]}recordDependencies(e,n){const r=u(this,zs),i=u(this,qr),s=u(this,Kr);
327for(const a of n)a in u(this,qr)?r.add(i[a]):a in s&&s[a].forEach(r.add,r);return this}recordNamedDependency(e,n){return u(this,Dh).has(n)&&u(this,zs).add(u(this,Dh).get(n)),this}recordOperation(e,n=!1){if(this.recordDependencies(e,[vf]),u(this,Nc)){const i=cL(u(this,Nc),e),{dependencies:s}=i;u(this,zs).forEach(s.add,s),u(this,lt)._savesStack.forEach(s.add,s),u(this,lt)._markedContentStack.forEach(s.add,s),s.delete(e),i.isRenderingOperation=!0}const r=!n&&e===u(this,lt)._pendingBBoxIdx;return u(this,lt).recordOperation(e,n,[u(this,zs),u(this,lt)._savesStack,u(this,lt)._markedContentStack]),r&&u(this,zs).clear(),this}recordShowTextOperation(e,n=!1){const r=Array.from(u(this,zs));this.recordOperation(e,n),this.recordIncrementalData("sameLineText",e);for(const i of r)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,n=!1){const r=!n&&e===u(this,lt)._pendingBBoxIdx;return u(this,lt).bboxToClipBoxDropOperation(e),r&&u(this,zs).clear(),this}take(){return u(this,Xp).clear(),u(this,lt).take()}takeDebugMetadata(){return u(this,Nc)}}qr=new WeakMap,Kr=new WeakMap,Dh=new WeakMap,zs=new WeakMap,Xp=new WeakMap,Nc=new WeakMap,Rc=new WeakMap,lt=new WeakMap;var ct,Qt,Vs,Qp,Jp;const lI=class lI{constructor(e,n,r){E(this,ct);E(this,Qt);E(this,Vs);E(this,Qp,0);E(this,Jp,0);if(e instanceof lI&&u(e,Vs)===!!r)return e;S(this,ct,e),S(this,Qt,n),S(this,Vs,!!r)}get clipBox(){return u(this,ct).clipBox}growOperationsCount(){throw new Error("Unreachable")}save(e){return jt(this,Jp)._++,u(this,ct).save(u(this,Qt)),this}restore(e){return u(this,Jp)>0&&(u(this,ct).restore(u(this,Qt)),jt(this,Jp)._--),this}recordOpenMarker(e){return jt(this,Qp)._++,this}getOpenMarker(){return u(this,Qp)>0?u(this,Qt):u(this,ct).getOpenMarker()}recordCloseMarker(e){return jt(this,Qp)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return u(this,ct).pushBaseTransform(e),this}popBaseTransform(){return u(this,ct).popBaseTransform(),this}recordSimpleData(e,n){return u(this,ct).recordSimpleData(e,u(this,Qt)),this}recordIncrementalData(e,n){return u(this,ct).recordIncrementalData(e,u(this,Qt)),this}resetIncrementalData(e,n){return u(this,ct).resetIncrementalData(e,u(this,Qt)),this}recordNamedData(e,n){return this}recordSimpleDataFromNamed(e,n,r){return u(this,ct).recordSimpleDataFromNamed(e,n,u(this,Qt)),this}recordFutureForcedDependency(e,n){return u(this,ct).recordFutureForcedDependency(e,u(this,Qt)),this}inheritSimpleDataAsFutureForcedDependencies(e){return u(this,ct).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return u(this,ct).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return u(this,Vs)||u(this,ct).resetBBox(u(this,Qt)),this}recordClipBox(e,n,r,i,s,a){return u(this,Vs)||u(this,ct).recordClipBox(u(this,Qt),n,r,i,s,a),this}recordBBox(e,n,r,i,s,a){return u(this,Vs)||u(this,ct).recordBBox(u(this,Qt),n,r,i,s,a),this}recordCharacterBBox(e,n,r,i,s,a,o){return u(this,Vs)||u(this,ct).recordCharacterBBox(u(this,Qt),n,r,i,s,a,o),this}recordFullPageBBox(e){return u(this,Vs)||u(this,ct).recordFullPageBBox(u(this,Qt)),this}getSimpleIndex(e){return u(this,ct).getSimpleIndex(e)}recordDependencies(e,n){return u(this,ct).recordDependencies(u(this,Qt),n),this}recordNamedDependency(e,n){return u(this,ct).recordNamedDependency(u(this,Qt),n),this}recordOperation(e){return u(this,ct).recordOperation(u(this,Qt),!0),this}recordShowTextOperation(e){return u(this,ct).recordShowTextOperation(u(this,Qt),!0),this}bboxToClipBoxDropOperation(e){return u(this,Vs)||u(this,ct).bboxToClipBoxDropOperation(u(this,Qt),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};ct=new WeakMap,Qt=new WeakMap,Vs=new WeakMap,Qp=new WeakMap,Jp=new WeakMap;let Vv=lI;const Zi={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:["f
327ilter","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 Lh,jh,Fh,Bh,$h,Cw;const rv=class rv{constructor(e){E(this,Lh);E(this,jh);E(this,Fh,4);E(this,Bh,0);E(this,$h,new(u(rv,Cw))(u(this,Fh)*6));S(this,Lh,e.width),S(this,jh,e.height)}record(e,n,r,i){if(u(this,Bh)===u(this,Fh)){S(this,Fh,u(this,Fh)*2);const o=new(u(rv,Cw))(u(this,Fh)*6);o.set(u(this,$h)),S(this,$h,o)}const s=Q.domMatrixToTransform(e.getTransform());let a;if(i[0]!==1/0){const o=vl.slice();Q.axialAlignedBoundingBox([0,-r,n,0],s,o);const l=Q.intersect(i,o);if(!l)return;const[c,h,d,f]=l;if(c!==o[0]||h!==o[1]||d!==o[2]||f!==o[3]){const p=Math.atan2(s[1],s[0]),m=Math.abs(Math.sin(p)),y=Math.abs(Math.cos(p));if(m<1e-6||y<1e-6||Math.abs(m-y)<1e-6)a=[c,h,c,f,d,h];else{const x=d-c,v=f-h,w=m*m,b=y*y,k=y*m,_=b-w,C=(v*b-x*k)/_,P=(v*k-x*w)/_;a=[c+P,h,c,h+C,d,f-C]}}}a||(a=[0,-r,0,0,n,-r],Q.applyTransform(a,s,0),Q.applyTransform(a,s,2),Q.applyTransform(a,s,4)),a[0]/=u(this,Lh),a[1]/=u(this,jh),a[2]/=u(this,Lh),a[3]/=u(this,jh),a[4]/=u(this,Lh),a[5]/=u(this,jh),u(this,$h).set(a,u(this,Bh)*6),jt(this,Bh)._++}take(){return u(this,$h).subarray(0,u(this,Bh)*6)}};Lh=new WeakMap,jh=new WeakMap,Fh=new WeakMap,Bh=new WeakMap,$h=new WeakMap,Cw=new WeakMap,E(rv,Cw,bn.isFloat16ArraySupported?Float16Array:Float32Array);let kT=rv;var Zp;class Pce{constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){E(this,Zp,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 n=this.styleElement.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),u(this,Zp).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:n,_inspectFont:r}){if(!(!e||u(this,Zp).has(e.loadedName))){if(Vt(!n,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:a}=e,o=new FontFace(i,s,a);this.addNativeFontFace(o);try{await o.load(),u(this,Zp).add(i),r==null||r(e)}catch{_e(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Ze("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 r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw _e(`Failed to load font '${r.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){var n;const e=!!((n=this._document)!=null&&n.fonts);return Se(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Se(this,"isSyncFontLoadingSupported",Li||bn.platform.isFirefox)}_queueLoadingCallback(e){function n(){for(Vt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){const s=r.shift();setTimeout(s.callback,0)}}const{loadingRequests:r}=this,i={done:!1,complete:n,callback:e};return r.push(i),i}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Se(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,n){function r(_,C){return _.charCodeAt(C)<<24|_.charCodeAt(C+1)<<16|_.charCodeAt(C+2)<<8|_.charCodeAt(C+3)&255}function i(_){return String.fromCharCode(_>>24&255,_>>16&255,_>>
3278&255,_&255)}function s(_,C,P,R){const O=_.substring(0,C),M=_.substring(C+P);return O+R+M}let a,o;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let h=0;function d(_,C){if(++h>30){_e("Load test font never loaded."),C();return}if(c.font="30px "+_,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(d.bind(null,_,C))}const f=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=s(p,976,f.length,f);const y=16,x=1482184792;let v=r(p,y);for(a=0,o=f.length-3;a<o;a+=4)v=v-x+r(f,a)|0;a<f.length&&(v=v-x+r(f+"XXX",a)|0),p=s(p,y,4,i(v));const w=`url(data:font/opentype;base64,${btoa(p)});`,b=`@font-face {font-family:"${f}";src:${w}}`;this.insertRule(b);const k=this._document.createElement("div");k.style.visibility="hidden",k.style.width=k.style.height="10px",k.style.position="absolute",k.style.top=k.style.left="0px";for(const _ of[e.loadedName,f]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=_,k.append(C)}this._document.body.append(k),d(f,()=>{k.remove(),n.complete()})}}Zp=new WeakMap;var ut;class Nce{constructor(e,n=null,r,i){F(this,"compiledGlyphs",Object.create(null));E(this,ut);S(this,ut,e),this._inspectFont=n,r&&(this.charProcOperatorList=r),i&&Object.assign(this,i)}createNativeFontFace(){var n;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(n=this._inspectFont)==null||n.call(this,this),e}createFontFaceRule(){var r;if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}return(r=this._inspectFont)==null||r.call(this,this,e),n}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];const r=this.loadedName+"_path_"+n;let i;try{i=e.get(r)}catch(a){_e(`getPathGenerator - ignoring character: "${a}".`)}const s=Cz(i==null?void 0:i.path);return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[n]=s}get black(){return u(this,ut).black}get bold(){return u(this,ut).bold}get disableFontFace(){return u(this,ut).disableFontFace}set disableFontFace(e){Se(this,"disableFontFace",!!e)}get fontExtraProperties(){return u(this,ut).fontExtraProperties}get isInvalidPDFjsFont(){return u(this,ut).isInvalidPDFjsFont}get isType3Font(){return u(this,ut).isType3Font}get italic(){return u(this,ut).italic}get missingFile(){return u(this,ut).missingFile}get remeasure(){return u(this,ut).remeasure}get vertical(){return u(this,ut).vertical}get ascent(){return u(this,ut).ascent}get defaultWidth(){return u(this,ut).defaultWidth}get descent(){return u(this,ut).descent}get bbox(){return u(this,ut).bbox}get fontMatrix(){return u(this,ut).fontMatrix}get fallbackName(){return u(this,ut).fallbackName}get loadedName(){return u(this,ut).loadedName}get mimetype(){return u(this,ut).mimetype}get name(){return u(this,ut).name}get data(){return u(this,ut).data}clearData(){u(this,ut).clearData()}get cssFontInfo(){return u(this,ut).cssFontInfo}get systemFontInfo(){return u(this,ut).systemFontInfo}get defaultVMetrics(){return u(this,ut).defaultVMetrics}}ut=new WeakMap;class l5{}F(l5,"strings",["fontFamily","fontWeight","italicAngle"]);class c5{}F(c5,"strings",["css","loadedName","baseFontName","src"]);const lr=class lr{};F(lr,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),F(lr,"numbers",["ascent","defaultWidth","descent"]),F(lr,"strings",["fallbackName","loadedName","mimetype","name"]),F(lr,"OFFSET_NUMBERS",Math.ceil(lr.bools.length*2/8)),F(lr,"OFFSET_BBOX",lr.OFFSET_NUMBERS+lr.numbers.length*8),F(lr,"OFFSET_FONT_MATRIX",lr.OFFSET_BBOX+1+2*4),F(lr,"OFFSET_DEFAULT_VMETRICS",lr.OFFSET_FONT_MATRIX+1+8*6),F(lr,"OFFSET_STRINGS",lr.OFFSET_DEFAULT_VMETRICS+1+2*3);let fi=lr;class Nr{}F(Nr,"KIND",0),F(Nr,"HAS_BBOX",1),F(Nr,"HAS_BACKGROUND",2),F(Nr,"SHADING_TYPE",3),F(Nr,"N_COORD",4),F(Nr,"N_COLOR",8),F(Nr,"N_STOP",12),F(Nr,"N_FIGURES",16);var Tw,j1,em,tm,$x;class Rce{constructor(e){E(this,tm);E(this,Tw);E(this,j1,new TextDecoder);E(this,em);S(this,Tw,e),S(this,em,new DataView(e))}get fontFamily(){return T(this,tm,$x).call(this,0)}get fontWeight(){return T(this,tm,$x).call(this,1)}get italicAngle(){return T(this,tm,$x).call(this,2)}}Tw=new WeakMap,j1=new WeakMap,em=new WeakMap,tm=new WeakSet,$x=function(e){Vt(e<l5.strings.length,"Invalid string index");let n=0;for(let i=0;i<e;i++)n+=u(this,em).getUint32(n)+4;const r=u(this,em).getUint32(n);return u(this,j1).decode(new Uint8Array(u(this,Tw),n+4,r))};var Uh,nm,Ua,zh,py;class Ice{constructor(e){E(this,zh);E(this,Uh);E(this,nm,new TextDecoder);E(this,Ua);S(this,Uh,e),S(this,Ua,new DataView(e))}
327get guessFallback(){return u(this,Ua).getUint8(0)!==0}get css(){return T(this,zh,py).call(this,0)}get loadedName(){return T(this,zh,py).call(this,1)}get baseFontName(){return T(this,zh,py).call(this,2)}get src(){return T(this,zh,py).call(this,3)}get style(){let e=1;e+=4+u(this,Ua).getUint32(e);const n=u(this,Ua).getUint32(e),r=u(this,nm).decode(new Uint8Array(u(this,Uh),e+4,n));e+=4+n;const i=u(this,Ua).getUint32(e),s=u(this,nm).decode(new Uint8Array(u(this,Uh),e+4,i));return{style:r,weight:s}}}Uh=new WeakMap,nm=new WeakMap,Ua=new WeakMap,zh=new WeakSet,py=function(e){Vt(e<c5.strings.length,"Invalid string index");let n=5;for(let i=0;i<e;i++)n+=u(this,Ua).getUint32(n)+4;const r=u(this,Ua).getUint32(n);return u(this,nm).decode(new Uint8Array(u(this,Uh),n+4,r))};var Hs,F1,on,it,Os,Ux,zx,my,AT;class Oce{constructor({buffer:e,extra:n}){E(this,it);E(this,Hs);E(this,F1,new TextDecoder);E(this,on);S(this,Hs,e),S(this,on,new DataView(e)),n&&Object.assign(this,n)}get black(){return T(this,it,Os).call(this,0)}get bold(){return T(this,it,Os).call(this,1)}get disableFontFace(){return T(this,it,Os).call(this,2)}get fontExtraProperties(){return T(this,it,Os).call(this,3)}get isInvalidPDFjsFont(){return T(this,it,Os).call(this,4)}get isType3Font(){return T(this,it,Os).call(this,5)}get italic(){return T(this,it,Os).call(this,6)}get missingFile(){return T(this,it,Os).call(this,7)}get remeasure(){return T(this,it,Os).call(this,8)}get vertical(){return T(this,it,Os).call(this,9)}get ascent(){return T(this,it,Ux).call(this,0)}get defaultWidth(){return T(this,it,Ux).call(this,1)}get descent(){return T(this,it,Ux).call(this,2)}get bbox(){return T(this,it,zx).call(this,fi.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return T(this,it,zx).call(this,fi.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return T(this,it,zx).call(this,fi.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}get fallbackName(){return T(this,it,my).call(this,0)}get loadedName(){return T(this,it,my).call(this,1)}get mimetype(){return T(this,it,my).call(this,2)}get name(){return T(this,it,my).call(this,3)}get data(){const{offset:e,length:n}=T(this,it,AT).call(this);return n===0?void 0:new Uint8Array(u(this,Hs),e+4,n)}clearData(){const{offset:e,length:n}=T(this,it,AT).call(this);n!==0&&(u(this,on).setUint32(e,0),S(this,Hs,new Uint8Array(u(this,Hs),0,e+4).slice().buffer),S(this,on,new DataView(u(this,Hs))))}get cssFontInfo(){let e=fi.OFFSET_STRINGS;const n=u(this,on).getUint32(e);e+=4+n;const r=u(this,on).getUint32(e);e+=4+r;const i=u(this,on).getUint32(e);if(i===0)return null;const s=new Uint8Array(i);return s.set(new Uint8Array(u(this,Hs),e+4,i)),new Rce(s.buffer)}get systemFontInfo(){let e=fi.OFFSET_STRINGS;const n=u(this,on).getUint32(e);e+=4+n;const r=u(this,on).getUint32(e);if(r===0)return null;const i=new Uint8Array(r);return i.set(new Uint8Array(u(this,Hs),e+4,r)),new Ice(i.buffer)}}Hs=new WeakMap,F1=new WeakMap,on=new WeakMap,it=new WeakSet,Os=function(e){Vt(e<fi.bools.length,"Invalid boolean index");const n=Math.floor(e/4),r=e*2%8,i=u(this,on).getUint8(n)>>r&3;return i===0?void 0:i===2},Ux=function(e){return Vt(e<fi.numbers.length,"Invalid number index"),u(this,on).getFloat64(fi.OFFSET_NUMBERS+e*8)},zx=function(e,n,r,i){const s=u(this,on).getUint8(e);if(s===0)return;Vt(s===n,"Invalid array length."),e+=1;const a=new Array(s);for(let o=0;o<s;o++)a[o]=u(this,on)[r](e,!0),e+=i;return a},my=function(e){Vt(e<fi.strings.length,"Invalid string index");let n=fi.OFFSET_STRINGS+4;for(let i=0;i<e;i++)n+=u(this,on).getUint32(n)+4;const r=u(this,on).getUint32(n);return u(this,F1).decode(new Uint8Array(u(this,Hs),n+4,r))},AT=function(){let e=fi.OFFSET_STRINGS;const n=u(this,on).getUint32(e);e+=4+n;const r=u(this,on).getUint32(e);e+=4+r;const i=u(this,on).getUint32(e);e+=4+i;const s=u(this,on).getUint32(e);return{offset:e,length:s}};class Mce{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){const e=this.view,n=this.data[Nr.KIND],r=!!this.data[Nr.HAS_BBOX],i=!!this.data[Nr.HAS_BACKGROUND],s=e.getUint32(Nr.N_COORD,!0),a=e.getUint32(Nr.N_COLOR,!0),o=e.getUint32(Nr.N_STOP,!0);let l=20;const c=new Float32Array(this.buffer,l,s*2);l+=s*8;const h=new Uint8Array(this.buffer,l,a*4);l+=a*4;const d=[];for(let m=0;m<o;++m){const y=e.getFloat32(l,!0);l+=4;
327const x=e.getUint32(l,!0);l+=4,d.push([y,`#${x.toString(16).padStart(6,"0")}`])}let f=null;if(r){f=[];for(let m=0;m<4;++m)f.push(e.getFloat32(l,!0)),l+=4}let p=null;if(i&&(p=new Uint8Array(this.buffer,l,3),l+=3),n===1)return["RadialAxial","axial",f,d,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(n===2)return["RadialAxial","radial",f,d,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(n===3){const m=this.data[Nr.SHADING_TYPE];let y=null;if(c.length>0){y=vl.slice();for(let x=0,v=c.length;x<v;x+=2)Q.pointBoundingBox(c[x],c[x+1],y)}return["Mesh",m,c,h,s,y,f,p]}throw new Error(`Unsupported pattern kind: ${n}`)}}var rm;class Dce{constructor(e){E(this,rm);S(this,rm,e)}get path(){return bn.isFloat16ArraySupported?new Float16Array(u(this,rm)):new Float32Array(u(this,rm))}}rm=new WeakMap;function Lce(t){if(t instanceof URL)return t;if(typeof t=="string"){if(Li){if(/^[a-z][a-z0-9\-+.]+:/i.test(t))return new URL(t);const n=process.getBuiltinModule("url");return new URL(n.pathToFileURL(t))}const e=URL.parse(t,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 jce(t){if(Li&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return Xk(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t==null?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Wb(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const ET=t=>typeof t=="object"&&Number.isInteger(t==null?void 0:t.num)&&t.num>=0&&Number.isInteger(t==null?void 0:t.gen)&&t.gen>=0,Fce=t=>typeof t=="object"&&typeof(t==null?void 0:t.name)=="string",Bce=dce.bind(null,ET,Fce);var qo,B1;class $ce{constructor(){E(this,qo,new Map);E(this,B1,Promise.resolve())}postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};u(this,B1).then(()=>{for(const[i]of u(this,qo))i.call(this,r)})}addEventListener(e,n,r=null){let i=null;if((r==null?void 0:r.signal)instanceof AbortSignal){const{signal:s}=r;if(s.aborted){_e("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,n);i=()=>s.removeEventListener("abort",a),s.addEventListener("abort",a)}u(this,qo).set(n,i)}removeEventListener(e,n){const r=u(this,qo).get(n);r==null||r(),u(this,qo).delete(n)}terminate(){for(const[,e]of u(this,qo))e==null||e();u(this,qo).clear()}}qo=new WeakMap,B1=new WeakMap;const Gb={DATA:1,ERROR:2},hn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function uL(){}function Hr(t){if(t instanceof Au||t instanceof ZC||t instanceof J2||t instanceof f1||t instanceof TE)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||Ze('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Au(t.message);case"InvalidPDFException":return new ZC(t.message);case"PasswordException":return new J2(t.message,t.code);case"ResponseException":return new f1(t.message,t.status,t.missing);case"UnknownErrorException":return new TE(t.message,t.details)}return new TE(t.message,t.toString())}var im,ks,u5,h5,d5,Vx;class gy{constructor(e,n,r){E(this,ks);E(this,im,new AbortController);this.sourceName=e,this.targetName=n,this.comObj=r,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),r.addEventListener("message",T(this,ks,u5).bind(this),{signal:u(this,im).signal})}on(e,n){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=n}send(e,n,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},r)}
327sendWithPromise(e,n,r){const i=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:n},r)}catch(a){s.reject(a)}return s.promise}sendWithStream(e,n,r,i){const s=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const h=Promise.withResolvers();return this.streamControllers[s]={controller:c,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:s,data:n,desiredSize:c.desiredSize},i),h.promise},pull:c=>{const h=Promise.withResolvers();return this.streamControllers[s].pullCall=h,l.postMessage({sourceName:a,targetName:o,stream:hn.PULL,streamId:s,desiredSize:c.desiredSize}),h.promise},cancel:c=>{Vt(c instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[s].cancelCall=h,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:hn.CANCEL,streamId:s,reason:Hr(c)}),h.promise}},r)}destroy(){var e;(e=u(this,im))==null||e.abort(),S(this,im,null)}}im=new WeakMap,ks=new WeakSet,u5=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){T(this,ks,d5).call(this,e);return}if(e.callback){const r=e.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===Gb.DATA)i.resolve(e.data);else if(e.callback===Gb.ERROR)i.reject(Hr(e.reason));else throw new Error("Unexpected callback case");return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,i=e.sourceName,s=this.comObj;Promise.try(n,e.data).then(function(a){s.postMessage({sourceName:r,targetName:i,callback:Gb.DATA,callbackId:e.callbackId,data:a})},function(a){s.postMessage({sourceName:r,targetName:i,callback:Gb.ERROR,callbackId:e.callbackId,reason:Hr(a)})});return}if(e.streamId){T(this,ks,h5).call(this,e);return}n(e.data)},h5=function(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(c,h=1,d){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:r,targetName:i,stream:hn.ENQUEUE,streamId:n,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:hn.CLOSE,streamId:n}),delete a.streamSinks[n])},error(c){Vt(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:r,targetName:i,stream:hn.ERROR,streamId:n,reason:Hr(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[n]=l,Promise.try(o,e.data,l).then(function(){s.postMessage({sourceName:r,targetName:i,stream:hn.START_COMPLETE,streamId:n,success:!0})},function(c){s.postMessage({sourceName:r,targetName:i,stream:hn.START_COMPLETE,streamId:n,reason:Hr(c)})})},d5=function(e){const n=e.streamId,r=this.sourceName,i=e.sourceName,s=this.comObj,a=this.streamControllers[n],o=this.streamSinks[n];switch(e.stream){case hn.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Hr(e.reason));break;case hn.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Hr(e.reason));break;case hn.PULL:if(!o){s.postMessage({sourceName:r,targetName:i,stream:hn.PULL_COMPLETE,streamId:n,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||uL).then(function(){s.postMessage({sourceName:r,targetName:i,stream:hn.PULL_COMPLETE,streamId:n,success:!0})},function(c){s.postMessage({sourceName:r,targetName:i,stream:hn.PULL_COMPLETE,streamId:n,reason:Hr(c)})});break;case hn.ENQUEUE:if(Vt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case hn.CLOSE:if(Vt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),T(this,ks,Vx).call(this,a,n);break;case hn.ERROR:Vt(a,"error should have stream controller"),a.controller.error(Hr(e.reason)),T(this,ks,Vx).call(this,a,n);break;case hn.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Hr(e.reason)),T(this,ks,Vx).call(this,a,n);break;case hn.CANCEL:if(!o)break;const l=Hr(e.reason);Promise.try(o.onCancel||uL,l).then(function(){s.postMessage({sourceName:r,targetName:i,stream:hn.CANCEL_COMPLETE,streamId:n,success:!0})},function(c){s.postMessage({sourceName:r,targetName:i,stream:hn.CANCEL_COMPLETE,streamId:n,reason:Hr(c)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}},Vx=async function(e,n){var r,i,s;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(i=e.pullCall)==null?void 0:i.promise,(s=e.cancelCall)==null?void 0:s.promise]),delete this.streamControllers[n]};var $1;class f5{constructor({cMapUrl:e=null,standardFontDataUrl:n=null,wasmUrl:r=null}){E(this,$1,Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"}));this.cMapUrl=e,this.standardFontDataUrl=n,this.wasmUrl=r}async fetch({kind:e,filename:n}
327){switch(e){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:Ze(`Not implemented: ${e}`)}const r=this[e];if(!r)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const i=`${r}${n}`;return this._fetch(i,e).catch(s=>{throw new Error(`Unable to load ${u(this,$1)[e]} data at: ${i}`)})}async _fetch(e,n){Ze("Abstract method `_fetch` called.")}}$1=new WeakMap;class hL extends f5{async _fetch(e,n){const r=n==="cMapUrl"&&!e.endsWith(".bcmap")?"text":"bytes",i=await HR(e,r);return i instanceof Uint8Array?i:Xk(i)}}var Pw;class p5{constructor({enableHWA:e=!1}){E(this,Pw,!1);S(this,Pw,e)}create(e,n){if(e<=0||n<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,n);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!u(this,Pw)})}}reset({canvas:e},n,r){if(!e)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");e.width=n,e.height=r}destroy(e){const{canvas:n}=e;if(!n)throw new Error("Canvas is not specified");n.width=n.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){Ze("Abstract method `_createCanvas` called.")}}Pw=new WeakMap;class Uce extends p5{constructor({ownerDocument:e=globalThis.document,enableHWA:n=!1}){super({enableHWA:n}),this._document=e}_createCanvas(e,n){const r=this._document.createElement("canvas");return r.width=e,r.height=n,r}}class m5{addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,r,i,s){return"none"}destroy(e=!1){}}var Vh,sm,Ko,Yo,fr,Hh,Wh,ne,or,yy,Nf,Hx,Rf,g5,_T,If,vy,wy,CT,by;class zce extends m5{constructor({docId:n,ownerDocument:r=globalThis.document}){super();E(this,ne);E(this,Vh);E(this,sm);E(this,Ko);E(this,Yo);E(this,fr);E(this,Hh);E(this,Wh,0);S(this,Yo,n),S(this,fr,r)}addFilter(n){if(!n)return"none";let r=u(this,ne,or).get(n);if(r)return r;const[i,s,a]=T(this,ne,Hx).call(this,n),o=n.length===1?i:`${i}${s}${a}`;if(r=u(this,ne,or).get(o),r)return u(this,ne,or).set(n,r),r;const l=`g_${u(this,Yo)}_transfer_map_${jt(this,Wh)._++}`,c=T(this,ne,Rf).call(this,l);u(this,ne,or).set(n,c),u(this,ne,or).set(o,c);const h=T(this,ne,If).call(this,l);return T(this,ne,wy).call(this,i,s,a,h),c}addHCMFilter(n,r){var m;const i=`${n}-${r}`,s="base";let a=u(this,ne,yy).get(s);if((a==null?void 0:a.key)===i||(a?((m=a.filter)==null||m.remove(),a.key=i,a.url="none",a.filter=null):(a={key:i,url:"none",filter:null},u(this,ne,yy).set(s,a)),!n||!r))return a.url;const o=T(this,ne,by).call(this,n);n=Q.makeHexColor(...o);const l=T(this,ne,by).call(this,r);if(r=Q.makeHexColor(...l),u(this,ne,Nf).style.color="",n==="#000000"&&r==="#ffffff"||n===r)return a.url;const c=new Array(256);for(let y=0;y<=255;y++){const x=y/255;c[y]=x<=.03928?x/12.92:((x+.055)/1.055)**2.4}const h=c.join(","),d=`g_${u(this,Yo)}_hcm_filter`,f=a.filter=T(this,ne,If).call(this,d);T(this,ne,wy).call(this,h,h,h,f),T(this,ne,_T).call(this,f);const p=(y,x)=>{const v=o[y]/255,w=l[y]/255,b=new Array(x+1);for(let k=0;k<=x;k++)b[k]=v+k/x*(w-v);return b.join(",")};return T(this,ne,wy).call(this,p(0,5),p(1,5),p(2,5),f),a.url=T(this,ne,Rf).call(this,d),a.url}addAlphaFilter(n){let r=u(this,ne,or).get(n);if(r)return r;const[i]=T(this,ne,Hx).call(this,[n]),s=`alpha_${i}`;if(r=u(this,ne,or).get(s),r)return u(this,ne,or).set(n,r),r;const a=`g_${u(this,Yo)}_alpha_map_${jt(this,Wh)._++}`,o=T(this,ne,Rf).call(this,a);u(this,ne,or).set(n,o),u(this,ne,or).set(s,o);const l=T(this,ne,If).call(this,a);return T(this,ne,CT).call(this,i,l),o}addLuminosityFilter(n){let r=u(this,ne,or).get(n||"luminosity");if(r)return r;let i,s;if(n?([i]=T(this,ne,Hx).call(this,[n]),s=`luminosity_${i}`):s="luminosity",r=u(this,ne,or).get(s),r)return u(this,ne,or).set(n,r),r;const a=`g_${u(this,Yo)}_luminosity_map_${jt(this,Wh)._++}`,o=T(this,ne,Rf).call(this,a);u(this,ne,or).set(n,o),u(this,ne,or).set(s,o);const l=T(this,ne,If).call(this,a);return T(this,ne,g5).call(this,l),n&&T(this,ne,CT).call(this,i,l),o}addHighlightHCMFilter(n,r,i,s,a){var w;const o=`${r}-${i}-${s}-${a}`;let l=u(this,ne,yy).get(n);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},u(this,ne,yy).set(n,l)),!r||!i))return l.url;const[c,h]=[r,i].map(T(this,ne,by).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),f=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[p,m]=[s,a].map(T(this,ne,by).bind(this));f<d&&([d,f,p,m]=[f,d,m,p]),u(this,ne,Nf).style.color="";const y=(b,k,_)=>{const C=new Array(256),P=(f-d)/_,R=b/255,O=(k-b)/(255*_);let M=0;for(let D=0;D<=_;D++){const j=Math.round(d+D*P),U=R+D*O;for(let B=M;B<=j;B++)C[B]=U;M=j+1}for(let D=M;D<256;D++)C[D]=C[M-1];return C.join(",")},x=`g_${u(this,Yo)}_hcm_${n}
327_filter`,v=l.filter=T(this,ne,If).call(this,x);return T(this,ne,_T).call(this,v),T(this,ne,wy).call(this,y(p[0],m[0],5),y(p[1],m[1],5),y(p[2],m[2],5),v),l.url=T(this,ne,Rf).call(this,x),l.url}destroy(n=!1){var r,i,s,a;n&&((r=u(this,Hh))!=null&&r.size)||((i=u(this,Ko))==null||i.parentNode.parentNode.remove(),S(this,Ko,null),(s=u(this,sm))==null||s.clear(),S(this,sm,null),(a=u(this,Hh))==null||a.clear(),S(this,Hh,null),S(this,Wh,0))}}Vh=new WeakMap,sm=new WeakMap,Ko=new WeakMap,Yo=new WeakMap,fr=new WeakMap,Hh=new WeakMap,Wh=new WeakMap,ne=new WeakSet,or=function(){return u(this,sm)||S(this,sm,new Map)},yy=function(){return u(this,Hh)||S(this,Hh,new Map)},Nf=function(){if(!u(this,Ko)){const n=u(this,fr).createElement("div"),{style:r}=n;r.visibility="hidden",r.contain="strict",r.width=r.height=0,r.position="absolute",r.top=r.left=0,r.zIndex=-1;const i=u(this,fr).createElementNS(Ao,"svg");i.setAttribute("width",0),i.setAttribute("height",0),S(this,Ko,u(this,fr).createElementNS(Ao,"defs")),n.append(i),i.append(u(this,Ko)),u(this,fr).body.append(n)}return u(this,Ko)},Hx=function(n){if(n.length===1){const c=n[0],h=new Array(256);for(let f=0;f<256;f++)h[f]=c[f]/255;const d=h.join(",");return[d,d,d]}const[r,i,s]=n,a=new Array(256),o=new Array(256),l=new Array(256);for(let c=0;c<256;c++)a[c]=r[c]/255,o[c]=i[c]/255,l[c]=s[c]/255;return[a.join(","),o.join(","),l.join(",")]},Rf=function(n){if(u(this,Vh)===void 0){S(this,Vh,"");const r=u(this,fr).URL;r!==u(this,fr).baseURI&&(Qk(r)?_e('#createUrl: ignore "data:"-URL for performance reasons.'):S(this,Vh,kz(r,"")))}return`url(${u(this,Vh)}#${n})`},g5=function(n){const r=u(this,fr).createElementNS(Ao,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),n.append(r)},_T=function(n){const r=u(this,fr).createElementNS(Ao,"feColorMatrix");r.setAttribute("type","matrix"),r.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"),n.append(r)},If=function(n){const r=u(this,fr).createElementNS(Ao,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",n),u(this,ne,Nf).append(r),r},vy=function(n,r,i){const s=u(this,fr).createElementNS(Ao,r);s.setAttribute("type","discrete"),s.setAttribute("tableValues",i),n.append(s)},wy=function(n,r,i,s){const a=u(this,fr).createElementNS(Ao,"feComponentTransfer");
327s.append(a),T(this,ne,vy).call(this,a,"feFuncR",n),T(this,ne,vy).call(this,a,"feFuncG",r),T(this,ne,vy).call(this,a,"feFuncB",i)},CT=function(n,r){const i=u(this,fr).createElementNS(Ao,"feComponentTransfer");r.append(i),T(this,ne,vy).call(this,i,"feFuncA",n)},by=function(n){return u(this,ne,Nf).style.color=n,Z0(getComputedStyle(u(this,ne,Nf)).getPropertyValue("color"))};Li&&_e("Please use the `legacy` build in Node.js environments.");async function Vce(t){const n=await process.getBuiltinModule("fs/promises").readFile(t);return new Uint8Array(n)}class Hce extends m5{}class Wce extends p5{_createCanvas(e,n){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,n)}}class Gce extends f5{async _fetch(e,n){return Vce(e)}}const qce=`
328struct Uniforms {
329  offsetX      : f32,
330  offsetY      : f32,
331  scaleX       : f32,
332  scaleY       : f32,
333  paddedWidth  : f32,
334  paddedHeight : f32,
335  borderSize   : f32,
336  _pad         : f32,
337};
338
339@group(0) @binding(0) var<uniform> u : Uniforms;
340
341struct VertexInput {
342  @location(0) position : vec2<f32>,
343  @location(1) color    : vec4<f32>,
344};
345
346struct VertexOutput {
347  @builtin(position) position : vec4<f32>,
348  @location(0)       color    : vec3<f32>,
349};
350
351@vertex
352fn vs_main(in : VertexInput) -> VertexOutput {
353  var out : VertexOutput;
354  let cx = (in.position.x + u.offsetX) * u.scaleX;
355  let cy = (in.position.y + u.offsetY) * u.scaleY;
356  out.position = vec4<f32>(
357    ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
358    1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
359    0.0,
360    1.0
361  );
362  out.color = in.color.rgb;
363  return out;
364}
365
366@fragment
367fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
368  return vec4<f32>(in.color, 1.0);
369}
370`;var U1,Xo,Gh,am,z1,y5;class Kce{constructor(){E(this,z1);E(this,U1,null);E(this,Xo,null);E(this,Gh,null);E(this,am,null)}init(){return u(this,U1)||S(this,U1,T(this,z1,y5).call(this))}get isReady(){return u(this,Xo)!==null}loadMeshShader(){if(!u(this,Xo)||u(this,Gh))return;const e=u(this,Xo).createShaderModule({code:qce});S(this,Gh,u(this,Xo).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:u(this,am)}]},primitive:{topology:"triangle-list"}}))}draw(e,n,r,i,s,a,o,l){this.loadMeshShader();const c=u(this,Xo),{offsetX:h,offsetY:d,scaleX:f,scaleY:p}=i,m=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(m,0,e);const y=c.createBuffer({size:Math.max(n.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});n.byteLength>0&&c.queue.writeBuffer(y,0,n);const x=c.createBuffer({size:8*4,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(x,0,new Float32Array([h,d,f,p,a,o,l,0]));const v=c.createBindGroup({layout:u(this,Gh).getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:x}}]}),w=new OffscreenCanvas(a,o),b=w.getContext("webgpu");b.configure({device:c,format:u(this,am),alphaMode:s?"opaque":"premultiplied"});const k=s?{r:s[0]/255,g:s[1]/255,b:s[2]/255,a:1}:{r:0,g:0,b:0,a:0},_=c.createCommandEncoder(),C=_.beginRenderPass({colorAttachments:[{view:b.getCurrentTexture().createView(),clearValue:k,loadOp:"clear",storeOp:"store"}]});return r>0&&(C.setPipeline(u(this,Gh)),C.setBindGroup(0,v),C.setVertexBuffer(0,m),C.setVertexBuffer(1,y),C.draw(r)),C.end(),c.queue.submit([_.finish()]),m.destroy(),y.destroy(),x.destroy(),w.transferToImageBitmap()}}U1=new WeakMap,Xo=new WeakMap,Gh=new WeakMap,am=new WeakMap,z1=new WeakSet,y5=async function(){var e;if(!((e=globalThis.navigator)!=null&&e.gpu))return!1;try{const n=await navigator.gpu.requestAdapter();
370return n?(S(this,am,navigator.gpu.getPreferredCanvasFormat()),S(this,Xo,await n.requestDevice()),!0):!1}catch{return!1}};const Jk=new Kce;function Yce(){return Jk.init()}function Xce(){return Jk.isReady}function Qce(){Jk.loadMeshShader()}function Jce(t,e,n,r,i,s,a,o){return Jk.draw(t,e,n,r,i,s,a,o)}const Zn={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function Wx(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,r),t.clip(i)}class YR{isModifyingCurrentTransform(){return!1}getPattern(){Ze("Abstract method `getPattern` called.")}}class Zce extends YR{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,n=null){let r,i=this._p0,s=this._p1;if(n&&(i=i.slice(),s=s.slice(),Q.applyTransform(i,n),Q.applyTransform(s,n)),this._type==="axial")r=e.createLinearGradient(i[0],i[1],s[0],s[1]);else if(this._type==="radial"){let a=this._r0,o=this._r1;if(n){const l=new Float32Array(2);Q.singularValueDecompose2dScale(n,l),a*=l[0],o*=l[0]}r=e.createRadialGradient(i[0],i[1],a,s[0],s[1],o)}for(const a of this._colorStops)r.addColorStop(a[0],a[1]);return r}_createReversedGradient(e,n=null){let r=this._p1,i=this._p0;n&&(r=r.slice(),i=i.slice(),Q.applyTransform(r,n),Q.applyTransform(i,n));let s=this._r1,a=this._r0;if(n){const c=new Float32Array(2);Q.singularValueDecompose2dScale(n,c),s*=c[0],a*=c[0]}const o=e.createRadialGradient(r[0],r[1],s,i[0],i[1],a),l=this._colorStops.map(([c,h])=>[1-c,h]).reverse();for(const[c,h]of l)o.addColorStop(c,h);return o}getPattern(e,n,r,i){let s;if(i===Zn.STROKE||i===Zn.FILL){if(this.isOriginBased()){let f=Q.transform(r,n.baseTransform);this.matrix&&(f=Q.transform(f,this.matrix));const p=.001,m=Math.hypot(f[0],f[1]),y=Math.hypot(f[2],f[3]),x=(f[0]*f[2]+f[1]*f[3])/(m*y);if(Math.abs(x)<p)if(this.isRadial()){if(Math.abs(m-y)<p)return this._createGradient(e,f)}else return this._createGradient(e,f)}const a=n.current.getClippedPathBoundingBox(i,Tt(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=n.canvasFactory.create(o,l),h=c.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),r=Q.transform(r,[1,0,0,1,a[0],a[1]]),h.transform(...n.baseTransform),this.matrix&&h.transform(...this.matrix),Wx(h,this._bbox),this.areConic()&&(h.fillStyle=this._createReversedGradient(h),h.fill()),h.fillStyle=this._createGradient(h),h.fill(),s=e.createPattern(c.canvas,"no-repeat"),n.canvasFactory.destroy(c);const d=new DOMMatrix(r);s.setTransform(d)}else this.areConic()&&(e.save(),Wx(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),Wx(e,this._bbox),s=this._createGradient(e);return s}}function eue(t,e,n,r,i,s,a,o){const l=e.coords,c=e.colors,h=t.data,d=t.width*4;let f;l[n*2+1]>l[r*2+1]&&(f=n,n=r,r=f,f=s,s=a,a=f),l[r*2+1]>l[i*2+1]&&(f=r,r=i,i=f,f=a,a=o,o=f),l[n*2+1]>l[r*2+1]&&(f=n,n=r,r=f,f=s,s=a,a=f);const p=(l[n*2]+e.offsetX)*e.scaleX,m=(l[n*2+1]+e.offsetY)*e.scaleY,y=(l[r*2]+e.offsetX)*e.scaleX,x=(l[r*2+1]+e.offsetY)*e.scaleY,v=(l[i*2]+e.offsetX)*e.scaleX,w=(l[i*2+1]+e.offsetY)*e.scaleY;if(m>=w)return;const b=c[s*4],k=c[s*4+1],_=c[s*4+2],C=c[a*4],P=c[a*4+1],R=c[a*4+2],O=c[o*4],M=c[o*4+1],D=c[o*4+2],j=Math.round(m),U=Math.round(w);let B,z,$,W,L,V,N,G;for(let Y=j;Y<=U;Y++){if(Y<x){const he=Y<m?0:(m-Y)/(m-x);B=p-(p-y)*he,z=b-(b-C)*he,$=k-(k-P)*he,W=_-(_-R)*he}else{let he;Y>w?he=1:x===w?he=0:he=(x-Y)/(x-w),B=y-(y-v)*he,z=C-(C-O)*he,$=P-(P-M)*he,W=R-(R-D)*he}let I;Y<m?I=0:Y>w?I=1:I=(m-Y)/(m-w),L=p-(p-v)*I,V=b-(b-O)*I,N=k-(k-M)*I,G=_-(_-D)*I;const we=Math.round(Math.min(B,L)),Oe=Math.round(Math.max(B,L));let oe=d*Y+we*4;for(let he=we;he<=Oe;he++)I=(B-he)/(B-L),I<0?I=0:I>
vendor: 9,855 bytes, line 370
3701&&(I=1),h[oe++]=z-(z-V)*I|0,h[oe++]=$-($-N)*I|0,h[oe++]=W-(W-G)*I|0,h[oe++]=255}}class tue extends YR{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,Qce()}_createMeshCanvas(e,n,r){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,h=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3)||1,f=Math.min(Math.ceil(Math.abs(h*e[1]*1.1)),3e3)||1,p=c?c/d:1,m=h?h/f:1,y={coords:this._posData,colors:this._colData,offsetX:-o,offsetY:-l,scaleX:1/p,scaleY:1/m},x=d+2*2,v=f+2*2,w=r.create(x,v);if(Xce()&&this._vertexCount>48)w.context.drawImage(Jce(this._posData,this._colData,this._vertexCount,y,n,x,v,2),0,0);else{const b=w.context.createImageData(d,f);if(n){const k=b.data;for(let _=0,C=k.length;_<C;_+=4)k[_]=n[0],k[_+1]=n[1],k[_+2]=n[2],k[_+3]=255}for(let k=0,_=this._vertexCount;k<_;k+=3)eue(b,y,k,k+1,k+2,k,k+1,k+2);w.context.putImageData(b,2,2)}return{canvas:w.canvas,offsetX:o-2*p,offsetY:l-2*m,scaleX:p,scaleY:m}}isModifyingCurrentTransform(){return!0}getPattern(e,n,r,i){Wx(e,this._bbox);const s=new Float32Array(2);if(i===Zn.SHADING)Q.singularValueDecompose2dScale(Tt(e),s);else if(this.matrix){Q.singularValueDecompose2dScale(this.matrix,s);const[l,c]=s;Q.singularValueDecompose2dScale(n.baseTransform,s),s[0]*=l,s[1]*=c}else Q.singularValueDecompose2dScale(n.baseTransform,s);const a=this._createMeshCanvas(s,i===Zn.SHADING?null:this._background,n.canvasFactory);i!==Zn.SHADING&&(e.setTransform(...n.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 n.canvasFactory.destroy(a),o}}class nue extends YR{getPattern(){return"hotpink"}}function rue(t){switch(t[0]){case"RadialAxial":return new Zce(t);case"Mesh":return new tue(t);case"Dummy":return new nue}throw new Error(`Unknown IR type: ${t[0]}`)}const dL={COLORED:1,UNCOLORED:2},V1=class V1{constructor(e,n,r,i){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=n,this.canvasGraphicsFactory=r,this.baseTransform=i,this.patternBaseMatrix=this.matrix?Q.transform(i,this.matrix):i}canSkipPatternCanvas([e,n,r,i]){const[s,a,o,l]=this.bbox,c=Math.abs(this.xstep),h=Math.abs(this.ystep);if(e>c+1e-6||n>h+1e-6)return null;const d=Math.floor((r-o)/c)+1,f=Math.ceil((r+e-s)/c)-1,p=Math.floor((i-l)/h)+1,m=Math.ceil((i+n-a)/h)-1;return f<=d&&m<=p?[d,p]:null}updatePatternDims(e,n){const r=Q.inverseTransform(this.patternBaseMatrix),i=[e[0],e[1]],s=[e[2],e[3]];Q.applyTransform(i,r),Q.applyTransform(s,r),n[0]=Math.abs(s[0]-i[0]),n[1]=Math.abs(s[1]-i[1]),n[2]=Math.min(i[0],s[0]),n[3]=Math.min(i[1],s[1])}_renderTileCanvas(e,n,r,i){var f,p;const[s,a,o,l]=this.bbox,c=e.canvasFactory.create(r.size,i.size),h=c.context,d=this.canvasGraphicsFactory.createCanvasGraphics(h,n);return d.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(d,this.paintType,this.color),h.translate(-r.scale*s,-i.scale*a),d.transform(0,r.scale,0,0,i.scale,0,0),h.save(),(f=d.dependencyTracker)==null||f.save(),this.clipBbox(d,s,a,o,l),d.baseTransform=Tt(d.ctx),d.executeOperatorList(this.operatorList),d.endDrawing(),(p=d.dependencyTracker)==null||p.restore(),h.restore(),c}_getCombinedScales(){const e=new Float32Array(2);Q.singularValueDecompose2dScale(this.matrix,e);const[n,r]=e;return Q.singularValueDecompose2dScale(this.baseTransform,e),[n*e[0],r*e[1]]}drawPattern(e,n,r=!1,[i,s],a){const[o,l,c,h]=this.bbox,d=e.dependencyTracker;if(d&&(e.dependencyTracker=new Vv(d,a)),e.save(),r?e.ctx.clip(n,"evenodd"):e.ctx.clip(n),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(i*this.xstep,s*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!=="source-over"||e.inSMaskMode){const f=c-o,p=h-l,[m,y]=this._getCombinedScales(),x=this.getSizeAndScale(f,this.ctx.canvas.width,m),v=this.getSizeAndScale(p,this.ctx.canvas.height,y),w=this._renderTileCanvas(e,a,x,v);e.ctx.drawImage(w.canvas,o,l,f,p),e.canvasFactory.destroy(w)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,l,c,h),e.baseTransformStack.push(e.baseTransform),e.baseTransform=Tt(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),d&&(e.dependencyTracker=d)}createPatternCanvas(e,n){const[r,i,s,a]=this.bbox,o=s-r,l=a-i;let{xstep:c,ystep:h}=this;c=Math.abs(c),h=Math.abs(h),Yk("TilingType: "+this.tilingType);const[d,f]=this._getCombinedScales();let p=o,m=l,y=!1,x=!1;Math.ceil(c*d)>=Math.ceil(o*d)?p=c:y=!0,Math.ceil(h*f)>=Math.ceil(l*f)?m=h:x=!0;const v=this.getSizeAndScale(p,this.ctx.canvas.width,d),w=this.getSizeAndScale(m,this.ctx.canvas.height,f),b=this._renderTileCanvas(e,n,v,w);if(y||x){const k=b.canvas;y&&(p=c),x&&(m=h);const _=this.getSizeAndScale(p,this.ctx.canvas.width,d),C=this.getSizeAndScale(m,this.ctx.canvas.height,f),P=_.size,R=C.size,O=e.canvasFactory.create(P,R),M=O.context,D=y?Math.floor(o/c):0,j=x?Math.floor(l/h):0;for(let U=0;U<=D;U++)for(let B=0;B<=j;B++)M.drawImage(k,P*U,R*B,P,R,0,0,P,R);return e.canvasFactory.destroy(b),{canvas:O.canvas,canvasEntry:O,scaleX:_.scale,scaleY:C.scale,offsetX:r,offsetY:i}}return{canvas:b.canvas,canvasEntry:b,scaleX:v.scale,scaleY:w.scale,offsetX:r,offsetY:i}}getSizeAndScale(e,n,r){const i=Math.max(V1.MAX_PATTERN_SIZE,n);let s=Math.ceil(e*r);return s>=i?s=i:r=s/e,{scale:r,size:s}}clipBbox(e,n,r,i,s){const a=i-n,o=s-r,l=new Path2D;l.rect(n,r,a,o),Q.axialAlignedBoundingBox([n,r,i,s],Tt(e.ctx),e.current.minMax),e.ctx.clip(l),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,n,r){const i=e.ctx,s=e.current;switch(s.patternFill=s.patternStroke=!1,n){case dL.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;i.fillStyle=s.fillColor=a,i.strokeStyle=s.strokeColor=o;break;case dL.UNCOLORED:i.fillStyle=i.strokeStyle=r,s.fillColor=s.strokeColor=r;break;default:throw new oce(`Unsupported paint type: ${n}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,n,r,i,s){const a=i!==Zn.SHADING?Q.transform(r,this.patternBaseMatrix):r,o=this.createPatternCanvas(n,s);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return n.canvasFactory.destroy(o.canvasEntry),c.setTransform(l),c}};F(V1,"MAX_PATTERN_SIZE",3e3);let nv=V1;function iue({src:t,srcPos:e=0,dest:n,width:r,height:i,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=bn.isLittleEndian?4278190080:255,[l,c]=a?[s,o]:[o,s],h=r>>3,d=r&7,f=l^c,p=t.length;n=new Uint32Array(n.buffer);let m=0;for(let y=0;y<i;++y){for(const v=e+h;e<v;++e,m+=8){const w=t[e];n[m]=l^-(w>>7&1)&f,n[m+1]=l^-(w>>6&1)&f,n[m+2]=l^-(w>>5&1)&f,n[m+3]=l^-(w>>4&1)&f,n[m+4]=l^-(w>>3&1)&f,n[m+5]=l^-(w>>2&1)&f,n[m+6]=l^-(w>>1&1)&f,n[m+7]=l^-(w&1)&f}if(d===0)continue;const x=e<p?t[e++]:255;for(let v=0;v<d;++v,++m)n[m]=l^-(x>>7-v&1)&f}return{srcPos:e,destPos:m}}const fL=16,pL=100,sue=15,mL=10,Qr=16,NE=new DOMMatrix,ji=new Float32Array(2);function aue(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(n,r){e.translate(n,r),this.__originalTranslate(n,r)},t.scale=function(n,r){e.scale(n,r),this.__originalScale(n,r)},t.transform=function(n,r,i,s,a,o){e.transform(n,r,i,s,a,o),this.__originalTransform(n,r,i,s,a,o)},t.setTransform=function(n,r,i,s,a,o){r===void 0?(e.setTransform(n),this.__originalSetTransform(n)):(e.setTransform(n,r,i,s,a,o),this.__originalSetTransform(n,r,i,s,a,o))},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(n){e.rotate(n),this.__originalRotate(n)},t.clip=function(n){e.clip(n),this.__originalClip(n)},t.moveTo=function(n,r){e.moveTo(n,r),this.__originalMoveTo(n,r)},t.lineTo=function(n,r){e.lineTo(n,r),this.__originalLineTo(n,r)},t.bezierCurveTo=function(n,r,i,s,a,o){e.bezierCurveTo(n,r,i,s,a,o),this.__originalBezierCurveTo(n,r,i,s,a,o)},t.rect=function(n,r,i,s){e.rect(n,r,i,s),this.__originalRect(n,r,i,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}function qb(t,e,n,r,i,s,a,o,l,c){const[h,d,f,p,m,y]=Tt(t);if(d===0&&f===0){const w=a*h+m,b=Math.round(w),k=o*p+y,_=Math.round(k),C=(a+l)*h+m,P=Math.abs(Math.round(C)-b)||1,R=(o+c)*p+y,O=Math.abs(Math.round(R)-_)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(p),b,_),t.drawImage(e,n,r,i,s,0,0,P,O),t.setTransform(h,d,f,p,m,y),[P,O]}if(h===0&&p===0){const w=o*f+m,b=Math.round(w),k=a*d+y,_=Math.round(k),C=(o+c)*f+m,P=M
370ath.abs(Math.round(C)-b)||1,R=(a+l)*d+y,O=Math.abs(Math.round(R)-_)||1;return t.setTransform(0,Math.sign(d),Math.sign(f),0,b,_),t.drawImage(e,n,r,i,s,0,0,O,P),t.setTransform(h,d,f,p,m,y),[O,P]}t.drawImage(e,n,r,i,s,a,o,l,c);const x=Math.hypot(h,d),v=Math.hypot(f,p);return[x*l,v*c]}class gL{constructor(e,n){F(this,"alphaIsShape",!1);F(this,"fontSize",0);F(this,"fontSizeScale",1);F(this,"textMatrix",null);F(this,"textMatrixScale",1);F(this,"fontMatrix",QC);F(this,"leading",0);F(this,"x",0);F(this,"y",0);F(this,"lineX",0);F(this,"lineY",0);F(this,"charSpacing",0);F(this,"wordSpacing",0);F(this,"textHScale",1);F(this,"textRenderingMode",An.FILL);F(this,"textRise",0);F(this,"fillColor","#000000");F(this,"strokeColor","#000000");F(this,"tilingPatternDims",null);F(this,"patternFill",!1);F(this,"patternStroke",!1);F(this,"fillAlpha",1);F(this,"strokeAlpha",1);F(this,"lineWidth",1);F(this,"activeSMask",null);F(this,"transferMaps","none");F(this,"minMax",oh.slice());this.clipBox=new Float32Array([0,0,e,n])}clone(){var n;const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=(n=this.tilingPatternDims)==null?void 0:n.slice(),e}getPathBoundingBox(e=Zn.FILL,n=null){const r=this.minMax.slice();if(e===Zn.STROKE){n||Ze("Stroke bounding box must include transform."),Q.singularValueDecompose2dScale(n,ji);const i=ji[0]*this.lineWidth/2,s=ji[1]*this.lineWidth/2;r[0]-=i,r[1]-=s,r[2]+=i,r[3]+=s}return r}updateClipFromPath(){const e=Q.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(oh,0)}getClippedPathBoundingBox(e=Zn.FILL,n=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function yL(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,i=n%Qr,s=(n-i)/Qr,a=i===0?s:s+1,o=t.createImageData(r,Qr);let l=0,c;const h=e.data,d=o.data;let f,p,m,y;if(e.kind===Ox.GRAYSCALE_1BPP){const x=h.byteLength,v=new Uint32Array(d.buffer,0,d.byteLength>>2),w=v.length,b=r+7>>3,k=4294967295,_=bn.isLittleEndian?4278190080:255;for(f=0;f<a;f++){for(m=f<s?Qr:i,c=0,p=0;p<m;p++){const C=x-l;let P=0;const R=C>b?r:C*8-7,O=R&-8;let M=0,D=0;for(;P<O;P+=8)D=h[l++],v[c++]=D&128?k:_,v[c++]=D&64?k:_,v[c++]=D&32?k:_,v[c++]=D&16?k:_,v[c++]=D&8?k:_,v[c++]=D&4?k:_,v[c++]=D&2?k:_,v[c++]=D&1?k:_;for(;P<R;P++)M===0&&(D=h[l++],M=128),v[c++]=D&M?k:_,M>>=1}for(;c<w;)v[c++]=0;t.putImageData(o,0,f*Qr)}}else if(e.kind===Ox.RGBA_32BPP){for(p=0,y=r*Qr*4,f=0;f<s;f++)d.set(h.subarray(l,l+y)),l+=y,t.putImageData(o,0,p),p+=Qr;f<a&&(y=r*i*4,d.set(h.subarray(l,l+y)),t.putImageData(o,0,p))}else if(e.kind===Ox.RGB_24BPP)for(m=Qr,y=r*m,f=0;f<a;f++){for(f>=s&&(m=i,y=r*m),c=0,p=y;p--;)d[c++]=h[l++],d[c++]=h[l++],d[c++]=h[l++],d[c++]=255;t.putImageData(o,0,f*Qr)}else throw new Error(`bad image kind: ${e.kind}`)}function vL(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,i=n%Qr,s=(n-i)/Qr,a=i===0?s:s+1,o=t.createImageData(r,Qr);let l=0;const c=e.data,h=o.data;for(let d=0;d<a;d++){const f=d<s?Qr:i;({srcPos:l}=iue({src:c,srcPos:l,dest:h,width:r,height:f,nonBlackColor:0})),t.putImageData(o,0,d*Qr)}}function Qg(t,e){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Kb(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}function wL(t,e){if(e)return!0;Q.singularValueDecompose2dScale(t,ji);const n=Math.fround(go.pixelRatio*Eu.PDF_TO_CSS_UNITS);return ji[0]<=n&&ji[1]<=n}const oue=["butt","round","square"],lue=["miter","round","bevel"],cue={},bL={};var da,TT,PT,NT;const cI=class cI{constructor(e,n,r,i,s,{optionalContentConfig:a,markedContentStack:o=null},l,c,h,d){E(this,da);
370this.ctx=e,this.current=new gL(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=n,this.objs=r,this.canvasFactory=i,this.filterFactory=s,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.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=h??null,this.imagesTracker=d??null}getObject(e,n,r=null){var i;return typeof n=="string"?((i=this.dependencyTracker)==null||i.recordNamedDependency(e,n),n.startsWith("g_")?this.commonObjs.get(n):this.objs.get(n)):r}beginDrawing({transform:e,viewport:n,transparency:r=!1,background:i=null}){const s=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=o,r){const l=this.transparentCanvasEntry=this.canvasFactory.create(s,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=l,this.ctx.save(),this.ctx.transform(...Tt(this.compositeCtx))}this.ctx.save(),Kb(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=Tt(this.ctx)}executeOperatorList(e,n,r,i,s){var v;const a=e.argsArray,o=e.fnArray;let l=n||0;const c=a.length;if(c===l)return l;const h=c-l>mL&&typeof r=="function",d=h?Date.now()+sue:0;let f=0;const p=this.commonObjs,m=this.objs;let y,x;for(;;){if(i!==void 0){if(l===i.nextBreakPoint)return i.breakIt(l,r),l;if(i.shouldSkip(l)){if(++l===c)return l;continue}}if(!s||s(l))if(y=o[l],x=a[l]??null,y!==Oo.dependency)x===null?this[y](l):this[y](l,...x);else for(const w of x){(v=this.dependencyTracker)==null||v.recordNamedData(w,l);const b=w.startsWith("g_")?p:m;if(!b.has(w))return b.get(w,r),l}if(l++,l===c)return l;if(h&&++f>mL){if(Date.now()>d)return r(),l;f=0}}}endDrawing(){T(this,da,TT).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,this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),T(this,da,PT).call(this)}_scaleImage(e,n){const r=e.width??e.displayWidth,i=e.height??e.displayHeight,s=Math.max(Math.hypot(n[0],n[1]),1),a=Math.max(Math.hypot(n[2],n[3]),1),o=[];let l=s,c=a,h=r,d=i;for(;l>2&&h>1||c>2&&d>1;){let v=h,w=d;l>2&&h>1&&(v=Math.ceil(h/2),l/=h/v),c>2&&d>1&&(w=Math.ceil(d/2),c/=d/w),o.push({newWidth:v,newHeight:w}),h=v,d=w}if(o.length===0)return{img:e,paintWidth:r,paintHeight:i,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,r,i,0,0,v,w),{img:b.canvas,paintWidth:v,paintHeight:w,tmpCanvas:b}}let f=this.canvasFactory.create(1,1),p=this.canvasFactory.create(1,1),m=r,y=i,x=e;for(const{newWidth:v,newHeight:w}of o)this.canvasFactory.reset(p,v,w),p.context.drawImage(x,0,0,m,y,0,0,v,w),[f,p]=[p,f],x=f.canvas,m=v,y=w;return this.canvasFactory.destroy(p),{img:f.canvas,paintWidth:m,paintHeight:y,tmpCanvas:f}}_createMaskCanvas(e,n){var D,j;const r=this.ctx,{width:i,height:s}=n,a=this.current.fillColor,o=this.current.patternFill,l=Tt(r);let c,h,d,f;if((n.bitmap||n.data)&&n.count>1){const U=n.bitmap||n.data.buffer;h=JSON.stringify(o?l:[l.slice(0,4),a]),c=this._cachedBitmapsMap.getOrInsertComputed(U,VR);const B=c.get(h);if(B&&!o){const z=Math.round(Math.min(l[0],l[2])+l[4]),$=Math.round(Math.min(l[1],l[3])+l[5]);return(D=this.dependencyTracker)==null||D.recordDependencies(e,Zi.transformAndFill),{canvas:B,offsetX:z,offsetY:$}}d=B}d||(f=this.canvasFactory.create(i,s),vL(f.context,n));let p=Q.transform(l,[1/i,0,0,-1/s,0,0]);p=Q.transform(p,[1,0,0,1,0,-s]);const m=oh.slice();Q.axialAlignedBoundingBox([0,0,i,s],p,m);const[y,x,v,w]=m,b=Math.round(v-y)||1,k=Math.round(w-x)||1,_=this.canvasFactory.create(b,k),C=_.context,P=y,R=x;C.translate(-P,-R),C.transform(...p);let O=null;if(!d){const U=this._scaleImage(f.canvas,ba(C));d=U.img,O=U.tmpCanvas,d!==f.canvas&&(this.canvasFactory.destroy(f),f=null),c&&o&&(c.set(h,d),O=null,f=null)}C.imageSmoothingEnabled=wL(Tt(C),n.interpolate),qb(C,d,0,0,d.width,d.height,0,0,i,s),O&&this.canvasFactory.destroy(O),f&&this.canvasFactory.destroy(f),C.globalCompositeOperation="source-in";const M=Q.transform(ba(C),[1,0,0,1,-P,-R]);return C.fillStyle=o?a.getPattern(r,this,M,Zn.FILL,e):a,C.fillRect(0,0,i,s),c&&!o&&c.set(h,_.canvas),(j=this.dependencyTracker)==null||j.recordDependencies(e,Zi.transformAndFill),{canvas:_.canvas,canvasEntry:c&&!o?null:_,offsetX:Math.round(P),offsetY:Math.round(R)}}setLineWidth(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("lineWidth",e),n!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=n,this.ctx.lineWidth=n}setLineCap(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("lineCap",e),this.ctx.lineCap=oue[n]}setLineJoin(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("lineJoin",e),this.ctx.lineJoin=lue[n]}setMiterLimit(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("miterLimit",e),this.ctx.miterLimit=n}setDash(e,n,r){var s;(s=this.dependencyTracker)==null||s.recordSimpleData("dash",e);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(n),i.lineDashOffset=r)}
370setRenderingIntent(e,n){}setFlatness(e,n){}setGState(e,n){var r,i,s,a,o;for(const[l,c]of n)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":(r=this.dependencyTracker)==null||r.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=c;break;case"ca":(i=this.dependencyTracker)==null||i.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=c;break;case"BM":(s=this.dependencyTracker)==null||s.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=c;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",e),this.current.activeSMask=c?this.tempSMask:null,this.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}_ensurePreparedSMask(e,n,r){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e,n,r))}checkSMaskState(e){const n=this.inSMaskMode;this.current.activeSMask&&!n?this.beginSMaskMode(e):!this.current.activeSMask&&n?this.endSMaskMode():this.current.activeSMask&&n&&this._ensurePreparedSMask(this.current.activeSMask,this.ctx.canvas.width,this.ctx.canvas.height)}_prepareSMaskCanvas(e,n,r){const{canvas:i,subtype:s,backdrop:a,transferMap:o}=e,l=s==="Luminosity"||s==="Alpha"&&o;if(!a&&!l){this.smaskPreparedFor=e;return}let c,h,d;if(a&&l){const f=this.canvasFactory.create(n,r),p=f.context;p.drawImage(i,e.offsetX,e.offsetY),p.globalCompositeOperation="destination-atop",p.fillStyle=a,p.fillRect(0,0,n,r),p.globalCompositeOperation="source-over",c=this.canvasFactory.create(n,r);const m=c.context;m.filter=s==="Alpha"?this.filterFactory.addAlphaFilter(o):this.filterFactory.addLuminosityFilter(o),m.drawImage(f.canvas,0,0),m.filter="none",this.canvasFactory.destroy(f),h=d=0}else if(l){c=this.canvasFactory.create(i.width,i.height);const f=c.context;f.filter=s==="Alpha"?this.filterFactory.addAlphaFilter(o):this.filterFactory.addLuminosityFilter(o),f.drawImage(i,0,0),f.filter="none",{offsetX:h,offsetY:d}=e}else{c=this.canvasFactory.create(n,r);const f=c.context;f.drawImage(i,e.offsetX,e.offsetY),f.globalCompositeOperation="destination-atop",f.fillStyle=a,f.fillRect(0,0,n,r),f.globalCompositeOperation="source-over",h=d=0}this.smaskPreparedEntry=c,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=h,this.smaskPreparedOffsetY=d}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const{width:n,height:r}=this.ctx.canvas,i=this.canvasFactory.create(n,r);this.smaskScratchCanvas=i,this.suspendedCtx=this.ctx;const s=this.ctx=i.context;s.setTransform(this.suspendedCtx.getTransform()),Qg(this.suspendedCtx,s),aue(s,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask,n,r),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Qg(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[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,n,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.ctx.restore(
370)}composeSMask(e,n,r,i){const s=i[0],a=i[1],o=i[2]-s,l=i[3]-a;if(o===0||l===0)return;const c=this.smaskPreparedEntry;if(c){const h=s-this.smaskPreparedOffsetX,d=a-this.smaskPreparedOffsetY;r.save(),r.globalAlpha=1,r.setTransform(1,0,0,1,0,0);const f=new Path2D;f.rect(s,a,o,l),r.clip(f),r.globalCompositeOperation="destination-in",r.drawImage(c.canvas,h,d,o,l,s,a,o,l),r.restore()}else this.genericComposeSMask(n.context,r,o,l,s,a,n.offsetX,n.offsetY);e.save(),e.globalAlpha=1,e.globalCompositeOperation=n.blendMode||"source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,s,a,o,l,s,a,o,l),e.restore()}genericComposeSMask(e,n,r,i,s,a,o,l){const c=e.canvas,h=s-o,d=a-l;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);const f=new Path2D;f.rect(s,a,r,i),n.clip(f),n.globalCompositeOperation="destination-in",n.drawImage(c,h,d,r,i,s,a,r,i),n.restore()}save(e){var r;this.inSMaskMode&&Qg(this.ctx,this.suspendedCtx),this.ctx.save();const n=this.current;this.stateStack.push(n),this.current=n.clone(),(r=this.dependencyTracker)==null||r.save(e)}restore(e){var n;if((n=this.dependencyTracker)==null||n.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(Qg(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,n,r,i,s,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",e),this.ctx.transform(n,r,i,s,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,n,r,i){let[s]=r;if(!i){s||(s=r[0]=new Path2D),n!==Oo.stroke&&n!==Oo.closeStroke&&(this.current.tilingPatternDims=null),this[n](e,s);return}if(this.dependencyTracker!==null){const o=n===Oo.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-o,i[2]+o,i[1]-o,i[3]+o).recordDependencies(e,["transform"])}s instanceof Path2D||(s=r[0]=Cz(s)),Q.axialAlignedBoundingBox(i,Tt(this.ctx),this.current.minMax);const a=this.current.tilingPatternDims;if(a&&n!==Oo.stroke&&n!==Oo.closeStroke&&this.current.fillColor instanceof nv){const o=Q.intersect(this.current.clipBox,this.current.minMax);o?this.current.fillColor.updatePatternDims(o,a):this.current.tilingPatternDims=null}this[n](e,s),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,n,r=!0){var a;const i=this.ctx,s=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof s=="object"&&(s!=null&&s.getPattern)){const o=s.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=s.getPattern(i,this,ba(i),Zn.STROKE,e),o){const l=new Path2D;l.addPath(n,i.getTransform().invertSelf().multiplySelf(o)),n=l}this.rescaleAndStroke(n,!1),i.restore()}else this.rescaleAndStroke(n,!0);(a=this.dependencyTracker)==null||a.recordDependencies(e,Zi.stroke),r&&this.consumePath(e,n,this.current.getClippedPathBoundingBox(Zn.STROKE,Tt(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,n){this.stroke(e,n)}fill(e,n,r=!0){var c,h,d;const i=this.ctx,s=this.current.fillColor,a=this.current.patternFill;let o=!1;const l=this.current.getClippedPathBoundingBox();if((c=this.dependencyTracker)==null||c.recordDependencies(e,Zi.fill),a){const f=this.current.tilingPatternDims,p=f&&s.canSkipPatternCanvas(f);if(p){s.drawPattern(this,n,this.pendingEOFill,p,e),this.pendingEOFill=!1,r&&this.consumePath(e,n,l),this.current.tilingPatternDims=null;return}const m=s.isModifyingCurrentTransform()?i.getTransform():null;if((h=this.dependencyTracker)==null||h.save(e),i.save(),i.fillStyle=s.getPattern(i,this,ba(i),Zn.FILL,e),m){const y=new Path2D;y.addPath(n,i.getTransform().invertSelf().multiplySelf(m)),n=y}o=!0}this.contentVisible&&l!==null&&(this.pendingEOFill?(i.fill(n,"evenodd"),this.pendingEOFill=!1):i.fill(n)),o&&(i.restore(),(d=this.dependencyTracker)==null||d.restore(e)),r&&this.consumePath(e,n,l)}eoFill(e,n){this.pendingEOFill=!0,this.fill(e,n)}fillStroke(e,n){this.fill(e,n,!1),this.stroke(e,n,!1),this.consumePath(e,n)}eoFillStroke(e,n){this.pendingEOFill=!0,this.fillStroke(e,n)}closeFillStroke(e,n){this.fillStroke(e,n)}closeEOFillStroke(e,n){this.pendingEOFill=!0,this.fillStroke(e,n)}endPath(e,n){this.consumePath(e,n)}rawFillPath(e,n){var r;this.ctx.fill(n),(r=this.dependencyTracker)==null||r.recordDependencies(e,Zi.rawFillPath).recordOperation(e)}clip(e){var n;(n=this.dependencyTracker)==null||n.recordFutureForcedDependency("clipMode",e),this.pendingClip=cue}eoClip(e){var n;(n=this.dependencyTracker)==null||n.recordFutureForcedDependency("clipMode",e),this.pendingClip=bL}beginText(e){var n;this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,
370(n=this.dependencyTracker)==null||n.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const n=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;n!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(n!==void 0){const i=new Path2D,s=r.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:c,path:h}of n)h&&i.addPath(h,new DOMMatrix(a).preMultiplySelf(s).translate(o,l).scale(c,-c));r.clip(i)}delete this.pendingTextPaths}setCharSpacing(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("charSpacing",e),this.current.charSpacing=n}setWordSpacing(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("wordSpacing",e),this.current.wordSpacing=n}setHScale(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("hScale",e),this.current.textHScale=n/100}setLeading(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("leading",e),this.current.leading=-n}setFont(e,n,r){var d,f;(d=this.dependencyTracker)==null||d.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",n,e);const i=this.commonObjs.get(n),s=this.current;if(!i)throw new Error(`Can't find font for ${n}`);if(s.fontMatrix=i.fontMatrix||QC,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&_e("Invalid font matrix for font "+n),r<0?(r=-r,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=r,i.isType3Font)return;const a=i.loadedName||"sans-serif",o=((f=i.systemFontInfo)==null?void 0:f.css)||`"${a}", ${i.fallbackName}`;let l="normal";i.black?l="900":i.bold&&(l="bold");const c=i.italic?"italic":"normal";let h=r;r<fL?h=fL:r>pL&&(h=pL),this.current.fontSizeScale=r/h,this.ctx.font=`${c} ${l} ${h}px ${o}`}setTextRenderingMode(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=n}setTextRise(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("textRise",e),this.current.textRise=n}moveText(e,n,r){var i;(i=this.dependencyTracker)==null||i.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=n,this.current.y=this.current.lineY+=r}setLeadingMoveText(e,n,r){this.setLeading(e,-r),this.moveText(e,n,r)}setTextMatrix(e,n){var i;(i=this.dependencyTracker)==null||i.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:r}=this;r.textMatrix=n,r.textMatrixScale=Math.hypot(n[0],n[1]),r.x=r.lineX=0,r.y=r.lineY=0}nextLine(e){var n;this.moveText(e,0,this.current.leading),(n=this.dependencyTracker)==null||n.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}paintChar(e,n,r,i,s,a){var v,w,b,k;const o=this.ctx,l=this.current,c=l.font,h=l.textRenderingMode,d=l.fontSize/l.fontSizeScale,f=h&An.FILL_STROKE_MASK,p=!!(h&An.ADD_TO_PATH_FLAG),m=l.patternFill&&!c.missingFile,y=l.patternStroke&&!c.missingFile;let x;if((c.disableFontFace||p||m||y)&&!c.missingFile&&(x=c.getPathGenerator(this.commonObjs,n)),x&&(c.disableFontFace||m||y)){o.save(),o.translate(r,i),o.scale(d,-d),(v=this.dependencyTracker)==null||v.recordCharacterBBox(e,o,c);let _;if(f===An.FILL||f===An.FILL_STROKE)if(s){_=o.getTransform(),o.setTransform(...s);const C=T(this,da,NT).call(this,x,_,s);o.fill(C)}else o.fill(x);if(f===An.STROKE||f===An.FILL_STROKE)if(a){_||(_=o.getTransform()),o.setTransform(...a);const{a:C,b:P,c:R,d:O}=_,M=Q.inverseTransform(a),D=Q.transform([C,P,R,O,0,0],M);Q.singularValueDecompose2dScale(D,ji),o.lineWidth*=Math.max(ji[0],ji[1])/d,o.stroke(T(this,da,NT).call(this,x,_,a))}else o.lineWidth/=d,o.stroke(x);
370o.restore()}else(f===An.FILL||f===An.FILL_STROKE)&&(o.fillText(n,r,i),(w=this.dependencyTracker)==null||w.recordCharacterBBox(e,o,c,d,r,i,()=>o.measureText(n))),(f===An.STROKE||f===An.FILL_STROKE)&&(this.dependencyTracker&&((b=this.dependencyTracker)==null||b.recordCharacterBBox(e,o,c,d,r,i,()=>o.measureText(n)).recordDependencies(e,Zi.stroke)),o.strokeText(n,r,i));p&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Tt(o),x:r,y:i,fontSize:d,path:x}),(k=this.dependencyTracker)==null||k.recordCharacterBBox(e,o,c,d,r,i))}get isFontSubpixelAAEnabled(){const e=this.canvasFactory.create(10,10),n=e.context;n.scale(1.5,1),n.fillText("I",0,10);const r=n.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let i=!1;for(let s=3;s<r.length;s+=4)if(r[s]>0&&r[s]<255){i=!0;break}return Se(this,"isFontSubpixelAAEnabled",i)}showText(e,n){var D,j,U,B;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Zi.showText).resetBBox(e),this.current.textRenderingMode&An.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const r=this.current,i=r.font;if(i.isType3Font){this.showType3Text(e,n),(D=this.dependencyTracker)==null||D.recordShowTextOperation(e);return}const s=r.fontSize;if(s===0){(j=this.dependencyTracker)==null||j.recordOperation(e);return}const a=this.ctx,o=r.fontSizeScale,l=r.charSpacing,c=r.wordSpacing,h=r.fontDirection,d=r.textHScale*h,f=n.length,p=i.vertical,m=p?1:-1,y=i.defaultVMetrics,x=s*r.fontMatrix[0],v=r.textRenderingMode===An.FILL&&!i.disableFontFace&&!r.patternFill;a.save(),r.textMatrix&&a.transform(...r.textMatrix),a.translate(r.x,r.y+r.textRise),h>0?a.scale(d,-1):a.scale(d,1);let w,b;const k=r.textRenderingMode&An.FILL_STROKE_MASK,_=k===An.FILL||k===An.FILL_STROKE,C=k===An.STROKE||k===An.FILL_STROKE;let P=r.lineWidth;const R=r.textMatrixScale;if(R===0||P===0?C&&(P=this.getSinglePixelWidth()):P/=R,o!==1&&(a.scale(o,o),P/=o),a.lineWidth=P,_&&r.patternFill){a.save();const z=r.fillColor.getPattern(a,this,ba(a),Zn.FILL,e);w=Tt(a),a.restore(),a.fillStyle=z}if(C&&r.patternStroke){a.save();const z=r.strokeColor.getPattern(a,this,ba(a),Zn.STROKE,e);b=Tt(a),a.restore(),a.strokeStyle=z}if(i.isInvalidPDFjsFont){const z=[];let $=0;for(const L of n)z.push(L.unicode),$+=L.width;const W=z.join("");if(a.fillText(W,0,0),this.dependencyTracker!==null){const L=a.measureText(W);this.dependencyTracker.recordBBox(e,this.ctx,-L.actualBoundingBoxLeft,L.actualBoundingBoxRight,-L.actualBoundingBoxAscent,L.actualBoundingBoxDescent).recordShowTextOperation(e)}r.x+=$*x*d,a.restore(),this.compose();return}let O=0,M;for(M=0;M<f;++M){const z=n[M];if(typeof z=="number"){O+=m*z*s/1e3;continue}let $=!1;const W=(z.isSpace?c:0)+l,L=z.fontChar,V=z.accent;let N,G,Y=z.width;if(p){const Oe=z.vmetric||y,oe=-(z.vmetric?Oe[1]:Y*.5)*x,he=Oe[2]*x;Y=Oe?-Oe[0]:Y,N=oe/o,G=(O+he)/o}else N=O/o,G=0;let I;if(i.remeasure&&Y>0){I=a.measureText(L);const Oe=I.width*1e3/s*o;if(Y<Oe&&this.isFontSubpixelAAEnabled){const oe=Y/Oe;$=!0,a.save(),a.scale(oe,1),N/=oe}else Y!==Oe&&(N+=(Y-Oe)/2e3*s/o)}if(this.contentVisible&&(z.isInFont||i.missingFile)){if(v&&!V)a.fillText(L,N,G),(U=this.dependencyTracker)==null||U.recordCharacterBBox(e,a,I?{bbox:null}:i,s/o,N,G,()=>I??a.measureText(L));else if(this.paintChar(e,L,N,G,w,b),V){const Oe=N+s*V.offset.x/o,oe=G-s*V.offset.y/o;this.paintChar(e,V.fontChar,Oe,oe,w,b)}}const we=p?Y*x-W*h:Y*x+W*h;O+=we,$&&a.restore()}p?r.y-=O:r.x+=O*d,a.restore(),this.compose(),(B=this.dependencyTracker)==null||B.recordShowTextOperation(e)}showType3Text(e,n){const r=this.ctx,i=this.current,s=i.font,a=i.fontSize,o=i.fontDirection,l=s.vertical?1:-1,c=i.charSpacing,h=i.wordSpacing,d=i.textHScale*o,f=i.fontMatrix||QC,p=n.length,m=i.textRenderingMode===An.INVISIBLE;let y,x,v,w;if(m||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),i.textMatrix&&r.transform(...i.textMatrix),r.translate(i.x,i.y+i.textRise),r.scale(d,o);const b=this.dependencyTracker;for(this.dependencyTracker=b?new Vv(b,e):null,y=0;y<p;++y){if(x=n[y],typeof x=="number"){w=l*x*a/1e3,this.ctx.translate(w,0),i.x+=w*d;continue}const k=(x.isSpace?h:0)+c,_=s.charProcOperatorList[x.operatorListId];_?this.contentVisible&&(this.save(),r.scale(a,a),r.transform(...f),this.executeOperatorList(_),this.restore(
370)):_e(`Type3 character "${x.operatorListId}" is not available.`);const C=[x.width,0];Q.applyTransform(C,f),v=C[0]*a+k,r.translate(v,0),i.x+=v*d}r.restore(),b&&(this.dependencyTracker=b)}setCharWidth(e,n,r){}setCharWidthAndBounds(e,n,r,i,s,a,o){var c;const l=new Path2D;l.rect(i,s,a-i,o-s),this.ctx.clip(l),(c=this.dependencyTracker)==null||c.recordBBox(e,this.ctx,i,a,s,o).recordClipBox(e,this.ctx,i,a,s,o),this.endPath(e)}getColorN_Pattern(e,n){let r;if(n[0]==="TilingPattern"){const i=this.baseTransform||Tt(this.ctx),s={createCanvasGraphics:(a,o)=>new cI(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Vv(this.dependencyTracker,o,!0):null)};r=new nv(n,this.ctx,s,i)}else r=this._getPattern(e,n[1],n[2]);return r}setStrokeColorN(e,...n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,n),this.current.patternStroke=!0}setFillColorN(e,...n){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("fillColor",e);const r=this.current.fillColor=this.getColorN_Pattern(e,n);this.current.patternFill=!0,this.current.tilingPatternDims=r instanceof nv?[0,0,0,0]:null}setStrokeRGBColor(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=n,this.current.patternStroke=!1}
370setStrokeTransparent(e){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=n,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,n,r=null){let i;return this.cachedPatterns.has(n)?i=this.cachedPatterns.get(n):(i=rue(this.getObject(e,n)),this.cachedPatterns.set(n,i)),r&&(i.matrix=r),i}shadingFill(e,n){var a;if(!this.contentVisible)return;const r=this.ctx;this.save(e);const i=this._getPattern(e,n);r.fillStyle=i.getPattern(r,this,ba(r),Zn.SHADING,e);const s=ba(r);if(s){const{width:o,height:l}=r.canvas,c=oh.slice();Q.axialAlignedBoundingBox([0,0,o,l],s,c);const[h,d,f,p]=c;this.ctx.fillRect(h,d,f-h,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Zi.transform).recordDependencies(e,Zi.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){Ze("Should not call beginInlineImage")}beginImageData(){Ze("Should not call beginImageData")}paintFormXObjectBegin(e,n,r){var i;if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),n&&this.transform(e,...n),this.baseTransform=Tt(this.ctx),r)){Q.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);const[s,a,o,l]=r,c=new Path2D;c.rect(s,a,o-s,l-a),this.ctx.clip(c),(i=this.dependencyTracker)==null||i.recordClipBox(e,this.ctx,s,o,a,l),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,n){var m;if(!this.contentVisible)return;this.save(e);const{inSMaskMode:r}=this;r&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;if(n.isolated||Yk("TODO: Support non-isolated groups."),n.knockout&&_e("Knockout groups not supported."),!n.needsIsolation&&i.globalAlpha===1&&i.globalCompositeOperation==="source-over"&&!r){if(n.bbox){let y=new Path2D;const[x,v,w,b]=n.bbox;if(y.rect(x,v,w-x,b-v),n.matrix){const k=new Path2D;k.addPath(y,new DOMMatrix(n.matrix)),y=k}i.clip(y)}this.groupStack.push(null),this.groupLevel++;return}const s=Tt(i);n.matrix&&i.transform(...n.matrix);const a=[0,0,i.canvas.width,i.canvas.height];let o;n.bbox?(o=oh.slice(),Q.axialAlignedBoundingBox(n.bbox,Tt(i),o),o=Q.intersect(o,a)||[0,0,0,0]):o=a;const l=Math.floor(o[0]),c=Math.floor(o[1]),h=Math.max(Math.ceil(o[2])-l,1),d=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,h,d]);const f=this.canvasFactory.create(h,d);n.smask&&this.smaskGroupCanvases.push(f);const p=f.context;if(p.translate(-l,-c),p.transform(...s),!n.isolated&&!n.smask&&r&&n.needsIsolation&&(p.save(),p.setTransform(1,0,0,1,0,0),p.drawImage(i.canvas,-l,-c),p.restore()),n.bbox){let y=new Path2D;const[x,v,w,b]=n.bbox;if(y.rect(x,v,w-x,b-v),n.matrix){const k=new Path2D;k.addPath(y,new DOMMatrix(n.matrix)),y=k}p.clip(y)}n.smask&&this.smaskStack.push({canvas:f.canvas,context:p,offsetX:l,offsetY:c,subtype:n.smask.subtype,backdrop:n.smask.backdrop,transferMap:n.smask.transferMap||null}),(!n.smask||this.dependencyTracker)&&(i.setTransform(1,0,0,1,0,0),i.translate(l,c),i.save()),Qg(i,p),this.ctx=p,(m=this.dependencyTracker)==null||m.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(i),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),this.groupStack.push(i),this.groupLevel++}endGroup(e,n){var s;if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,i=this.groupStack.pop();if(i===null){this.restore(e);return}if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,(s=this.dependencyTracker)==null||s.popBaseTransform(),n.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(
370),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform()));else{this.ctx.restore();const a=Tt(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);const o=oh.slice();Q.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a,o),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy({canvas:r.canvas,context:r}),this.compose(o)}}beginAnnotation(e,n,r,i,s,a){if(T(this,da,TT).call(this),Kb(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const o=r[2]-r[0],l=r[3]-r[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=r[0],i[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=o,r[3]=l,Q.singularValueDecompose2dScale(Tt(this.ctx),ji);const{viewportScale:c}=this,h=Math.ceil(o*this.outputScaleX*c),d=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);const{canvas:f,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(n,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(ji[0],0,0,-ji[1],0,l*ji[1]),Kb(this.ctx)}else{Kb(this.ctx),this.endPath(e);const c=new Path2D;c.rect(r[0],r[1],o,l),this.ctx.clip(c)}}this.current=new gL(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...i),this.transform(e,...s),this.baseTransform=Tt(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),T(this,da,PT).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,n){var o;if(!this.contentVisible)return;const r=n.count;n=this.getObject(e,n.data,n),n.count=r;const i=this.ctx,s=this._createMaskCanvas(e,n),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),(o=this.dependencyTracker)==null||o.resetBBox(e).recordBBox(e,this.ctx,s.offsetX,s.offsetX+a.width,s.offsetY,s.offsetY+a.height).recordOperation(e),i.restore(),s.canvasEntry&&this.canvasFactory.destroy(s.canvasEntry),this.compose()}paintImageMaskXObjectRepeat(e,n,r,i=0,s=0,a,o){var d,f,p;if(!this.contentVisible)return;n=this.getObject(e,n.data,n);const l=this.ctx;l.save();const c=Tt(l);l.transform(r,i,s,a,0,0);const h=this._createMaskCanvas(e,n);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]),(d=this.dependencyTracker)==null||d.resetBBox(e);for(let m=0,y=o.length;m<y;m+=2){const x=Q.transform(c,[r,i,s,a,o[m],o[m+1]]);l.drawImage(h.canvas,x[4],x[5]),(f=this.dependencyTracker)==null||f.recordBBox(e,this.ctx,x[4],x[4]+h.canvas.width,x[5],x[5]+h.canvas.height)}l.restore(),h.canvasEntry&&this.canvasFactory.destroy(h.canvasEntry),this.compose(),(p=this.dependencyTracker)==null||p.recordOperation(e)}paintImageMaskXObjectGroup(e,n){var a,o,l;if(!this.contentVisible)return;const r=this.ctx,i=this.current.fillColor,s=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(e).recordDependencies(e,Zi.transformAndFill);for(const c of n){const{data:h,width:d,height:f,transform:p}=c,m=this.canvasFactory.create(d,f),y=m.context;y.save();const x=this.getObject(e,h,c);vL(y,x),y.globalCompositeOperation="source-in",y.fillStyle=s?i.getPattern(y,this,ba(r),Zn.FILL,e):i,y.fillRect(0,0,d,f),y.restore(),r.save(),r.transform(...p),r.scale(1,-1),qb(r,m.canvas,0,0,d,f,0,-1,1,1),this.canvasFactory.destroy(m),(o=this.dependencyTracker)==null||o.recordBBox(e,r,0,d,0,f),r.restore()}this.compose(),(l=this.dependencyTracker)==null||l.recordOperation(e)}paintImageXObject(e,n){if(!this.contentVisible)return;const r=this.getObject(e,n);if(!r){_e("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,r)}paintImageXObjectRepeat(e,n,r,i,s){if(!this.contentVisible)return;const a=this.getObject(e,n);if(!a){_e("Dependent image isn't ready yet");return}const o=a.width,l=a.height,c=[];for(let h=0,d=s.length;h<d;h+=2)c.push({transform:[r,0,0,i,s[h],s[h+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return{img:e.bitmap,canvasEntry:null};const{bitmap:n,width:r,height:i}=e,s=this.canvasFactory.create(r,i),a=s.context;
370return a.filter=this.current.transferMaps,a.drawImage(n,0,0),a.filter="none",{img:s.canvas,canvasEntry:s}}paintInlineImageXObject(e,n){var h;if(!this.contentVisible)return;const r=n.width,i=n.height,s=this.ctx;this.save(e);const{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none"),s.scale(1/r,-1/i);let o,l=null;if(n.bitmap){const d=this.applyTransferMapsToBitmap(n);o=d.img,l=d.canvasEntry}else if(typeof HTMLElement=="function"&&n instanceof HTMLElement||!n.data)o=n;else{const d=this.canvasFactory.create(r,i);yL(d.context,n),o=this.applyTransferMapsToCanvas(d.context),l=d}const c=this._scaleImage(o,ba(s));s.imageSmoothingEnabled=wL(Tt(s),n.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,s,0,r,-i,0).recordDependencies(e,Zi.imageXObject).recordOperation(e),(h=this.imagesTracker)==null||h.record(s,r,i,this.dependencyTracker.clipBox)),qb(s,c.img,0,0,c.paintWidth,c.paintHeight,0,-i,r,i),c.tmpCanvas&&this.canvasFactory.destroy(c.tmpCanvas),l&&this.canvasFactory.destroy(l),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,n,r){var o,l,c;if(!this.contentVisible)return;const i=this.ctx;let s,a=null;if(n.bitmap)s=n.bitmap;else{const h=n.width,d=n.height,f=this.canvasFactory.create(h,d);yL(f.context,n),s=this.applyTransferMapsToCanvas(f.context),a=f}(o=this.dependencyTracker)==null||o.resetBBox(e);for(const h of r)i.save(),i.transform(...h.transform),i.scale(1,-1),qb(i,s,h.x,h.y,h.w,h.h,0,-1,1,1),(l=this.dependencyTracker)==null||l.recordBBox(e,i,0,1,-1,0),i.restore();a&&this.canvasFactory.destroy(a),(c=this.dependencyTracker)==null||c.recordOperation(e),this.compose()}paintSolidColorImageMask(e){var n;this.contentVisible&&((n=this.dependencyTracker)==null||n.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Zi.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,n){}markPointProps(e,n,r){}beginMarkedContent(e,n){var r;(r=this.dependencyTracker)==null||r.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,n,r){var i;(i=this.dependencyTracker)==null||i.beginMarkedContent(e),n==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){var n;(n=this.dependencyTracker)==null||n.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,n,r){var a,o;const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);const s=this.ctx;this.pendingClip?(i||(this.pendingClip===bL?s.clip(n,"evenodd"):s.clip(n)),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=Tt(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:r,c:i,d:s}=this.ctx.getTransform();let a,o;if(r===0&&i===0){const l=Math.abs(n),c=Math.abs(s);if(l===c)if(e===0)a=o=1/l;else{const h=l*e;a=o=h<1?1/h:1}else if(e===0)a=1/l,o=1/c;else{const h=l*e,d=c*e;a=h<1?1/h:1,o=d<1?1/d:1}}else{const l=Math.abs(n*s-r*i),c=Math.hypot(n,r),h=Math.hypot(i,s);if(e===0)a=h/l,o=c/l;else{const d=e*l;a=h>d?h/d:1,o=c>d?c/d:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,n){const{ctx:r,current:{lineWidth:i}}=this,[s,a]=this.getScaleForStroking();if(s===a){r.lineWidth=(i||1)*s,r.stroke(e);return}const o=r.getLineDash();n&&r.save(),r.scale(s,a),NE.a=1/s,NE.d=1/a;const l=new Path2D;if(l.addPath(e,NE),o.length>0){const c=Math.max(s,a);r.setLineDash(o.map(h=>h/c)),r.lineDashOffset/=c}
370r.lineWidth=i||1,r.stroke(l),n&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};da=new WeakSet,TT=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)},PT=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const n=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}},NT=function(e,n,r){const i=new Path2D;return i.addPath(e,new DOMMatrix(r).invertSelf().multiplySelf(n)),i};let yp=cI;for(const t in Oo)yp.prototype[t]!==void 0&&(yp.prototype[Oo[t]]=yp.prototype[t]);var Nw,Rw;class Zk{constructor(e,n,r){E(this,Nw,null);E(this,Rw,null);F(this,"_fullReader",null);F(this,"_rangeReaders",new Set);F(this,"_source",null);this._source=e,S(this,Nw,n),S(this,Rw,r)}get _progressiveDataLength(){var e;return((e=this._fullReader)==null?void 0:e._loaded)??0}getFullReader(){return Vt(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(u(this,Nw))(this)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new(u(this,Rw))(this,e,n);return this._rangeReaders.add(r),r}cancelAllRequests(e){var n;(n=this._fullReader)==null||n.cancel(e);for(const r of new Set(this._rangeReaders))r.cancel(e)}}Nw=new WeakMap,Rw=new WeakMap;class eA{constructor(e){F(this,"onProgress",null);F(this,"_contentLength",0);F(this,"_filename",null);F(this,"_headersCapability",Promise.withResolvers());F(this,"_isRangeSupported",!1);F(this,"_isStreamingSupported",!1);F(this,"_loaded",0);F(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(){Ze("Abstract method `read` called")}cancel(e){Ze("Abstract method `cancel` called")}}class tA{constructor(e,n,r){F(this,"_stream",null);this._stream=e}async read(){Ze("Abstract method `read` called")}cancel(e){Ze("Abstract method `cancel` called")}}function uue(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let h=o(n);return h=unescape(h),h=l(h),h=c(h),s(h)}if(n=a(t),n){const h=c(n);return s(h)}if(n=r("filename","i").exec(t),n){n=n[1];let h=o(n);return h=c(h),s(h)}function r(h,d){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function i(h,d){if(h){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const f=new TextDecoder(h,{fatal:!0}),p=Xk(d);d=f.decode(p),e=!1}catch{}}return d}function s(h){return e&&/[\x80-\xff]/.test(h)&&(h=i("utf-8",h),e&&(h=i("iso-8859-1",h))),h}function a(h){const d=[];let f;const p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=p.exec(h))!==null;){let[,y,x,v]=f;if(y=parseInt(y,10),y in d){if(y===0)break;continue}d[y]=[x,v]}const m=[];for(let y=0;y<d.length&&y in d;++y){let[x,v]=d[y];v=o(v),x&&(v=unescape(v),y===0&&(v=l(v))),m.push(v)}return m.join("")}function o(h){if(h.startsWith('"')){const d=h.slice(1).split('\\"');for(let f=0;f<d.length;++f){const p=d[f].indexOf('"');p!==-1&&(d[f]=d[f].slice(0,p),d.length=f+1),d[f]=d[f].replaceAll(/\\(.)/g,"$1")}h=d.join('"')}return h}function l(h){const d=h.indexOf("'");if(d===-1)return h;const f=h.slice(0,d),m=h.slice(d+1).replace(/^[^']*'/,"");return i(f,m)}function c(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,f,p,m){if(p==="q"||p==="Q")return m=m.replaceAll("_"," "),m=m.replaceAll(/=([0-9a-fA-F]{2})/g,function(y,x){return String.fromCharCode(parseInt(x,16))}),i(f,m);try{m=atob(m)}catch{}return i(f,m)})}return""}function v5(t,e){const n=new Headers;if(!t||!e||typeof e!="object")return n;for(const r in e){const i=e[r];i!==void 0&&n.append(r,i)}return n}function nA(t){var e;return((e=URL.parse(t))==null?void 0:e.origin)??null}function w5({responseHeaders:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const i={contentLength:0,isRangeSupported:!1},s=parseInt(t.get("Content-Length"),10);return!Number.isInteger(s)||(i.contentLength=s,s<=2*n)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")==="identity"&&(i.isRangeSupported=!0),i}function b5(t){const e=t.get("Content-Disposition");if(e){let n=uue(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(GR(n))return n}return null}
370function rA(t,e){return new f1(`Unexpected server response (${t}) while retrieving PDF "${e.href}".`,t,t===404||t===0&&e.protocol==="file:")}function x5(t,e){if(t!==e)throw new Error(`Expected range response-origin "${t}" to match "${e}".`)}function S5(t,e,n,r){return fetch(t,{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:n?"include":"same-origin",redirect:"follow"})}function k5(t,e){if(t!==200&&t!==206)throw rA(t,e)}function iA(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;throw new Error(`getArrayBuffer - unexpected data: ${t}`)}class hue extends Zk{constructor(n){super(n,due,fue);F(this,"_responseOrigin",null);const{httpHeaders:r,url:i}=n;Vt(/https?:/.test(i.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=v5(!0,r)}}class due extends eA{constructor(n){super(n);F(this,"_abortController",new AbortController);F(this,"_reader",null);const{disableRange:r,disableStream:i,rangeChunkSize:s,url:a,withCredentials:o}=n._source;this._isStreamingSupported=!i;const l=new Headers(n.headers);S5(a,l,o,this._abortController).then(c=>{n._responseOrigin=nA(c.url),k5(c.status,a),this._reader=c.body.getReader();const h=c.headers,{contentLength:d,isRangeSupported:f}=w5({responseHeaders:h,isHttp:!0,rangeChunkSize:s,disableRange:r});this._contentLength=d,this._isRangeSupported=f,this._filename=b5(h),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Au("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;const{value:n,done:r}=await this._reader.read();return r?{value:n,done:r}:(this._loaded+=n.byteLength,this._callOnProgress(),{value:iA(n),done:!1})}cancel(n){var r;(r=this._reader)==null||r.cancel(n),this._abortController.abort()}}class fue extends tA{constructor(n,r,i){super(n,r,i);F(this,"_abortController",new AbortController);F(this,"_readCapability",Promise.withResolvers());F(this,"_reader",null);const{url:s,withCredentials:a}=n._source,o=new Headers(n.headers);o.append("Range",`bytes=${r}-${i-1}`),S5(s,o,a,this._abortController).then(l=>{const c=nA(l.url);x5(c,n._responseOrigin),k5(l.status,s),this._reader=l.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;const{value:n,done:r}=await this._reader.read();return r?{value:n,done:r}:{value:iA(n),done:!1}}cancel(n){var r;(r=this._reader)==null||r.cancel(n),this._abortController.abort()}}function xL(t){return t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}function sA(){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}var H1,A5;class pue extends Zk{constructor(n){super(n,mue,gue);E(this,H1);F(this,"_progressiveDone",!1);F(this,"_queuedChunks",[]);const{pdfDataRangeTransport:r}=n,{initialData:i,progressiveDone:s}=r;if((i==null?void 0:i.length)>0){const o=xL(i);this._queuedChunks.push(o)}this._progressiveDone=s;const a=o=>{var l;switch(o.type){case"range":case"progressiveRead":T(this,H1,A5).call(this,o.begin,o.chunk);break;case"progressiveDone":(l=this._fullReader)==null||l.progressiveDone(),this._progressiveDone=!0;break}};r.transportReady(a)}getFullReader(){const n=super.getFullReader();return this._queuedChunks=null,n}getRangeReader(n,r){const i=super.getRangeReader(n,r);return i&&(i.onDone=()=>this._rangeReaders.delete(i),this._source.pdfDataRangeTransport.requestDataRange(n,r)),i}cancelAllRequests(n){super.cancelAllRequests(n),this._source.pdfDataRangeTransport.abort()}}H1=new WeakSet,A5=function(n,r){const i=xL(r);if(n===void 0)this._fullReader?this._fullReader._enqueue(i):this._queuedChunks.push(i);else{const s=this._rangeReaders.keys().find(a=>a._begin===n);Vt(s,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),s._enqueue(i)}};var Iw;class mue extends eA{constructor(n){super(n);E(this,Iw,sA.bind(this));F(this,"_done",!1);F(this,"_queuedChunks",null);F(this,"_requests",[]);const{pdfDataRangeTransport:r,disableRange:i,disableStream:s}=n._source,{length:a,contentDispositionFilename:o}=r;this._queuedChunks=n._queuedChunks||[];for(const c of this._queuedChunks)this._loaded+=c.byteLength;this._done=n._progressiveDone,this._contentLength=a,this._isStreamingSupported=!s,this._isRangeSupported=!i,GR(o)&&(this._filename=o),this._headersCapability.resolve();const l=this._loaded;Promise.resolve().then(()=>{l>0&&this._loaded===l&&this._callOnProgress()})}_enqueue(n){this._done||(this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunks.push(n),this._loaded+=n.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 n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,u(this,Iw).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&u(this,Iw).call(this)}}Iw=new WeakMap;var Ow;class gue extends tA{constructor(n,r,i){super(n,r,i);E(this,Ow,sA.bind(this));F(this,"onDone",null);F(this,"_begin",-1);F(this,"_done",!1);F(this,"_queuedChunk",null);F(this,"_requests",[]);this._begin=r}_enqueue(n){var r;this._done||(this._requests.length===0?this._queuedChunk=n:(this._requests.shift().resolve({value:n,done:!1}),u(this,Ow).call(this)),this._done=!0,(r=this.onDone)==null||r.call(this))}async read(){if(this._queuedChunk){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){var r;this._done=!0,u(this,Ow).call(this),(r=this.onDone)==null||r.call(this)}}Ow=new WeakMap;const RE=200,SL=206;function yue(t){return typeof t!="string"?t:Xk(t).buffer}var za,vg,E5,_5;class vue extends Zk{constructor(n){super(n,wue,bue);E(this,vg);E(this,za,new WeakMap);F(this,"_responseOrigin",null);const{httpHeaders:r,url:i}=n;this.url=i,this.isHttp=/https?:/.test(i.protocol),this.headers=v5(this.isHttp,r)}_request(n){const r=new XMLHttpRequest,i={validateStatus:null,onHeadersReceived:n.onHeadersReceived,onDone:n.onDone,onError:n.onError,onProgress:n.onProgress};u(this,za).set(r,i),r.open("GET",this.url),r.withCredentials=this._source.withCredentials;for(const[s,a]of this.headers)r.setRequestHeader(s,a);return this.isHttp&&"begin"in n&&"end"in n?(r.setRequestHeader("Range",`bytes=${n.begin}-${n.end-1}`),i.validateStatus=s=>s===SL||s===RE):i.validateStatus=s=>s===RE,r.responseType="arraybuffer",Vt(n.onError,"Expected `onError` callback to be provided."),r.onerror=()=>n.onError(r.status),r.onreadystatechange=T(this,vg,_5).bind(this,r),r.onprogress=T(this,vg,E5).bind(this,r),r.send(null),r}
370_abortRequest(n){u(this,za).has(n)&&(u(this,za).delete(n),n.abort())}getRangeReader(n,r){const i=super.getRangeReader(n,r);return i&&(i.onClosed=()=>this._rangeReaders.delete(i)),i}}za=new WeakMap,vg=new WeakSet,E5=function(n,r){var s;const i=u(this,za).get(n);(s=i==null?void 0:i.onProgress)==null||s.call(i,r)},_5=function(n,r){const i=u(this,za).get(n);if(!i||(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),n.readyState!==4)||!u(this,za).has(n))return;if(u(this,za).delete(n),n.status===0&&this.isHttp){i.onError(n.status);return}const s=n.status||RE;if(!i.validateStatus(s)){i.onError(n.status);return}const a=yue(n.response);if(s===SL){const o=n.getResponseHeader("Content-Range");/bytes (\d+)-(\d+)\/(\d+)/.test(o)?i.onDone(a):(_e('Missing or invalid "Content-Range" header.'),i.onError(0))}else a?i.onDone(a):i.onError(n.status)};var Mw,yo,C5,T5,P5,N5;class wue extends eA{constructor(n){super(n);E(this,yo);E(this,Mw,sA.bind(this));F(this,"_cachedChunks",[]);F(this,"_done",!1);F(this,"_requests",[]);F(this,"_storedError",null);this._fullRequestXhr=n._request({onHeadersReceived:T(this,yo,C5).bind(this),onDone:T(this,yo,T5).bind(this),onError:T(this,yo,P5).bind(this),onProgress:T(this,yo,N5).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 n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){this._done=!0,this._headersCapability.reject(n),u(this,Mw).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}}Mw=new WeakMap,yo=new WeakSet,C5=function(){const n=this._stream,{disableRange:r,rangeChunkSize:i}=n._source,s=this._fullRequestXhr;n._responseOrigin=nA(s.responseURL);const a=s.getAllResponseHeaders(),o=new Headers(a?a.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(h=>{const[d,...f]=h.split(": ");return[d,f.join(": ")]}):[]),{contentLength:l,isRangeSupported:c}=w5({responseHeaders:o,isHttp:n.isHttp,rangeChunkSize:i,disableRange:r});this._contentLength=l,this._isRangeSupported=c,this._filename=b5(o),this._isRangeSupported&&n._abortRequest(s),this._headersCapability.resolve()},T5=function(n){this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._cachedChunks.push(n),this._done=!0,this._cachedChunks.length===0&&u(this,Mw).call(this)},P5=function(n){this._storedError=rA(n,this._stream.url),this._headersCapability.reject(this._storedError);for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0},N5=function(n){var r;(r=this.onProgress)==null||r.call(this,{loaded:n.loaded,total:n.lengthComputable?n.total:this._contentLength})};var Dw,Rl,R5,I5,RT;class bue extends tA{constructor(n,r,i){super(n,r,i);E(this,Rl);E(this,Dw,sA.bind(this));F(this,"onClosed",null);F(this,"_done",!1);F(this,"_queuedChunk",null);F(this,"_requests",[]);F(this,"_storedError",null);this._requestXhr=n._request({begin:r,end:i,onHeadersReceived:T(this,Rl,R5).bind(this),onDone:T(this,Rl,I5).bind(this),onError:T(this,Rl,RT).bind(this),onProgress:null})}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const r=this._queuedChunk;return this._queuedChunk=null,{value:r,done:!1}}if(this._done)return{value:void 0,done:!0};const n=Promise.withResolvers();return this._requests.push(n),n.promise}cancel(n){var r;this._done=!0,u(this,Dw).call(this),this._stream._abortRequest(this._requestXhr),(r=this.onClosed)==null||r.call(this)}}Dw=new WeakMap,Rl=new WeakSet,R5=function(){var r;const n=nA((r=this._requestXhr)==null?void 0:r.responseURL);try{x5(n,this._stream._responseOrigin)}catch(i){this._storedError=i,T(this,Rl,RT).call(this,0)}},I5=function(n){var r;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0,u(this,Dw).call(this),(r=this.onClosed)==null||r.call(this)},RT=function(n){this._storedError??(this._storedError=rA(n,this._stream.url));for(const r of this._requests)r.reject(this._storedError);this._requests.length=0,this._queuedChunk=null};function O5(t,e=null){const n=process.getBuiltinModule("fs"),{Readable:r}=process.getBuiltinModule("stream"),i=n.createReadStream(t,e);return r.toWeb(i)}class xue extends Zk{constructor(e){super(e,Sue,kue);const{url:n}=e;Vt(n.protocol==="file:","PDFNodeStream only supports file:// URLs.")}}class Sue extends eA{constructor(n){super(n);F(this,"_reader",null);const{disableRange:r,disableStream:i,rangeChunkSize:s,url:a}=n._source;this._isStreamingSupported=!i,process.getBuiltinModule("fs/promises").lstat(a).then(l=>{const c=O5(a);this._reader=c.getReader();const{size:h}=l;this._contentLength=h,this._isRangeSupported=!r&&h>2*s,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Au("Streaming is disabled.")),this._headersCapability.resolve()}).catch(l=>{l.code==="ENOENT"&&(l=rA(0,a)),this._headersCapability.reject(l)})}async read(){await this._headersCapability.promise;const{value:n,done:r}=await this._reader.read();return r?{value:n,done:r}:(this._loaded+=n.byteLength,this._callOnProgress(),{value:iA(n),done:!1})}cancel(n){var r;(r=this._reader)==null||r.cancel(n)}}class kue extends tA{constructor(n,r,i){super(n,r,i);F(this,"_readCapability",Promise.withResolvers());F(this,"_reader",null);const{url:s}=n._source;try{const a=O5(s,{start:r,end:i-1});this._reader=a.getReader(),this._readCapability.resolve()}catch(a){this._readCapability.reject(a)}}async read(){await this._readCapability.promise;const{value:n,done:r}=await this._reader.read();return r?{value:n,done:r}:{value:iA(n),done:!1}}cancel(n){var r;(r=this._reader)==null||r.cancel(n)}}function Aue(t){return tv(t)?hue:Li?xue:vue}var Lw,jw;class so{static get workerPort(){return u(this,Lw)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");S(this,Lw,e)}static get workerSrc(){return u(this,jw)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");S(this,jw,e)}}Lw=new WeakMap,jw=new WeakMap,E(so,Lw,null),E(so,jw,"");var om,Fw;class Eue{constructor({parsedData:e,rawData:n}){E(this,om);E(this,Fw);S(this,om,e),S(this,Fw,n)}getRaw(){return u(this,Fw)}get(e){return u(this,om).get(e)??null}[Symbol.iterator](){return u(this,om).entries()}}om=new WeakMap,Fw=new WeakMap;const Of=Symbol("INTERNAL");var Bw,$w,Uw,lm;class _ue{constructor(e,{name:n,intent:r,usage:i,rbGroups:s}){E(this,Bw,!1);E(this,$w,!1);E(this,Uw,!1);E(this,lm,!0);S(this,Bw,!!(e&Mi.DISPLAY)),S(this,$w,!!(e&Mi.PRINT)),this.name=n,this.intent=r,this.usage=i,this.rbGroups=s}get visible(){if(u(this,Uw))return u(this,lm);if(!u(this,lm))return!1;const{print:e,view:n}=this.usage;return u(this,Bw)?(n==null?void 0:n.viewState)!=="OFF":u(this,$w)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,n,r=!1){e!==Of&&Ze("Internal method `_setVisible` called."),S(this,Uw,r),S(this,lm,n)}}Bw=new WeakMap,$w=new WeakMap,Uw=new WeakMap,lm=new WeakMap;var Ic,ht,cm,um,zw,IT;class Cue{constructor(e,n=Mi.DISPLAY){E(this,zw);E(this,Ic,null);E(this,ht,new Map);E(this,cm,null);
370E(this,um,null);if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,S(this,um,e.order);for(const r of e.groups)u(this,ht).set(r.id,new _ue(n,r));if(e.baseState==="OFF")for(const r of u(this,ht).values())r._setVisible(Of,!1);for(const r of e.on)u(this,ht).get(r)._setVisible(Of,!0);for(const r of e.off)u(this,ht).get(r)._setVisible(Of,!1);S(this,cm,this.getHash())}}isVisible(e){if(u(this,ht).size===0)return!0;if(!e)return Yk("Optional content group not defined."),!0;if(e.type==="OCG")return u(this,ht).has(e.id)?u(this,ht).get(e.id).visible:(_e(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return T(this,zw,IT).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!u(this,ht).has(n))return _e(`Optional content group not found: ${n}`),!0;if(u(this,ht).get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!u(this,ht).has(n))return _e(`Optional content group not found: ${n}`),!0;if(!u(this,ht).get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!u(this,ht).has(n))return _e(`Optional content group not found: ${n}`),!0;if(!u(this,ht).get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!u(this,ht).has(n))return _e(`Optional content group not found: ${n}`),!0;if(u(this,ht).get(n).visible)return!1}return!0}return _e(`Unknown optional content policy ${e.policy}.`),!0}return _e(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0,r=!0){var s;const i=u(this,ht).get(e);if(!i){_e(`Optional content group not found: ${e}`);return}if(r&&n&&i.rbGroups.length)for(const a of i.rbGroups)for(const o of a)o!==e&&((s=u(this,ht).get(o))==null||s._setVisible(Of,!1,!0));i._setVisible(Of,!!n,!0),S(this,Ic,null)}setOCGState({state:e,preserveRB:n}){let r;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}const s=u(this,ht).get(i);if(s)switch(r){case"ON":this.setVisibility(i,!0,n);break;case"OFF":this.setVisibility(i,!1,n);break;case"Toggle":this.setVisibility(i,!s.visible,n);break}}S(this,Ic,null)}get hasInitialVisibility(){return u(this,cm)===null||this.getHash()===u(this,cm)}getOrder(){return u(this,ht).size?u(this,um)?u(this,um).slice():[...u(this,ht).keys()]:null}getGroup(e){return u(this,ht).get(e)||null}getHash(){if(u(this,Ic)!==null)return u(this,Ic);const e=new bT;for(const[n,r]of u(this,ht))e.update(`${n}:${r.visible}`);return S(this,Ic,e.hexdigest())}[Symbol.iterator](){return u(this,ht).entries()}}Ic=new WeakMap,ht=new WeakMap,cm=new WeakMap,um=new WeakMap,zw=new WeakSet,IT=function(e){const n=e.length;if(n<2)return!0;const r=e[0];for(let i=1;i<n;i++){const s=e[i];let a;if(Array.isArray(s))a=T(this,zw,IT).call(this,s);
370else if(u(this,ht).has(s))a=u(this,ht).get(s).visible;else return _e(`Optional content group not found: ${s}`),!0;switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return r==="And"};var ln,Ws,Kn,qh,Va,gr,xy,Sy,Gx;class Tue{constructor(){E(this,gr);E(this,ln,null);E(this,Ws,null);E(this,Kn,0);E(this,qh,null);E(this,Va,null)}get pagesNumber(){return u(this,Kn)}set pagesNumber(e){u(this,Kn)!==e&&(S(this,Kn,e),S(this,ln,null),S(this,Ws,null))}movePages(e,n,r){T(this,gr,xy).call(this);const i=u(this,ln),s=T(this,gr,Sy).call(this),a=n.length,o=new Uint32Array(a);let l=0;for(let f=0;f<a;f++){const p=n[f]-1;o[f]=i[p],p<r&&l++}const c=u(this,Kn),h=c-a,d=Dt(r-l,0,h);for(let f=0,p=0;f<c;f++)e.has(f+1)||(i[p++]=i[f]);i.copyWithin(d+a,d,h),i.set(o,d),T(this,gr,Gx).call(this,s),i.every((f,p)=>f===p+1)&&S(this,ln,null)}deletePages(e){T(this,gr,xy).call(this);const n=u(this,ln),r=T(this,gr,Sy).call(this);S(this,Va,{pageNumberToId:n.slice(),pagesNumber:u(this,Kn),prevPageNumbers:u(this,Ws).slice()});const i=u(this,Kn)-e.length;S(this,Kn,i);const s=S(this,ln,new Uint32Array(i));S(this,Ws,new Int32Array(i));let a=0,o=0;for(const l of e){const c=l-1;c!==a&&(s.set(n.subarray(a,c),o),o+=c-a),a=c+1}a<n.length&&s.set(n.subarray(a),o),T(this,gr,Gx).call(this,r,new Set(e))}cancelDelete(){u(this,Va)&&(S(this,ln,u(this,Va).pageNumberToId),S(this,Kn,u(this,Va).pagesNumber),S(this,Ws,u(this,Va).prevPageNumbers),S(this,Va,null))}cleanSavedData(){S(this,Va,null)}copyPages(e){T(this,gr,xy).call(this),S(this,qh,{pageNumbers:e,pageIds:e.map(n=>u(this,ln)[n-1])})}cancelCopy(){S(this,qh,null)}pastePages(e){T(this,gr,xy).call(this);const n=u(this,ln),r=T(this,gr,Sy).call(this),{pageNumbers:i,pageIds:s}=u(this,qh),a=u(this,Kn)+i.length;S(this,Kn,a);const o=S(this,ln,new Uint32Array(a));S(this,Ws,new Int32Array(a)),o.set(n.subarray(0,e),0),o.set(s,e),o.set(n.subarray(e),e+i.length),T(this,gr,Gx).call(this,r,null,e,i),S(this,qh,null)}hasBeenAltered(){return u(this,ln)!==null}getPageMappingForSaving(e=null){e??(e=T(this,gr,Sy).call(this));let n=0;for(const i of e.values())n=Math.max(n,i.length);const r=new Array(n);for(let i=0;i<n;i++)r[i]={document:null,pageIndices:[],includePages:[]};for(const[i,s]of e)for(let a=0,o=s.length;a<o;a++)r[a].includePages.push([i-1,s[a]-1]);for(const{includePages:i,pageIndices:s}of r){i.sort((a,o)=>a[0]-o[0]);for(let a=0,o=i.length;a<o;a++)s.push(i[a][1]),i[a]=i[a][0]}return r}extractPages(e){e=Array.from(e).sort((r,i)=>r-i);const n=new Map;for(let r=0,i=e.length;r<i;r++){const s=this.getPageId(e[r]);n.getOrInsertComputed(s,zR).push(r+1)}return this.getPageMappingForSaving(n)}getPrevPageNumber(e){var n;return((n=u(this,Ws))==null?void 0:n[e-1])??0}getPageNumber(e){if(!u(this,ln))return e;const n=u(this,ln);for(let r=0,i=u(this,Kn);r<i;r++)if(n[r]===e)return r+1;return 0}getPageId(e){var n;return((n=u(this,ln))==null?void 0:n[e-1])??e}getMapping(){var e;return(e=u(this,ln))==null?void 0:e.subarray(0,this.pagesNumber)}}ln=new WeakMap,Ws=new WeakMap,Kn=new WeakMap,qh=new WeakMap,Va=new WeakMap,gr=new WeakSet,xy=function(){if(u(this,ln))return;const e=u(this,Kn),n=S(this,ln,new Uint32Array(e));for(let r=0;r<e;r++)n[r]=r+1;S(this,Ws,new Int32Array(n))},Sy=function(){const e=new Map,n=u(this,ln);for(let r=0,i=u(this,Kn);r<i;r++){const s=n[r],a=e.get(s);a?a.push(r+1):e.set(s,[r+1])}return e},Gx=function(e,n=null,r=-1,i=null){const s=u(this,Ws),a=u(this,ln),o=r+((i==null?void 0:i.length)??0),l=new Map;for(let c=0,h=u(this,Kn);c<h;c++){if(c>=r&&c<o){s[c]=-i[c-r];continue}const d=a[c],f=e.get(d);let p=l.get(d)||0;if(n&&f)for(;p<f.length&&n.has(f[p]);)p++;s[c]=f==null?void 0:f[p],l.set(d,p+1)}};const Mf=Symbol("INITIAL_DATA"),kL=()=>({...Promise.withResolvers(),data:Mf});var hs;class M5{constructor(){E(this,hs,new Map)}get(e,n=null){if(n){const i=u(this,hs).getOrInsertComputed(e,kL);return i.promise.then(()=>n(i.data)),null}const r=u(this,hs).get(e);if(!r||r.data===Mf)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=u(this,hs).get(e);return!!n&&n.data!==Mf}delete(e){const n=u(this,hs).get(e);return!n||n.data===Mf?!1:(u(this,hs).delete(e),!0)}resolve(e,n=null){const r=u(this,hs).getOrInsertComputed(e,kL);if(r.data!==Mf)throw new Error(`Object already resolved ${e}.`);r.data=n,r.resolve()}clear(){var e;
370for(const{data:n}of u(this,hs).values())(e=n==null?void 0:n.bitmap)==null||e.close();u(this,hs).clear()}*[Symbol.iterator](){for(const[e,{data:n}]of u(this,hs))n!==Mf&&(yield[e,n])}}hs=new WeakMap;const Pue=1e5,AL=30;var mj,Oc,Ar,Vw,Hw,hm,Kh,Qo,Ww,Gw,Yh,qw,dm,Mc,fm,Kw,pm,Xh,Yw,Xw,mm,Qh,Qw,gm,ym,Il,D5,L5,OT,Wi,qx,MT,j5,F5;const Hn=class Hn{constructor({textContentSource:e,images:n,container:r,viewport:i}){E(this,Il);E(this,Oc,Promise.withResolvers());E(this,Ar,null);E(this,Vw,!1);E(this,Hw,!!((mj=globalThis.FontInspector)!=null&&mj.enabled));E(this,hm,null);E(this,Kh,null);E(this,Qo,null);E(this,Ww,0);E(this,Gw,0);E(this,Yh,null);E(this,qw,null);E(this,dm,0);E(this,Mc,0);E(this,fm,Object.create(null));E(this,Kw,[]);E(this,pm,null);E(this,Xh,[]);E(this,Yw,new WeakMap);E(this,Xw,null);var c;if(e instanceof ReadableStream)S(this,pm,e);else if(typeof e=="object")S(this,pm,new ReadableStream({start(h){h.enqueue(e),h.close()}}));else throw new Error('No "textContentSource" parameter specified.');S(this,Ar,S(this,qw,r)),S(this,hm,n),S(this,Mc,i.scale*go.pixelRatio),S(this,dm,i.rotation),S(this,Qo,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:a,pageX:o,pageY:l}=i.rawDims;S(this,Xw,[1,0,0,-1,-o,l+a]),S(this,Gw,s),S(this,Ww,a),T(c=Hn,Wi,j5).call(c),r.style.setProperty("--min-font-size",u(Hn,gm)),Gd(r,i),u(this,Oc).promise.finally(()=>{u(Hn,ym).delete(this),S(this,Qo,null),S(this,fm,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:n}=bn.platform;return Se(this,"fontFamilyMap",new Map([["sans-serif",`${e&&n?"Calibri, ":""}sans-serif`],["monospace",`${e&&n?"Lucida Console, ":""}monospace`]]))}render(){u(this,hm)&&u(this,Ar).append(u(this,hm).render());const e=()=>{u(this,Yh).read().then(({value:n,done:r})=>{if(r){u(this,Oc).resolve();return}u(this,Kh)??S(this,Kh,n.lang),Object.assign(u(this,fm),n.styles),T(this,Il,D5).call(this,n.items),e()},u(this,Oc).reject)};return S(this,Yh,u(this,pm).getReader()),u(Hn,ym).add(this),e(),u(this,Oc).promise}update({viewport:e,onBefore:n=null}){var s;const r=e.scale*go.pixelRatio,i=e.rotation;if(i!==u(this,dm)&&(n==null||n(),S(this,dm,i),Gd(u(this,qw),{rotation:i})),r!==u(this,Mc)){n==null||n(),S(this,Mc,r);const a={div:null,properties:null,ctx:T(s=Hn,Wi,qx).call(s,u(this,Kh))};for(const o of u(this,Xh))a.properties=u(this,Yw).get(o),a.div=o,T(this,Il,OT).call(this,a)}}cancel(){var n;const e=new Au("TextLayer task cancelled.");(n=u(this,Yh))==null||n.cancel(e).catch(()=>{}),S(this,Yh,null),u(this,Oc).reject(e)}get textDivs(){return u(this,Xh)}get textContentItemsStr(){return u(this,Kw)}static cleanup(){if(!(u(this,ym).size>0)){u(this,mm).clear();for(const{canvas:e}of u(this,Qh).values())e.remove();u(this,Qh).clear()}}};Oc=new WeakMap,Ar=new WeakMap,Vw=new WeakMap,Hw=new WeakMap,hm=new WeakMap,Kh=new WeakMap,Qo=new WeakMap,Ww=new WeakMap,Gw=new WeakMap,Yh=new WeakMap,qw=new WeakMap,dm=new WeakMap,Mc=new WeakMap,fm=new WeakMap,Kw=new WeakMap,pm=new WeakMap,Xh=new WeakMap,Yw=new WeakMap,Xw=new WeakMap,mm=new WeakMap,Qh=new WeakMap,Qw=new WeakMap,gm=new WeakMap,ym=new WeakMap,Il=new WeakSet,D5=function(e){var i,s;if(u(this,Vw))return;(s=u(this,Qo)).ctx??(s.ctx=T(i=Hn,Wi,qx).call(i,u(this,Kh)));const n=u(this,Xh),r=u(this,Kw);for(const a of e){if(n.length>Pue){_e("Ignoring additional textDivs for performance reasons."),S(this,Vw,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=u(this,Ar);S(this,Ar,document.createElement("span")),u(this,Ar).classList.add("markedContent"),a.id&&u(this,Ar).setAttribute("id",`${a.id}`),a.tag==="Artifact"&&(u(this,Ar).ariaHidden=!0),o.append(u(this,Ar))}else a.type==="endMarkedContent"&&S(this,Ar,u(this,Ar).parentNode);continue}r.push(a.str),T(this,Il,L5).call(this,a)}},L5=function(e){var m;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};u(this,Xh).push(n);const i=Q.transform(u(this,Xw),e.transform);let s=Math.atan2(i[1],i[0]);const a=u(this,fm)[e.fontName];a.vertical&&(s+=Math.PI/2);let o=u(this,Hw)&&a.fontSubstitution||a.fontFamily;o=Hn.fontFamilyMap.get(o)||o;const l=Math.hypot(i[2],i[3]),c=l*T(m=Hn,Wi,F5).call(m,o,a,u(this,Kh));let h,d;s===0?(h=i[4],d=i[5]-c):(h=i[4]+c*Math.sin(s),d=i[5]-c*Math.cos(s));const f=n.style;f.left=`${(100*h/u(this,Gw)).toFixed(2)}%`,f.top=`${(100*d/u(this,Ww)).toFixed(2)}%`,f.setProperty("--font-height",`${l.toFixed(2)}px`),f.fontFamily=o,r.fontSize=l,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,u(this,Hw)&&(n.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),s!==0&&(r.angle=s*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const y=Math.abs(e.transform[0]),x=Math.abs(e.transform[3]);y!==x&&Math.max(y,x)/Math.min(y,x)>1.5&&(p=!0)}if(p&&(r.canvasWidth=a.vertical?e.height:e.width),u(this,Yw).set(n,r),u(this,Qo).div=n,u(this,Qo).properties=r,T(this,Il,OT).call(this,u(this,Qo)),r.hasText&&u(this,Ar).append(n),r.hasEOL){const y=document.createElement("br");y.setAttribute("role","presentation"),u(this,Ar).append(y)}},OT=function(e){var a;const{div:n,properties:r,ctx:i}=e,{style:s}=n;if(r.canvasWidth!==0&&r.hasText){const{fontFamily:o}=s,{canvasWidth:l,fontSize:c}=r;
370T(a=Hn,Wi,MT).call(a,i,c*u(this,Mc),o);const{width:h}=i.measureText(n.textContent);h>0&&s.setProperty("--scale-x",l*u(this,Mc)/h)}r.angle!==0&&s.setProperty("--rotate",`${r.angle}deg`)},Wi=new WeakSet,qx=function(e=null){let n=u(this,Qh).get(e||(e=""));if(!n){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),n=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),u(this,Qh).set(e,n),u(this,Qw).set(n,{size:0,family:""})}return n},MT=function(e,n,r){const i=u(this,Qw).get(e);n===i.size&&r===i.family||(e.font=`${n}px ${r}`,i.size=n,i.family=r)},j5=function(){if(u(this,gm)!==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),S(this,gm,e.getBoundingClientRect().height),e.remove()},F5=function(e,n,r){const i=u(this,mm).get(e);if(i)return i;const s=T(this,Wi,qx).call(this,r);s.canvas.width=s.canvas.height=AL,T(this,Wi,MT).call(this,s,AL,e);const a=s.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);s.canvas.width=s.canvas.height=0;let c=.8;return o?c=o/(o+l):(bn.platform.isFirefox&&_e("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),n.ascent?c=n.ascent:n.descent&&(c=1+n.descent)),u(this,mm).set(e,c),c},E(Hn,Wi),E(Hn,mm,new Map),E(Hn,Qh,new Map),E(Hn,Qw,new WeakMap),E(Hn,gm,null),E(Hn,ym,new Set);let Hv=Hn;const Nue=100;function B5(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new DT,{docId:n}=e,r=t.url?Lce(t.url):null,i=t.data?jce(t.data):null,s=t.httpHeaders||null,a=t.withCredentials===!0,o=t.password??null,l=t.range instanceof $5?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:2**16;let h=t.worker instanceof Wv?t.worker:null;const d=t.verbosity,f=typeof t.docBaseUrl=="string"&&!Qk(t.docBaseUrl)?t.docBaseUrl:null,p=Wb(t.cMapUrl),m=t.cMapPacked!==!1,y=Wb(t.iccUrl),x=Wb(t.standardFontDataUrl),v=Wb(t.wasmUrl),w=t.stopAtErrors!==!0,b=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,k=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Li,_=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Li&&(bn.platform.isFirefox||!globalThis.chrome),C=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,P=typeof t.disableFontFace=="boolean"?t.disableFontFace:Li,R=t.fontExtraProperties===!0,O=t.enableXfa===!0,M=t.ownerDocument||globalThis.document,D=t.disableRange===!0,j=t.disableStream===!0,U=t.disableAutoFetch===!0,B=t.pdfBug===!0,z=t.CanvasFactory||(Li?Wce:Uce),$=t.FilterFactory||(Li?Hce:zce),W=t.BinaryDataFactory||(Li?Gce:hL),L=t.enableHWA===!0,N=t.enableWebGPU===!0?Yce():Promise.resolve(!1),G=t.useWasm!==!1,Y=t.pagesMapper||new Tue,I=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Li&&!P,we=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(W===hL&&p&&m&&x&&v&&tv(p,document.baseURI)&&tv(x,document.baseURI)&&tv(v,document.baseURI)),Oe=null;ice(d);const oe={canvasFactory:new z({ownerDocument:M,enableHWA:L}),filterFactory:new $({docId:n,ownerDocument:M}),binaryDataFactory:we?null:new W({cMapUrl:p,standardFontDataUrl:x,wasmUrl:v})};h||(h=Wv.create({verbosity:d,port:so.workerPort}),e._worker=h);const he={docId:n,apiVersion:"5.7.284",data:i,password:o,disableAutoFetch:U,rangeChunkSize:c,docBaseUrl:f,enableXfa:O,evaluatorOptions:{maxImageSize:b,disableFontFace:P,ignoreErrors:w,isOffscreenCanvasSupported:k,isImageDecoderSupported:_,canvasMaxAreaInBytes:C,fontExtraProperties:R,useSystemFonts:I,useWasm:G,useWorkerFetch:we,cMapUrl:p,cMapPacked:m,iccUrl:y,standardFontDataUrl:x,wasmUrl:v,hasGPU:!1}},rn={ownerDocument:M,pdfBug:B,styleElement:Oe,enableHWA:L,loadingParams:{disableAutoFetch:U,enableXfa:O}};return Promise.all([h.promise,N]).then(function([,kn]){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");he.evaluatorOptions.hasGPU=kn;
370const sn=h.messageHandler.sendWithPromise("GetDocRequest",he,i?[i.buffer]:null);let wr;if(!i)if(l)wr=new pue({pdfDataRangeTransport:l,disableRange:D,disableStream:j});else if(r){const Br=Aue(r);wr=new Br({url:r,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:D,disableStream:j})}else throw new Error("getDocument - expected either `data`, `range`, or `url` parameter.");return sn.then(Br=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const $r=new gy(n,Br,h.port),Ts=new Iue($r,e,wr,rn,oe,Y);e._transport=Ts,$r.send("Ready",null)})}).catch(e._capability.reject),e}var W1;const G1=class G1{constructor(){F(this,"_capability",Promise.withResolvers());F(this,"_transport",null);F(this,"_worker",null);F(this,"docId",`d${jt(G1,W1)._++}`);F(this,"destroyed",!1);F(this,"onPassword",null);F(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,n,r,i;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((n=this._transport)==null?void 0:n.destroy())}catch(s){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,s}this._transport=null,(i=this._worker)==null||i.destroy(),this._worker=null}async getData(){return this._transport.getData()}};W1=new WeakMap,E(G1,W1,0);let DT=G1;var vm,Jh;class $5{constructor(e,n,r=!1,i=null){E(this,vm,Promise.withResolvers());E(this,Jh,null);this.length=e,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=i,Object.defineProperty(this,"onDataProgress",{value:()=>{mce("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}onDataRange(e,n){u(this,Jh).call(this,{type:"range",begin:e,chunk:n})}onDataProgressiveRead(e){u(this,vm).promise.then(()=>{u(this,Jh).call(this,{type:"progressiveRead",chunk:e})})}onDataProgressiveDone(){u(this,vm).promise.then(()=>{u(this,Jh).call(this,{type:"progressiveDone"})})}transportReady(e){S(this,Jh,e),u(this,vm).resolve()}requestDataRange(e,n){Ze("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}vm=new WeakMap,Jh=new WeakMap;class Rue{constructor(e,n){this._pdfInfo=e,this._transport=n}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 Se(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)}
370getDestinations(){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,n){return this._transport.getAnnotationsByType(e,n)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(n)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}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)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var Jo,Zh,ed,ky;const uI=class uI{constructor(e,n,r,i,s=!1){E(this,ed);E(this,Jo,!1);E(this,Zh,null);this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=s?new eL:null,this._pdfBug=s,this.commonObjs=r.commonObjs,this.objs=new M5,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,S(this,Zh,i),this.imageCoordinates=null}clone(e){const n=new uI(e,this._pageInfo,this._transport,u(this,Zh),this._pdfBug);return n.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(n),n}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:n=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}={}){return new J0({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:n,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations({intent:e="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Se(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:n=e.canvas,viewport:r,intent:i="display",annotationMode:s=tc.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:h=null,printAnnotationStorage:d=null,isEditing:f=!1,recordImages:p=!1,recordOperations:m=!1,operationsFilter:y=null}){var U,B,z;(U=this._stats)==null||U.time("Overall");const x=this._transport.getRenderingIntent(i,s,d,f),{renderingIntent:v,cacheKey:w}=x;S(this,Jo,!1),l||(l=this._transport.getOptionalContentConfig(v));const b=this._intentStates.getOrInsertComputed(w,tT);b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const k=!!(v&Mi.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(x));const _=!!(this._pdfBug&&((z=globalThis.StepperManager)!=null&&z.enabled)),C=!!n&&!this.recordedBBoxes&&(m||_),P=!!n&&!this.imageCoordinates&&p,R=$=>{var W,L,V,N;if(b.renderTasks.delete(D),C){const G=(W=D.gfx)==null?void 0:W.dependencyTracker.take();G&&((L=D.stepper)==null||L.setOperatorBBoxes(G,D.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=G))}P&&!$&&(this.imageCoordinates=(V=D.gfx)==null?void 0:V.imagesTracker.take()),k&&S(this,Jo,!0),T(this,ed,ky).call(this),$?(D.capability.reject($),this._abortOperatorList({intentState:b,reason:$ instanceof Error?$:new Error($)})):D.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(N=globalThis.Stats)!=null&&N.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)
370)};let O=null,M=null;(C||P)&&(M=new Cce(n,b.operatorList.length)),C&&(O=new Tce(M,_));const D=new jT({callback:R,params:{canvas:n,canvasContext:e,dependencyTracker:O??M,imagesTracker:P?new kT(n):null,viewport:r,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:!k,pdfBug:this._pdfBug,pageColors:h,enableHWA:this._transport.enableHWA,operationsFilter:y});(b.renderTasks||(b.renderTasks=new Set)).add(D);const j=D.task;return Promise.all([b.displayReadyCapability.promise,l]).then(([$,W])=>{var L;if(this.destroyed){R();return}if((L=this._stats)==null||L.time("Rendering"),!(W.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");D.initializeGraphics({transparency:$,optionalContentConfig:W}),D.operatorListChanged()}).catch(R),j}getOperatorList({intent:e="display",annotationMode:n=tc.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){var c;function s(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,n,r,i,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,tT);let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageId:u(this,Zh).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(i){return i.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Uv.textContent(i));const n=this.streamTextContent(e),r={items:[],styles:Object.create(null),lang:null};for await(const i of n)r.lang??(r.lang=i.lang),Object.assign(r.styles,i.styles),r.items.push(...i.items);return r}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const n of this._intentStates.values())if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!n.opListReadCapability)for(const r of n.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),S(this,Jo,!1),Promise.all(e)}cleanup(e=!1){S(this,Jo,!0);const n=T(this,ed,ky).call(this);return e&&n&&this._stats&&(this._stats=new eL),n}_startRenderPage(e,n){var i,s;const r=this._intentStates.get(n);r&&((i=this._stats)==null||i.timeEnd("Page Request"),(s=r.displayReadyCapability)==null||s.resolve(e))}_renderPageChunk(e,n){for(let r=0,i=e.length;r<i;r++)n.operatorList.fnArray.push(e.fnArray[r]),n.operatorList.argsArray.push(e.argsArray[r]);n.operatorList.lastChunk=e.lastChunk,n.operatorList.separateAnnots=e.separateAnnots;for(const r of n.renderTasks)r.operatorListChanged();e.lastChunk&&T(this,ed,ky).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r,modifiedIds:i}){const{map:s,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:u(this,Zh).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:s,modifiedIds:i},void 0,a).getReader(),c=this._intentStates.get(n);c.streamReader=l;const h=()=>{l.read().then(({value:d,done:f})=>{if(f){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),h())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const f of c.renderTasks)f.operatorListChanged();T(this,ed,ky).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};h()}_abortOperatorList({intentState:e,reason:n,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(n instanceof WR){let i=Nue;n.extraDelay>0&&n.extraDelay<1e3&&(i+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},i);return}}if(e.streamReader.cancel(new Au(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,s]of this._intentStates)if(s===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}};Jo=new WeakMap,Zh=new WeakMap,ed=new WeakSet,ky=function(){if(!u(this,Jo)||this.destroyed)return!1;for(const{renderTasks:e,operatorList:n}of this._intentStates.values())if(e.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),S(this,Jo,!1),!0};let LT=uI;var Dc,Gs,Zo,td,q1,nd,rd,Mr,Kx,U5,z5,Ay,wm,Yx;const Kt=class Kt{constructor({name:e=null,port:n=null,verbosity:r=sce()}={}){E(this,Mr);E(this,Dc,Promise.withResolvers());E(this,Gs,null);E(this,Zo,null);E(this,td,null);if(this.name=e,this.destroyed=!1,this.verbosity=r,n){if(u(Kt,rd).has(n))throw new Error("Cannot use more than one PDFWorker per port.");u(Kt,rd).set(n,this),T(this,Mr,U5).call(this,n)}else T(this,Mr,z5).call(this)}get promise(){return u(this,Dc).promise}get port(){return u(this,Zo)}get messageHandler(){return u(this,Gs)}destroy(){var e,n;this.destroyed=!0,(e=u(this,td))==null||e.terminate(),S(this,td,null),u(Kt,rd).delete(u(this,Zo)
370),S(this,Zo,null),(n=u(this,Gs))==null||n.destroy(),S(this,Gs,null)}static create(e){const n=u(this,rd).get(e==null?void 0:e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new Kt(e)}static get workerSrc(){if(so.workerSrc)return so.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Se(this,"_setupFakeWorkerGlobal",(async()=>u(this,wm,Yx)?u(this,wm,Yx):(await import(this.workerSrc)).WorkerMessageHandler)())}};Dc=new WeakMap,Gs=new WeakMap,Zo=new WeakMap,td=new WeakMap,q1=new WeakMap,nd=new WeakMap,rd=new WeakMap,Mr=new WeakSet,Kx=function(){u(this,Dc).resolve(),u(this,Gs).send("configure",{verbosity:this.verbosity})},U5=function(e){S(this,Zo,e),S(this,Gs,new gy("main","worker",e)),u(this,Gs).on("ready",()=>{}),T(this,Mr,Kx).call(this)},z5=function(){if(u(Kt,nd)||u(Kt,wm,Yx)){T(this,Mr,Ay).call(this);return}let{workerSrc:e}=Kt;try{Kt._isSameOrigin(window.location,e)||(e=Kt._createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),r=new gy("main","worker",n),i=()=>{s.abort(),r.destroy(),n.terminate(),this.destroyed?u(this,Dc).reject(new Error("Worker was destroyed")):T(this,Mr,Ay).call(this)},s=new AbortController;n.addEventListener("error",()=>{u(this,td)||i()},{signal:s.signal}),r.on("test",o=>{if(s.abort(),this.destroyed||!o){i();return}S(this,Gs,r),S(this,Zo,n),S(this,td,n),T(this,Mr,Kx).call(this)}),r.on("ready",o=>{if(s.abort(),this.destroyed){i();return}try{a()}catch{T(this,Mr,Ay).call(this)}});const a=()=>{const o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{Yk("The worker has been disabled.")}T(this,Mr,Ay).call(this)},Ay=function(){u(Kt,nd)||(_e("Setting up fake worker."),S(Kt,nd,!0)),Kt._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){u(this,Dc).reject(new Error("Worker was destroyed"));return}const n=new $ce;S(this,Zo,n);const r=`fake${jt(Kt,q1)._++}`,i=new gy(r+"_worker",r,n);e.setup(i,n),S(this,Gs,new gy(r,r+"_worker",n)),T(this,Mr,Kx).call(this)}).catch(e=>{u(this,Dc).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},wm=new WeakSet,Yx=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},E(Kt,wm),E(Kt,q1,0),E(Kt,nd,!1),E(Kt,rd,new WeakMap),Li&&(S(Kt,nd,!0),so.workerSrc||(so.workerSrc="./pdf.worker.mjs")),Kt._isSameOrigin=(e,n)=>{const r=URL.parse(e);if(!(r!=null&&r.origin)||r.origin==="null")return!1;const i=new URL(n,r);return r.origin===i.origin},Kt._createCDNWrapper=e=>{const n=`await import("${e}");`;return URL.createObjectURL(new Blob([n],{type:"text/javascript"}))};let Wv=Kt;var wi,id,el,qs,sd,bm,tl,ia,Ey,Xx;class Iue{constructor(e,n,r,i,s,a){E(this,ia);F(this,"downloadInfoCapability",Promise.withResolvers());E(this,wi,null);E(this,id,new Map);E(this,el,null);E(this,qs,new Map);E(this,sd,new Map);E(this,bm,new Map);E(this,tl,null);this.messageHandler=e,this.loadingTask=n,S(this,el,r),this.commonObjs=new M5,this.fontLoader=new Pce({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.enableHWA=i.enableHWA,this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.binaryDataFactory=s.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){const{_pageIndex:n}=e;u(this,qs).set(n,e),u(this,sd).set(n,Promise.resolve(e))}get annotationStorage(){return Se(this,"annotationStorage",new KR)}getRenderingIntent(e,n=tc.ENABLE,r=null,i=!1,s=!1){let a=Mi.DISPLAY,o=zv;switch(e){case"any":a=Mi.ANY;break;case"display":break;case"print":a=Mi.PRINT;break;default:_e(`getRenderingIntent - invalid intent: ${e}`)}const l=a&Mi.PRINT&&r instanceof o5?r:this.annotationStorage;switch(n){case tc.DISABLE:a+=Mi.ANNOTATIONS_DISABLE;break;case tc.ENABLE:break;case tc.ENABLE_FORMS:a+=Mi.ANNOTATIONS_FORMS;break;case tc.ENABLE_STORAGE:a+=Mi.ANNOTATIONS_STORAGE,o=l.serializable;break;default:_e(`getRenderingIntent - invalid annotationMode: ${n}`)}i&&(a+=Mi.IS_EDITING),s&&(a+=Mi.OPLIST);const{ids:c,hash:h}=l.modifiedIds,d=[a,o.hash,h];return{renderingIntent:a,cacheKey:d.join("_"),annotationStorageSerializable:o,modifiedIds:c}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=u(this,tl))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const i of u(this,qs).values())e.push(i._destroy());u(this,qs).clear(),u(this,sd).clear(),u(this,bm).clear(),Object.hasOwn(this,"annotationStorage")&&this.annotationStorage.resetModified();
370const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{var i,s;this.commonObjs.clear(),this.fontLoader.clear(),u(this,id).clear(),this.filterFactory.destroy(),Hv.cleanup(),(i=u(this,el))==null||i.cancelAllRequests(new Au("Worker was terminated.")),(s=this.messageHandler)==null||s.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(r,i)=>{Vt(u(this,el),"GetReader - no `BasePDFStream` instance available."),S(this,wi,u(this,el).getFullReader()),u(this,wi).onProgress=s=>T(this,ia,Xx).call(this,s),i.onPull=()=>{u(this,wi).read().then(function({value:s,done:a}){if(a){i.close();return}Vt(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{u(this,wi).cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{await u(this,wi).headersReady;const{isStreamingSupported:i,isRangeSupported:s,contentLength:a}=u(this,wi);return i&&s&&(u(this,wi).onProgress=null),{isStreamingSupported:i,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,i)=>{Vt(u(this,el),"GetRangeReader - no `BasePDFStream` instance available.");const s=u(this,el).getRangeReader(r.begin,r.end);if(!s){i.close();return}i.onPull=()=>{s.read().then(function({value:a,done:o}){if(o){i.close();return}Vt(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{s.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:r})=>{this.pagesMapper.pagesNumber=r.numPages,this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new Rue(r,this))}),e.on("DocException",r=>{n._capability.reject(Hr(r))}),e.on("PasswordRequest",r=>{S(this,tl,Promise.withResolvers());try{if(!n.onPassword)throw Hr(r);const i=s=>{s instanceof Error?u(this,tl).reject(s):u(this,tl).resolve({password:s})};n.onPassword(i,r.code)}catch(i){u(this,tl).reject(i)}return u(this,tl).promise}),e.on("DataLoaded",r=>{T(this,ia,Xx).call(this,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;u(this,qs).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,i,s])=>{var a;if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":if("error"in s){const f=s.error;_e(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}const o=new Oce(s),l=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(f,p)=>globalThis.FontInspector.fontAdded(f,p):null,c=new Nce(o,l,s.charProcOperatorList,s.extra);this.fontLoader.bind(c).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{c.fontExtraProperties||c.clearData(),this.commonObjs.resolve(r,c)});break;case"CopyLocalImage":const{imageRef:h}=s;Vt(h,"The imageRef must be defined.");for(const f of u(this,qs).values())for(const[,p]of f.objs){if((p==null?void 0:p.ref)!==h)continue;if(!p.dataLen)return null;const m=structuredClone(p);return this.commonObjs.resolve(r,m),p.dataLen}break;case"FontPath":this.commonObjs.resolve(r,new Dce(s));break;case"Image":this.commonObjs.resolve(r,s);break;case"Pattern":const d=new Mce(s);this.commonObjs.resolve(r,d.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([r,i,s,a])=>{var l;if(this.destroyed)return;const o=u(this,qs).get(i);if(!o.objs.has(r)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(s){case"Image":case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",r=>{this.destroyed||T(this,ia,Xx).call(this,r)}),e.on("FetchBinaryData",async r=>{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(r)})}
370getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&_e("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((r=u(this,wi))==null?void 0:r.filename)??null},n).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){const n={pageInfos:e};let r;if(this.annotationStorage.size>0){const{map:i,transfer:s}=this.annotationStorage.serializable;n.annotationStorage=i,r=s}return this.messageHandler.sendWithPromise("ExtractPages",n,r).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 n=e-1,r=this.pagesMapper.getPageId(e)-1,i=u(this,sd).get(n);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&u(this,bm).set(a.refStr,r);const o=new LT(n,a,this,this.pagesMapper,this._params.pdfBug);return u(this,qs).set(n,o),o});return u(this,sd).set(n,s),s}async getPageIndex(e){if(!ET(e))throw new Error("Invalid pageIndex request.");const n=await this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}),r=this.pagesMapper.getPageNumber(n+1);if(r===0)throw new Error("GetPageIndex: page has been removed.");return r-1}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:n})}getFieldObjects(){return T(this,ia,Ey).call(this,"GetFieldObjects")}hasJSActions(){return T(this,ia,Ey).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,n){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:n})}getDocJSActions(){return T(this,ia,Ey).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 T(this,ia,Ey).call(this,"GetOptionalContentConfig").then(n=>new Cue(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata";return u(this,id).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(n=>{var r,i;return{info:n[0],metadata:n[1]?new Eue(n[1]):null,contentDispositionFilename:((r=u(this,wi))==null?void 0:r.filename)??null,contentLength:((i=u(this,wi))==null?void 0:i.contentLength)??null,hasStructTree:n[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 n of u(this,qs).values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),u(this,id).clear(),this.filterFactory.destroy(!0),Hv.cleanup()}}cachedPageNumber(e){if(!ET(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,r=u(this,bm).get(n);if(r>=0){const i=this.pagesMapper.getPageNumber(r+1);if(i!==0)return i}return null}}wi=new WeakMap,id=new WeakMap,el=new WeakMap,qs=new WeakMap,sd=new WeakMap,bm=new WeakMap,tl=new WeakMap,ia=new WeakSet,Ey=function(e,n=null){return u(this,id).getOrInsertComputed(e,()=>
370this.messageHandler.sendWithPromise(e,n))},Xx=function({loaded:e,total:n}){var r,i;(i=(r=this.loadingTask).onProgress)==null||i.call(r,{loaded:e,total:n,percent:n?Dt(Math.round(e/n*100),0,100):NaN})};class Oue{constructor(e){F(this,"_internalRenderTask",null);F(this,"onContinue",null);F(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:n}=this._internalRenderTask;return e.form||e.canvas&&(n==null?void 0:n.size)>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}}var Lc,ad;const Qu=class Qu{constructor({callback:e,params:n,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:f=null,enableHWA:p=!1,operationsFilter:m=null}){E(this,Lc,null);this.callback=e,this.params=n,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Oue(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=n.canvas,this._canvasContext=n.canvas?null:n.canvasContext,this._enableHWA=p,this._dependencyTracker=n.dependencyTracker,this._imagesTracker=n.imagesTracker,this._operationsFilter=m}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){var c,h;if(this.cancelled)return;if(this._canvas){if(u(Qu,ad).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.");u(Qu,ad).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:r,transform:i,background:s,dependencyTracker:a,imagesTracker:o}=this.params,l=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new yp(l,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,a,o),this.gfx.beginDrawing({transform:i,viewport:r,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,(h=this.graphicsReadyCallback)==null||h.call(this)}cancel(e=null,n=0){var r,i,s;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),u(this,Lc)&&(window.cancelAnimationFrame(u(this,Lc)),S(this,Lc,null)),u(Qu,ad).delete(this._canvas),e||(e=new WR(`Rendering cancelled, page ${this._pageIndex+1}`,n)),this.callback(e),(s=(i=this.task).onError)==null||s.call(i,e)}operatorListChanged(){var e,n;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.gfx.dependencyTracker)==null||e.growOperationsCount(this.operatorList.fnArray.length),(n=this.stepper)==null||n.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?S(this,Lc,window.requestAnimationFrame(()=>{S(this,Lc,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(),u(Qu,ad).delete(this._canvas),this.callback())))}};Lc=new WeakMap,ad=new WeakMap,E(Qu,ad,new WeakSet);let jT=Qu;const Mue="5.7.284",Due="7e5b36c2d";var bi,od,xm,_n,Jw,Sm,nl,Zw,jc,Ks,e0,dt,FT,BT,$T,Hu,V5,Hl;
370const Wr=class Wr{constructor({editor:e=null,uiManager:n=null}){E(this,dt);E(this,bi,null);E(this,od,null);E(this,xm);E(this,_n,null);E(this,Jw,!1);E(this,Sm,!1);E(this,nl,null);E(this,Zw);E(this,jc,null);E(this,Ks,null);var r,i;e?(S(this,Sm,!1),S(this,nl,e)):S(this,Sm,!0),S(this,Ks,(e==null?void 0:e._uiManager)||n),S(this,Zw,u(this,Ks)._eventBus),S(this,xm,((r=e==null?void 0:e.color)==null?void 0:r.toUpperCase())||((i=u(this,Ks))==null?void 0:i.highlightColors.values().next().value)||"#FFFF98"),u(Wr,e0)||S(Wr,e0,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 Se(this,"_keyboardManager",new eb([[["Escape","mac+Escape"],Wr.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Wr.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Wr.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Wr.prototype._moveToPrevious],[["Home","mac+Home"],Wr.prototype._moveToBeginning],[["End","mac+End"],Wr.prototype._moveToEnd]]))}renderButton(){const e=S(this,bi,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",u(this,nl)&&(e.ariaControls=`${u(this,nl).id}_colorpicker_dropdown`);const n=u(this,Ks)._signal;e.addEventListener("click",T(this,dt,Hu).bind(this),{signal:n}),e.addEventListener("keydown",T(this,dt,$T).bind(this),{signal:n});const r=S(this,od,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=u(this,xm),e.append(r),e}renderMainDropdown(){const e=S(this,_n,T(this,dt,FT).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===u(this,bi)){T(this,dt,Hu).call(this,e);return}const n=e.target.getAttribute("data-color");n&&T(this,dt,BT).call(this,n,e)}_moveToNext(e){var n,r;if(!u(this,dt,Hl)){T(this,dt,Hu).call(this,e);return}if(e.target===u(this,bi)){(n=u(this,_n).firstElementChild)==null||n.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var n,r;if(e.target===((n=u(this,_n))==null?void 0:n.firstElementChild)||e.target===u(this,bi)){u(this,dt,Hl)&&this._hideDropdownFromKeyboard();return}u(this,dt,Hl)||T(this,dt,Hu).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var n;if(!u(this,dt,Hl)){T(this,dt,Hu).call(this,e);return}(n=u(this,_n).firstElementChild)==null||n.focus()}_moveToEnd(e){var n;if(!u(this,dt,Hl)){T(this,dt,Hu).call(this,e);return}(n=u(this,_n).lastElementChild)==null||n.focus()}hideDropdown(){var e,n;(e=u(this,_n))==null||e.classList.add("hidden"),u(this,bi).ariaExpanded="false",(n=u(this,jc))==null||n.abort(),S(this,jc,null)}_hideDropdownFromKeyboard(){var e;if(!u(this,Sm)){if(!u(this,dt,Hl)){(e=u(this,nl))==null||e.unselect();return}this.hideDropdown(),u(this,bi).focus({preventScroll:!0,focusVisible:u(this,Jw)})}}updateColor(e){if(u(this,od)&&(u(this,od).style.backgroundColor=e),!u(this,_n))return;const n=u(this,Ks).highlightColors.values();for(const r of u(this,_n).children)r.ariaSelected=n.next().value===e.toUpperCase()}destroy(){var e,n;(e=u(this,bi))==null||e.remove(),S(this,bi,null),S(this,od,null),(n=u(this,_n))==null||n.remove(),S(this,_n,null)}};bi=new WeakMap,od=new WeakMap,xm=new WeakMap,_n=new WeakMap,Jw=new WeakMap,Sm=new WeakMap,nl=new WeakMap,Zw=new WeakMap,jc=new WeakMap,Ks=new WeakMap,e0=new WeakMap,dt=new WeakSet,FT=function(){const e=document.createElement("div"),n=u(this,Ks)._signal;e.addEventListener("contextmenu",_s,{signal:n}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),u(this,nl)&&(e.id=`${u(this,nl).id}_colorpicker_dropdown`);for(const[r,i]of u(this,Ks).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",i),s.title=r,s.setAttribute("data-l10n-id",u(Wr,e0)[r]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=i,s.ariaSelected=i===u(this,xm),s.addEventListener("click",T(this,dt,BT).bind(this,i),{signal:n}),e.append(s)}return e.addEventListener("keydown",T(this,dt,$T).bind(this),{signal:n}),e}
370,BT=function(e,n){n.stopPropagation(),u(this,Zw).dispatch("switchannotationeditorparams",{source:this,type:Te.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},$T=function(e){Wr._keyboardManager.exec(this,e)},Hu=function(e){if(u(this,dt,Hl)){this.hideDropdown();return}if(S(this,Jw,e.detail===0),u(this,jc)||(S(this,jc,new AbortController),window.addEventListener("pointerdown",T(this,dt,V5).bind(this),{signal:u(this,Ks).combinedSignal(u(this,jc))})),u(this,bi).ariaExpanded="true",u(this,_n)){u(this,_n).classList.remove("hidden");return}const n=S(this,_n,T(this,dt,FT).call(this));u(this,bi).append(n)},V5=function(e){var n;(n=u(this,_n))!=null&&n.contains(e.target)||this.hideDropdown()},Hl=function(){return u(this,_n)&&!u(this,_n).classList.contains("hidden")},E(Wr,e0,null);let y1=Wr;var xi,km,ld,rl,t0;const Ju=class Ju{constructor(e){E(this,xi,null);E(this,km,!1);E(this,ld,null);E(this,rl,null);S(this,ld,e),S(this,rl,e._uiManager),u(Ju,t0)||S(Ju,t0,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(u(this,xi))return u(this,xi);const{editorType:e,colorType:n,colorAndOpacityType:r,opacityType:i,color:s,opacity:a}=u(this,ld),o=S(this,km,bn.isAlphaColorInputSupported&&i!==void 0),l=S(this,xi,document.createElement("input"));if(l.type="color",o){l.setAttribute("alpha","");const c=Q.hexNums[Math.round((a??1)*255)];l.value=(s||"#000000")+c}else l.value=s||"#000000";return l.className="basicColorPicker",l.tabIndex=0,l.setAttribute("data-l10n-id",u(Ju,t0)[e]),l.addEventListener("input",()=>{if(o){const c=qR(l.value);if(!c)return;const[h,d,f,p]=c,m=Q.makeHexColor(h,d,f);r!==void 0?u(this,rl).updateParams(r,{color:m,opacity:p}):(u(this,rl).updateParams(n,m),u(this,rl).updateParams(i,p))}else u(this,rl).updateParams(n,l.value)},{signal:u(this,rl)._signal}),l}update(e){if(u(this,xi))if(u(this,km)){const n=Q.hexNums[Math.round(u(this,ld).opacity*255)];u(this,xi).value=e+n}else u(this,xi).value=e}updateOpacity(e){if(!u(this,xi)||!u(this,km))return;const n=Q.hexNums[Math.round(e*255)];u(this,xi).value=u(this,ld).color+n}destroy(){var e;(e=u(this,xi))==null||e.remove(),S(this,xi,null)}hideDropdown(){}};xi=new WeakMap,km=new WeakMap,ld=new WeakMap,rl=new WeakMap,t0=new WeakMap,E(Ju,t0,null);let v1=Ju;function EL(t){return Math.floor(Dt(t,0,1)*255).toString(16).padStart(2,"0")}function Jg(t){return Dt(t,0,1)*255}class _L{static CMYK_G([e,n,r,i]){return["G",1-Math.min(1,.3*e+.59*r+.11*n+i)]}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=Jg(e),[e,e,e]}static G_HTML([e]){const n=EL(e);return`#${n}${n}${n}`}static RGB_G([e,n,r]){return["G",.3*e+.59*n+.11*r]}static RGB_rgb(e){return e.map(Jg)}static RGB_HTML(e){return`#${e.map(EL).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,r,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,r+i),1-Math.min(1,n+i)]}static CMYK_rgb([e,n,r,i]){return[Jg(1-Math.min(1,e+i)),Jg(1-Math.min(1,r+i)),Jg(1-Math.min(1,n+i))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,r]){const i=1-e,s=1-n,a=1-r,o=Math.min(i,s,a);return["CMYK",i,s,a,o]}}class Lue{create(e,n,r=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${n}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${n}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Ze("Abstract method `_createSVG` called.")}}class w1 extends Lue{_createSVG(e){return document.createElementNS(Ao,e)}}const jue=9,Kd=new WeakSet,Fue=new Date().getTimezoneOffset()*60*1e3;class IE{static create(e){switch(e.data.annotationType){case dn.LINK:return new XR(e);case dn.TEXT:return new $ue(e);case dn.WIDGET:switch(e.data.fieldType){case"Tx":return new Uue(e);case"Btn":return e.data.radioButton?new G5(e):e.data.checkBox?new Vue(e):new Hue
370(e);case"Ch":return new Wue(e);case"Sig":return new zue(e)}return new of(e);case dn.POPUP:return new zT(e);case dn.FREETEXT:return new Q5(e);case dn.LINE:return new que(e);case dn.SQUARE:return new Kue(e);case dn.CIRCLE:return new Yue(e);case dn.POLYLINE:return new J5(e);case dn.CARET:return new Que(e);case dn.INK:return new QR(e);case dn.POLYGON:return new Xue(e);case dn.HIGHLIGHT:return new Z5(e);case dn.UNDERLINE:return new Jue(e);case dn.SQUIGGLY:return new Zue(e);case dn.STRIKEOUT:return new ehe(e);case dn.STAMP:return new eV(e);case dn.FILEATTACHMENT:return new the(e);default:return new Wt(e)}}}var cd,Am,ds,n0,UT;const hI=class hI{constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){E(this,n0);E(this,cd,null);E(this,Am,!1);E(this,ds,null);this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,n&&(this.contentElement=this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:n}){return!!(e!=null&&e.str||n!=null&&n.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return hI._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){var r;const{data:e}=this,n=(r=this.annotationStorage)==null?void 0:r.getEditor(e.id);return n?n.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}
370get commentButtonPosition(){var o;const e=(o=this.annotationStorage)==null?void 0:o.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:n,inkLists:r,rect:i}=this.data;let s=-1/0,a=-1/0;if((n==null?void 0:n.length)>=8){for(let l=0;l<n.length;l+=8)n[l+1]>a?(a=n[l+1],s=n[l+2]):n[l+1]===a&&(s=Math.max(s,n[l+2]));return[s,a]}if((r==null?void 0:r.length)>=1){for(const l of r)for(let c=0,h=l.length;c<h;c+=2)l[c+1]>a?(a=l[c+1],s=l[c]):l[c+1]===a&&(s=Math.max(s,l[c]));if(s!==1/0)return[s,a]}return i?[i[2],i[3]]:null}_normalizePoint(e){const{page:{view:n},viewport:{rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}}=this.parent;return e[1]=n[3]-e[1]+n[1],e[0]=100*(e[0]-s)/r,e[1]=100*(e[1]-a)/i,e}get commentText(){var n,r,i;const{data:e}=this;return((r=(n=this.annotationStorage.getRawValue(`${$v}${e.id}`))==null?void 0:n.popup)==null?void 0:r.contents)||((i=e.contentsObj)==null?void 0:i.str)||""}set commentText(e){const{data:n}=this,r={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(n.id,{popup:r})||this.annotationStorage.setValue(`${$v}${n.id}`,{id:n.id,annotationType:n.annotationType,page:this.parent.page,popup:r,popupRef:n.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){var e,n;(n=((e=u(this,ds))==null?void 0:e.popup)||this.popup)==null||n.remove(),S(this,ds,this.popup=null)}updateEdited(e){var s;if(!this.container)return;e.rect&&(u(this,cd)||S(this,cd,{rect:this.data.rect.slice(0)}));const{rect:n,popup:r}=e;n&&T(this,n0,UT).call(this,n);let i=((s=u(this,ds))==null?void 0:s.popup)||this.popup;!i&&(r!=null&&r.text)&&(this._createPopup(r),i=u(this,ds).popup),i&&(i.updateEdited(e),r!=null&&r.deleted&&(i.remove(),S(this,ds,null),this.popup=null))}resetEdited(){var e;u(this,cd)&&(T(this,n0,UT).call(this,u(this,cd).rect),(e=u(this,ds))==null||e.popup.resetEdited(),S(this,cd,null))}_createContainer(e){const{data:n,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",n.id),!(this instanceof of)&&!(this instanceof XR)&&(s.tabIndex=0);const{style:a}=s;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,n.alternativeText&&(s.title=n.alternativeText),n.noRotate&&s.classList.add("norotate"),!n.rect||this instanceof zT){const{rotation:y}=n;return!n.hasOwnCanvas&&y!==0&&this.setRotation(y,s),s}const{width:o,height:l}=this;if(!e&&n.borderStyle.width>0){a.borderWidth=`${n.borderStyle.width}px`;const y=n.borderStyle.horizontalCornerRadius,x=n.borderStyle.verticalCornerRadius;if(y>0||x>0){const w=`calc(${y}px * var(--total-scale-factor)) / calc(${x}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof G5){const w=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=w}switch(n.borderStyle.style){case Tf.SOLID:a.borderStyle="solid";break;case Tf.DASHED:a.borderStyle="dashed";break;case Tf.BEVELED:_e("Unimplemented border style: beveled");break;case Tf.INSET:_e("Unimplemented border style: inset");break;case Tf.UNDERLINE:a.borderBottomStyle="solid";break}const v=n.borderColor||null;v?(S(this,Am,!0),a.borderColor=Q.makeHexColor(...v)):a.borderWidth=0}const c=Q.normalizeRect([n.rect[0],r.view[3]-n.rect[1]+r.view[1],n.rect[2],r.view[3]-n.rect[3]+r.view[1]]),{pageWidth:h,pageHeight:d,pageX:f,pageY:p}=i.rawDims;a.left=`${100*(c[0]-f)/h}%`,a.top=`${100*(c[1]-p)/d}%`;const{rotation:m}=n;return n.hasOwnCanvas||m===0?(a.width=`${100*o/h}%`,a.height=`${100*l/d}%`):this.setRotation(m,s),s}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims;let{width:s,height:a}=this;e%180!==0&&([s,a]=[a,s]),n.style.width=`${100*s/r}%`,n.style.height=`${100*a/i}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,i)=>{const s=i.detail[n],a=s[0],o=s.slice(1);i.target.style[r]=_L[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:_L[`${a}_rgb`](o)})};return Se(this,"_commonActions",{display:n=>{const{display:r}=n.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:n=>{this.annotationStorage.setValue(this.data.id,{noPrint:!n.detail.print})},hidden:n=>{const{hidden:r}=n.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:n=>{setTimeout(()=>
370n.target.focus({preventScroll:!1}),0)},userName:n=>{n.target.title=n.detail.userName},readonly:n=>{n.target.disabled=n.detail.readonly},required:n=>{this._setRequired(n.target,n.detail.required)},bgColor:n=>{e("bgColor","backgroundColor",n)},fillColor:n=>{e("fillColor","backgroundColor",n)},fgColor:n=>{e("fgColor","color",n)},textColor:n=>{e("textColor","color",n)},borderColor:n=>{e("borderColor","borderColor",n)},strokeColor:n=>{e("strokeColor","borderColor",n)},rotation:n=>{const r=n.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,n){const r=this._commonActions;for(const i of Object.keys(n.detail)){const s=e[i]||r[i];s==null||s(n)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const r=this._commonActions;for(const[i,s]of Object.entries(n)){const a=r[i];if(a){const o={detail:{[i]:s},target:e};a(o),delete n[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,r,i,s]=this.data.rect.map(y=>Math.fround(y));if(e.length===8){const[y,x,v,w]=e.subarray(2,6);if(i===y&&s===x&&n===v&&r===w)return}const{style:a}=this.container;let o;if(u(this,Am)){const{borderColor:y,borderWidth:x}=a;a.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${y}" stroke-width="${x}">`],this.container.classList.add("hasBorder")}const l=i-n,c=s-r,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const f=h.createElement("defs");d.append(f);const p=h.createElement("clipPath"),m=`clippath_${this.data.id}`;p.setAttribute("id",m),p.setAttribute("clipPathUnits","objectBoundingBox"),f.append(p);for(let y=2,x=e.length;y<x;y+=8){const v=e[y],w=e[y+1],b=e[y+2],k=e[y+3],_=h.createElement("rect"),C=(b-n)/l,P=(s-w)/c,R=(v-b)/l,O=(w-k)/c;_.setAttribute("x",C),_.setAttribute("y",P),_.setAttribute("width",R),_.setAttribute("height",O),p.append(_),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${C}" y="${P}" width="${R}" height="${O}"/>`)}u(this,Am)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(d),this.container.style.clipPath=`url(#${m})`}_createPopup(e=null){const{data:n}=this;let r,i;e?(r={str:e.text},i=e.date):(r=n.contentsObj,i=n.modificationDate),S(this,ds,new zT({data:{color:n.color,titleObj:n.titleObj,modificationDate:i,contentsObj:r,richText:n.richText,parentRect:n.rect,borderStyle:0,id:`popup_${n.id}`,rotation:n.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(u(this,ds)||this.popup||this.data.popupRef)}get extraPopupElement(){return u(this,ds)}render(){Ze("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:s,id:a,exportValues:o}of i){if(s===-1||a===n)continue;const l=typeof o=="string"?o:null,c=document.querySelector(`[data-element-id="${a}"]`);if(c&&!Kd.has(c)){_e(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:c})}return r}for(const i of document.getElementsByName(e)){const{exportValue:s}=i,a=i.getAttribute("data-element-id");a!==n&&Kd.has(i)&&r.push({id:a,exportValue:s,domElement:i})}return r}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 n of e)n.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:n,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};cd=new WeakMap,Am=new WeakMap,ds=new WeakMap,n0=new WeakSet,UT=function(e){const{container:{style:n},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}}}=this;r==null||r.splice(0,4,...e),n.left=`${100*(e[0]-o)/s}%`,n.top=`${100*(a-e[3]+l)/a}%`,i===0?(n.width=`${100*(e[2]-e[0])/s}%`,n.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(i)};let Wt=hI;class Bue extends Wt{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}
370get 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 Bi,Wu,H5,W5;class XR extends Wt{constructor(n,r=null){super(n,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});E(this,Bi);this.isTooltipOnly=n.data.isTooltipOnly}render(){const{data:n,linkService:r}=this,i=document.createElement("a");i.setAttribute("data-element-id",n.id);let s=!1;return n.url?(r.addLinkAttributes(i,n.url,n.newWindow),s=!0):n.action?(this._bindNamedAction(i,n.action,n.overlaidText),s=!0):n.attachment?(T(this,Bi,H5).call(this,i,n.attachment,n.overlaidText,n.attachmentDest),s=!0):n.setOCGState?(T(this,Bi,W5).call(this,i,n.setOCGState,n.overlaidText),s=!0):n.dest?(this._bindLink(i,n.dest,n.overlaidText),s=!0):(n.actions&&(n.actions.Action||n.actions["Mouse Up"]||n.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,n),s=!0),n.resetForm?(this._bindResetFormAction(i,n.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&(this.contentElement=i,this.container.append(i)),this.container}_bindLink(n,r,i=""){n.href=this.linkService.getDestinationHash(r),n.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&T(this,Bi,Wu).call(this),i&&(n.title=i)}_bindNamedAction(n,r,i=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(r),!1),i&&(n.title=i),T(this,Bi,Wu).call(this)}_bindJSAction(n,r){n.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(r.actions)){const a=i.get(s);a&&(n[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:s}}),!1})}r.overlaidText&&(n.title=r.overlaidText),n.onclick||(n.onclick=()=>!1),T(this,Bi,Wu).call(this)}_bindResetFormAction(n,r){const i=n.onclick;if(i||(n.href=this.linkService.getAnchorUrl("")),T(this,Bi,Wu).call(this),!this._fieldObjects){_e('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(n.onclick=()=>!1);return}n.onclick=()=>{var d;i==null||i();const{fields:s,refs:a,include:o}=r,l=[];if(s.length!==0||a.length!==0){const f=new Set(a);for(const p of s){const m=this._fieldObjects[p]||[];for(const{id:y}of m)f.add(y)}for(const p of Object.values(this._fieldObjects))for(const m of p)f.has(m.id)===o&&l.push(m)}else for(const f of Object.values(this._fieldObjects))l.push(...f);const c=this.annotationStorage,h=[];for(const f of l){const{id:p}=f;switch(h.push(p),f.type){case"text":{const y=f.defaultValue||"";c.setValue(p,{value:y});break}case"checkbox":case"radiobutton":{const y=f.defaultValue===f.exportValues;c.setValue(p,{value:y});break}case"combobox":case"listbox":{const y=f.defaultValue||"";c.setValue(p,{value:y});break}default:continue}const m=document.querySelector(`[data-element-id="${p}"]`);if(m){if(!Kd.has(m)){_e(`_bindResetFormAction - element not allowed: ${p}`);continue}}else continue;m.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((d=this.linkService.eventBus)==null||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}})),!1}}}Bi=new WeakSet,Wu=function(){this.container.setAttribute("data-internal-link","")},H5=function(n,r,i="",s=null){n.href=this.linkService.getAnchorUrl(""),r.description?n.title=r.description:i&&(n.title=i),n.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(r.content,r.filename,s),!1},T(this,Bi,Wu).call(this)},W5=function(n,r,i=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(r),!1),i&&(n.title=i),T(this,Bi,Wu).call(this)};class $ue extends Wt{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}}
370class of extends Wt{render(){return this.container}showElementAndHideCanvas(e){var n;this.data.hasOwnCanvas&&(((n=e.previousSibling)==null?void 0:n.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return bn.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,i,s){r.includes("mouse")?e.addEventListener(r,a=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a),shift:a.shiftKey,modifier:this._getKeyModifier(a)}})}):e.addEventListener(r,a=>{var o;if(r==="blur"){if(!n.focused||!a.relatedTarget)return;n.focused=!1}else if(r==="focus"){if(n.focused)return;n.focused=!0}s&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(a)}}))})}_setEventListeners(e,n,r,i){var s,a,o;for(const[l,c]of r)(c==="Action"||(s=this.data.actions)!=null&&s[c])&&((c==="Focus"||c==="Blur")&&(n||(n={focused:!1})),this._setEventListener(e,n,l,c,i),c==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,n,"blur","Blur",null):c==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,n,"focus","Focus",null))}_setBackgroundColor(e){const n=this.data.backgroundColor||null;e.style.backgroundColor=n===null?"transparent":Q.makeHexColor(...n)}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||jue,s=e.style;let a;const o=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o),h=Math.round(c/(CE*i))||1,d=c/h;a=Math.min(i,l(d/CE))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(i,l(c/CE))}s.fontSize=`calc(${a}px * var(--total-scale-factor))`,s.color=Q.makeHexColor(...r),this.data.textAlignment!==null&&(s.textAlign=n[this.data.textAlignment])}_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class Uue extends of{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,r,i){const s=this.annotationStorage;
370for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[n]=r),s.setValue(a.id,{[i]:r})}render(){var i,s;const e=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const a=e.getValue(n,{value:this.data.fieldValue});let o=a.value||"";const l=e.getValue(n,{charLimit:this.data.maxLen}).charLimit;l&&o.length>l&&(o=o.slice(0,l));let c=a.formattedValue||((i=this.data.textContent)==null?void 0:i.join(`
371`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const h={userValue:o,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=c??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",c??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Kd.add(r),this.contentElement=r,r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;const{datetimeFormat:d,datetimeType:f,timeStep:p}=this.data,m=!!f&&this.enableScripting;d&&(r.title=d),this._setRequired(r,this.data.required),l&&(r.maxLength=l),r.addEventListener("input",x=>{e.setValue(n,{value:x.target.value}),this.setPropertyOnSiblings(r,"value",x.target.value,"value"),h.formattedValue=null}),r.addEventListener("resetform",x=>{const v=this.data.defaultFieldValue??"";r.value=h.userValue=v,h.formattedValue=null});let y=x=>{const{formattedValue:v}=h;v!=null&&(x.target.value=v),x.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",v=>{var b;if(h.focused)return;const{target:w}=v;if(m&&(w.type=f,p&&(w.step=p)),h.userValue){const k=h.userValue;if(m)if(f==="time"){const _=new Date(k),C=[_.getHours(),_.getMinutes(),_.getSeconds()];w.value=C.map(P=>P.toString().padStart(2,"0")).join(":")}else w.value=new Date(k-Fue).toISOString().split(f==="date"?"T":".",1)[0];else w.value=k}h.lastCommittedValue=w.value,h.commitKey=1,(b=this.data.actions)!=null&&b.Focus||(h.focused=!0)}),r.addEventListener("updatefromsandbox",v=>{this.showElementAndHideCanvas(v.target);const w={value(b){h.userValue=b.detail.value??"",m||e.setValue(n,{value:h.userValue.toString()}),b.target.value=h.userValue},formattedValue(b){const{formattedValue:k}=b.detail;h.formattedValue=k,k!=null&&b.target!==document.activeElement&&(b.target.value=k);const _={formattedValue:k};m&&(_.value=k),e.setValue(n,_)},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{var P;const{charLimit:k}=b.detail,{target:_}=b;if(k===0){_.removeAttribute("maxLength");return}_.setAttribute("maxLength",k);let C=h.userValue;!C||C.length<=k||(C=C.slice(0,k),_.value=h.userValue=C,e.setValue(n,{value:C}),(P=this.linkService.eventBus)==null||P.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:C,willCommit:!0,commitKey:1,selStart:_.selectionStart,selEnd:_.selectionEnd}}))}};this._dispatchEventFromSandbox(w,v)}),r.addEventListener("keydown",v=>{var k;h.commitKey=1;let w=-1;
371if(v.key==="Escape"?w=0:v.key==="Enter"&&!this.data.multiLine?w=2:v.key==="Tab"&&(h.commitKey=3),w===-1)return;const{value:b}=v.target;h.lastCommittedValue!==b&&(h.lastCommittedValue=b,h.userValue=b,(k=this.linkService.eventBus)==null||k.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:b,willCommit:!0,commitKey:w,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}))});const x=y;y=null,r.addEventListener("blur",v=>{var k,_;if(!h.focused||!v.relatedTarget)return;(k=this.data.actions)!=null&&k.Blur||(h.focused=!1);const{target:w}=v;let{value:b}=w;if(m){if(b&&f==="time"){const C=b.split(":").map(P=>parseInt(P,10));b=new Date(2e3,0,1,C[0],C[1],C[2]||0).valueOf(),w.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();w.type="text"}h.userValue=b,h.lastCommittedValue!==b&&((_=this.linkService.eventBus)==null||_.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:b,willCommit:!0,commitKey:h.commitKey,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}})),x(v)}),(s=this.data.actions)!=null&&s.Keystroke&&r.addEventListener("beforeinput",v=>{var O;h.lastCommittedValue=null;const{data:w,target:b}=v,{value:k,selectionStart:_,selectionEnd:C}=b;let P=_,R=C;switch(v.inputType){case"deleteWordBackward":{const M=k.substring(0,_).match(/\w*[^\w]*$/);M&&(P-=M[0].length);break}
vendor: 4,162 bytes, line 371
371case"deleteWordForward":{const M=k.substring(_).match(/^[^\w]*\w*/);M&&(R+=M[0].length);break}case"deleteContentBackward":_===C&&(P-=1);break;case"deleteContentForward":_===C&&(R+=1);break}v.preventDefault(),(O=this.linkService.eventBus)==null||O.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:k,change:w||"",willCommit:!1,selStart:P,selEnd:R}})}),this._setEventListeners(r,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],v=>v.target.value)}if(y&&r.addEventListener("blur",y),this.data.comb){const v=(this.data.rect[2]-this.data.rect[0])/l;r.classList.add("comb"),r.style.letterSpacing=`calc(${v}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class zue extends of{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Vue extends of{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,n=this.data,r=n.id;let i=e.getValue(r,{value:n.exportValue===n.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Kd.add(s),s.setAttribute("data-element-id",r),s.disabled=n.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=n.fieldName,i&&s.setAttribute("checked",!0),s.setAttribute("exportValue",n.exportValue),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r)){const h=l&&c.exportValue===n.exportValue;c.domElement&&(c.domElement.checked=h),e.setValue(c.id,{value:h})}e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=n.defaultFieldValue||"Off";a.target.checked=o===n.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",a=>{const o={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(o,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class G5 extends of{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,n=this.data,r=n.id;let i=e.getValue(r,{value:n.fieldValue===n.buttonValue}).value;if(typeof i=="string"&&(i=i!==n.buttonValue,e.setValue(r,{value:i})),i)for(const a of this._getElementsByName(n.fieldName,r))e.setValue(a.id,{value:!1});const s=document.createElement("input");if(Kd.add(s),s.setAttribute("data-element-id",r),s.disabled=n.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=n.fieldName,i&&s.setAttribute("checked",!0),s.tabIndex=0,s.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const c of this._getElementsByName(o,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),s.addEventListener("resetform",a=>{const o=n.defaultFieldValue;a.target.checked=o!=null&&o===n.buttonValue}),this.enableScripting&&this.hasJSActions){const a=n.buttonValue;s.addEventListener("updatefromsandbox",o=>{const l={value:c=>{const h=a===c.detail.value;for(const d of this._getElementsByName(c.target.name)){const f=h&&d.id===r;d.domElement&&(d.domElement.checked=f),e.setValue(d.id,{value:f})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}
vendor: 4,097 bytes, line 371
371return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Hue extends XR{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const n=e.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class Wue extends of{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,n=this.data.id,r=e.getValue(n,{value:this.data.fieldValue}),i=document.createElement("select");Kd.add(i),i.setAttribute("data-element-id",n),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",d=>{const f=this.data.defaultFieldValue;for(const p of i.options)p.selected=p.value===f});const a=(d,f)=>{const p=f.replaceAll(" "," ");d.textContent=p,p!==f&&d.setAttribute("display-value",f)};for(const d of this.data.options){const f=document.createElement("option");a(f,d.displayValue),f.value=d.exportValue,r.value.includes(d.exportValue)&&(f.setAttribute("selected",!0),s=!1),i.append(f)}let o=null;if(s){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),i.prepend(d),o=()=>{d.remove(),i.removeEventListener("input",o),o=null},i.addEventListener("input",o)}const l=d=>{const f=d?"value":"textContent",{options:p,multiple:m}=i;return m?Array.prototype.filter.call(p,y=>y.selected).map(y=>y[f]):p.selectedIndex===-1?null:p[p.selectedIndex][f]};let c=l(!1);const h=d=>{const f=d.target.options;return Array.prototype.map.call(f,p=>({displayValue:p.getAttribute("display-value")||p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",d=>{const f={value(p){o==null||o();const m=p.detail.value,y=new Set(Array.isArray(m)?m:[m]);for(const x of i.options)x.selected=y.has(x.value);e.setValue(n,{value:l(!0)}),c=l(!1)},multipleSelection(p){i.multiple=!0},remove(p){const m=i.options,y=p.detail.remove;m[y].selected=!1,i.remove(y),m.length>0&&Array.prototype.findIndex.call(m,v=>v.selected)===-1&&(m[0].selected=!0),e.setValue(n,{value:l(!0),items:h(p)}),c=l(!1)},clear(p){for(;i.length!==0;)i.remove(0);e.setValue(n,{value:null,items:[]}),c=l(!1)},insert(p){const{index:m,displayValue:y,exportValue:x}=p.detail.insert,v=i.children[m],w=document.createElement("option");a(w,y),w.value=x,v?v.before(w):i.append(w),e.setValue(n,{value:l(!0),items:h(p)}),c=l(!1)},items(p){const{items:m}=p.detail;for(;i.length!==0;)i.remove(0);for(const y of m){const{displayValue:x,exportValue:v}=y,w=document.createElement("option");a(w,x),w.value=v,i.append(w)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(n,{value:l(!0),items:h(p)}),c=l(!1)},indices(p){const m=new Set(p.detail.indices);for(const y of p.target.options)y.selected=m.has(y.index);e.setValue(n,{value:l(!0)}),c=l(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(f,d)}),i.addEventListener("input",d=>{var m;const f=l(!0),p=l(!1);e.setValue(n,{value:f}),d.preventDefault(),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:c,change:p,changeEx:f,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):i.addEventListener("input",function(d){e.setValue(n,{value:l(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}
371var r0,VT;class zT extends Wt{constructor(n){const{data:r,elements:i,parent:s}=n,a=!!s._commentManager;super(n,{isRenderable:!a&&Wt._hasPopupData(r)});E(this,r0);if(this.elements=i,a&&Wt._hasPopupData(r)){const o=this.popup=T(this,r0,VT).call(this);for(const l of i)l.popup=o}else this.popup=null}render(){const{container:n}=this;n.classList.add("popupAnnotation"),n.role="comment";const r=this.popup=T(this,r0,VT).call(this),i=[];for(const s of this.elements)s.popup=r,s.container.ariaHasPopup="dialog",i.push(s.data.id),s.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(s=>`${ep}${s}`).join(",")),this.container}}r0=new WeakSet,VT=function(){return new Gue({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 Si,Fc,K1,Y1,Em,_m,Jt,Ha,Bc,ud,Cm,Tm,Wa,ki,il,sl,Zt,al,$c,i0,ol,Pm,hd,Uc,Mn,zc,Ie,Qx,HT,WT,GT,Jx,qT,q5,K5,Y5,X5,Zx,eS,KT;class Gue{constructor({container:e,color:n,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:o,parent:l,rect:c,parentRect:h,open:d,commentManager:f=null}){E(this,Ie);E(this,Si,null);E(this,Fc,T(this,Ie,Y5).bind(this));E(this,K1,T(this,Ie,KT).bind(this));E(this,Y1,T(this,Ie,eS).bind(this));E(this,Em,T(this,Ie,Zx).bind(this));E(this,_m,null);E(this,Jt,null);E(this,Ha,null);E(this,Bc,null);E(this,ud,null);E(this,Cm,null);E(this,Tm,null);E(this,Wa,!1);E(this,ki,null);E(this,il,null);E(this,sl,null);E(this,Zt,null);E(this,al,null);E(this,$c,null);E(this,i0,null);E(this,ol,null);E(this,Pm,null);E(this,hd,null);E(this,Uc,!1);E(this,Mn,null);E(this,zc,null);S(this,Jt,e),S(this,Pm,i),S(this,Ha,a),S(this,ol,o),S(this,Cm,l),S(this,_m,n),S(this,i0,c),S(this,Tm,h),S(this,ud,r),S(this,Si,f),S(this,Mn,r[0]),S(this,Bc,p1.toDateObject(s)),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup()),f||(T(this,Ie,Qx).call(this),u(this,Jt).hidden=!0,d&&T(this,Ie,Zx).call(this))}renderCommentButton(){if(u(this,Zt)){u(this,Zt).parentNode||u(this,Mn).container.after(u(this,Zt));return}if(u(this,al)||T(this,Ie,HT).call(this),!u(this,al))return;const{signal:e}=S(this,il,new AbortController),n=u(this,Mn).hasOwnCommentButton,r=()=>{u(this,Si).toggleCommentPopup(this,!0,void 0,!n)},i=()=>{u(this,Si).toggleCommentPopup(this,!1,!0,!n)},s=()=>{u(this,Si).toggleCommentPopup(this,!1,!1)};if(n){S(this,Zt,u(this,Mn).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",u(this,Fc),{signal:e}),a.addEventListener("click",r,{signal:e}),a.addEventListener("pointerenter",i,{signal:e}),a.addEventListener("pointerleave",s,{signal:e}),a.classList.add("popupTriggerArea")}else{const a=S(this,Zt,document.createElement("button"));a.className="annotationCommentButton";const o=u(this,Mn).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"),T(this,Ie,GT).call(this),T(this,Ie,WT).call(this),a.addEventListener("keydown",u(this,Fc),{signal:e}),a.addEventListener("click",r,{signal:e}),a.addEventListener("pointerenter",i,{signal:e}),a.addEventListener("pointerleave",s,{signal:e}),o.after(a)}}get commentButtonColor(){const{color:e,opacity:n}=u(this,Mn).commentData;return e?u(this,Cm)._commentManager.makeCommentColor(e,n):null}focusCommentButton(){setTimeout(()=>{var e;(e=u(this,Zt))==null||e.focus()},0)}getData(){const{richText:e,color:n,opacity:r,creationDate:i,modificationDate:s}=u(this,Mn).commentData;return{contentsObj:{str:this.comment},richText:e,color:n,opacity:r,creationDate:i,modificationDate:s}}get elementBeforePopup(){return u(this,Zt)}get comment(){return u(this,zc)||S(this,zc,u(this,Mn).commentText),u(this,zc)}set comment(e){e!==this.comment&&(u(this,Mn).commentText=S(this,zc,e))}focus(){var e;(e=u(this,Mn).container)==null||e.focus()}get parentBoundingClientRect(){return u(this,Mn).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:n}){u(this,Zt)&&(u(this,Zt).classList.toggle("selected",e),u(this,Zt).ariaExpanded=n)}setSelectedCommentButton(e){u(this,Zt).classList.toggle("selected",e)}get commentPopupPosition(){if(u(this,$c))return u(this,$c);const{x:e,y:n,height:r}=u(this,Zt).getBoundingClientRect(),{x:i,y:s,width:a,height:o}=u(this,Mn).layer.getBoundingClientRect();
371return[(e-i)/a,(n+r-s)/o]}set commentPopupPosition(e){S(this,$c,e)}hasDefaultPopupPosition(){return u(this,$c)===null}get commentButtonPosition(){return u(this,al)}get commentButtonWidth(){return u(this,Zt).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[n,r]=u(this,$c)||this.commentButtonPosition.map(c=>c/100),i=this.parentBoundingClientRect,{x:s,y:a,width:o,height:l}=i;u(this,Si).showDialog(null,this,s+n*o,a+r*l,{...e,parentDimensions:i})}render(){var r,i;if(u(this,ki))return;const e=S(this,ki,document.createElement("div"));if(e.className="popup",u(this,_m)){const s=e.style.outlineColor=Q.makeHexColor(...u(this,_m));e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`}const n=document.createElement("span");if(n.className="header",(r=u(this,Pm))!=null&&r.str){const s=document.createElement("span");s.className="title",n.append(s),{dir:s.dir,str:s.textContent}=u(this,Pm)}if(e.append(n),u(this,Bc)){const s=document.createElement("time");s.className="popupDate",s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:u(this,Bc).valueOf()})),s.dateTime=u(this,Bc).toISOString(),n.append(s)}_z({html:u(this,Ie,Jx)||u(this,Ha).str,dir:(i=u(this,Ha))==null?void 0:i.dir,className:"popupContent"},e),u(this,Jt).append(e)}updateEdited({rect:e,popup:n,deleted:r}){var i;if(u(this,Si)){r?(this.remove(),S(this,zc,null)):n&&(n.deleted?this.remove():(T(this,Ie,GT).call(this),S(this,zc,n.text))),e&&(S(this,al,null),T(this,Ie,HT).call(this),T(this,Ie,WT).call(this));return}if(r||n!=null&&n.deleted){this.remove();return}T(this,Ie,Qx).call(this),u(this,hd)||S(this,hd,{contentsObj:u(this,Ha),richText:u(this,ol)}),e&&S(this,sl,null),n&&n.text&&(S(this,ol,T(this,Ie,K5).call(this,n.text)),S(this,Bc,p1.toDateObject(n.date)),S(this,Ha,null)),(i=u(this,ki))==null||i.remove(),S(this,ki,null)}resetEdited(){var e;u(this,hd)&&({contentsObj:jt(this,Ha)._,richText:jt(this,ol)._}=u(this,hd),S(this,hd,null),(e=u(this,ki))==null||e.remove(),S(this,ki,null),S(this,sl,null))}remove(){var e,n,r;if((e=u(this,il))==null||e.abort(),S(this,il,null),(n=u(this,ki))==null||n.remove(),S(this,ki,null),S(this,Uc,!1),S(this,Wa,!1),(r=u(this,Zt))==null||r.remove(),S(this,Zt,null),this.trigger)for(const i of this.trigger)i.classList.remove("popupTriggerArea")}forceHide(){S(this,Uc,this.isVisible),u(this,Uc)&&(u(this,Jt).hidden=!0)}maybeShow(){u(this,Si)||(T(this,Ie,Qx).call(this),u(this,Uc)&&(u(this,ki)||T(this,Ie,eS).call(this),S(this,Uc,!1),u(this,Jt).hidden=!1))}get isVisible(){return u(this,Si)?!1:u(this,Jt).hidden===!1}}Si=new WeakMap,Fc=new WeakMap,K1=new WeakMap,Y1=new WeakMap,Em=new WeakMap,_m=new WeakMap,Jt=new WeakMap,Ha=new WeakMap,Bc=new WeakMap,ud=new WeakMap,Cm=new WeakMap,Tm=new WeakMap,Wa=new WeakMap,ki=new WeakMap,il=new WeakMap,sl=new WeakMap,Zt=new WeakMap,al=new WeakMap,$c=new WeakMap,i0=new WeakMap,ol=new WeakMap,Pm=new WeakMap,hd=new WeakMap,Uc=new WeakMap,Mn=new WeakMap,zc=new WeakMap,Ie=new WeakSet,Qx=function(){var n;if(u(this,il))return;S(this,il,new AbortController);const{signal:e}=u(this,il);for(const r of this.trigger)r.addEventListener("click",u(this,Em),{signal:e}),r.addEventListener("pointerenter",u(this,Y1),{signal:e}),r.addEventListener("pointerleave",u(this,K1),{signal:e}),r.classList.add("popupTriggerArea");for(const r of u(this,ud))(n=r.container)==null||n.addEventListener("keydown",u(this,Fc),{signal:e})},HT=function(){const e=u(this,ud).find(n=>n.hasCommentButton);e&&S(this,al,e._normalizePoint(e.commentButtonPosition))},WT=function(){if(u(this,Mn).extraPopupElement&&!u(this,Mn).editor)return;u(this,Zt)||this.renderCommentButton();const[e,n]=u(this,al),{style:r}=u(this,Zt);r.left=`calc(${e}%)`,r.top=`calc(${n}% - var(--comment-button-dim))`},GT=function(){u(this,Mn).extraPopupElement||(u(this,Zt)||this.renderCommentButton(),u(this,Zt).style.backgroundColor=this.commentButtonColor||"")},Jx=function(){const e=u(this,ol),n=u(this,Ha);return e!=null&&e.str&&(!(n!=null&&n.str)||n.str===e.str)&&u(this,ol).html||null},qT=function(){var e,n,r;return((r=(n=(e=u(this,Ie,Jx))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.fontSize)||0},q5=function(){var e,n,r;return((r=(n=(e=u(this,Ie,Jx))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.color)||null},K5=function(e){const n=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},i={style:{color:u(this,Ie,q5),fontSize:u(this,Ie,qT)?`calc(${u(this,Ie,qT)}px * var(--total-scale-factor))`:""}};for(const s of e.split(`
372`))n.push({name:"span",value:s,attributes:i});return r},Y5=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&u(this,Wa))&&T(this,Ie,Zx).call(this)},X5=function(){if(u(this,sl)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:s}}}=u(this,Cm);let a=!!u(this,Tm),o=a?u(this,Tm):u(this,i0);for(const m of u(this,ud))if(!o||Q.intersect(m.data.rect,o)!==null){o=m.data.rect,a=!0;break}const l=Q.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),h=a?o[2]-o[0]+5:0,d=l[0]+h,f=l[1];S(this,sl,[100*(d-i)/n,100*(f-s)/r]);const{style:p}=u(this,Jt);
372p.left=`${u(this,sl)[0]}%`,p.top=`${u(this,sl)[1]}%`},Zx=function(){if(u(this,Si)){u(this,Si).toggleCommentPopup(this,!1);return}S(this,Wa,!u(this,Wa)),u(this,Wa)?(T(this,Ie,eS).call(this),u(this,Jt).addEventListener("click",u(this,Em)),u(this,Jt).addEventListener("keydown",u(this,Fc))):(T(this,Ie,KT).call(this),u(this,Jt).removeEventListener("click",u(this,Em)),u(this,Jt).removeEventListener("keydown",u(this,Fc)))},eS=function(){u(this,ki)||this.render(),this.isVisible?u(this,Wa)&&u(this,Jt).classList.add("focused"):(T(this,Ie,X5).call(this),u(this,Jt).hidden=!1,u(this,Jt).style.zIndex=parseInt(u(this,Jt).style.zIndex,10)+1e3)},KT=function(){u(this,Jt).classList.remove("focused"),!(u(this,Wa)||!this.isVisible)&&(u(this,Jt).hidden=!0,u(this,Jt).style.zIndex=parseInt(u(this,Jt).style.zIndex,10)-1e3)};class Q5 extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=xe.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const n of this.textContent){const r=document.createElement("span");r.textContent=n,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}var s0;class que extends Wt{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});E(this,s0,null)}render(){this.container.classList.add("lineAnnotation");const{data:n,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=S(this,s0,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",n.rect[2]-n.lineCoordinates[0]),a.setAttribute("y1",n.rect[3]-n.lineCoordinates[1]),a.setAttribute("x2",n.rect[2]-n.lineCoordinates[2]),a.setAttribute("y2",n.rect[3]-n.lineCoordinates[3]),a.setAttribute("stroke-width",n.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return u(this,s0)}addHighlightArea(){this.container.classList.add("highlightArea")}}s0=new WeakMap;var a0;class Kue extends Wt{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});E(this,a0,null)}render(){this.container.classList.add("squareAnnotation");const{data:n,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=n.borderStyle.width,o=S(this,a0,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return u(this,a0)}addHighlightArea(){this.container.classList.add("highlightArea")}}a0=new WeakMap;var o0;class Yue extends Wt{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});E(this,o0,null)}render(){this.container.classList.add("circleAnnotation");const{data:n,width:r,height:i}=this,s=this.svgFactory.create(r,i,!0),a=n.borderStyle.width,o=S(this,o0,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",i/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",i/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),s.append(o),this.container.append(s),!n.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return u(this,o0)}addHighlightArea(){this.container.classList.add("highlightArea")}}o0=new WeakMap;var l0;class J5 extends Wt{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});E(this,l0,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,vertices:r,borderStyle:i,popupRef:s},width:a,height:o}=this;if(!r)return this.container;const l=this.svgFactory.create(a,o,!0);let c=[];for(let d=0,f=r.length;d<f;d+=2){const p=r[d]-n[0],m=n[3]-r[d+1];c.push(`${p},${m}`)}c=c.join(" ");const h=S(this,l0,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",c),h.setAttribute("stroke-width",i.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),l.append(h),this.container.append(l),!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return u(this,l0)}addHighlightArea(){this.container.classList.add("highlightArea")}}l0=new WeakMap;class Xue extends J5{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Que extends Wt{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}}
372var c0,dd,u0,YT;class QR extends Wt{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});E(this,u0);E(this,c0,null);E(this,dd,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?xe.HIGHLIGHT:xe.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,rotation:r,inkLists:i,borderStyle:s,popupRef:a}}=this,{transform:o,width:l,height:c}=T(this,u0,YT).call(this,r,n),h=this.svgFactory.create(l,c,!0),d=S(this,c0,this.svgFactory.createElement("svg:g"));h.append(d),d.setAttribute("stroke-width",s.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",o);for(let f=0,p=i.length;f<p;f++){const m=this.svgFactory.createElement(this.svgElementName);u(this,dd).push(m),m.setAttribute("points",i[f].join(",")),d.append(m)}return!a&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(n){super.updateEdited(n);const{thickness:r,points:i,rect:s}=n,a=u(this,c0);if(r>=0&&a.setAttribute("stroke-width",r||1),i)for(let o=0,l=u(this,dd).length;o<l;o++)u(this,dd)[o].setAttribute("points",i[o].join(","));if(s){const{transform:o,width:l,height:c}=T(this,u0,YT).call(this,this.data.rotation,s);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${c}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return u(this,dd)}addHighlightArea(){this.container.classList.add("highlightArea")}}c0=new WeakMap,dd=new WeakMap,u0=new WeakSet,YT=function(n,r){switch(n){case 90:return{transform:`rotate(90) translate(${-r[0]},${r[1]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};case 180:return{transform:`rotate(180) translate(${-r[2]},${r[1]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]};case 270:return{transform:`rotate(270) translate(${-r[2]},${r[3]}) scale(1,-1)`,width:r[3]-r[1],height:r[2]-r[0]};default:return{transform:`translate(${-r[0]},${r[3]}) scale(1,-1)`,width:r[2]-r[0],height:r[3]-r[1]}}};class Z5 extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=xe.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const r=document.createElement("mark");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class Jue extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){const r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class Zue extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){const r=document.createElement("u");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class ehe extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){const r=document.createElement("s");r.classList.add("overlaidText"),r.textContent=e,this.container.append(r)}return this.container}}class eV extends Wt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=xe.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}}
372var h0,d0,XT;class the extends Wt{constructor(n){var i;super(n,{isRenderable:!0});E(this,d0);E(this,h0,null);const{file:r}=this.data;this.filename=r.filename,this.content=r.content,(i=this.linkService.eventBus)==null||i.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:n,data:r}=this;let i;r.hasAppearance||r.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),i.addEventListener("dblclick",T(this,d0,XT).bind(this)),S(this,h0,i);const{isMac:s}=bn.platform;return n.addEventListener("keydown",a=>{a.key==="Enter"&&(s?a.metaKey:a.ctrlKey)&&T(this,d0,XT).call(this)}),!r.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),n.append(i),n}getElementsToTriggerPopup(){return u(this,h0)}addHighlightArea(){this.container.classList.add("highlightArea")}}h0=new WeakMap,d0=new WeakSet,XT=function(){var n;(n=this.downloadManager)==null||n.openOrDownloadData(this.content,this.filename)};var fd,pd,Nm,Vc,f0,md,Ai,p0,Sl,tS,JT;const dI=class dI{constructor({div:e,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:i,page:s,viewport:a,structTreeLayer:o,commentManager:l,linkService:c,annotationStorage:h}){E(this,Sl);E(this,fd,null);E(this,pd,null);E(this,Nm,null);E(this,Vc,new Map);E(this,f0,null);E(this,md,null);E(this,Ai,[]);E(this,p0,!1);F(this,"zIndex",0);this.div=e,S(this,fd,n),S(this,pd,r),S(this,f0,o||null),S(this,md,c||null),S(this,Nm,h||new KR),this.page=s,this.viewport=a,this._annotationEditorUIManager=i,this._commentManager=l||null}hasEditableAnnotations(){return u(this,Vc).size>0}async render(e){var o;const{annotations:n}=e,r=this.div;Gd(r,this.viewport);const i=new Map,s=[],a={data:null,layer:r,linkService:u(this,md),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new w1,annotationStorage:u(this,Nm),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const l of n){if(l.noHTML)continue;const c=l.annotationType===dn.POPUP;if(c){const f=i.get(l.id);if(!f)continue;if(!this._commentManager){s.push(l);continue}a.elements=f}else if(l.rect[2]===l.rect[0]||l.rect[3]===l.rect[1])continue;a.data=l;const h=IE.create(a);if(!h.isRenderable)continue;c||(u(this,Ai).push(h),l.popupRef&&i.getOrInsertComputed(l.popupRef,zR).push(h));const d=h.render();l.hidden&&(d.style.visibility="hidden"),h._isEditable&&(u(this,Vc).set(h.data.id,h),(o=this._annotationEditorUIManager)==null||o.renderAnnotationElement(h))}await T(this,Sl,tS).call(this);for(const l of s){const c=a.elements=i.get(l.id);a.data=l;const h=IE.create(a);if(!h.isRenderable)continue;const d=h.render();h.contentElement.id=`${ep}${l.id}`,l.hidden&&(d.style.visibility="hidden"),c.at(-1).container.after(d)}T(this,Sl,JT).call(this)}async addLinkAnnotations(e){const n={data:null,layer:this.div,linkService:u(this,md),svgFactory:new w1,parent:this};for(const r of e){r.borderStyle||(r.borderStyle=dI._defaultBorderStyle),n.data=r;const i=IE.create(n);i.isRenderable&&(i.render(),i.contentElement.id=`${ep}${r.id}`,u(this,Ai).push(i))}await T(this,Sl,tS).call(this)}update({viewport:e}){const n=this.div;this.viewport=e,Gd(n,{rotation:e.rotation}),T(this,Sl,JT).call(this),n.hidden=!1}getEditableAnnotations(){return u(this,Vc).values()}getEditableAnnotation(e){return u(this,Vc).get(e)}addFakeAnnotation(e){const{div:n}=this,{id:r,rotation:i}=e,s=new Bue({data:{id:r,rect:e.getPDFRect(),rotation:i},editor:e,layer:n,parent:this,enableComment:!!this._commentManager,linkService:u(this,md),annotationStorage:u(this,Nm)});return s.render(),s.contentElement.id=`${ep}${r}`,s.createOrUpdatePopup(),u(this,Ai).push(s),s}removeAnnotation(e){var i;const n=u(this,Ai).findIndex(s=>s.data.id===e);if(n<0)return;const[r]=u(this,Ai).splice(n,1);(i=u(this,fd))==null||i.removePointerInTextLayer(r.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(const n of e)n.updateFakeAnnotationElement(this);T(this,Sl,tS).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return Se(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Tf.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};fd=new WeakMap,pd=new WeakMap,Nm=new WeakMap,Vc=new WeakMap,f0=new WeakMap,md=new WeakMap,Ai=new WeakMap,p0=new WeakMap,Sl=new WeakSet,tS=async function(){var r,i,s;if(u(this,Ai).length===0)return;this.div.replaceChildren();const e=[];
372if(!u(this,p0)){S(this,p0,!0);for(const{contentElement:a,data:{id:o}}of u(this,Ai)){const l=a.id=`${ep}${o}`;e.push((r=u(this,f0))==null?void 0:r.getAriaAttributes(l).then(c=>{if(c)for(const[h,d]of c)a.setAttribute(h,d)}))}}u(this,Ai).sort(({data:{rect:[a,o,l,c]}},{data:{rect:[h,d,f,p]}})=>{if(a===l&&o===c)return 1;if(h===f&&d===p)return-1;const m=c,y=o,x=(o+c)/2,v=p,w=d,b=(d+p)/2;if(x>=v&&b<=y)return-1;if(b>=m&&x<=w)return 1;const k=(a+l)/2,_=(h+f)/2;return k-_});const n=document.createDocumentFragment();for(const a of u(this,Ai))n.append(a.container),this._commentManager?(s=((i=a.extraPopupElement)==null?void 0:i.popup)||a.popup)==null||s.renderCommentButton():a.extraPopupElement&&n.append(a.extraPopupElement.render());if(this.div.append(n),await Promise.all(e),u(this,fd))for(const a of u(this,Ai))u(this,fd).addPointerInTextLayer(a.contentElement,!1)},JT=function(){var n;if(!u(this,pd))return;const e=this.div;for(const[r,i]of u(this,pd)){const s=e.querySelector(`[data-annotation-id="${r}"]`);if(!s)continue;i.className="annotationContent";const{firstChild:a}=s;a?a.nodeName==="CANVAS"?a.replaceWith(i):a.classList.contains("annotationContent")?a.after(i):a.before(i):s.append(i);const o=u(this,Vc).get(r);o&&(o._hasNoCanvas?((n=this._annotationEditorUIManager)==null||n.setMissingCanvas(r,s.id,i),o._hasNoCanvas=!1):o.canvas=i)}u(this,pd).clear()};let QT=dI;const Yb=/\r\n?|\n/g;var Ei,m0,gd,_i,xn,tV,nV,rV,nS,kl,rS,iS,iV,eP,sV;const _t=class _t extends xt{constructor(n){super({...n,name:"freeTextEditor"});E(this,xn);E(this,Ei,"");E(this,m0,`${this.id}-editor`);E(this,gd,null);E(this,_i);F(this,"_colorPicker",null);this.color=n.color||_t._defaultColor||xt._defaultLineColor,S(this,_i,n.fontSize||_t._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){const n=_t.prototype,r=a=>a.isEmpty(),i=qd.TRANSLATE_SMALL,s=qd.TRANSLATE_BIG;return Se(this,"_keyboardManager",new eb([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],n.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],n.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],n._translateEmpty,{args:[-i,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],n._translateEmpty,{args:[-s,0],checker:r}],[["ArrowRight","mac+ArrowRight"],n._translateEmpty,{args:[i,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],n._translateEmpty,{args:[s,0],checker:r}],[["ArrowUp","mac+ArrowUp"],n._translateEmpty,{args:[0,-i],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],n._translateEmpty,{args:[0,-s],checker:r}],[["ArrowDown","mac+ArrowDown"],n._translateEmpty,{args:[0,i],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],n._translateEmpty,{args:[0,s],checker:r}]]))}static initialize(n,r){xt.initialize(n,r);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(n,r){switch(n){case Te.FREETEXT_SIZE:_t._defaultFontSize=r;break;case Te.FREETEXT_COLOR:_t._defaultColor=r;break}}updateParams(n,r){switch(n){case Te.FREETEXT_SIZE:T(this,xn,tV).call(this,r);break;case Te.FREETEXT_COLOR:T(this,xn,nV).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[Te.FREETEXT_SIZE,_t._defaultFontSize],[Te.FREETEXT_COLOR,_t._defaultColor||xt._defaultLineColor]]}get propertiesToUpdate(){return[[Te.FREETEXT_SIZE,u(this,_i)],[Te.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new v1(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Te.FREETEXT_COLOR}onUpdatedColor(){var n;this.editorDiv.style.color=this.color,(n=this._colorPicker)==null||n.update(this.color),super.onUpdatedColor()}_translateEmpty(n,r){this._uiManager.translateSelectedEditors(n,r,!0)}getInitialTranslation(){const n=this.parentScale;return[-_t._internalPadding*n,-(_t._internalPadding+u(this,_i))*n]}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"),S(this,gd,new AbortController);const n=this._uiManager.combinedSignal(u(this,gd));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:n}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:n}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:n}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:n}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:n}),!0}disableEditMode(){var n;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",u(this,m0)),this._isDraggable=!0,(n=u(this,gd))==null||n.abort(),S(this,gd,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(n){this._focusEventsAllowed&&(super.focusin(n),n.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(n){var r;this.width||(this.enableEditMode(),n&&this.editorDiv.focus(),(r=this._initialOptions)!=null&&r.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 n=u(this,Ei),r=S(this,Ei,T(this,xn,rV).call(this).trimEnd());if(n===r)return;const i=s=>{if(S(this,Ei,s),!s){this.remove();return}T(this,xn,iS).call(this),this._uiManager.rebuild(this),T(this,xn,nS).call(this)};this.addCommands({cmd:()=>{i(r)}
372,undo:()=>{i(n)},mustExec:!1}),T(this,xn,nS).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(n){n.target===this.div&&n.key==="Enter"&&(this.enterInEditMode(),n.preventDefault())}editorDivKeydown(n){_t._keyboardManager.exec(this,n)}editorDivFocus(n){this.isEditing=!0}editorDivBlur(n){this.isEditing=!1}editorDivInput(n){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let n,r;(this._isCopy||this.annotationElementId)&&(n=this.x,r=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",u(this,m0)),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:i}=this.editorDiv;if(i.fontSize=`calc(${u(this,_i)}px * var(--total-scale-factor))`,i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[s,a]=this.parentDimensions;if(this.annotationElementId){const{position:o}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[h,d]=this.pageDimensions,[f,p]=this.pageTranslation;let m,y;switch(this.rotation){case 0:m=n+(o[0]-f)/h,y=r+this.height-(o[1]-p)/d;break;case 90:m=n+(o[0]-f)/h,y=r-(o[1]-p)/d,[l,c]=[c,-l];break;case 180:m=n-this.width+(o[0]-f)/h,y=r-(o[1]-p)/d,[l,c]=[-l,-c];break;case 270:m=n+(o[0]-f-this.height*d)/h,y=r+(o[1]-p-this.width*h)/d,[l,c]=[-c,l];break}this.setAt(m*s,y*a,l,c)}else this._moveAfterPaste(n,r);T(this,xn,iS).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(n){var m,y,x;const r=n.clipboardData||window.clipboardData,{types:i}=r;if(i.length===1&&i[0]==="text/plain")return;n.preventDefault();const s=T(m=_t,kl,eP).call(m,r.getData("text")||"").replaceAll(Yb,`
373`);if(!s)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!s.includes(`
374`)){o.insertNode(document.createTextNode(s)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:c}=o,h=[],d=[];if(l.nodeType===Node.TEXT_NODE){const v=l.parentElement;if(d.push(l.nodeValue.slice(c).replaceAll(Yb,"")),v!==this.editorDiv){let w=h;for(const b of this.editorDiv.childNodes){if(b===v){w=d;continue}w.push(T(y=_t,kl,rS).call(y,b))}}h.push(l.nodeValue.slice(0,c).replaceAll(Yb,""))}else if(l===this.editorDiv){let v=h,w=0;for(const b of this.editorDiv.childNodes)w++===c&&(v=d),v.push(T(x=_t,kl,rS).call(x,b))}S(this,Ei,`${h.join(`
375`)}${s}${d.join(`
376`)}`),T(this,xn,iS).call(this);const f=new Range;let p=Math.sumPrecise(h.map(v=>v.length));for(const{firstChild:v}of this.editorDiv.childNodes)if(v.nodeType===Node.TEXT_NODE){const w=v.nodeValue.length;if(p<=w){f.setStart(v,p),f.setEnd(v,p);break}p-=w}a.removeAllRanges(),a.addRange(f)}get contentDiv(){return this.editorDiv}getPDFRect(){const n=_t._internalPadding*this.parentScale;return this.getRect(n,n)}static async deserialize(n,r,i){var o;let s=null;if(n instanceof Q5){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:h,rotation:d,id:f,popupRef:p,richText:m,contentsObj:y,creationDate:x,modificationDate:v},textContent:w,textPosition:b,parent:{page:{pageNumber:k}}}=n;if(!w||w.length===0)return null;s=n={annotationType:xe.FREETEXT,color:Array.from(c),fontSize:l,value:w.join(`
377`),position:b,pageIndex:k-1,rect:h.slice(0),rotation:d,annotationElementId:f,id:f,deleted:!1,popupRef:p,comment:(y==null?void 0:y.str)||null,richText:m,creationDate:x,modificationDate:v}}const a=await super.deserialize(n,r,i);return S(a,_i,n.fontSize),a.color=Q.makeHexColor(...n.color),S(a,Ei,T(o=_t,kl,eP).call(o,n.value)),a._initialData=s,n.comment&&a.setCommentData(n),a}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=xt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(n),{color:r,fontSize:u(this,_i),value:T(this,xn,iV).call(this)});return this.addComment(i),n?(i.isCopy=!0,i):this.annotationElementId&&!T(this,xn,sV).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(n){const r=super.renderAnnotationElement(n);if(!r)return null;const{style:i}=r;i.fontSize=`calc(${u(this,_i)}px * var(--total-scale-factor))`,i.color=this.color,r.replaceChildren();for(const s of u(this,Ei).split(`
378`)){const a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),r.append(a)}return n.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:u(this,Ei)}}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};Ei=new WeakMap,m0=new WeakMap,gd=new WeakMap,_i=new WeakMap,xn=new WeakSet,tV=function(n){const r=s=>{this.editorDiv.style.fontSize=`calc(${s}px * var(--total-scale-factor))`,this.translate(0,-(s-u(this,_i)
vendor: 8,433 bytes, lines 378-380
378)*this.parentScale),S(this,_i,s),T(this,xn,nS).call(this)},i=u(this,_i);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Te.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},nV=function(n){const r=s=>{this.color=s,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Te.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},rV=function(){var i;const n=[];this.editorDiv.normalize();let r=null;for(const s of this.editorDiv.childNodes)(r==null?void 0:r.nodeType)===Node.TEXT_NODE&&s.nodeName==="BR"||(n.push(T(i=_t,kl,rS).call(i,s)),r=s);return n.join(`
379`)},nS=function(){const[n,r]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:s,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",s.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=i.width/n,this.height=i.height/r):(this.width=i.height/n,this.height=i.width/r),this.fixAndSetPosition()},kl=new WeakSet,rS=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(Yb,"")},iS=function(){if(this.editorDiv.replaceChildren(),!!u(this,Ei))for(const n of u(this,Ei).split(`
380`)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},iV=function(){return u(this,Ei).replaceAll(" "," ")},eP=function(n){return n.replaceAll(" "," ")},sV=function(n){const{value:r,fontSize:i,color:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||n.value!==r||n.fontSize!==i||n.color.some((o,l)=>o!==s[l])||n.pageIndex!==a},E(_t,kl),F(_t,"_freeTextDefaultContent",""),F(_t,"_internalPadding",0),F(_t,"_defaultColor",null),F(_t,"_defaultFontSize",10),F(_t,"_type","freetext"),F(_t,"_editorType",xe.FREETEXT);let ZT=_t;class re{toSVGPath(){Ze("Abstract method `toSVGPath` must be implemented.")}get box(){Ze("Abstract getter `box` must be implemented.")}serialize(e,n){Ze("Abstract method `serialize` must be implemented.")}static _rescale(e,n,r,i,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=n+e[o]*i,a[o+1]=r+e[o+1]*s;return a}static _rescaleAndSwap(e,n,r,i,s,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=n+e[o+1]*i,a[o+1]=r+e[o]*s;return a}static _translate(e,n,r,i){i||(i=new Float32Array(e.length));for(let s=0,a=e.length;s<a;s+=2)i[s]=n+e[s],i[s+1]=r+e[s+1];return i}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,n,r,i,s){switch(s){case 90:return[1-n/r,e/i];case 180:return[1-e/r,1-n/i];case 270:return[n/r,1-e/i];default:return[e/r,n/i]}}static _normalizePagePoint(e,n,r){switch(r){case 90:return[1-n,e];case 180:return[1-e,1-n];case 270:return[n,1-e];default:return[e,n]}}static createBezierPoints(e,n,r,i,s,a){return[(e+5*r)/6,(n+5*i)/6,(5*r+s)/6,(5*i+a)/6,(r+s)/2,(i+a)/2]}}F(re,"PRECISION",1e-4);var Ci,Ys,Rm,Im,Ga,Le,yd,vd,g0,y0,Om,Mm,Hc,v0,X1,Q1,Nn,_y,aV,oV,lV,cV,uV,hV;const Ro=class Ro{constructor({x:e,y:n},r,i,s,a,o=0){E(this,Nn);E(this,Ci);E(this,Ys,[]);E(this,Rm);E(this,Im);E(this,Ga,[]);E(this,Le,new Float32Array(18));E(this,yd);E(this,vd);E(this,g0);E(this,y0);E(this,Om);E(this,Mm);E(this,Hc,[]);S(this,Ci,r),S(this,Mm,s*i),S(this,Im,a),u(this,Le).set([NaN,NaN,NaN,NaN,e,n],6),S(this,Rm,o),S(this,y0,u(Ro,v0)*i),S(this,g0,u(Ro,Q1)*i),S(this,Om,i),u(this,Hc).push(e,n)}isEmpty(){return isNaN(u(this,Le)[8])}add({x:e,y:n}){var O;S(this,yd,e),S(this,vd,n);const[r,i,s,a]=u(this,Ci);let[o,l,c,h]=u(this,Le).subarray(8,12);const d=e-c,f=n-h,p=Math.hypot(d,f);if(p<u(this,g0))return!1;const m=p-u(this,y0),y=m/p,x=y*d,v=y*f;let w=o,b=l;o=c,l=h,c+=x,h+=v,(O=u(this,Hc))==null||O.push(e,n);const k=-v/m,_=x/m,C=k*u(this,Mm),P=_*u(this,Mm);return u(this,Le).set(u(this,Le).subarray(2,8),0),u(this,Le).set([c+C,h+P],4),u(this,Le).set(u(this,Le).subarray(14,18),12),u(this,Le).set([c-C,h-P],16),isNaN(u(this,Le)[6])?(u(this,Ga).length===0&&(u(this,Le).set([o+C,l+P],2),u(this,Ga).push(NaN,NaN,NaN,NaN,(o+C-r)/s,(l+P-i)/a),u(this,Le).set([o-C,l-P],14),u(this,Ys).push(NaN,NaN,NaN,NaN,(o-C-r)/s,(l-P-i)/a)),u(this,Le).set([w,b,o,l,c,h],6),!this.isEmpty()):(u(this,Le).set([w,b,o,l,c,h],6),Math.abs(Math.atan2(b-l,w-o)-Math.atan2(v,x))<Math.PI/2?([o,l,c,h]=u(this,Le).subarray(2,6),u(this,Ga).push(NaN,NaN,NaN,NaN,((o+c)/2-r)/s,((l+h)/2-i)/a),[o,l,w,b]=u(this,Le).subarray(14,18),u(this,Ys).push(NaN,NaN,NaN,NaN,((w+o)/2-r)/s,((b+l)/2-i)/a),!0):([w,b,o,l,c,h]=u(this,Le).subarray(0,6),u(this,Ga).push(((w+5*o)/6-r)/s,((b+5*l)/6-i)/a,((5*o+c)/6-r)/s,((5*l+h)/6-i)/a,((o+c)/2-r)/s,((l+h)/2-i)/a),[c,h,o,l,w,b]=u(this,Le).subarray(12,18),u(this,Ys).push(((w+5*o)/6-r)/s,((b+5*l)/6-i)/a,((5*o+c)/6-r)/s,((5*l+h)/6-i)/a,((o+c)/2-r)/s,((l+h)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=u(this,Ga),n=u(this,Ys);if(isNaN(u(this,Le)[6])&&!this.isEmpty())return T(this,Nn,aV).call(this);const r=[];r.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?r.push(`L${e[i+4]} ${e[i+5]}`):r.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);T(this,Nn,lV).call(this,r);for(let i=n.length-6;i>=6;i-=6)isNaN(n[i])?r.push(`L${n[i+4]} ${n[i+5]}`):r.push(`C${n[i]} ${n[i+1]} ${n[i+2]} ${n[i+3]} ${n[i+4]} ${n[i+5]}`);return T(this,Nn,oV).call(this,r),r.join(" ")}newFreeDrawOutline(e,n,r,i,s,a){return new dV(e,n,r,i,s,a)}getOutlines(){var d;const e=u(this,Ga),n=u(this,Ys),r=u(this,Le),[i,s,a,o]=u(this,Ci),l=new Float32Array((((d=u(this,Hc))==null?void 0:d.length)??0)+2);for(let f=0,p=l.length-2;f<p;f+=2)l[f]=(u(this,Hc)[f]-i)/a,l[f+1]=(u(this,Hc)[f+1]-s)/o;if(l[l.length-2]=(u(this,yd)-i)/a,l[l.length-1]=(u(this,vd)-s)/o,isNaN(r[6])&&!this.isEmpty())return T(this,Nn,cV).call(this,l);const c=new Float32Array(u(this,Ga).length+24+u(this,Ys).length);let h=e.length;for(let f=0;f<h;f+=2){if(isNaN(e[f])){c[f]=c[f+1]=NaN;continue}c[f]=e[f],c[f+1]=e[f+1]}h=T(this,Nn,hV).call(this,c,h);for(let f=n.length-6;f>=6;f-=6)for(let p=0;p<6;p+=2){if(isNaN(n[f+p])){c[h]=c[h+1]=NaN,h+=2;continue}c[h]=n[f+p],c[h+1]=n[f+p+1],h+=2}return T(this,Nn,uV).call(this,c,h),this.newFreeDrawOutline(c,l,u(this,Ci),u(this,Om),u(this,Rm),u(this,Im))}};Ci=new WeakMap,Ys=new WeakMap,Rm=new WeakMap,Im=new WeakMap,Ga=new WeakMap,Le=new WeakMap,yd=new WeakMap,vd=new WeakMap,g0=new WeakMap,y0=new WeakMap,Om=new WeakMap,Mm=new WeakMap,Hc=new WeakMap,v0=new WeakMap,X1=new WeakMap,Q1=new WeakMap,Nn=new WeakSet,_y=function(){const e=u(this,Le).subarray(4,6),n=u(this,Le).subarray(16,18),[r,i,s,a]=u(this,Ci);return[(u(this,yd)+(e[0]-n[0])/2-r)/s,(u(this,vd)+(e[1]-n[1])/2-i)/a,(u(this,yd)+(n[0]-e[0])/2-r)/s,(u(this,vd)+(n[1]-e[1])/2-i)/a]},aV=function(){const[e,n,r,i]=u(this,Ci),[s,a,o,l]=T(this,Nn,_y).call(this);return`M${(u(this,Le)[2]-e)/r} ${(u(this,Le)[3]-n)/i} L${(u(this,Le)[4]-e)/r} ${(u(this,Le)[5]-n)/i} L${s} ${a} L${o} ${l} L${(u(this,Le)[16]-e)/r} ${(u(this,Le)[17]-n)/i} L${(u(this,Le)[14]-e)/r} ${(u(this,Le)[15]-n)/i} Z`},oV=function(e){const n=u(this,Ys);e.push(`L${n[4]} ${n[5]} Z`)},lV=function(e){const[n,r,i,s]=u(this,Ci),a=u(this,Le).subarray(4,6),o=u(this,Le).subarray(16,18),[l,c,h,d]=T(this,Nn,_y).call(this);e.push(`L${(a[0]-n)/i} ${(a[1]-r)/s} L${l} ${c} L${h} ${d} L${(o[0]-n)/i} ${(o[1]-r)/s}`)},cV=function(e){const n=u(this,Le),[r,i,s,a]=u(this,Ci),[o,l,c,h]=T(this,Nn,_y).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(n[2]-r)/s,(n[3]-i)/a,NaN,NaN,NaN,NaN,(n[4]-r)/s,(n[5]-i)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,(n[16]-r)/s,(n[17]-i)/a,NaN,NaN,NaN,NaN,(n[14]-r)/s,(n[15]-i)/a],0),this.newFreeDrawOutline(d,e,u(this,Ci),u(this,Om),u(this,Rm),u(this,Im))},uV=function(e,n){const r=u(this,Ys);return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],n),n+=6},hV=function(e,n){const r=u(this,Le).subarray(4,6),i=u(this,Le).subarray(16,18),[s,a,o,l]=u(this,Ci),[c,h,d,f]=T(this,Nn,_y).call(this);return e.set([NaN,NaN,NaN,NaN,(r[0]-s)/o,(r[1]-a)/l,NaN,NaN,NaN,NaN,c,h,NaN,NaN,NaN,NaN,d,f,NaN,NaN,NaN,NaN,(i[0]-s)/o,(i[1]-a)/l],n),n+=24},E(Ro,v0,8),E(Ro,X1,2),E(Ro,Q1,u(Ro,v0)+u(Ro,X1));let b1=Ro;var Dm,wd,ll,w0,Ti,b0,cn,J1,fV;class dV extends re{constructor(n,r,i,s,a,o){super();
380E(this,J1);E(this,Dm);E(this,wd,new Float32Array(4));E(this,ll);E(this,w0);E(this,Ti);E(this,b0);E(this,cn);S(this,cn,n),S(this,Ti,r),S(this,Dm,i),S(this,b0,s),S(this,ll,a),S(this,w0,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],T(this,J1,fV).call(this,o);const[l,c,h,d]=u(this,wd);for(let f=0,p=n.length;f<p;f+=2)n[f]=(n[f]-l)/h,n[f+1]=(n[f+1]-c)/d;for(let f=0,p=r.length;f<p;f+=2)r[f]=(r[f]-l)/h,r[f+1]=(r[f+1]-c)/d}toSVGPath(){const n=[`M${u(this,cn)[4]} ${u(this,cn)[5]}`];for(let r=6,i=u(this,cn).length;r<i;r+=6){if(isNaN(u(this,cn)[r])){n.push(`L${u(this,cn)[r+4]} ${u(this,cn)[r+5]}`);continue}n.push(`C${u(this,cn)[r]} ${u(this,cn)[r+1]} ${u(this,cn)[r+2]} ${u(this,cn)[r+3]} ${u(this,cn)[r+4]} ${u(this,cn)[r+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,r,i,s],a){const o=i-n,l=s-r;let c,h;switch(a){case 0:c=re._rescale(u(this,cn),n,s,o,-l),h=re._rescale(u(this,Ti),n,s,o,-l);break;case 90:c=re._rescaleAndSwap(u(this,cn),n,r,o,l),h=re._rescaleAndSwap(u(this,Ti),n,r,o,l);break;case 180:c=re._rescale(u(this,cn),i,r,-o,l),h=re._rescale(u(this,Ti),i,r,-o,l);break;case 270:c=re._rescaleAndSwap(u(this,cn),i,s,-o,-l),h=re._rescaleAndSwap(u(this,Ti),i,s,-o,-l);break}return{outline:Array.from(c),points:[Array.from(h)]}}get box(){return u(this,wd)}newOutliner(n,r,i,s,a,o=0){return new b1(n,r,i,s,a,o)}getNewOutline(n,r){const[i,s,a,o]=u(this,wd),[l,c,h,d]=u(this,Dm),f=a*h,p=o*d,m=i*h+l,y=s*d+c,x=this.newOutliner({x:u(this,Ti)[0]*f+m,y:u(this,Ti)[1]*p+y},u(this,Dm),u(this,b0),n,u(this,w0),r??u(this,ll));for(let v=2;v<u(this,Ti).length;v+=2)x.add({x:u(this,Ti)[v]*f+m,y:u(this,Ti)[v+1]*p+y});return x.getOutlines()}}Dm=new WeakMap,wd=new WeakMap,ll=new WeakMap,w0=new WeakMap,Ti=new WeakMap,b0=new WeakMap,cn=new WeakMap,J1=new WeakSet,fV=function(n){const r=u(this,cn);let i=r[4],s=r[5];const a=[i,s,i,s];let o=i,l=s,c=i,h=s;const d=n?Math.max:Math.min,f=new Float32Array(4);for(let m=6,y=r.length;m<y;m+=6){const x=r[m+4],v=r[m+5];isNaN(r[m])?(Q.pointBoundingBox(x,v,a),l>v?(o=x,l=v):l===v&&(o=d(o,x)),h<v?(c=x,h=v):h===v&&(c=d(c,x))):(f.set(vl,0),Q.bezierBoundingBox(i,s,...r.slice(m,m+6),f),Q.rectBoundingBox(...f,a),l>f[1]?(o=f[0],l=f[1]):l===f[1]&&(o=d(o,f[0])),h<f[3]?(c=f[2],h=f[3]):h===f[3]&&(c=d(c,f[2]))),i=x,s=v}const p=u(this,wd);p[0]=a[0]-u(this,ll),p[1]=a[1]-u(this,ll),p[2]=a[2]-a[0]+2*u(this,ll),p[3]=a[3]-a[1]+2*u(this,ll),this.firstPoint=[o,l],this.lastPoint=[c,h]};var x0,S0,k0,Wc,Xs,Lr,pV,sS,mV,gV,nP;class tP{constructor(e,n=0,r=0,i=!0){E(this,Lr);E(this,x0);E(this,S0);E(this,k0);E(this,Wc,[]);E(this,Xs,[]);const s=vl.slice(),o=10**-4;for(const{x,y:v,width:w,height:b}of e){const k=Math.floor((x-n)/o)*o,_=Math.ceil((x+w+n)/o)*o,C=Math.floor((v-n)/o)*o,P=Math.ceil((v+b+n)/o)*o,R=[k,C,P,!0],O=[_,C,P,!1];u(this,Wc).push(R,O),Q.rectBoundingBox(k,C,_,P,s)}const l=s[2]-s[0]+2*r,c=s[3]-s[1]+2*r,h=s[0]-r,d=s[1]-r;let f=i?-1/0:1/0,p=1/0;const m=u(this,Wc).at(i?-1:-2),y=[m[0],m[2]];for(const x of u(this,Wc)){const[v,w,b,k]=x;!k&&i?w<p?(p=w,f=v):w===p&&(f=Math.max(f,v)):k&&!i&&(w<p?(p=w,f=v):w===p&&(f=Math.min(f,v))),x[0]=(v-h)/l,x[1]=(w-d)/c,x[2]=(b-d)/c}S(this,x0,new Float32Array([h,d,l,c])),S(this,S0,[f,p]),S(this,k0,y)}getOutlines(){u(this,Wc).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of u(this,Wc))n[3]?(e.push(...T(this,Lr,nP).call(this,n)),T(this,Lr,mV).call(this,n)):(T(this,Lr,gV).call(this,n),e.push(...T(this,Lr,nP).call(this,n)));return T(this,Lr,pV).call(this,e)}}x0=new WeakMap,S0=new WeakMap,k0=new WeakMap,Wc=new WeakMap,Xs=new WeakMap,Lr=new WeakSet,pV=function(e){const n=[],r=new Set;for(const a of e){const[o,l,c]=a;n.push([o,l,a],[o,c,a])}n.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=n.length;a<o;a+=2){const l=n[a][2],c=n[a+1][2];l.push(c),c.push(l),r.add(l),r.add(c)}const i=[];let s;for(;r.size>0;){const a=r.values().next().value;let[o,l,c,h,d]=a;r.delete(a);let f=o,p=l;for(s=[o,c],i.push(s);;){let m;if(r.has(h))m=h;else if(r.has(d))m=d;else break;r.delete(m),[o,l,c,h,d]=m,f!==o&&(s.push(f,p,o,p===l?l:c),f=o),p=p===l?c:l}s.push(f,p)}return new nhe(i,u(this,x0),u(this,S0),u(this,k0))},sS=function(e){const n=u(this,Xs);let r=0,i=n.length-1;for(;r<=i;){const s=r+i>>1,a=n[s][0];if(a===e)return s;a<e?r=s+1:i=s-1}return i+1},mV=function([,e,n]){const r=T(this,Lr,sS).call(this,e);u(this,Xs).splice(r,0,[e,n])},gV=function([,e,n]){const r=T(this,Lr,sS).call(this,e);for(let i=r;i<u(this,Xs).length;i++){const[s,a]=u(this,Xs)[i];if(s!==e)break;if(s===e&&a===n){u(this,Xs).splice(i,1);return}}for(let i=r-1;i>=0;i--){const[s,a]=u(this,Xs)[i];if(s!==e)break;if(s===e&&a===n){u(this,Xs).splice(i,1);return}}},nP=function(e){const[n,r,i]=e,s=[[n,r,i]],a=T(this,Lr,sS).call(this,i);for(let o=0;o<a;o++){const[l,c]=u(this,Xs)[o];for(let h=0,d=s.length;h<d;h++){const[,f,p]=s[h];if(!(c<=f||p<=l)){if(f>=l){if(p>c)s[h][1]=c;else{if(d===1)return[];s.splice(h,1),h--,d--}continue}s[h][2]=l,p>c&&s.push([n,c,p])}}}return s};var A0,Lm;class nhe extends re{constructor(n,r,i,s){super();E(this,A0);E(this,Lm);S(this,Lm,n),S(this,A0,r),this.firstPoint=i,this.lastPoint=s}toSVGPath(){const n=[];for(const r of u(this,Lm)){let[i,s]=r;n.push(`M${i} ${s}`);for(let a=2;a<r.length;a+=2){const o=r[a],l=r[a+1];o===i?(n.push(`V${l}`),s=l):l===s&&(n.push(`H${o}`),i=o)}n.push("Z")}return n.join(" ")}serialize([n,r,i,s],a){const o=[],l=i-n,c=s-r;for(const h of u(this,Lm)){const d=new Array(h.length);for(let f=0;f<h.length;f+=2)d[f]=n+h[f]*l,d[f+1]=s-h[f+1]*c;o.push(d)}return o}get box(){return u(this,A0)}get classNamesForOutlining(){return["highlightOutline"]}}A0=new WeakMap,Lm=new WeakMap;class rP extends b1{newFreeDrawOutline(e,n,r,i,s,a){return new rhe(e,n,r,i,s,a)}}class rhe extends dV{newOutliner(e,n,r,i,s,a=0){return new rP(e,n,r,i,s,a)}}var jm,E0,cl,bd,_0,Yr,C0,T0,xd,Pi,Ni,Yn,Fm,Bm,pr,$m,fs,P0,Re,iP,aS,yV,vV,wV,sP,Gu,vs,Df,bV,oS,lS,xV,SV,kV,AV,EV;const Ke=class Ke extends xt{constructor(n){super({...n,name:"highlightEditor"});E(this,Re);E(this,jm,null);E(this,E0,0);E(this,cl);E(this,bd,null);E(this,_0,null);E(this,Yr,null);E(this,C0,null);E(this,T0,0);E(this,xd,null);E(this,Pi,null);E(this,Ni,null);E(this,Yn,!1);E(this,Fm,null);E(this,Bm,null);E(this,pr,null);E(this,$m,"");E(this,fs);E(this,P0,"");this.color=n.color||Ke._defaultColor,S(this,fs,n.thickness||Ke._defaultThickness),this.opacity=n.opacity||Ke._defaultOpacity,S(this,cl,n.boxes||null),S(this,P0,n.methodOfCreation||""),S(this,$m,n.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",n.highlightId>-1?(S(this,Yn,!0),T(this,Re,aS).call(this,n),T(this,Re,Gu).call(this)):u(this,cl)&&(S(this,jm,n.anchorNode),S(this,E0,n.anchorOffset),S(this,C0,n.focusNode),S(this,T0,n.focusOffset),T(this,Re,iP).call(this),T(this,Re,Gu).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const n=Ke.prototype;return Se(this,"_keyboardManager",new eb([[["ArrowLeft","mac+ArrowLeft"],n._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],n._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],n._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],n._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:u(this,Yn)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:u(this,fs),methodOfCreation:u(this,P0)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(n){return{numberOfColors:n.get("color").size}}static initialize(n,r){var i;xt.initialize(n,r),Ke._defaultColor||(Ke._defaultColor=((i=r.highlightColors)==null?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case Te.HIGHLIGHT_COLOR:Ke._defaultColor=r;break;case Te.HIGHLIGHT_THICKNESS:Ke._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return u(this,Bm)}get commentButtonPosition(){return u(this,Fm)}updateParams(n,r){switch(n){case Te.HIGHLIGHT_COLOR:T(this,Re,yV).call(this,r);break;case Te.HIGHLIGHT_THICKNESS:T(this,Re,vV).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[Te.HIGHLIGHT_COLOR,Ke._defaultColor],[Te.HIGHLIGHT_THICKNESS,Ke._defaultThickness]]}get propertiesToUpdate(){return[[Te.HIGHLIGHT_COLOR,this.color||Ke._defaultColor],[Te.HIGHLIGHT_THICKNESS,u(this,fs)||Ke._defaultThickness],[Te.HIGHLIGHT_FREE,u(this,Yn)]]}onUpdatedColor(){var n,r;(n=this.parent)==null||n.drawLayer.updateProperties(u(this,Ni),{root:{fill:this.color,"fill-opacity":this.opacity}}),(r=u(this,_0))==null||r.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",S(this,_0,new y1({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(T(this,Re,lS).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,T(this,Re,lS).call(this))}onceAdded(n){this.annotationElementId||this.parent.addUndoableEditor(this),n&&this.div.focus()}remove(){T(this,Re,sP).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(T(this,Re,Gu).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var i;let r=!1;this.parent&&!n?T(this,Re,sP).call(this):n&&(T(this,Re,Gu).call(this,n),r=!this.parent&&((i=this.div)==null?void 0:i.classList.contains("selectedEditor"))),super.setParent(n),this.show(this._isVisible),r&&this.select()}rotate(n){var s,a,o;const{drawLayer:r}=this.parent;let i;u(this,Yn)?(n=(n-this.rotation+360)%360,i=T(s=Ke,vs,Df).call(s,u(this,Pi).box,n)):i=T(a=Ke,vs,Df).call(a,[this.x,this.y,this.width,this.height],n),r.updateProperties(u(this,Ni),{bbox:i,root:{"data-main-rotation":n}}),r.updateProperties(u(this,pr),{bbox:T(o=Ke,vs,Df).call(o,u(this,Yr).box,n),root:{"data-main-rotation":n}})}
380render(){if(this.div)return this.div;const n=super.render();u(this,$m)&&(n.setAttribute("aria-label",u(this,$m)),n.setAttribute("role","mark")),u(this,Yn)?n.classList.add("free"):this.div.addEventListener("keydown",T(this,Re,bV).bind(this),{signal:this._uiManager._signal});const r=S(this,xd,document.createElement("div"));return n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=u(this,bd),this.setDims(),Oz(this,u(this,xd),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){var n;this.isSelected||(n=this.parent)==null||n.drawLayer.updateProperties(u(this,pr),{rootClass:{hovered:!0}})}pointerleave(){var n;this.isSelected||(n=this.parent)==null||n.drawLayer.updateProperties(u(this,pr),{rootClass:{hovered:!1}})}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:T(this,Re,oS).call(this,!0);break;case 1:case 3:T(this,Re,oS).call(this,!1);break}}select(){var n;super.select(),u(this,pr)&&((n=this.parent)==null||n.drawLayer.updateProperties(u(this,pr),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var n;super.unselect(),u(this,pr)&&((n=this.parent)==null||n.drawLayer.updateProperties(u(this,pr),{rootClass:{selected:!1}}),u(this,Yn)||T(this,Re,oS).call(this,!1))}get _mustFixPosition(){return!u(this,Yn)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.updateProperties(u(this,Ni),{rootClass:{hidden:!n}}),this.parent.drawLayer.updateProperties(u(this,pr),{rootClass:{hidden:!n}}))}static startHighlighting(n,r,{target:i,x:s,y:a}){const{x:o,y:l,width:c,height:h}=i.getBoundingClientRect(),d=new AbortController,f=n.combinedSignal(d),p=m=>{d.abort(),T(this,vs,AV).call(this,n,m)};window.addEventListener("blur",p,{signal:f}),window.addEventListener("pointerup",p,{signal:f}),window.addEventListener("pointerdown",zt,{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",_s,{signal:f}),i.addEventListener("pointermove",T(this,vs,kV).bind(this,n),{signal:f}),this._freeHighlight=new rP({x:s,y:a},[o,l,c,h],n.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=n.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(n,r,i){var x,v,w,b;let s=null;if(n instanceof Z5){const{data:{quadPoints:k,rect:_,rotation:C,id:P,color:R,opacity:O,popupRef:M,richText:D,contentsObj:j,creationDate:U,modificationDate:B},parent:{page:{pageNumber:z}}}=n;s=n={annotationType:xe.HIGHLIGHT,color:Array.from(R),opacity:O,quadPoints:k,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:P,id:P,deleted:!1,popupRef:M,richText:D,comment:(j==null?void 0:j.str)||null,creationDate:U,modificationDate:B}}else if(n instanceof QR){const{data:{inkLists:k,rect:_,rotation:C,id:P,color:R,borderStyle:{rawWidth:O},popupRef:M,richText:D,contentsObj:j,creationDate:U,modificationDate:B},parent:{page:{pageNumber:z}}}=n;s=n={annotationType:xe.HIGHLIGHT,color:Array.from(R),thickness:O,inkLists:k,boxes:null,pageIndex:z-1,rect:_.slice(0),rotation:C,annotationElementId:P,id:P,deleted:!1,popupRef:M,richText:D,comment:(j==null?void 0:j.str)||null,creationDate:U,modificationDate:B}}const{color:a,quadPoints:o,inkLists:l,outlines:c,opacity:h}=n,d=await super.deserialize(n,r,i);d.color=Q.makeHexColor(...a),d.opacity=h||1,l&&S(d,fs,n.thickness),d._initialData=s,n.comment&&d.setCommentData(n);const[f,p]=d.pageDimensions,[m,y]=d.pageTranslation;if(o){const k=S(d,cl,[]);for(let _=0;_<o.length;_+=8)k.push({x:(o[_]-m)/f,y:1-(o[_+1]-y)/p,width:(o[_+2]-o[_])/f,height:(o[_+1]-o[_+5])/p});T(x=d,Re,iP).call(x),T(v=d,Re,Gu).call(v),d.rotate(d.rotation)}else if(l||c){S(d,Yn,!0);const k=(l||c.points)[0],_={x:k[0]-m,y:p-(k[1]-y)},C=new rP(_,[0,0,f,p],1,u(d,fs)/2,!0,.001);for(let O=0,M=k.length;O<M;O+=2)_.x=k[O]-m,_.y=p-(k[O+1]-y),C.add(_);const{id:P,clipPathId:R}=r.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:C.toSVGPath()}},!0,!0);T(w=d,Re,aS).call(w,{highlightOutlines:C.getOutlines(),highlightId:P,clipPathId:R}),T(b=d,Re,Gu).call(b),d.rotate(d.parentRotation)}return d}serialize(n=!1){if(this.isEmpty()||n)return null;if(this.deleted)return this.serializeDeleted();const r=xt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(n);return Object.assign(i,{color:r,opacity:this.opacity,thickness:u(this,fs),quadPoints:T(this,Re,xV).call(this),outlines:T(this,Re,SV).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!T(this,Re,EV).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(n){return this.deleted?(n.hide(),null):(n.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};jm=new WeakMap,E0=new WeakMap,cl=new WeakMap,bd=new WeakMap,_0=new WeakMap,Yr=new WeakMap,C0=new WeakMap,T0=new WeakMap,xd=new WeakMap,Pi=new WeakMap,Ni=new WeakMap,Yn=new WeakMap,Fm=new WeakMap,Bm=new WeakMap,pr=ne
380w WeakMap,$m=new WeakMap,fs=new WeakMap,P0=new WeakMap,Re=new WeakSet,iP=function(){const n=new tP(u(this,cl),.001);S(this,Pi,n.getOutlines()),[this.x,this.y,this.width,this.height]=u(this,Pi).box;const r=new tP(u(this,cl),.0025,.001,this._uiManager.direction==="ltr");S(this,Yr,r.getOutlines());const{firstPoint:i}=u(this,Pi);S(this,Fm,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);const{lastPoint:s}=u(this,Yr);S(this,Bm,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},aS=function({highlightOutlines:n,highlightId:r,clipPathId:i}){var f,p;if(S(this,Pi,n),S(this,Yr,n.getNewOutline(u(this,fs)/2+1.5,.0025)),r>=0)S(this,Ni,r),S(this,bd,i),this.parent.drawLayer.finalizeDraw(r,{bbox:n.box,path:{d:n.toSVGPath()}}),S(this,pr,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:u(this,Yr).box,path:{d:u(this,Yr).toSVGPath()}},!0));else if(this.parent){const m=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(u(this,Ni),{bbox:T(f=Ke,vs,Df).call(f,u(this,Pi).box,(m-this.rotation+360)%360),path:{d:n.toSVGPath()}}),this.parent.drawLayer.updateProperties(u(this,pr),{bbox:T(p=Ke,vs,Df).call(p,u(this,Yr).box,m),path:{d:u(this,Yr).toSVGPath()}})}const[a,o,l,c]=n.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=c;break;case 90:{const[m,y]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*y/m,this.height=c*m/y;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=c;break;case 270:{const[m,y]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*y/m,this.height=c*m/y;break}}const{firstPoint:h}=n;S(this,Fm,[(h[0]-a)/l,(h[1]-o)/c]);const{lastPoint:d}=u(this,Yr);S(this,Bm,[(d[0]-a)/l,(d[1]-o)/c])},yV=function(n){const r=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},i=this.color,s=this.opacity;this.addCommands({cmd:r.bind(this,n,Ke._defaultOpacity),undo:r.bind(this,i,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Te.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(n)},!0)},vV=function(n){const r=u(this,fs),i=s=>{S(this,fs,s),T(this,Re,wV).call(this,s)};this.addCommands({cmd:i.bind(this,n),undo:i.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Te.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},wV=function(n){u(this,Yn)&&(T(this,Re,aS).call(this,{highlightOutlines:u(this,Pi).getNewOutline(n/2)}),this.fixAndSetPosition(),this.setDims())},sP=function(){u(this,Ni)===null||!this.parent||(this.parent.drawLayer.remove(u(this,Ni)),S(this,Ni,null),this.parent.drawLayer.remove(u(this,pr)),S(this,pr,null))},Gu=function(n=this.parent){u(this,Ni)===null&&({id:jt(this,Ni)._,clipPathId:jt(this,bd)._}=n.drawLayer.draw({bbox:u(this,Pi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:u(this,Yn)},path:{d:u(this,Pi).toSVGPath()}},!1,!0),S(this,pr,n.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:u(this,Yn)},bbox:u(this,Yr).box,path:{d:u(this,Yr).toSVGPath()}},u(this,Yn))),u(this,xd)&&(u(this,xd).style.clipPath=u(this,bd)))},vs=new WeakSet,Df=function([n,r,i,s],a){switch(a){case 90:return[1-r-s,n,s,i];case 180:return[1-n-i,1-r-s,i,s];case 270:return[r,1-n-i,s,i]}return[n,r,i,s]},bV=function(n){Ke._keyboardManager.exec(this,n)},oS=function(n){if(!u(this,jm))return;const r=window.getSelection();n?r.setPosition(u(this,jm),u(this,E0)):r.setPosition(u(this,C0),u(this,T0))},lS=function(){return u(this,Yn)?this.rotation:0},xV=function(){if(u(this,Yn))return null;const[n,r]=this.pageDimensions,[i,s]=this.pageTranslation,a=u(this,cl),o=new Float32Array(a.length*8);let l=0;for(const{x:c,y:h,width:d,height:f}of a){const p=c*n+i,m=(1-h)*r+s;o[l]=o[l+4]=p,o[l+1]=o[l+3]=m,o[l+2]=o[l+6]=p+d*n,o[l+5]=o[l+7]=m-f*r,l+=8}return o},SV=function(n){return u(this,Pi).serialize(n,T(this,Re,lS).call(this))},kV=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},AV=function(n,r){this._freeHighlight.isEmpty()?n.drawLayer.remove(this._freeHighlightId):n.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},EV=function(n){const{color:r}=this._initialData;return this.hasEditedComment||n.color.some((i,s)=>i!==r[s])},E(Ke,vs),F(Ke,"_defaultColor",null),F(Ke,"_defaultOpacity",1),F(Ke,"_defaultThickness",12),F(Ke,"_type","highlight"),F(Ke,"_editorType",xe.HIGHLIGHT),F(Ke,"_freeHighlightId",-1),F(Ke,"_freeHighlight",null),F(Ke,"_freeHighlightClipId","");let x1=Ke;var Sd;class _V{constructor(){E(this,Sd,Object.create(null))}updateProperty(e,n){this[e]=n,this.updateSVGProperty(e,n)}updateProperties(e){if(e)for(const[n,r]of Object.entries(e))n.startsWith("_")||this.updateProperty(n,r)}updateSVGProperty(e,n){u(this,Sd)[e]=n}toSVGProperties(){const e=u(this,Sd);return S(this,Sd,Object.create(null)),{root:e}}reset(){S(this,Sd,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Ze("Not implemented")}}Sd=new WeakMap;var Er,Um,Dn,kd,Ad,He,aP,oP,lP,Cy,CV,cS,Ty,Lf;const Be=class Be extends xt{constructor(n){super(n);E(this,He);E(this,Er,null);E(this,Um);F(this,"_colorPicker",null);F(this,"_drawId",null);S(this,Um,n.mustBeCommitted||!1),this._addOutlines(n)}onUpdatedColor(){var n;(n=this._colorPicker)==null||n.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){var n,r;(r=(n=this._colorPicker)==null?void 0:n.updateOpacity)==null||r.call(n,this.opacity)}
380_addOutlines(n){n.drawOutlines&&(T(this,He,aP).call(this,n),T(this,He,Cy).call(this))}static _mergeSVGProperties(n,r){const i=new Set(Object.keys(n));for(const[s,a]of Object.entries(r))i.has(s)?Object.assign(n[s],a):n[s]=a;return n}static getDefaultDrawingOptions(n){Ze("Not implemented")}static get typesMap(){Ze("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(n,r){const i=this.typesMap.get(n);i&&this._defaultDrawingOptions.updateProperty(i,r),this._currentParent&&(u(Be,Dn).updateProperty(i,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(n,r){const i=this.constructor.typesMap.get(n);i&&this._updateProperty(n,i,r)}static get defaultPropertiesToUpdate(){const n=[],r=this._defaultDrawingOptions;for(const[i,s]of this.typesMap)n.push([i,r[s]]);return n}get propertiesToUpdate(){const n=[],{_drawingOptions:r}=this;for(const[i,s]of this.constructor.typesMap)n.push([i,r[s]]);return n}_updateProperty(n,r,i){const s=this._drawingOptions,a=s[r],o=l=>{var h;s.updateProperty(r,l);const c=u(this,Er).updateProperty(r,l);c&&T(this,He,Ty).call(this,c),(h=this.parent)==null||h.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),n===this.colorType?this.onUpdatedColor():n===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:o.bind(this,i),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(n,r){const i=this.constructor.typesMap.get(this.colorType),s=this.constructor.typesMap.get(this.opacityType),a=this._drawingOptions,o=a[i],l=a[s],c=(h,d)=>{var f;a.updateProperty(i,h),a.updateProperty(s,d),u(this,Er).updateProperty(i,h),u(this,Er).updateProperty(s,d),(f=this.parent)==null||f.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:c.bind(this,n,r),undo:c.bind(this,o,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Te.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,Be._mergeSVGProperties(u(this,Er).getPathResizingSVGProperties(T(this,He,cS).call(this)),{bbox:T(this,He,Lf).call(this)}))}_onResized(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,Be._mergeSVGProperties(u(this,Er).getPathResizedSVGProperties(T(this,He,cS).call(this)),{bbox:T(this,He,Lf).call(this)}))}_onTranslating(n,r){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,{bbox:T(this,He,Lf).call(this)})}_onTranslated(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,Be._mergeSVGProperties(u(this,Er).getPathTranslatedSVGProperties(T(this,He,cS).call(this),this.parentDimensions),{bbox:T(this,He,Lf).call(this)}))}_onStartDragging(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var n;(n=this.parent)==null||n.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(n){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,u(this,Um)&&(S(this,Um,!1),this.commit(),this.parent.setSelected(this),n&&this.isOnScreen&&this.div.focus())}remove(){T(this,He,lP).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(T(this,He,Cy).call(this),T(this,He,Ty).call(this,u(this,Er).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var i;let r=!1;this.parent&&!n?(this._uiManager.removeShouldRescale(this),T(this,He,lP).call(this)):n&&(this._uiManager.addShouldRescale(this),T(this,He,Cy).call(this,n),r=!this.parent&&((i=this.div)==null?void 0:i.classList.contains("selectedEditor"))),super.setParent(n),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Be._mergeSVGProperties({bbox:T(this,He,Lf).call(this)},u(this,Er).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&T(this,He,Ty).call(this,u(this,Er).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
380render(){if(this.div)return this.div;let n,r;this._isCopy&&(n=this.x,r=this.y);const i=super.render();i.classList.add("draw");const s=document.createElement("div");return i.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(n,r),i}static createDrawerInstance(n,r,i,s,a){Ze("Not implemented")}static startDrawing(n,r,i,s){var x;const{target:a,offsetX:o,offsetY:l,pointerId:c,pointerType:h}=s;if(cr.isInitializedAndDifferentPointerType(h))return;const{viewport:{rotation:d}}=n,{width:f,height:p}=a.getBoundingClientRect(),m=S(Be,kd,new AbortController),y=n.combinedSignal(m);if(cr.setPointer(h,c),window.addEventListener("pointerup",v=>{cr.isSamePointerIdOrRemove(v.pointerId)&&this._endDraw(v)},{signal:y}),window.addEventListener("pointercancel",v=>{cr.isSamePointerIdOrRemove(v.pointerId)&&this._currentParent.endDrawingSession()},{signal:y}),window.addEventListener("pointerdown",v=>{cr.isSamePointerType(v.pointerType)&&(cr.initializeAndAddPointerId(v.pointerId),u(Be,Dn).isCancellable()&&(u(Be,Dn).removeLastElement(),u(Be,Dn).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:y}),window.addEventListener("contextmenu",_s,{signal:y}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:y}),a.addEventListener("touchmove",v=>{cr.isSameTimeStamp(v.timeStamp)&&zt(v)},{signal:y}),n.toggleDrawing(),(x=r._editorUndoBar)==null||x.hide(),u(Be,Dn)){n.drawLayer.updateProperties(this._currentDrawId,u(Be,Dn).startNew(o,l,f,p,d));return}r.updateUIForDefaultProperties(this),S(Be,Dn,this.createDrawerInstance(o,l,f,p,d)),S(Be,Ad,this.getDefaultDrawingOptions()),this._currentParent=n,{id:this._currentDrawId}=n.drawLayer.draw(this._mergeSVGProperties(u(Be,Ad).toSVGProperties(),u(Be,Dn).defaultSVGProperties),!0,!1)}static _drawMove(n){if(cr.isSameTimeStamp(n.timeStamp),!u(Be,Dn))return;const{offsetX:r,offsetY:i,pointerId:s}=n;if(cr.isSamePointerId(s)){if(cr.isUsingMultiplePointers()){this._endDraw(n);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,u(Be,Dn).add(r,i)),cr.setTimeStamp(n.timeStamp),zt(n)}}static _cleanup(n){n&&(this._currentDrawId=-1,this._currentParent=null,S(Be,Dn,null),S(Be,Ad,null),cr.clearTimeStamp()),u(Be,kd)&&(u(Be,kd).abort(),S(Be,kd,null),cr.clearPointerIds())}static _endDraw(n){const r=this._currentParent;if(r){if(r.toggleDrawing(!0),this._cleanup(!1),(n==null?void 0:n.target)===r.div&&r.drawLayer.updateProperties(this._currentDrawId,u(Be,Dn).end(n.offsetX,n.offsetY)),this.supportMultipleDrawings){const i=u(Be,Dn),s=this._currentDrawId,a=i.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(s,i.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(s,i.removeLastElement())},mustExec:!1,type:Te.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(n){const r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(Te.DRAW_STEP),!u(Be,Dn).isEmpty()){const{pageDimensions:[i,s],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:u(Be,Dn).getOutlines(i*a,s*a,a,this._INNER_MARGIN),drawingOptions:u(Be,Ad),mustBeCommitted:!n});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(n){}static deserializeDraw(n,r,i,s,a,o){Ze("Not implemented")}static async deserialize(n,r,i){var d,f;const{rawDims:{pageWidth:s,pageHeight:a,pageX:o,pageY:l}}=r.viewport,c=this.deserializeDraw(o,l,s,a,this._INNER_MARGIN,n),h=await super.deserialize(n,r,i);
380return h.createDrawingOptions(n),T(d=h,He,aP).call(d,{drawOutlines:c}),T(f=h,He,Cy).call(f),h.onScaleChanging(),h.rotate(),h}serializeDraw(n){const[r,i]=this.pageTranslation,[s,a]=this.pageDimensions;return u(this,Er).serialize([r,i,s,a],n)}renderAnnotationElement(n){return n.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Er=new WeakMap,Um=new WeakMap,Dn=new WeakMap,kd=new WeakMap,Ad=new WeakMap,He=new WeakSet,aP=function({drawOutlines:n,drawId:r,drawingOptions:i}){S(this,Er,n),this._drawingOptions||(this._drawingOptions=i),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),r>=0?(this._drawId=r,this.parent.drawLayer.finalizeDraw(r,n.defaultProperties)):this._drawId=T(this,He,oP).call(this,n,this.parent),T(this,He,Ty).call(this,n.box)},oP=function(n,r){const{id:i}=r.drawLayer.draw(Be._mergeSVGProperties(this._drawingOptions.toSVGProperties(),n.defaultSVGProperties),!1,!1);return i},lP=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Cy=function(n=this.parent){if(!(this._drawId!==null&&this.parent===n)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,n.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=T(this,He,oP).call(this,u(this,Er),n)}},CV=function([n,r,i,s]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[r,1-n,i*(o/a),s*(a/o)];case 180:return[1-n,1-r,i,s];case 270:return[1-r,n,i*(o/a),s*(a/o)];default:return[n,r,i,s]}},cS=function(){const{x:n,y:r,width:i,height:s,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-r,n,i*(a/o),s*(o/a)];case 180:return[1-n,1-r,i,s];case 270:return[r,1-n,i*(a/o),s*(o/a)];default:return[n,r,i,s]}},Ty=function(n){[this.x,this.y,this.width,this.height]=T(this,He,CV).call(this,n),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},Lf=function(){const{x:n,y:r,width:i,height:s,rotation:a,parentRotation:o,parentDimensions:[l,c]}=this;switch((a*4+o)/90){case 1:return[1-r-s,n,s,i];case 2:return[1-n-i,1-r-s,i,s];case 3:return[r,1-n-i,s,i];case 4:return[n,r-i*(l/c),s*(c/l),i*(l/c)];case 5:return[1-r,n,i*(l/c),s*(c/l)];case 6:return[1-n-s*(c/l),1-r,s*(c/l),i*(l/c)];case 7:return[r-i*(l/c),1-n-s*(c/l),i*(l/c),s*(c/l)];case 8:return[n-i,r-s,i,s];case 9:return[1-r,n-i,s,i];case 10:return[1-n,1-r,i,s];case 11:return[r-s,1-n,s,i];case 12:return[n-s*(c/l),r,s*(c/l),i*(l/c)];case 13:return[1-r-i*(l/c),n-s*(c/l),i*(l/c),s*(c/l)];case 14:return[1-n,1-r-i*(l/c),s*(c/l),i*(l/c)];case 15:return[r,1-n,i*(l/c),s*(c/l)];default:return[n,r,i,s]}},F(Be,"_currentDrawId",-1),F(Be,"_currentParent",null),E(Be,Dn,null),E(Be,kd,null),E(Be,Ad,null),F(Be,"_INNER_MARGIN",3);let S1=Be;var qa,Ln,jn,Ed,zm,_r,Xn,ps,_d,Cd,Td,Vm,uS;class ihe{constructor(e,n,r,i,s,a){E(this,Vm);E(this,qa,new Float64Array(6));E(this,Ln);E(this,jn);E(this,Ed);E(this,zm);E(this,_r);E(this,Xn,"");E(this,ps,0);E(this,_d,new tb);E(this,Cd);E(this,Td);S(this,Cd,r),S(this,Td,i),S(this,Ed,s),S(this,zm,a),[e,n]=T(this,Vm,uS).call(this,e,n);const o=S(this,Ln,[NaN,NaN,NaN,NaN,e,n]);S(this,_r,[e,n]),S(this,jn,[{line:o,points:u(this,_r)}]),u(this,qa).set(o,0)}updateProperty(e,n){e==="stroke-width"&&S(this,zm,n)}isEmpty(){return!u(this,jn)||u(this,jn).length===0}isCancellable(){return u(this,_r).length<=10}add(e,n){[e,n]=T(this,Vm,uS).call(this,e,n);const[r,i,s,a]=u(this,qa).subarray(2,6),o=e-s,l=n-a;return Math.hypot(u(this,Cd)*o,u(this,Td)*l)<=2?null:(u(this,_r).push(e,n),isNaN(r)?(u(this,qa).set([s,a,e,n],2),u(this,Ln).push(NaN,NaN,NaN,NaN,e,n),{path:{d:this.toSVGPath()}}):(isNaN(u(this,qa)[0])&&u(this,Ln).splice(6,6),u(this,qa).set([r,i,s,a,e,n],0),u(this,Ln).push(...re.createBezierPoints(r,i,s,a,e,n)),{path:{d:this.toSVGPath()}}))}end(e,n){const r=this.add(e,n);return r||(u(this,_r).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,n,r,i,s){S(this,Cd,r),S(this,Td,i),S(this,Ed,s),[e,n]=T(this,Vm,uS).call(this,e,n);const a=S(this,Ln,[NaN,NaN,NaN,NaN,e,n]);S(this,_r,[e,n]);const o=u(this,jn).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),u(this,jn).push({line:a,points:u(this,_r)}),u(this,qa).set(a,0),S(this,ps,0),this.toSVGPath(),null}getLastElement(){return u(this,jn).at(-1)}setLastElement(e){return u(this,jn)?(u(this,jn).push(e),S(this,Ln,e.line),S(this,_r,e.points),S(this,ps,0),{path:{d:this.toSVGPath()}}):u(this,_d).setLastElement(e)}removeLastElement(){if(!u(this,jn))return u(this,_d).removeLastElement();u(this,jn).pop(),S(this,Xn,"");for(let e=0,n=u(this,jn).length;e<n;e++){const{line:r,points:i}=u(this,jn)[e];S(this,Ln,r),S(this,_r,i),S(this,ps,0),this.toSVGPath()}return{path:{d:u(this,Xn)}}}toSVGPath(){const e=re.svgRound(u(this,Ln)[4]),n=re.svgRound(u(this,Ln)[5]);if(u(this,_r).length===2)return S(this,Xn,`${u(this,Xn)} M ${e} ${n} Z`),u(this,Xn);if(u(this,_r).length<=6){const i=u(this,Xn).lastIndexOf("M");S(this,Xn,`${u(this,Xn).slice(0,i)} M ${e} ${n}`),S(this,ps,6)}if(u(this,_r).length===4){const i=re.svgRound(u(this,Ln)[10]),s=re.svgRound(u(this,Ln)[11]);return S(this,Xn,`${u(this,Xn)} L ${i} ${s}`),S(this,ps,12),u(this,Xn)}const r=[];u(this,ps)===0&&(r.push(`M ${e} ${n}`),S(this,ps,6));for(let i=u(this,ps),s=u(this,Ln).length;i<s;i+=6){const[a,o,l,c,h,d]=u(this,Ln).slice(i,i+6).map(re.svgRound);r.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}return S(this,Xn,u(this,Xn)+r.join(" ")),S(this,ps,u(this,Ln).length),u(this,Xn)}getOutlines(e,n,r,i){const s=u(this,jn).at(-1);return s.line=new Float32Array(s.line),s.points=new Float32Array(s.points),u(this,_d).build(u(this,jn),e,n,r,u(this,Ed),u(this,zm),i),S(this,qa,null),S(this,Ln,null),S(this,jn,null),S(this,Xn,null),u(this,_d)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}qa=new WeakMap,Ln=new WeakMap,jn=new WeakMap,Ed=new WeakMap,zm=new WeakMap,_r=new WeakMap,Xn=new WeakMap,ps=new WeakMap,_d=new WeakMap,Cd=new WeakMap,Td=new WeakMap,Vm=new WeakSet,uS=function(e,n){return re._normalizePoint(e,n,u(this,Cd),u(this,Td),u(this,Ed))};
380var Cr,N0,R0,Ri,Ka,Ya,Hm,Wm,Pd,er,_o,TV,PV,NV;class tb extends re{constructor(){super(...arguments);E(this,er);E(this,Cr);E(this,N0,0);E(this,R0);E(this,Ri);E(this,Ka);E(this,Ya);E(this,Hm);E(this,Wm);E(this,Pd)}build(n,r,i,s,a,o,l){S(this,Ka,r),S(this,Ya,i),S(this,Hm,s),S(this,Wm,a),S(this,Pd,o),S(this,R0,l??0),S(this,Ri,n),T(this,er,PV).call(this)}get thickness(){return u(this,Pd)}setLastElement(n){return u(this,Ri).push(n),{path:{d:this.toSVGPath()}}}removeLastElement(){return u(this,Ri).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const n=[];for(const{line:r}of u(this,Ri)){if(n.push(`M${re.svgRound(r[4])} ${re.svgRound(r[5])}`),r.length===6){n.push("Z");continue}if(r.length===12&&isNaN(r[6])){n.push(`L${re.svgRound(r[10])} ${re.svgRound(r[11])}`);continue}for(let i=6,s=r.length;i<s;i+=6){const[a,o,l,c,h,d]=r.subarray(i,i+6).map(re.svgRound);n.push(`C${a} ${o} ${l} ${c} ${h} ${d}`)}}return n.join("")}serialize([n,r,i,s],a){const o=[],l=[],[c,h,d,f]=T(this,er,TV).call(this);let p,m,y,x,v,w,b,k,_;switch(u(this,Wm)){case 0:_=re._rescale,p=n,m=r+s,y=i,x=-s,v=n+c*i,w=r+(1-h-f)*s,b=n+(c+d)*i,k=r+(1-h)*s;break;case 90:_=re._rescaleAndSwap,p=n,m=r,y=i,x=s,v=n+h*i,w=r+c*s,b=n+(h+f)*i,k=r+(c+d)*s;break;
380case 180:_=re._rescale,p=n+i,m=r,y=-i,x=s,v=n+(1-c-d)*i,w=r+h*s,b=n+(1-c)*i,k=r+(h+f)*s;break;case 270:_=re._rescaleAndSwap,p=n+i,m=r+s,y=-i,x=-s,v=n+(1-h-f)*i,w=r+(1-c-d)*s,b=n+(1-h)*i,k=r+(1-c)*s;break}for(const{line:C,points:P}of u(this,Ri))o.push(_(C,p,m,y,x,a?new Array(C.length):null)),l.push(_(P,p,m,y,x,a?new Array(P.length):null));return{lines:o,points:l,rect:[v,w,b,k]}}static deserialize(n,r,i,s,a,{paths:{lines:o,points:l},rotation:c,thickness:h}){const d=[];let f,p,m,y,x;switch(c){case 0:x=re._rescale,f=-n/i,p=r/s+1,m=1/i,y=-1/s;break;case 90:x=re._rescaleAndSwap,f=-r/s,p=-n/i,m=1/s,y=1/i;break;case 180:x=re._rescale,f=n/i+1,p=-r/s,m=-1/i,y=1/s;break;case 270:x=re._rescaleAndSwap,f=r/s+1,p=n/i+1,m=-1/s,y=-1/i;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 k=new Float32Array(3*(b-2));o.push(k);let[_,C,P,R]=w.subarray(0,4);k.set([NaN,NaN,NaN,NaN,_,C],0);for(let O=4;O<b;O+=2){const M=w[O],D=w[O+1];k.set(re.createBezierPoints(_,C,P,R,M,D),(O-2)*3),[_,C,P,R]=[P,R,M,D]}}}for(let w=0,b=o.length;w<b;w++)d.push({line:x(o[w].map(k=>k??NaN),f,p,m,y),points:x(l[w].map(k=>k??NaN),f,p,m,y)});const v=new this.prototype.constructor;return v.build(d,i,s,1,c,h,a),v}get box(){return u(this,Cr)}updateProperty(n,r){return n==="stroke-width"?T(this,er,NV).call(this,r):null}updateParentDimensions([n,r],i){const[s,a]=T(this,er,_o).call(this);S(this,Ka,n),S(this,Ya,r),S(this,Hm,i);const[o,l]=T(this,er,_o).call(this),c=o-s,h=l-a,d=u(this,Cr);return d[0]-=c,d[1]-=h,d[2]+=2*c,d[3]+=2*h,d}updateRotation(n){return S(this,N0,n),{path:{transform:this.rotationTransform}}}get viewBox(){return u(this,Cr).map(re.svgRound).join(" ")}get defaultProperties(){const[n,r]=u(this,Cr);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${re.svgRound(n)} ${re.svgRound(r)}`}}}get rotationTransform(){const[,,n,r]=u(this,Cr);let i=0,s=0,a=0,o=0,l=0,c=0;switch(u(this,N0)){case 90:s=r/n,a=-n/r,l=n;break;case 180:i=-1,o=-1,l=n,c=r;break;case 270:s=-r/n,a=n/r,c=r;break;default:return""}return`matrix(${i} ${s} ${a} ${o} ${re.svgRound(l)} ${re.svgRound(c)})`}getPathResizingSVGProperties([n,r,i,s]){const[a,o]=T(this,er,_o).call(this),[l,c,h,d]=u(this,Cr);if(Math.abs(h-a)<=re.PRECISION||Math.abs(d-o)<=re.PRECISION){const x=n+i/2-(l+h/2),v=r+s/2-(c+d/2);return{path:{"transform-origin":`${re.svgRound(n)} ${re.svgRound(r)}`,transform:`${this.rotationTransform} translate(${x} ${v})`}}}const f=(i-2*a)/(h-2*a),p=(s-2*o)/(d-2*o),m=h/i,y=d/s;return{path:{"transform-origin":`${re.svgRound(l)} ${re.svgRound(c)}`,transform:`${this.rotationTransform} scale(${m} ${y}) translate(${re.svgRound(a)} ${re.svgRound(o)}) scale(${f} ${p}) translate(${re.svgRound(-a)} ${re.svgRound(-o)})`}}}getPathResizedSVGProperties([n,r,i,s]){const[a,o]=T(this,er,_o).call(this),l=u(this,Cr),[c,h,d,f]=l;if(l[0]=n,l[1]=r,l[2]=i,l[3]=s,Math.abs(d-a)<=re.PRECISION||Math.abs(f-o)<=re.PRECISION){const v=n+i/2-(c+d/2),w=r+s/2-(h+f/2);for(const{line:b,points:k}of u(this,Ri))re._translate(b,v,w,b),re._translate(k,v,w,k);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${re.svgRound(n)} ${re.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const p=(i-2*a)/(d-2*a),m=(s-2*o)/(f-2*o),y=-p*(c+a)+n+a,x=-m*(h+o)+r+o;if(p!==1||m!==1||y!==0||x!==0)for(const{line:v,points:w}of u(this,Ri))re._rescale(v,y,x,p,m,v),re._rescale(w,y,x,p,m,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${re.svgRound(n)} ${re.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([n,r],i){const[s,a]=i,o=u(this,Cr),l=n-o[0],c=r-o[1];if(u(this,Ka)===s&&u(this,Ya)===a)for(const{line:h,points:d}of u(this,Ri))re._translate(h,l,c,h),re._translate(d,l,c,d);else{const h=u(this,Ka)/s,d=u(this,Ya)/a;S(this,Ka,s),S(this,Ya,a);for(const{line:f,points:p}of u(this,Ri))re._rescale(f,l,c,h,d,f),re._rescale(p,l,c,h,d,p);o[2]*=h,o[3]*=d}return o[0]=n,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${re.svgRound(n)} ${re.svgRound(r)}`}}}get defaultSVGProperties(){const n=u(this,Cr);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${re.svgRound(n[0])} ${re.svgRound(n[1])}`,transform:this.rotationTransform||null},bbox:n}}}
380Cr=new WeakMap,N0=new WeakMap,R0=new WeakMap,Ri=new WeakMap,Ka=new WeakMap,Ya=new WeakMap,Hm=new WeakMap,Wm=new WeakMap,Pd=new WeakMap,er=new WeakSet,_o=function(n=u(this,Pd)){const r=u(this,R0)+n/2*u(this,Hm);return u(this,Wm)%180===0?[r/u(this,Ka),r/u(this,Ya)]:[r/u(this,Ya),r/u(this,Ka)]},TV=function(){const[n,r,i,s]=u(this,Cr),[a,o]=T(this,er,_o).call(this,0);return[n+a,r+o,i-2*a,s-2*o]},PV=function(){const n=S(this,Cr,oh.slice());for(const{line:s}of u(this,Ri)){if(s.length<=12){for(let l=4,c=s.length;l<c;l+=6)Q.pointBoundingBox(s[l],s[l+1],n);continue}let a=s[4],o=s[5];for(let l=6,c=s.length;l<c;l+=6){const[h,d,f,p,m,y]=s.subarray(l,l+6);Q.bezierBoundingBox(a,o,h,d,f,p,m,y,n),a=m,o=y}}const[r,i]=T(this,er,_o).call(this);n[0]=Dt(n[0]-r,0,1),n[1]=Dt(n[1]-i,0,1),n[2]=Dt(n[2]+r,0,1),n[3]=Dt(n[3]+i,0,1),n[2]-=n[0],n[3]-=n[1]},NV=function(n){const[r,i]=T(this,er,_o).call(this);S(this,Pd,n);const[s,a]=T(this,er,_o).call(this),[o,l]=[s-r,a-i],c=u(this,Cr);return c[0]-=o,c[1]-=l,c[2]+=2*o,c[3]+=2*l,c};class aA extends _V{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:xt._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,n){e==="stroke-width"&&(n??(n=this["stroke-width"]),n*=this._viewParameters.realScale),super.updateSVGProperty(e,n)}clone(){const e=new aA(this._viewParameters);return e.updateAll(this),e}}var Z1,RV;const np=class np extends S1{constructor(n){super({...n,name:"inkEditor"});E(this,Z1);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(n,r){xt.initialize(n,r),this._defaultDrawingOptions=new aA(r.viewParameters)}static getDefaultDrawingOptions(n){const r=this._defaultDrawingOptions.clone();return r.updateProperties(n),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Se(this,"typesMap",new Map([[Te.INK_THICKNESS,"stroke-width"],[Te.INK_COLOR,"stroke"],[Te.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(n,r,i,s,a){return new ihe(n,r,i,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(n,r,i,s,a,o){return tb.deserialize(n,r,i,s,a,o)}static async deserialize(n,r,i){let s=null;if(n instanceof QR){const{data:{inkLists:o,rect:l,rotation:c,id:h,color:d,opacity:f,borderStyle:{rawWidth:p},popupRef:m,richText:y,contentsObj:x,creationDate:v,modificationDate:w},parent:{page:{pageNumber:b}}}=n;s=n={annotationType:xe.INK,color:Array.from(d),thickness:p,opacity:f,paths:{points:o},boxes:null,pageIndex:b-1,rect:l.slice(0),rotation:c,annotationElementId:h,id:h,deleted:!1,popupRef:m,richText:y,comment:(x==null?void 0:x.str)||null,creationDate:v,modificationDate:w}}const a=await super.deserialize(n,r,i);return a._initialData=s,n.comment&&a.setCommentData(n),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new v1(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Te.INK_COLOR}get colorAndOpacityType(){return Te.INK_COLOR_AND_OPACITY}get opacityType(){return Te.INK_OPACITY}updateParams(n,r){if(n===Te.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(r.color,r.opacity);return}super.updateParams(n,r)}static updateDefaultParams(n,r){if(n===Te.INK_COLOR_AND_OPACITY){super.updateDefaultParams(Te.INK_COLOR,r.color),super.updateDefaultParams(Te.INK_OPACITY,r.opacity);return}super.updateDefaultParams(n,r)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:n,_drawingOptions:r,parent:i}=this;r.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(n,r.toSVGProperties())}static onScaleChangingWhenDrawing(){const n=this._currentParent;n&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:n,thickness:r,opacity:i}){this._drawingOptions=np.getDefaultDrawingOptions({stroke:Q.makeHexColor(...n),"stroke-width":r,"stroke-opacity":i})}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:r,points:i}=this.serializeDraw(n),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":o}}=this,l=Object.assign(super.serialize(n),{color:xt._colorManager.convert(s),opacity:a,thickness:o,paths:{lines:r,points:i}});return this.addComment(l),n?(l.isCopy=!0,l):this.annotationElementId&&!T(this,Z1,RV).call(this,l)?null:(l.id=this.annotationElementId,l)}renderAnnotationElement(n){if(this.deleted)return n.hide(),null;const{points:r,rect:i}=this.serializeDraw(!1);return n.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:r,popup:this.comment}),null}};Z1=new WeakSet,RV=function(n){const{color:r,thickness:i,opacity:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||n.c
380olor.some((o,l)=>o!==r[l])||n.thickness!==i||n.opacity!==s||n.pageIndex!==a},F(np,"_type","ink"),F(np,"_editorType",xe.INK),F(np,"_defaultDrawingOptions",null);let cP=np;class uP extends tb{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const Xb=8,Zg=3;var Nd,et,hP,Qs,IV,OV,dP,hS,MV,DV,LV,fP,pP,jV;class ml{static extractContoursFromText(e,{fontFamily:n,fontStyle:r,fontWeight:i},s,a,o,l){let c=new OffscreenCanvas(1,1),h=c.getContext("2d",{alpha:!1});const d=200,f=h.font=`${r} ${i} ${d}px ${n}`,{actualBoundingBoxLeft:p,actualBoundingBoxRight:m,actualBoundingBoxAscent:y,actualBoundingBoxDescent:x,fontBoundingBoxAscent:v,fontBoundingBoxDescent:w,width:b}=h.measureText(e),k=1.5,_=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||0,b)*k),C=Math.ceil(Math.max(Math.abs(y)+Math.abs(x)||d,Math.abs(v)+Math.abs(w)||d)*k);c=new OffscreenCanvas(_,C),h=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),h.font=f,h.filter="grayscale(1)",h.fillStyle="white",h.fillRect(0,0,_,C),h.fillStyle="black",h.fillText(e,_*(k-1)/2,C*(3-k)/2);const P=T(this,et,fP).call(this,h.getImageData(0,0,_,C).data),R=T(this,et,LV).call(this,P),O=T(this,et,pP).call(this,R),M=T(this,et,dP).call(this,P,_,C,O);return this.processDrawnLines({lines:{curves:M,width:_,height:C},pageWidth:s,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,n,r,i,s){const[a,o,l]=T(this,et,jV).call(this,e),[c,h]=T(this,et,DV).call(this,a,o,l,Math.hypot(o,l)*u(this,Nd).sigmaSFactor,u(this,Nd).sigmaR,u(this,Nd).kernelSize),d=T(this,et,pP).call(this,h),f=T(this,et,dP).call(this,c,o,l,d);return this.processDrawnLines({lines:{curves:f,width:o,height:l},pageWidth:n,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:n,pageHeight:r,rotation:i,innerMargin:s,mustSmooth:a,areContours:o}){i%180!==0&&([n,r]=[r,n]);const{curves:l,width:c,height:h}=e,d=e.thickness??0,f=[],p=Math.min(n/c,r/h),m=p/n,y=p/r,x=[];for(const{points:w}of l){const b=a?T(this,et,MV).call(this,w):w;if(!b)continue;x.push(b);const k=b.length,_=new Float32Array(k),C=new Float32Array(3*(k===2?2:k-2));if(f.push({line:C,points:_}),k===2){_[0]=b[0]*m,_[1]=b[1]*y,C.set([NaN,NaN,NaN,NaN,_[0],_[1]],0);continue}let[P,R,O,M]=b;P*=m,R*=y,O*=m,M*=y,_.set([P,R,O,M],0),C.set([NaN,NaN,NaN,NaN,P,R],0);for(let D=4;D<k;D+=2){const j=_[D]=b[D]*m,U=_[D+1]=b[D+1]*y;C.set(re.createBezierPoints(P,R,O,M,j,U),(D-2)*3),[P,R,O,M]=[O,M,j,U]}}if(f.length===0)return null;const v=o?new uP:new tb;return v.build(f,n,r,1,i,o?0:d,s),{outline:v,newCurves:x,areContours:o,thickness:d,width:c,height:h}}static async compressSignature({outlines:e,areContours:n,thickness:r,width:i,height:s}){let a=1/0,o=-1/0,l=0;for(const w of e){l+=w.length;for(let b=2,k=w.length;b<k;b++){const _=w[b]-w[b-2];a=Math.min(a,_),o=Math.max(o,_)}}let c;a>=-128&&o<=127?c=Int8Array:a>=-32768&&o<=32767?c=Int16Array:c=Int32Array;const h=e.length,d=Xb+Zg*h,f=new Uint32Array(d);let p=0;f[p++]=d*Uint32Array.BYTES_PER_ELEMENT+(l-2*h)*c.BYTES_PER_ELEMENT,f[p++]=0,f[p++]=i,f[p++]=s,f[p++]=n?0:1,f[p++]=Math.max(0,Math.floor(r??0)),f[p++]=h,f[p++]=c.BYTES_PER_ELEMENT;for(const w of e)f[p++]=w.length-2,f[p++]=w[0],f[p++]=w[1];const m=new CompressionStream("deflate-raw"),y=m.writable.getWriter();await y.ready,y.write(f);const x=c.prototype.constructor;for(const w of e){const b=new x(w.length-2);for(let k=2,_=w.length;k<_;k++)b[k-2]=w[k]-w[k-2];y.write(b)}return y.close(),(await new Response(m.readable).bytes()).toBase64()}static async decompressSignature(e){try{const n=Uint8Array.fromBase64(e),{readable:r,writable:i}=new DecompressionStream("deflate-raw"),s=i.getWriter();await s.ready,s.write(n).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(const b of r)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 h=l[2],d=l[3],f=l[4]===0,p=l[5],m=l[6],y=l[7],x=[],v=(Xb+Zg*m)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(y){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<m;b++){const k=l[Zg*b+Xb],_=new Float32Array(k+2);x.push(_);for(let C=0;C<Zg-1;C++)_[C]=l[Zg*b+Xb+C+1];for(let C=0;C<k;C++)_[C+2]=_[C]+w[o++]}return{areContours:f,thickness:p,outlines:x,width:h,height:d}}catch(n){return _e(`decompressSignature: ${n}`),null}}}Nd=new WeakMap,et=new WeakSet,hP=function(e,n,r,i){return r-=e,i-=n,r===0?i>0?0:4:r===1?i+6:2-i},Qs=new WeakMap,IV=function(e,n,r,i,s,a,o){const l=T(this,et,hP).call(this,r,i,s,a);for(let c=0;c<8;c++){const h=(-c+l-o+16)%8,d=u(this,Qs)[2*h],f=u(this,Qs)[2*h+1];if(e[(r+d)*n+(i+f)]!==0)return h}return-1},OV=function(e,n,r,i,s,a,o){const l=T(this,et,hP).call(this,r,i,s,a);for(let c=0;c<8;c++){const h=(c+l+o+16)%8,d=u(this,Qs)[2*h],f=u(this,Qs)[2*h+1];if(e[(r+d)*n+(i+f)]!==0)return h}return-1},dP=function(e,n,r,i){const s=e.length,a=new Int32Array(s);for(let h=0;h<s;h++)a[h]=e[h]<=i?1:0;for(let h=1;h<r-1;h++)a[h*n]=a[h*n+n-1]=0;for(let h=0;h<n;h++)a[h]=a[n*r-1-h]=0;let o=1,l;const c=[];for(let h=1;h<r-1;h++){l=1;for(let d=1;d<n-1;d++){const f=h*n+d,p=a[f];if(p===0)continue;let m=h,y=d;if(p===1&&a[f-1]===0)o+=1,y-=1;else if(p>=1&&a[f+1]===0)o+=1,y+=1,p>1&&(l=p);else{p!==1&&(l=Math.abs(p));continue}const x=[d,h],v=y===d+1,w={isHole:v,points:x,id:o,parent:0};c.push(w);let b;for(const D of c)if(D.id===l){b=D;break}b?b.isHole?w.parent=v?b.parent:l:w.parent=v?l:b.parent:w.parent=v?l:0;const k=T(this,et,IV).call(this,a,n,h,d,m,y,0);if(k===-1){a[f]=-o,a[f]!==1&&(l=Math.abs(a[f]));continue}let _=u(this,Qs)[2*k],C=u(this,Qs)[2*k+1];const P=h+_,R=d+C;m=P,y=R;let O=h,M=d;for(;;){const D=T(this,et,OV).call(this,a,n,O,M,m,y,1);_=u(this,Qs)[2*D],C=u(this,Qs)[2*D+1];const j=O+_,U=M+C;x.push(U,j);const B=O*n+M;if(a[B+1]===0?a[B]=-o:a[B]===1&&(a[B]=o),j===h&&U===d&&O===P&&M===R){a[f]!==1&&(l=Math.abs(a[f]));break}else m=O,y=M,O=j,M=U}}}return c},hS=function(e,n,r,i){if(r-n<=4){for(let P=n;P<r-2;P+=2)i.push(e[P],e[P+1]);return}const s=e[n],a=e[n+1],o=e[r-4]-s,l=e[r-3]-a,c=Math.hypot(o,l),h=o/c,d=l/c,f=h*a-d*s,p=l/o,m=1/c,y=Math.atan(p),x=Math.cos(y),v=Math.sin(y),w=m*(Math.abs(x)+Math.abs(v)),b=m*(1-w+w**2),k=Math.max(Math.atan(Math.abs(v+x)*b),Math.atan(Math.abs(v-x)*b));let _=0,C=n;for(let P=n+2;P<r-2;P+=2){const R=Math.abs(f-h*e[P+1]+d*e[P]);R>
380_&&(C=P,_=R)}_>(c*k)**2?(T(this,et,hS).call(this,e,n,C+2,i),T(this,et,hS).call(this,e,C,r,i)):i.push(s,a)},MV=function(e){const n=[],r=e.length;return T(this,et,hS).call(this,e,0,r,n),n.push(e[r-2],e[r-1]),n.length<=4?null:n},DV=function(e,n,r,i,s,a){const o=new Float32Array(a**2),l=-2*i**2,c=a>>1;for(let y=0;y<a;y++){const x=(y-c)**2;for(let v=0;v<a;v++)o[y*a+v]=Math.exp((x+(v-c)**2)/l)}const h=new Float32Array(256),d=-2*s**2;for(let y=0;y<256;y++)h[y]=Math.exp(y**2/d);const f=e.length,p=new Uint8Array(f),m=new Uint32Array(256);for(let y=0;y<r;y++)for(let x=0;x<n;x++){const v=y*n+x,w=e[v];let b=0,k=0;for(let C=0;C<a;C++){const P=y+C-c;if(!(P<0||P>=r))for(let R=0;R<a;R++){const O=x+R-c;if(O<0||O>=n)continue;const M=e[P*n+O],D=o[C*a+R]*h[Math.abs(M-w)];b+=M*D,k+=D}}const _=p[v]=Math.round(b/k);m[_]++}return[p,m]},LV=function(e){const n=new Uint32Array(256);for(const r of e)n[r]++;return n},fP=function(e){const n=e.length,r=new Uint8ClampedArray(n>>2);let i=-1/0,s=1/0;for(let o=0,l=r.length;o<l;o++){const c=r[o]=e[o<<2];i=Math.max(i,c),s=Math.min(s,c)}const a=255/(i-s);for(let o=0,l=r.length;o<l;o++)r[o]=(r[o]-s)*a;return r},pP=function(e){let n,r=-1/0,i=-1/0;const s=e.findIndex(l=>l!==0);let a=s,o=s;for(n=s;n<256;n++){const l=e[n];l>r&&(n-a>i&&(i=n-a,o=n-1),r=l,a=n)}for(n=o-1;n>=0&&!(e[n]>e[n+1]);n--);return n},jV=function(e){const n=e,{width:r,height:i}=e,{maxDim:s}=u(this,Nd);let a=r,o=i;if(r>s||i>s){let f=r,p=i,m=Math.log2(Math.max(r,i)/s);const y=Math.floor(m);m=m===y?y-1:y;for(let v=0;v<m;v++){a=Math.ceil(f/2),o=Math.ceil(p/2);const w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(e,0,0,f,p,0,0,a,o),f=a,p=o,e!==n&&e.close(),e=w.transferToImageBitmap()}const x=Math.min(s/a,s/o);a=Math.round(a*x),o=Math.round(o*x)}const c=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,a,o),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,a,o);const h=c.getImageData(0,0,a,o).data;return[T(this,et,fP).call(this,h),a,o]},E(ml,et),E(ml,Nd,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),E(ml,Qs,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class JR extends _V{constructor(){super(),super.updateProperties({fill:xt._defaultLineColor,"stroke-width":0})}clone(){const e=new JR;return e.updateAll(this),e}}class ZR extends aA{constructor(e){super(e),super.updateProperties({stroke:xt._defaultLineColor,"stroke-width":1})}clone(){const e=new ZR(this._viewParameters);return e.updateAll(this),e}}var Gc,Xa,qc,Rd;const pi=class pi extends S1{constructor(n){super({...n,mustBeCommitted:!0,name:"signatureEditor"});E(this,Gc,!1);E(this,Xa,null);E(this,qc,null);E(this,Rd,null);this._willKeepAspectRatio=!0,S(this,qc,n.signatureData||null),S(this,Xa,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(n,r){xt.initialize(n,r),this._defaultDrawingOptions=new JR,this._defaultDrawnSignatureOptions=new ZR(r.viewParameters)}static getDefaultDrawingOptions(n){const r=this._defaultDrawingOptions.clone();return r.updateProperties(n),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Se(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!u(this,Xa)}}static computeTelemetryFinalData(n){const r=n.get("hasDescription");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let n,r;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,n=this.x,r=this.y),super.render(),this._drawId===null)if(u(this,qc)){const{lines:s,mustSmooth:a,areContours:o,description:l,uuid:c,heightInPage:h}=u(this,qc),{rawDims:{pageWidth:d,pageHeight:f},rotation:p}=this.parent.viewport,m=ml.processDrawnLines({lines:s,pageWidth:d,pageHeight:f,rotation:p,innerMargin:pi._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(m,h,l,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:u(this,Xa)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(n,r)),this.div}setUuid(n){S(this,Rd,n),this.addEditToolbar()}getUuid(){return u(this,Rd)}get description(){return u(this,Xa)}set description(n){S(this,Xa,n),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:n})),super.addEditToolbar().then(r=>{r==null||r.updateEditSignatureButton(n)}))}getSignaturePreview(){const{newCurves:n,areContours:r,thickness:i,width:s,height:a}=u(this,qc),o=Math.max(s,a),l=ml.processDrawnLines({lines:{curves:n.map(c=>({points:c})),thickness:i,width:s,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:r});return{areContours:r,outline:l.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(n,r,i,s){const{x:a,y:o}=this,{outline:l}=S(this,qc,n);S(this,Gc,l instanceof uP),this.description=i;let c;u(this,Gc)?c=pi.getDefaultDrawingOptions():(c=pi._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:c});const[,h]=this.pageDimensions;let d=r/h;d=d>=1?.5:d,this.width*=d/this.height,this.width>=1&&(d*=.9/this.width,this.width=.9),this.height=d,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(n){const{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return ml.process(n,r,i,s,pi._INNER_MARGIN)}getFromText(n,r){const{rawDims:{pageWidth:i,pageHeight:s},rotation:a}=this.parent.viewport;return ml.extractContoursFromText(n,r,i,s,a,pi._INNER_MARGIN)}getDrawnSignature(n){const{rawDims:{pageWidth:r,pageHeight:i},rotation:s}=this.parent.viewport;return ml.processDrawnLines({lines:n,pageWidth:r,pageHeight:i,rotation:s,innerMargin:pi._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:n,thickness:r}){n?this._drawingOptions=pi.getDefaultDrawingOptions():(this._drawingOptions=pi._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(n=!1){if(this.isEmpty())return null;const{lines:r,points:i}=this.serializeDraw(n),{_drawingOptions:{"stroke-width":s}}=this,a=Object.assign(super.serialize(n),{isSignature:!0,areContours:u(this,Gc),color:[0,0,0],thickness:u(this,Gc)?0:s});return this.addComment(a),n?(a.paths={lines:r,points:i},a.uuid=u(this,Rd),a.isCopy=!0):a.lines=r,u(this,Xa)&&(a.accessibilityData={type:"Figure",alt:u(this,Xa)}),a}static deserializeDraw(n,r,i,s,a,o){return o.areContours?uP.deserialize(n,r,i,s,a,o):tb.deserialize(n,r,i,s,a,o)}static async deserialize(n,r,i){var a;const s=await super.deserialize(n,r,i);return S(s,Gc,n.areContours),s.description=((a=n.accessibilityData)==null?void 0:a.alt)||"",S(s,Rd,n.uuid),s}};Gc=new WeakMap,Xa=new WeakMap,qc=new WeakMap,Rd=new WeakMap,F(pi,"_type","signature"),F(pi,"_editorType",xe.SIGNATURE),F(pi,"_defaultDrawingOptions",null);let mP=pi;var Mt,Fn,Kc,ul,Yc,Gm,hl,Id,Qa,Ii,qm,We,Py,Ny,dS,fS,pS,yP,mS,FV;class gP extends xt{constructor(n){super({...n,name:"stampEditor"});E(this,We);E(this,Mt,null);E(this,Fn,null);E(this,Kc,null);E(this,ul,null);E(this,Yc,null);E(this,Gm,"");E(this,hl,null);E(this,Id,!1);E(this,Qa,null);E(this,Ii,!1);E(this,qm,!1);S(this,ul,n.bitmapUrl),S(this,Yc,n.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(n,r){xt.initialize(n,r)}static isHandlingMimeForPasting(n){return nT.includes(n)}static paste(n,r){r.pasteEditor({mode:xe.STAMP},{bitmapFile:n.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var n;return{type:"stamp",hasAltText:!!((n=this.altTextData)!=null&&n.altText)}}static computeTelemetryFinalData(n){const r=n.get("hasAltText");return{hasAltText:r.get(!0)??0,hasNoAltText:r.get(!1)??0}}async mlGuessAltText(n=null,r=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:a,height:o}=n||this.copyCanvas(null,null,!0).imageData,l=await i.guess({name:"altText",request:{data:s,width:a,height:o,channels:s.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),r&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var n;u(this,Fn)&&(S(this,Mt,null),this._uiManager.imageManager.deleteId(u(this,Fn)),(n=u(this,hl))==null||n.remove(),S(this,hl,null),u(this,Qa)&&(clearTimeout(u(this,Qa)),S(this,Qa,null))),super.remove()}rebuild(){if(!this.parent){u(this,Fn)&&T(this,We,dS).call(this);return}super.rebuild(),this.div!==null&&(u(this,Fn)&&u(this,hl)===null&&T(this,We,dS).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(n){this._isDraggable=!0,n&&this.div.focus()}isEmpty(){return!(u(this,Kc)||u(this,Mt)||u(this,ul)||u(this,Yc)||u(this,Fn)||u(this,Id))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}
380render(){if(this.div)return this.div;let n,r;return this._isCopy&&(n=this.x,r=this.y),super.render(),this.div.hidden=!0,this.createAltText(),u(this,Id)||(u(this,Mt)?T(this,We,fS).call(this):T(this,We,dS).call(this)),this._isCopy&&this._moveAfterPaste(n,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(n,r){const{id:i,bitmap:s}=this._uiManager.imageManager.getFromCanvas(n,r);r.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(S(this,Fn,i),s&&S(this,Mt,s),S(this,Id,!1),T(this,We,fS).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;u(this,Qa)!==null&&clearTimeout(u(this,Qa)),S(this,Qa,setTimeout(()=>{S(this,Qa,null),T(this,We,yP).call(this)},200))}copyCanvas(n,r,i=!1){n||(n=224);const{width:s,height:a}=u(this,Mt),o=new go;let l=u(this,Mt),c=s,h=a,d=null;if(r){if(s>r||a>r){const P=Math.min(r/s,r/a);c=Math.floor(s*P),h=Math.floor(a*P)}d=document.createElement("canvas");const p=d.width=Math.ceil(c*o.sx),m=d.height=Math.ceil(h*o.sy);u(this,Ii)||(l=T(this,We,pS).call(this,p,m));const y=d.getContext("2d");y.filter=this._uiManager.hcmFilter;let x="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":vce.isDarkMode&&(x="#8f8f9d",v="#42414d");const w=15,b=w*o.sx,k=w*o.sy,_=new OffscreenCanvas(b*2,k*2),C=_.getContext("2d");C.fillStyle=x,C.fillRect(0,0,b*2,k*2),C.fillStyle=v,C.fillRect(0,0,b,k),C.fillRect(b,k,b,k),y.fillStyle=y.createPattern(_,"repeat"),y.fillRect(0,0,p,m),y.drawImage(l,0,0,l.width,l.height,0,0,p,m)}let f=null;if(i){let p,m;if(o.symmetric&&l.width<n&&l.height<n)p=l.width,m=l.height;else if(l=u(this,Mt),s>n||a>n){const v=Math.min(n/s,n/a);p=Math.floor(s*v),m=Math.floor(a*v),u(this,Ii)||(l=T(this,We,pS).call(this,p,m))}const x=new OffscreenCanvas(p,m).getContext("2d",{willReadFrequently:!0});x.drawImage(l,0,0,l.width,l.height,0,0,p,m),f={width:p,height:m,data:x.getImageData(0,0,p,m).data}}return{canvas:d,width:c,height:h,imageData:f}}static async deserialize(n,r,i){var x;let s=null,a=!1;
380if(n instanceof eV){const{data:{rect:v,rotation:w,id:b,structParent:k,popupRef:_,richText:C,contentsObj:P,creationDate:R,modificationDate:O},container:M,parent:{page:{pageNumber:D}},canvas:j}=n;let U,B;j?(delete n.canvas,{id:U,bitmap:B}=i.imageManager.getFromCanvas(M.id,j),j.remove()):(a=!0,n._hasNoCanvas=!0);const z=((x=await r._structTree.getAriaAttributes(`${ep}${b}`))==null?void 0:x.get("aria-label"))||"";s=n={annotationType:xe.STAMP,bitmapId:U,bitmap:B,pageIndex:D-1,rect:v.slice(0),rotation:w,annotationElementId:b,id:b,deleted:!1,accessibilityData:{decorative:!1,altText:z},isSvg:!1,structParent:k,popupRef:_,richText:C,comment:(P==null?void 0:P.str)||null,creationDate:R,modificationDate:O}}const o=await super.deserialize(n,r,i),{rect:l,bitmap:c,bitmapUrl:h,bitmapId:d,isSvg:f,accessibilityData:p}=n;a?(i.addMissingCanvas(n.id,o),S(o,Id,!0)):d&&i.imageManager.isValidId(d)?(S(o,Fn,d),c&&S(o,Mt,c)):S(o,ul,h),S(o,Ii,f);const[m,y]=o.pageDimensions;return o.width=(l[2]-l[0])/m,o.height=(l[3]-l[1])/y,p&&(o.altTextData=p),o._initialData=s,n.comment&&o.setCommentData(n),S(o,qm,!!s),o}serialize(n=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(n),{bitmapId:u(this,Fn),isSvg:u(this,Ii)});if(this.addComment(i),n)return i.bitmapUrl=T(this,We,mS).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=T(this,We,FV).call(this,i);return l.isSame?null:(l.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(r===null)return i;r.stamps||(r.stamps=new Map);const o=u(this,Ii)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!r.stamps.has(u(this,Fn)))r.stamps.set(u(this,Fn),{area:o,serialized:i}),i.bitmap=T(this,We,mS).call(this,!1);else if(u(this,Ii)){const l=r.stamps.get(u(this,Fn));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=T(this,We,mS).call(this,!1))}return i}renderAnnotationElement(n){return this.deleted?(n.hide(),null):(n.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}Mt=new WeakMap,Fn=new WeakMap,Kc=new WeakMap,ul=new WeakMap,Yc=new WeakMap,Gm=new WeakMap,hl=new WeakMap,Id=new WeakMap,Qa=new WeakMap,Ii=new WeakMap,qm=new WeakMap,We=new WeakSet,Py=function(n,r=!1){if(!n){this.remove();return}S(this,Mt,n.bitmap),r||(S(this,Fn,n.id),S(this,Ii,n.isSvg)),n.file&&S(this,Gm,n.file.name),T(this,We,fS).call(this)},Ny=function(){if(S(this,Kc,null),this._uiManager.enableWaiting(!1),!!u(this,hl)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,Mt)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&u(this,Mt)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},dS=function(){if(u(this,Fn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(u(this,Fn)).then(i=>T(this,We,Py).call(this,i,!0)).finally(()=>T(this,We,Ny).call(this));return}if(u(this,ul)){const i=u(this,ul);S(this,ul,null),this._uiManager.enableWaiting(!0),S(this,Kc,this._uiManager.imageManager.getFromUrl(i).then(s=>T(this,We,Py).call(this,s)).finally(()=>T(this,We,Ny).call(this)));return}if(u(this,Yc)){const i=u(this,Yc);S(this,Yc,null),this._uiManager.enableWaiting(!0),S(this,Kc,this._uiManager.imageManager.getFromFile(i).then(s=>T(this,We,Py).call(this,s)).finally(()=>T(this,We,Ny).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=nT.join(",");const r=this._uiManager._signal;S(this,Kc,new Promise(i=>{n.addEventListener("change",async()=>{if(!n.files||n.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const s=await this._uiManager.imageManager.getFromFile(n.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),T(this,We,Py).call(this,s)}i()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),i()},{signal:r})}).finally(()=>T(this,We,Ny).call(this))),n.click()},fS=function(){var c;const{div:n}=this;let{width:r,height:i}=u(this,Mt);const[s,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*s,i=this.height*a;else if(r>o*s||i>o*a){const h=Math.min(o*s/r,o*a/i);r*=h,i*=h}this._uiManager.enableWaiting(!1);const l=S(this,hl,document.createElement("canvas"));l.setAttribute("role","img"),this.addContainer(l),this.width=r/s,this.height=i/a,this.setDims(),(c=this._initialOptions)!=null&&c.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(n.hidden=!1),T(this,We,yP).call(this),u(this,qm)||(this.parent.addUndoableEditor(this),S(this,qm,!0)),this._reportTelemetry({action:"inserted_image"}),u(this,Gm)&&this.div.setAttribute("aria-description",u(this,Gm)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},pS=function(n,r){const{width:i,height:s}=u(this,Mt);let a=i,o=s,l=u(this,Mt);for(;a>2*n||o>2*r;){const c=a,h=o;a>2*n&&(a=Math.ceil(a/2)),o>2*r&&(o=Math.ceil(o/2));const d=new OffscreenCanvas(a,o);d.getContext("2d").drawImage(l,0,0,c,h,0,0,a,o),l=d.transferToImageBitmap()}return l},yP=function(){const[n,r]=this.parentDimensions,{width:i,height:s}=this,a=new go,o=Math.ceil(i*n*a.sx),l=Math.ceil(s*r*a.sy),c=u(this,hl);if(!c||c.width===o&&c.height===l)return;c.width=o,c.height=l;const h=u(this,Ii)?u(this,Mt):T(this,We,pS).call(this,o,l),d=c.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(h,0,0,h.width,h.height,0,0,o,l)},mS=function(n){if(n){if(u(this,Ii)){const s=this._uiManager.imageManager.getSvgUrl(u(this,Fn));if(s)return s}const r=document.createElement("canvas");return{width:r.width,height:r.height}=u(this,Mt),r.getContext("2d").drawImage(u(this,Mt),0,0),r.toDataURL()}if(u(this,Ii)){const[r,i]=this.pageDimensions,s=Math.round(this.width*r*Eu.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*Eu.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(s,a);return o.getContext("2d").drawImage(u(this,Mt),0,0,u(this,Mt).width,u(this,Mt).height,0,0,s,a),o.transferToImageBitmap()}return structuredClone(u(this,Mt))},FV=function(n){var o;const{pageIndex:r,accessibilityData:{altText:i}}=this._initialData,s=n.pageIndex===r,a=(((o=n.accessibilityData)==null?void 0:o.alt)||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}},F(gP,"_type","stamp"),F(gP,"_editorType",xe.STAMP);var Od,Km,Xc,Qc,dl,Xr,Jc,Ym,Xm,Js,fl,Bn,pl,Zc,Qm,le,eu,ft,wP,BV,ka,bP,xP,gS;const Ds=class Ds{constructor({uiManager:e,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:c,l10n:h}){E(this,ft);E(this,Od);E(this,Km,!1);E(this,Xc,null);E(this,Qc,null);E(this,dl,null);E(this,Xr,new Map);E(this,Jc,!1);E(this,Ym,!1);E(this,Xm,!1);E(this,Js,null);E(this,fl,null);E(this,Bn,null);E(this,pl,null);E(this,Zc,null);E(this,Qm,-1);E(this,le);const d=[...u(Ds,eu).values()];if(!Ds._initialized){Ds._initialized=!0;for(const f of d)f.initialize(h,e)}
380e.registerEditorTypes(d),S(this,le,e),this.pageIndex=n,this.div=r,S(this,Od,s),S(this,Xc,a),this.viewport=c,S(this,Bn,l),this.drawLayer=o,this._structTree=i,u(this,le).addLayer(this)}get isEmpty(){return u(this,Xr).size===0}get isInvisible(){return this.isEmpty&&u(this,le).getMode()===xe.NONE}updateToolbar(e){u(this,le).updateToolbar(e)}updateMode(e=u(this,le).getMode()){switch(T(this,ft,gS).call(this),e){case xe.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case xe.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case xe.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;if(n.toggle("nonEditing",!1),e===xe.POPUP)n.toggle("commentEditing",!0);else{n.toggle("commentEditing",!1);for(const r of u(Ds,eu).values())n.toggle(`${r._type}Editing`,e===r._editorType)}this.div.hidden=!1}hasTextLayer(e){var n;return e===((n=u(this,Bn))==null?void 0:n.div)}setEditingState(e){u(this,le).setEditingState(e)}addCommands(e){u(this,le).addCommands(e)}cleanUndoStack(e){u(this,le).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var n;(n=u(this,Xc))==null||n.togglePointerEvents(e)}async enable(){var r;S(this,Xm,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),(r=u(this,Zc))==null||r.abort(),S(this,Zc,null);const e=new Set;for(const i of u(this,ft,wP))i.enableEditing(),i.show(!0),i.annotationElementId&&(u(this,le).removeChangedExistingAnnotation(i),e.add(i.annotationElementId));const n=u(this,Xc);if(n)for(const i of n.getEditableAnnotations()){if(i.hide(),u(this,le).isDeletedAnnotationElement(i.data.id)||e.has(i.data.id))continue;const s=await this.deserialize(i);s&&(this.addOrRebuild(s),s.enableEditing())}S(this,Xm,!1),u(this,le)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){var i;if(S(this,Ym,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),u(this,Bn)&&!u(this,Zc)){S(this,Zc,new AbortController);const s=u(this,le).combinedSignal(u(this,Zc));u(this,Bn).div.addEventListener("pointerdown",a=>{const{clientX:l,clientY:c,timeStamp:h}=a,d=u(this,Qm);if(h-d>500){S(this,Qm,h);return}S(this,Qm,-1);const{classList:f}=this.div;f.toggle("getElements",!0);const p=document.elementsFromPoint(l,c);if(f.toggle("getElements",!1),!this.div.contains(p[0]))return;let m;const y=new RegExp(`^${$v}[0-9]+$`);for(const v of p)if(y.test(v.id)){m=v.id;break}if(!m)return;const x=u(this,Xr).get(m);(x==null?void 0:x.annotationElementId)===null&&(zt(a),x.dblclick(a))},{signal:s,capture:!0})}const e=u(this,Xc),n=[];if(e){const s=new Map,a=new Map;for(const o of u(this,ft,wP)){if(o.disableEditing(),!o.annotationElementId){n.push(o);continue}if(o.serialize()!==null){s.set(o.annotationElementId,o);continue}else a.set(o.annotationElementId,o);(i=this.getEditableAnnotation(o.annotationElementId))==null||i.show(),o.remove()}for(const o of e.getEditableAnnotations()){const{id:l}=o.data;if(u(this,le).isDeletedAnnotationElement(l)){o.updateEdited({deleted:!0});continue}let c=a.get(l);if(c){c.resetAnnotationElement(o),c.show(!1),o.show();continue}c=s.get(l),c&&(u(this,le).addChangedExistingAnnotation(c),c.renderAnnotationElement(o)&&c.show(!1)),o.show()}}T(this,ft,gS).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const s of u(Ds,eu).values())r.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e==null||e.updateFakeAnnotations(n),S(this,Ym,!1)}getEditableAnnotation(e){var n;return((n=u(this,Xc))==null?void 0:n.getEditableAnnotation(e))||null}setActiveEditor(e){u(this,le).getActive()!==e&&u(this,le).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=u(this,Bn))!=null&&e.div&&!u(this,pl)){S(this,pl,new AbortController);const n=u(this,le).combinedSignal(u(this,pl));u(this,Bn).div.addEventListener("pointerdown",T(this,ft,BV).bind(this),{signal:n}),u(this,Bn).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=u(this,Bn))!=null&&e.div&&u(this,pl)&&(u(this,pl).abort(),S(this,pl,null),u(this,Bn).div.classList.remove("highlighting"))}enableClick(){if(u(this,Qc))return;S(this,Qc,new AbortController);const e=u(this,le).combinedSignal(u(this,Qc));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const n=this.pointerup.bind(this);this.div.addEventListener("pointerup",n,{signal:e}),this.div.addEventListener("pointercancel",n,{signal:e})}disableClick(){var e;(e=u(this,Qc))==null||e.abort(),S(this,Qc,null)}attach(e){u(this,Xr).set(e.id,e);const{annotationElementId:n}=e;n&&u(this,le).isDeletedAnnotationElement(n)&&u(this,le).removeDeletedAnnotationElement(e)}detach(e){var n;u(this,Xr).delete(e.id),(n=u(this,Od))==null||n.removePointerInTextLayer(e.contentDiv),!u(this,Ym)&&e.annotationElementId&&u(this,le).addDeletedAnnotationElement(e)}remove(e){this.detach(e),u(this,le).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var n;e.parent!==this&&(e.parent&&e.annotationElementId&&(u(this,le).addDeletedAnnotationElement(e),xt.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(n=e.parent)==null||n.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}
380add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),u(this,le).addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!u(this,Xm)),u(this,le).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!u(this,dl)&&(e._focusEventsAllowed=!1,S(this,dl,setTimeout(()=>{S(this,dl,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:u(this,le)._signal}),n.focus())},0))),e._structTreeParentId=(r=u(this,Od))==null?void 0:r.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 n=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:n,undo:r,mustExec:!1})}getEditorByUID(e){for(const n of u(this,Xr).values())if(n.uid===e)return n;return null}combinedSignal(e){return u(this,le).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=u(this,ft,ka))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,n){this.updateToolbar(e),await u(this,le).updateMode(e.mode);const{offsetX:r,offsetY:i}=T(this,ft,xP).call(this),s=u(this,le).getId(),a=T(this,ft,bP).call(this,{parent:this,id:s,x:r,y:i,uiManager:u(this,le),isCentered:!0,...n});a&&this.add(a)}async deserialize(e){var n;return await((n=u(Ds,eu).get(e.annotationType??e.annotationEditorType))==null?void 0:n.deserialize(e,this,u(this,le)))||null}createAndAddNewEditor(e,n,r={}){const i=u(this,le).getId(),s=T(this,ft,bP).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:u(this,le),isCentered:n,...r});return s&&this.add(s),s}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(T(this,ft,xP).call(this),!0,e)}setSelected(e){u(this,le).setSelected(e)}toggleSelected(e){u(this,le).toggleSelected(e)}unselect(e){u(this,le).unselect(e)}pointerup(e){var i;const{isMac:n}=bn.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div||!u(this,Jc)||(S(this,Jc,!1),(i=u(this,ft,ka))!=null&&i.isDrawer&&u(this,ft,ka).supportMultipleDrawings))return;if(!u(this,Km)){S(this,Km,!0);return}const r=u(this,le).getMode();if(r===xe.STAMP||r===xe.POPUP||r===xe.SIGNATURE){u(this,le).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var i;if(u(this,le).getMode()===xe.HIGHLIGHT&&this.enableTextSelection(),u(this,Jc)){S(this,Jc,!1);return}const{isMac:n}=bn.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;if(S(this,Jc,!0),(i=u(this,ft,ka))!=null&&i.isDrawer){this.startDrawingSession(e);return}const r=u(this,le).getActive();S(this,Km,!r||r.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),u(this,Js)){u(this,ft,ka).startDrawing(this,u(this,le),!1,e);return}u(this,le).setCurrentDrawingSession(this),S(this,Js,new AbortController);const n=u(this,le).combinedSignal(u(this,Js));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(S(this,fl,null),this.commitOrRemove())},{signal:n}),u(this,ft,ka).startDrawing(this,u(this,le),!1,e)}pause(e){if(e){const{activeElement:n}=document;this.div.contains(n)&&S(this,fl,n);return}u(this,fl)&&setTimeout(()=>{var n;(n=u(this,fl))==null||n.focus(),S(this,fl,null)},0)}endDrawingSession(e=!1){return u(this,Js)?(u(this,le).setCurrentDrawingSession(null),u(this,Js).abort(),S(this,Js,null),S(this,fl,null),u(this,ft,ka).endDrawing(e)):null}findNewParent(e,n,r){const i=u(this,le).findParent(n,r);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return u(this,Js)?(this.endDrawingSession(),!0):!1}onScaleChanging(){u(this,Js)&&u(this,ft,ka).onScaleChangingWhenDrawing(this)}destroy(){var e,n;this.commitOrRemove(),((e=u(this,le).getActive())==null?void 0:e.parent)===this&&(u(this,le).commitOrRemove(),u(this,le).setActiveEditor(null)),u(this,dl)&&(clearTimeout(u(this,dl)),S(this,dl,null));for(const r of u(this,Xr).values())(n=u(this,Od))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,u(this,Xr).clear(),u(this,le).removeLayer(this)}async render({viewport:e}){this.viewport=e,Gd(this.div,e);for(const n of u(this,le).getEditors(this.pageIndex))this.add(n),n.rebuild();await u(this,le).findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){u(this,le).commitOrRemove(),T(this,ft,gS).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,Gd(this.div,{rotation:r}),n!==r)for(const i of u(this,Xr).values())i.rotate(r)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return u(this,le).viewParameters.realScale}};Od=new WeakMap,Km=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,dl=new WeakMap,Xr=new WeakMap,Jc=new WeakMap,Ym=new WeakMap,Xm=new WeakMap,Js=new WeakMap,fl=new WeakMap,Bn=new WeakMap,pl=new WeakMap,Zc=new WeakMap,Qm=new WeakMap,le=new WeakMap,eu=new WeakMap,ft=new WeakSet,wP=function(){return u(this,Xr).size!==0?u(this,Xr).values():u(this,le).getEditors(this.pageIndex)},BV=function(e){u(this,le).unselectAll();const{target:n}=e;if(n===u(this,Bn).div||(n.getAttribute("role")==="img"||n.classList.contains("endOfContent")||n.classList.contains("textLayerImagePlaceholder"))&&u(this,Bn).div.contains(n)){const{isMac:r}=bn.platform;if(e.button!==0||e.ctrlKey&&r)return;u(this,le).showAllEditors("highlight",!0,!0),u(this,Bn).div.classList.add("free"),this.toggleDrawing(),x1.startHighlighting(this,u(this,le).direction==="ltr",{target:u(this,Bn).div,x:e.x,y:e.y}),u(this,Bn).div.addEventListener("pointerup",()=>{u(this,Bn).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:u(this,le)._signal}),e.preventDefault()}},ka=function(){return u(Ds,eu).get(u(this,le).getMode())},bP=function(e){const n=u(this,ft,ka);return n?new n.prototype.constructor(e):null},xP=function(){const{x:e,y:n,width:r,height:i}=this.boundingClientRect,s=Math.max(0,e),a=Math.max(0,n),o=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,n+i),c=(s+o)/2-e,h=(a+l)/2-n,[d,f]=this.viewport.rotation%180===0?[c,h]:[h,c];return{offsetX:d,offsetY:f}},gS=function(){for(const e of u(this,Xr).values())e.isEmpty()&&e.remove()},F(Ds,"_initialized",!1),E(Ds,eu,new Map([ZT,cP,gP,x1,mP].map(e=>[e._editorType,e])));let vP=Ds;var Zs,Tr,Md,I0,ek,$V,vo,kP,UV,AP;const En=class En{constructor(){E(this,vo);E(this,Zs,null);E(this,Tr,new Map);E(this,Md,new Map)}setParent(e){if(!u(this,Zs)){S(this,Zs,e);return}if(u(this,Zs)!==e){if(u(this,Tr).size>0)for(const n of u(this,Tr).values())n.remove(),e.append(n);S(this,Zs,e)}}static get _svgFactory(){return Se(this,"_svgFactory",new w1)}draw(e,n=!1,r=!1){const i=jt(En,I0)._++,s=T(this,vo,kP).call(this),a=En._svgFactory.createElement("defs");s.append(a);const o=En._svgFactory.createElement("path");a.append(o);const l=`path_${i}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),n&&u(this,Md).set(i,o);const c=r?T(this,vo,UV).call(this,a,l):null,h=En._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(s,e),u(this,Tr).set(i,s),{id:i,clipPathId:`url(#${c})`}}drawOutline(e,n){const r=jt(En,I0)._++,i=T(this,vo,kP).call(this),s=En._svgFactory.createElement("defs");i.append(s);const a=En._svgFactory.createElement("path");s.append(a);const o=`path_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(n){const d=En._svgFactory.createElement("mask");s.append(d),l=`mask_${r}`,d.setAttribute("id",l),d.setAttribute("maskUnits","objectBoundingBox");const f=En._svgFactory.createElement("rect");d.append(f),f.setAttribute("width","1"),f.setAttribute("height","1"),f.setAttribute("fill","white");const p=En._svgFactory.createElement("use");d.append(p),p.setAttribute("href",`#${o}`),p.setAttribute("stroke","none"),p.setAttribute("fill","black"),p.setAttribute("fill-rule","nonzero"),p.classList.add("mask")}const c=En._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);const h=c.cloneNode();return i.append(h),c.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(i,e),u(this,Tr).set(r,i),r}finalizeDraw(e,n){u(this,Md).delete(e),this.updateProperties(e,n)}updateProperties(e,n){var l;if(!n)return;const{root:r,bbox:i,rootClass:s,path:a}=n,o=typeof e=="number"?u(this,Tr).get(e):e;if(o){if(r&&T(this,vo,AP).call(this,o,r),i&&T(l=En,ek,$V).call(l,o,i),s){const{classList:c}=o;for(const[h,d]of Object.entries(s))c.toggle(h,d)}if(a){const h=o.firstElementChild.firstElementChild;T(this,vo,AP).call(this,h,a)}}}updateParent(e,n){if(n===this)return;const r=u(this,Tr).get(e);r&&(u(n,Zs).append(r),u(this,Tr).delete(e),u(n,Tr).set(e,r))}remove(e){u(this,Md).delete(e),u(this,Zs)!==null&&(u(this,Tr).get(e).remove(),u(this,Tr).delete(e))}destroy(){S(this,Zs,null);for(const e of u(this,Tr).values())e.remove();u(this,Tr).clear(),u(this,Md).clear()}};Zs=new WeakMap,Tr=new WeakMap,Md=new WeakMap,I0=new WeakMap,ek=new WeakSet,$V=function(e,[n,r,i,s]){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*n}%`,a.width=`${100*i}%`,a.height=`${100*s}%`},vo=new WeakSet,kP=function(){const e=En._svgFactory.create(1,1,!0);return u(this,Zs).append(e),e.setAttribute("aria-hidden",!0),e},UV=function(e,n){const r=En._svgFactory.createElement("clipPath");e.append(r);const i=`clip_${n}`;r.setAttribute("id",i),r.setAttribute("clipPathUnits","objectBoundingBox");const s=En._svgFactory.createElement("use");return r.append(s),s.setAttribute("href",`#${n}`),s.classList.add("clip"),i},AP=function(e,n){for(const[r,i]of Object.entries(n))i===null?e.removeAttribute(r):e.setAttribute(r,i)},E(En,ek),E(En,I0,0);let SP=En;function Qb(t){return`${(t*100).toFixed(2)}%`}var Jm,O0,M0,Zm,Ja,Za,D0,tk,zV;const iv=class iv{constructor(e,n,r,i){E(this,tk);E(this,Jm,[]);E(this,O0,new Map);E(this,M0,null);E(this,Zm,0);E(this,Ja,0);E(this,Za,0);S(this,Zm,e),S(this,Jm,n),S(this,Ja,r.rawDims.pageWidth),S(this,Za,r.rawDims.pageHeight),S(this,M0,i)}render(){const e=document.createElement("div");e.className="textLayerImages";for(let n=0;n<u(this,Jm).length;n+=6){const r=T(this,tk,zV).call(this,u(this,Jm).subarray(n,n+6));r&&e.append(r)}return e.addEventListener("contextmenu",n=>{var v;if(!(n.target instanceof HTMLCanvasElement))return;const r=n.target,i=u(this,O0).get(r);if(!i)return;const s=(v=u(iv,D0))==null?void 0:v.deref();if(s===r)return;s&&(s.width=0,s.height=0),S(iv,D0,new WeakRef(r));const{inverseTransform:a,x1:o,y1:l,width:c,height:h}=i,d=u(this,M0).call(this),f=Math.ceil(o*d.width),p=Math.ceil(l*d.height),m=Math.floor((o+c/u(this,Ja))*d.width),y=Math.floor((l+h/u(this,Za))*d.height);r.width=m-f,r.height=y-p;const x=r.getContext("2d");x.setTransform(...a),x.translate(-f,-p),x.drawImage(d,0,0)}),e}};Jm=new WeakMap,O0=new WeakMap,M0=new WeakMap,Zm=new WeakMap,Ja=new WeakMap,Za=new WeakMap,D0=new WeakMap,tk=new WeakSet,zV=function([e,n,r,i,s,a]){const o=Math.hypot((s-e)*u(this,Ja),(a-n)*u(this,Za)),l=Math.hypot((r-e)*u(this,Ja),(i-n)*u(this,Za));if(o<u(this,Zm)||l<u(this,Zm))return null;const c=[(s-e)*u(this,Ja)/o,(a-n)*u(this,Za)/o,(r-e)*u(this,Ja)/l,(i-n)*u(this,Za)/l,0,0],h=Q.inverseTransform(c),d=document.createElement("canvas");return d.className="textLayerImagePlaceholder",d.width=0,d.height=0,Object.assign(d.style,{opacity:0,position:"absolute",left:Qb(e),top:Qb(n),width:Qb(o/u(this,Ja)),height:Qb(l/u(this,Za)),transformOrigin:"0% 0%",transform:`matrix(${c.join(",")})`}),u(this,O0).set(d,{inverseTransform:h,width:o,height:l,x1:e,y1:n}),d},E(iv,D0,null);let EP=iv;globalThis._pdfjsTestingUtils={HighlightOutliner:tP};globalThis.pdfjsLib={AbortException:Au,AnnotationEditorLayer:vP,AnnotationEditorParamsType:Te,AnnotationEditorType:xe,AnnotationEditorUIManager:qd,AnnotationLayer:QT,AnnotationMode:tc,AnnotationType:dn,applyOpacity:bce,build:Due,ColorPicker:y1,createValidAbsoluteUrl:Sz,CSSConstants:wce,DOMSVGFactory:w1,DrawLayer:SP,FeatureTest:bn,fetchData:HR,findContrastColor:xce,getDocument:B5,getFilenameFromUrl:fce,getPdfFilenameFromUrl:pce,getRGB:Z0,getRGBA:qR,getUuid:Az,getXfaPageViewport:gce,GlobalWorkerOptions:so,ImageKind:Ox,InvalidPDFException:ZC,isDataScheme:Qk,isPdfFile:GR,isValidExplicitDest:Bce,makeArr:zR,makeMap:VR,makeObj:tT,MathClamp:Dt,noContextMenu:_s,normalizeUnicode:hce,OPS:Oo,OutputScale:go,PasswordResponses:rce,PDFDataRangeTransport:$5,PDFDateString:p1,PDFWorker:Wv,PermissionFlag:nce,PixelsPerInch:Eu,RenderingCancelledException:WR,renderRichText:_z,ResponseException:f1,setLayerDimensions:Gd,shadow:Se,SignatureExtractor:ml,stopEvent:zt,Supp
380ortedImageMimeTypes:nT,TextLayer:Hv,TextLayerImages:EP,TouchManager:g1,updateUrlHash:kz,Util:Q,VerbosityLevel:qk,version:Mue,XfaLayer:Ez};function she(t){return new Worker("/assets/pdf.worker.min-Bpb0JTxQ.js",{name:t==null?void 0:t.name})}so.workerPort=new she;async function ahe(t,e=12e3){const n=await t.arrayBuffer(),r=await B5({data:n}).promise;let i="";for(let s=1;s<=r.numPages;s++){const l=(await(await r.getPage(s)).getTextContent()).items.map(c=>"str"in c?c.str:"").join(" ");if(i+=l+`
381
382`,i.length>=e)break}return i.trim().slice(0,e)}function ohe(t){const e=A.useRef({value:t,previous:t});return A.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var eI="Checkbox",[lhe,Tpe]=bk(eI),[che,uhe]=lhe(eI),VV=A.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,...h}=t,[d,f]=A.useState(null),p=Sn(e,b=>f(b)),m=A.useRef(!1),y=d?!!d.closest("form"):!0,[x=!1,v]=MN({prop:i,defaultProp:s,onChange:c}),w=A.useRef(x);return A.useEffect(()=>{const b=d==null?void 0:d.form;if(b){const k=()=>v(w.current);return b.addEventListener("reset",k),()=>b.removeEventListener("reset",k)}},[d,v]),g.jsxs(che,{scope:n,state:x,disabled:o,children:[g.jsx(St.button,{type:"button",role:"checkbox","aria-checked":Bd(x)?"mixed":x,"aria-required":a,"data-state":GV(x),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:p,onKeyDown:st(t.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:st(t.onClick,b=>{v(k=>Bd(k)?!0:!k),y&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),y&&g.jsx(hhe,{control:d,bubbles:!m.current,name:r,value:l,checked:x,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});VV.displayName=eI;var HV="CheckboxIndicator",WV=A.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,s=uhe(HV,n);return g.jsx(ON,{present:r||Bd(s.state)||s.state===!0,children:g.jsx(St.span,{"data-state":GV(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});WV.displayName=HV;var hhe=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,s=A.useRef(null),a=ohe(n),o=Z$(e);return A.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});l.indeterminate=Bd(n),d.call(l,Bd(n)?!1:n),l.dispatchEvent(f)}},[a,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Bd(n)?!1:n,...i,tabIndex:-1,ref:s,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Bd(t){return t==="indeterminate"}function GV(t){return Bd(t)?"indeterminate":t?"checked":"unchecked"}var qV=VV,dhe=WV;const KV=A.forwardRef(({className:t,...e},n)=>g.jsx(qV,{ref:n,className:Ue("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:g.jsx(dhe,{className:Ue("flex items-center justify-center text-current"),children:g.jsx(E$,{className:"h-4 w-4"})})}));KV.displayName=qV.displayName;const CL=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.trim()),TL=t=>/^https?:\/\/([a-z0-9-]+\.)*linkedin\.com\/.+/i.test(t.trim()),Jb=t=>{const e=t.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e.replace(/^\/+/,"")}`:""},So="label-mono text-white/40 mb-2 block",ui="bg-background border-white/10 text-white/90 placeholder:text-white/30 rounded-none focus-visible:ring-primary focus-visible:ring-offset-0",Rs="mt-1 text-[11px] text-red-400 font-display tracking-wide",fhe=({fitRating:t,questions:e,inputKind:n,inputText:r,deckFilename:i,deckFile:s,assessmentMarkdown:a})=>{const{toast:o}=Ag(),[l,c]=A.useState(!1),[h,d]=A.useState(!1),[f,p]=A.useState(!1),[m,y]=A.useState(null),[x,v]=A.useState(null),[w,b]=A.useState(!1),[k,_]=A.useState(""),[C,P]=A.useState(""),[R,O]=A.useState(""),[M,D]=A.useState(""),[j,U]=A.useState(""),[B,z]=A.useState(""),[$,W]=A.useState(""),[L,V]=A.useState(""),[N,G]=A.useState([]),Y=e.length?e:["Anything else we should know?"],[I,we]=A.useState(()=>Y.map(()=>"")),[Oe,oe]=A.useState(""),[he,rn]=A.useState({}),kn=()=>{N.length>=6||G([...N,{name:"",email:"",linkedin:""}])},sn=(me,Me)=>
382G(N.map((De,Rt)=>Rt===me?{...De,...Me}:De)),wr=me=>G(N.filter((Me,De)=>De!==me)),Br=()=>{const me={};let Me;const De=(be,It)=>{me[be]=It,Me||(Me=It)};k.trim()||De("firstName","Required"),C.trim()||De("lastName","Required"),CL(R)||De("email","Enter a valid email"),M.trim()&&!TL(Jb(M))&&De("linkedin","Enter a valid LinkedIn URL (or leave blank)"),j.trim()||De("company","Required"),B.trim()||De("hqLocation","Required"),$.trim()||De("sector","Required"),L.trim()||De("oneLiner","Required"),w||De("consent","Please confirm consent");const Rt={};return N.forEach((be,It)=>{if(!be.name&&!be.email&&!be.linkedin)return;const Ur={};be.email&&!CL(be.email)&&(Ur.email="Invalid email"),be.linkedin&&!TL(Jb(be.linkedin))&&(Ur.linkedin="Invalid LinkedIn URL"),(Ur.email||Ur.linkedin)&&(Rt[It]=Ur,Me||(Me=Ur.email||Ur.linkedin))}),Object.keys(Rt).length&&(me.cofounders=Rt),rn(me),{ok:!Me,firstError:Me}},$r=()=>{c(!0),!m&&(async()=>{try{let me=null;if(s)try{const Rt=new FormData;Rt.append("file",s);const{data:be,error:It}=await Zr.functions.invoke("upload-pitch-deck",{body:Rt});!It&&(be!=null&&be.path)&&(me=be.path,v(me))}catch(Rt){console.error("deck upload failed (non-blocking)",Rt)}const{data:Me,error:De}=await Zr.functions.invoke("start-fit-check-share",{body:{fit_rating:t,input_kind:n,input_text:r,deck_filename:i,deck_path:me,assessment_markdown:a}});!De&&(Me!=null&&Me.id)&&y(Me.id)}catch(me){console.error("draft capture failed (non-blocking)",me)}})()},Ts=async()=>{const{ok:me,firstError:Me}=Br();if(!me){o({title:"Please check the highlighted fields",description:Me,variant:"destructive"});return}d(!0);try{const De=Y.map((Rn,li)=>({question:Rn,answer:I[li]??""})),Rt=Jb(M);let be=x;if(!be&&s)try{const Rn=new FormData;Rn.append("file",s);const{data:li,error:lf}=await Zr.functions.invoke("upload-pitch-deck",{body:Rn});if(lf)throw lf;li!=null&&li.path&&(be=li.path)}catch(Rn){console.error("deck upload failed (non-blocking)",Rn)}const{data:It,error:Ur}=await Zr.functions.invoke("submit-fit-check",{body:{draft_id:m,consent:!0,fit_rating:t,input_kind:n,input_text:r,deck_filename:i,deck_path:be,assessment_markdown:a,follow_up_qa:De,extra_
382notes:Oe||null,primary_first_name:k.trim(),primary_last_name:C.trim(),primary_email:R.trim(),primary_linkedin:Rt,company_name:j.trim(),hq_location:B.trim(),sector:$.trim(),one_liner:L.trim(),cofounders:N.map(Rn=>({name:Rn.name.trim(),email:Rn.email.trim(),linkedin:Jb(Rn.linkedin)})).filter(Rn=>Rn.name||Rn.email||Rn.linkedin)}});if(Ur)throw new Error(Ur.message||"Network error reaching REALR");if(It!=null&&It.error)throw new Error(It.error);if(!(It!=null&&It.ok))throw new Error("Unexpected response from server");p(!0)}catch(De){o({title:"Submission failed",description:De instanceof Error?De.message:"Please try again or email [email protected].",variant:"destructive"})}finally{d(!1)}};return f?g.jsxs("div",{className:"mt-10 bg-surface-1 border border-primary/40 p-8 lg:p-10",children:[g.jsx(_$,{className:"w-8 h-8 text-primary mb-4"}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-wide mb-2",children:"Submitted to REALR"}),g.jsxs("p",{className:"text-sm text-white/60 leading-relaxed max-w-xl",children:["Thanks. Your input, the assessment output, and your answers have been shared with the REALR team. If there's a fit, we'll reach out at ",R,"."]})]}):l?g.jsxs("div",{className:"mt-10 bg-surface-1 border border-white/10 p-8 lg:p-10 space-y-8",children:[g.jsxs("div",{children:[g.jsx("div",{className:"eyebrow mb-3",children:"Share with REALR"}),g.jsx("p",{className:"text-sm text-white/55 leading-relaxed max-w-2xl",children:"Confidential. Reviewed by the REALR partners. We'll only get back to you if there's a fit."})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"label-mono text-white/60",children:"Primary founder"}),g.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:So,children:"First name *"}),g.jsx(yn,{className:ui,value:k,onChange:me=>_(me.target.value)}),he.firstName&&g.jsx("div",{className:Rs,children:he.firstName})]}),g.jsxs("div",{children:[g.jsx("label",{className:So,children:"Last name *"}),g.jsx(yn,{className:ui,value:C,onChange:me=>P(me.target.value)}),he.lastName&&g.jsx("div",{className:Rs,children:he.lastName})]}),g.jsxs("div",{children:[g.jsx("label",{className:So,children:"Email *"}),g.jsx(yn,{type:"email",className:ui,value:R,onChange:me=>O(me.target.value)}),he.email&&g.jsx("div",{className:Rs,children:he.email})]}),g.jsxs("div",{children:[g.jsx("label",{className:So,children:"LinkedIn URL (optional)"}),g.jsx(yn,{className:ui,placeholder:"linkedin.com/in/…",value:M,onChange:me=>D(me.target.value)}),he.linkedin&&g.jsx("div",{className:Rs,children:he.linkedin})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:So,children:"Company name *"}),g.jsx(yn,{className:ui,value:j,onChange:me=>U(me.target.value)}),he.company&&g.jsx("div",{className:Rs,children:he.company})]}),g.jsxs("div",{children:[g.jsx("label",{className:So,children:"HQ (city, country) *"}),g.jsx(yn,{className:ui,placeholder:"Zürich, Switzerland",value:B,onChange:me=>z(me.target.value)}),he.hqLocation&&g.jsx("div",{className:Rs,children:he.hqLocation})]}),g.jsxs("div",{children:[g.jsx("label",{className:So,children:"Sector *"}),g.jsx(yn,{className:ui,placeholder:"Health, Food, Climate…",value:$,onChange:me=>W(me.target.value)}),he.sector&&g.jsx("div",{className:Rs,children:he.sector})]}),g.jsxs("div",{className:"md:col-span-2",children:[g.jsx("label",{className:So,children:"One-liner — what do you do? *"}),g.jsx(fp,{className:`${ui} min-h-[70px] resize-none`,placeholder:"We do X for Y so that Z.",maxLength:280,value:L,onChange:me=>V(me.target.value)}),he.oneLiner&&g.jsx("div",{className:Rs,children:he.oneLiner})]})]})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"label-mono text-white/60",children:"Co-founders (optional)"}),N.length<6&&g.jsxs("button",{type:"button",onClick:kn,className:"text-[11px] text-primary hover:text-white font-display font-bold uppercase tracking-[0.2em] inline-flex items-center gap-1",children:[g.jsx(X9,{className:"w-3 h-3"})," Add"]})]}),N.map((me,Me)=>
382{var Rt;const De=(Rt=he.cofounders)==null?void 0:Rt[Me];return g.jsxs("div",{className:"border border-white/10 p-4 grid md:grid-cols-3 gap-3 relative",children:[g.jsx("button",{type:"button",onClick:()=>wr(Me),className:"absolute top-2 right-2 text-white/30 hover:text-primary","aria-label":"Remove",children:g.jsx(lg,{className:"w-4 h-4"})}),g.jsx(yn,{className:ui,placeholder:"Name",value:me.name,onChange:be=>sn(Me,{name:be.target.value})}),g.jsxs("div",{children:[g.jsx(yn,{className:ui,placeholder:"Email",value:me.email,onChange:be=>sn(Me,{email:be.target.value})}),(De==null?void 0:De.email)&&g.jsx("div",{className:Rs,children:De.email})]}),g.jsxs("div",{children:[g.jsx(yn,{className:ui,placeholder:"LinkedIn URL",value:me.linkedin,onChange:be=>sn(Me,{linkedin:be.target.value})}),(De==null?void 0:De.linkedin)&&g.jsx("div",{className:Rs,children:De.linkedin})]})]},Me)})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"label-mono text-white/60",children:e.length?"Answers to the follow-up questions":"Anything else?"}),Y.map((me,Me)=>g.jsxs("div",{children:[g.jsx("label",{className:"block text-sm text-white/75 leading-relaxed mb-2",children:me}),g.jsx(fp,{value:I[Me]??"",onChange:De=>{const Rt=[...I];Rt[Me]=De.target.value,we(Rt)},className:`${ui} min-h-[110px] resize-none`,maxLength:4e3})]},Me)),e.length>0&&g.jsxs("div",{children:[g.jsx("label",{className:So,children:"Anything else? (optional)"}),g.jsx(fp,{value:Oe,onChange:me=>oe(me.target.value),className:`${ui} min-h-[90px] resize-none`,maxLength:4e3})]})]}),g.jsxs("div",{children:[g.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[g.jsx(KV,{checked:w,onCheckedChange:me=>b(me===!0),className:"mt-1 border-white/30 data-[state=checked]:bg-primary data-[state=checked]:border-primary rounded-none"}),g.jsxs("span",{className:"text-xs text-white/60 leading-relaxed",children:["I consent to share my company input",n==="deck"?" (deck contents)":"",", the REALR assessment output, my answers, and my contact details with the REALR team for review. *"]})]}),he.consent&&g.jsx("div",{className:`${Rs} ml-7`,children:he.consent})]}),g.jsxs("div",{className:"flex justify-between items-center flex-wrap gap-3 pt-2",children:[g.jsx("button",{type:"button",onClick:()=>c(!1),className:"text-[11px] text-white/40 hover:text-primary font-display font-bold uppercase tracking-[0.2em]",children:"← Cancel"}),g.jsx(Ye,{onClick:Ts,disabled:h,className:"rounded-none bg-primary text-white hover:bg-primary/90 px-10 py-6 text-xs font-display font-bold uppercase tracking-[0.25em] shadow-[0_10px_30px_-10px_hsl(252_100%_68%/0.5)] disabled:opacity-40",children:h?g.jsxs(g.Fragment,{children:[g.jsx(bl,{className:"mr-2 h-4 w-4 animate-spin"})," Submitting…"]}):g.jsxs(g.Fragment,{children:[g.jsx(Z9,{className:"mr-2 h-4 w-4"})," Submit to REALR"]})})]})]}):g.jsxs("div",{className:"mt-10 bg-surface-1 border border-white/10 p-8 lg:p-10",children:[g.jsx("div",{className:"eyebrow mb-3",children:"Next step"}),g.jsx("h3",{className:"font-display font-bold text-white text-2xl lg:text-3xl uppercase tracking-wide mb-3",children:"Share this with REALR"}),g.jsx("p",{className:"text-sm text-white/55 leading-relaxed max-w-2xl mb-6",children:"Skip the inbox. Send your input, the assessment, and quick answers to the follow-up questions directly to our team — the fastest path to a review."}),g.jsxs(Ye,{onClick:$r,className:"rounded-none bg-primary text-white hover:bg-primary/90 px-8 py-5 text-xs font-display font-bold uppercase tracking-[0.25em] shadow-[0_10px_30px_-10px_hsl(252_100%_68%/0.5)]",children:["Share with REALR ",g.jsx(oo,{className:"ml-2 w-4 h-4"})]})]})},phe=t=>{const e=t.match(/Overall Fit Rating:\s*\*?\*?\s*(High|Medium|Low)/i);return e?e[1][0].toUpperCase()+e[1].slice(1).toLowerCase():null},mhe=t=>{const e=t.match(/Additional Questions:\s*\*?\*?([\s\S]*?)(?:\n\s*\*\*Next Steps|\n\s*Next Steps:|$)/i);if(!e)return[];const n=e[1].trim();return/^none\.?$/i.test(n)?[]:n.split(`
383`).map(r=>r.replace(/^[-*•\d.\s]+/,"").trim()).filter(r=>r.length>5&&r.endsWith("?")||r.length>8&&/\?/.test(r)).slice(0,10)},ghe=()=>{const{toast:t}=Ag(),[e,n]=A.useState("intro"),[r,i]=A.useState(""),[s,a]=A.useState(null),[o,l]=A.useState(null),[c,h]=A.useState(null),[d,f]=A.useState(null),p=A.useRef(null),m=A.useMemo(()=>c?phe(c):null,[c]),y=A.useMemo(()=>c?mhe(c):[],[c]),x=async(b,k)=>{n("analyzing");try{const{data:_,error:C}=await Zr.functions.invoke("assess-fit",{body:{summary:b}});if(C)throw C;if(_!=null&&_.error)throw new Error(_.error);if(!(_!=null&&_.assessment))throw new Error("No assessment returned");f({kind:k,text:b}),h(_.assessment),n("result")}catch(_){t({title:"Assessment failed",description:_ instanceof Error?_.message:"Please try again.",variant:"destructive"}),n("choose")}},v=async b=>
383{if(b.type!=="application/pdf"){t({title:"PDF only",description:"Please upload a PDF deck.",variant:"destructive"});return}a(b.name),l(b),n("analyzing");try{const k=await ahe(b);if(k.length<300){t({title:"Couldn't read this deck",description:"It looks image-only. Paste a short description of your company instead.",variant:"destructive"}),n("paste");return}await x(k,"deck")}catch(k){t({title:"Could not read the file",description:k instanceof Error?k.message:"Please try again or paste a description.",variant:"destructive"}),n("choose")}},w=()=>{h(null),i(""),a(null),l(null),n("choose")};return g.jsxs("div",{className:"bg-background min-h-screen",children:[g.jsx(K0,{title:"Fit Check — Pitch Realr | Early-Stage VC Assessment",description:"Upload your deck or describe your company to get an honest, thesis-driven fit assessment from Realr, an early-stage VC investing across Switzerland, Germany and the Nordics.",path:"/assessment"}),g.jsx("section",{className:"px-6 lg:px-16 py-24 lg:py-32",children:g.jsxs("div",{className:"max-w-4xl mx-auto",children:[g.jsxs("div",{className:"mb-16",children:[g.jsx("div",{className:"eyebrow mb-6",children:"Founder Diagnostic"}),g.jsxs("h1",{className:"display text-5xl lg:text-7xl text-white uppercase leading-[0.95] mb-6",children:["REALR ",g.jsx("span",{className:"text-primary italic",children:"Fit Check"})]}),g.jsx("p",{className:"text-lg text-white/55 max-w-2xl leading-relaxed",children:"An honest, thesis-driven read on whether your company aligns with what we back. Confidential. Not stored."})]}),e==="intro"&&g.jsxs("div",{className:"bg-surface-1 border border-white/10 p-8 lg:p-12",children:[g.jsx("div",{className:"grid md:grid-cols-3 gap-8 mb-12",children:[{n:"01",t:"Share",d:"Upload your deck or paste a short description of your company."},{n:"02",t:"Analyze",d:"Our thesis filter evaluates fit across 7 strict criteria."},{n:"03",t:"Read",d:"Receive an objective fit rating with clear reasoning."}].map(b=>g.jsxs("div",{className:"border-l border-primary/40 pl-4",children:[g.jsx("div",{className:"label-mono text-primary mb-3",children:b.n}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-wide mb-2",children:b.t}),g.jsx("p",{className:"text-sm text-white/50 leading-relaxed",children:b.d})]},b.n))}),g.jsxs(Ye,{onClick:()=>n("choose"),className:"rounded-none bg-primary text-white hover:bg-primary/90 px-10 py-6 text-xs font-display font-bold uppercase tracking-[0.25em] shadow-[0_10px_30px_-10px_hsl(252_100%_68%/0.5)]",children:["Begin ",g.jsx(oo,{className:"ml-2 w-4 h-4"})]})]}),e==="choose"&&g.jsxs("div",{children:[g.jsx("div",{className:"label-mono text-white/40 mb-6",children:"Choose input method"}),g.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[g.jsxs("button",{onClick:()=>n("deck"),className:"group bg-surface-1 border border-white/10 hover:border-primary/60 hover:bg-surface-2 p-10 text-left transition-all",children:[g.jsx(Ek,{className:"w-8 h-8 text-primary mb-6"}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-wide mb-2",children:"Upload deck"}),g.jsx("p",{className:"text-sm text-white/50 leading-relaxed mb-6",children:"Fastest path. PDF only, parsed in your browser."}),g.jsxs("span",{className:"text-[11px] text-primary font-display font-bold uppercase tracking-[0.25em] inline-flex items-center gap-2",children:["Choose file ",g.jsx(oo,{className:"w-3 h-3 transition-transform group-hover:translate-x-1"})]})]}),g.jsxs("button",{onClick:()=>n("paste"),className:"group bg-surface-1 border border-white/10 hover:border-primary/60 hover:bg-surface-2 p-10 text-left transition-all",children:[g.jsx(rq,{className:"w-8 h-8 text-primary mb-6"}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-wide mb-2",children:"Paste description"}),g.jsx("p",{className:"text-sm text-white/50 leading-relaxed mb-6",children:"Write a short description of your company."}),g.jsxs("span",{className:"text-[11px] text-primary font-display font-bold uppercase tracking-[0.25em] inline-flex items-center gap-2",children:["Open editor ",g.jsx(oo,{className:"w-3 h-3 transition-transform group-hover:translate-x-1"})]})]})]})]}),e==="deck"&&g.jsxs("div",{className:"bg-surface-1 border border-white/10 p-8 lg:p-12",children:[g.jsx("input",{ref:p,type:"file",accept:"application/pdf",className:"hidden",onChange:b=>{var k;return((k=b.target.files)==null?void 0:k[0])&&v(b.target.files[0])}}),g.jsxs("div",{onClick:()=>{var b;return(b=p.current)==null?void 0:b.click()},onDragOver:b=>b.preventDefault(),onDrop:b=>{var _;b.preventDefault();const k=(_=b.dataTransfer.files)==null?void 0:_[0];k&&v(k)},className:"border border-dashed border-white/20 hover:border-primary/60 hover:bg-background/50 p-16 text-center cursor-pointer transition-all",children:[g.jsx(K_,{className:"w-10 h-10 text-primary mx-auto mb-6"}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-wide mb-2",children:"Drop your deck"}),g.jsx("p",{className:"text-sm text-white/50",children:"PDF only · processed locally · max 12,000 chars extracted"})]}),g.jsxs("div",{className:"mt-6 flex justify-between items-center",children:[g.jsx("button",{onClick:()=>n("choose"),className:"text-[11px] text-white/40 hover:text-primary font-display font-bold uppercase tracking-[0.2em]",children:"← Back"}),g.jsx("button",{onClick:()=>n("paste"),className:"text-[11px] text-white/40 hover:text-primary font-display font-bold uppercase tracking-[0.2em]",children:"Paste description instead →"})]})]}),e==="paste"&&g.jsxs("div",{className:"bg-surface-1 border border-white/10 p-8 lg:p-12",children:[g.jsx("label",{className:"label-mono text-white/40 mb-4 block",children:"Description of your company"}),g.jsx(fp,{value:r,onChange:b=>i(b.target.value),placeholder:`Example:
384
385We are building [product] for [target customer] in [geography]. The problem is [...]. We make money via [...]. Founders are [...]. Traction so far: [...]. We are raising [€
385X] at [€Y] cap...`,className:"min-h-[280px] bg-background border-white/10 text-white/90 placeholder:text-white/30 rounded-none resize-none font-sans text-sm leading-relaxed focus-visible:ring-primary focus-visible:ring-offset-0",maxLength:12e3}),g.jsxs("div",{className:"mt-3 flex justify-between items-center text-[11px] text-white/30 font-display uppercase tracking-[0.2em]",children:[g.jsxs("span",{children:[r.length," / 12,000"]}),g.jsx("span",{children:"Confidential · Not stored"})]}),g.jsxs("div",{className:"mt-8 flex justify-between items-center gap-4 flex-wrap",children:[g.jsx("button",{onClick:()=>n("choose"),className:"text-[11px] text-white/40 hover:text-primary font-display font-bold uppercase tracking-[0.2em]",children:"← Back"}),g.jsxs(Ye,{onClick:()=>x(r.trim(),"paste"),disabled:r.trim().length<80,className:"rounded-none bg-primary text-white hover:bg-primary/90 px-10 py-6 text-xs font-display font-bold uppercase tracking-[0.25em] shadow-[0_10px_30px_-10px_hsl(252_100%_68%/0.5)] disabled:opacity-40",children:[g.jsx(tq,{className:"mr-2 h-4 w-4"})," Run the assessment"]})]})]}),e==="analyzing"&&g.jsxs("div",{className:"bg-surface-1 border border-white/10 p-16 text-center",children:[g.jsx(bl,{className:"w-10 h-10 text-primary animate-spin mx-auto mb-6"}),g.jsx("div",{className:"font-display font-bold text-white uppercase tracking-[0.2em] mb-2",children:"Analyzing"}),g.jsx("p",{className:"text-sm text-white/50",children:s?`Reading ${s} and evaluating against thesis…`:"Evaluating against thesis…"})]}),e==="result"&&c&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"bg-surface-1 border border-primary/40 p-8 lg:p-12 shadow-[0_20px_60px_-30px_hsl(252_100%_68%/0.5)]",children:[g.jsxs("div",{className:"flex justify-between items-start mb-8 gap-4 flex-wrap",children:[g.jsx("span",{className:"eyebrow",children:"Assessment Result"}),g.jsxs("button",{onClick:w,className:"text-[11px] text-white/40 hover:text-primary font-display font-bold uppercase tracking-[0.2em] transition-colors inline-flex items-center gap-2",children:["Run another ",g.jsx(oo,{className:"w-3 h-3"})]})]}),g.jsx("div",{className:"prose prose-invert prose-sm max-w-none prose-headings:font-display prose-headings:text-white prose-strong:text-primary prose-strong:font-display prose-strong:tracking-wide prose-p:text-white/75 prose-li:text-white/75 prose-a:text-primary",children:g.jsx(Qle,{children:c})}),g.jsx("p",{className:"mt-8 text-[11px] text-white/30 italic font-display uppercase tracking-[0.2em]",children:"AI-generated · Not an official REALR evaluation"})]}),(m==="High"||m==="Medium")&&d&&g.jsx(fhe,{fitRating:m,questions:y,inputKind:d.kind,inputText:d.text,deckFilename:d.kind==="deck"?s:null,deckFile:d.kind==="deck"?o:null,assessmentMarkdown:c})]})]})})]})},YV=A.createContext(void 0);function yhe({children:t}){const[e,n]=A.useState(null),[r,i]=A.useState(null),[s,a]=A.useState(!1),[o,l]=A.useState(!0),c=async()=>{var p;if(!(r!=null&&r.access_token))return a(!1),!1;try{const m=await Zr.functions.invoke("admin-submissions/check-admin",{headers:{Authorization:`Bearer ${r.access_token}`}});if(m.error)return console.log("Not an admin user"),a(!1),!1;const y=((p=m.data)==null?void 0:p.isAdmin)===!0;return a(y),y}catch(m){return console.error("Error checking admin status:",m),a(!1),!1}};A.useEffect(()=>{const{data:{subscription:p}}=Zr.auth.onAuthStateChange((m,y)=>{i(y),n((y==null?void 0:y.user)??null),y!=null&&y.user?setTimeout(()=>{c()},0):a(!1)});return Zr.auth.getSession().then(({data:{session:m}})=>{i(m),n((m==null?void 0:m.user)??null),m!=null&&m.user?c().finally(()=>l(!1)):l(!1)}),()=>p.unsubscribe()},[]),A.useEffect(()=>{r!=null&&r.access_token&&c()},[r==null?void 0:r.access_token]);const h=async(p,m)=>{const{error:y}=await Zr.auth.signInWithPassword({email:p,password:m});return{error:y}},d=async(p,m)=>{const y=`${window.location.origin}/admin/dashboard`,{error:x}=await Zr.auth.signUp({email:p,password:m,options:{emailRedirectTo:y}});return{error:x}},f=async()=>{await Zr.auth.signOut(),a(!1)};return g.jsx(YV.Provider,{value:{user:e,session:r,isAdmin:s,isLoading:o,signIn:h,signUp:d,signOut:f,checkAdminStatus:c},children:t})}function XV(){const t=A.useContext(YV);if(t===void 0)throw new Error("useAdminAuth must be used within an AdminAuthProvider");return t}var qe;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>
vendor: 1,173 bytes, line 385
385typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(qe||(qe={}));var PL;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(PL||(PL={}));const ce=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xl=t=>{switch(typeof t){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return Number.isNaN(t)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(t)?ce.array:t===null?ce.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ce.promise:typeof Map<"u"&&t instanceof Map?ce.map:typeof Set<"u"&&t instanceof Set?ce.set:typeof Date<"u"&&t instanceof Date?ce.date:ce.object;default:return ce.unknown}},J=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
385d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ha extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,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(n(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof ha))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ha.create=t=>new ha(t);const _P=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ce.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,qe.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${qe.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${qe.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${qe.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:qe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case J.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;
vendor: 5,143 bytes, line 385
385case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,qe.assertNever(t)}return{message:n}};let vhe=_P;function whe(){return vhe}const bhe=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}};function te(t,e){const n=whe(),r=bhe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===_P?void 0:_P].filter(i=>!!i)});t.common.issues.push(r)}class Ki{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return ke;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Ki.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return ke;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const ke=Object.freeze({status:"aborted"}),Ry=t=>({status:"dirty",value:t}),Cs=t=>({status:"valid",value:t}),NL=t=>t.status==="aborted",RL=t=>t.status==="dirty",pg=t=>t.status==="valid",k1=t=>typeof Promise<"u"&&t instanceof Promise;var ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));class _u{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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 IL=(t,e)=>{if(pg(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ha(t.common.issues);return this._error=n,this._error}}};function je(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:l}=t;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class Ge{get description(){return this._def.description}_getType(e){return Xl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ki,ctx:{common:e.parent.common,data:e.data,parsedType:Xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(k1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xl(e)},i=this._parseSync({data:e,path:r.path,parent:r});return IL(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xl(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return pg(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>pg(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xl(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(k1(i)?i:Promise.resolve(i));return IL(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:J.custom,...r(i)});
vendor: 22,605 bytes, line 385
385return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new gg({schema:this,typeName:Ae.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:n=>this["~validate"](n)}}optional(){return mu.create(this,this._def)}nullable(){return yg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ho.create(this)}promise(){return C1.create(this,this._def)}or(e){return E1.create([this,e],this._def)}and(e){return _1.create(this,e,this._def)}transform(e){return new gg({...je(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new TP({...je(this._def),innerType:this,defaultValue:n,typeName:Ae.ZodDefault})}brand(){return new Vhe({typeName:Ae.ZodBranded,type:this,...je(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new PP({...je(this._def),innerType:this,catchValue:n,typeName:Ae.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return tI.create(this,e)}readonly(){return NP.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xhe=/^c[^\s-]{8,}$/i,She=/^[0-9a-z]+$/,khe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ahe=/^[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,Ehe=/^[a-z0-9_-]{21}$/i,_he=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Che=/^[-+]?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)?)??$/,The=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Phe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let OE;const Nhe=/^(?:(?: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])$/,Rhe=/^(?:(?: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])$/,Ihe=/^(([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]))$/,Ohe=/^(([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])$/,Mhe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dhe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,QV="((\\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])))",Lhe=new RegExp(`^${QV}$`);function JV(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function jhe(t){return new RegExp(`^${JV(t)}$`)}function Fhe(t){let e=`${QV}T${JV(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Bhe(t,e){return!!((e==="v4"||!e)&&Nhe.test(t)||(e==="v6"||!e)&&Ihe.test(t))}function $he(t,e){if(!_he.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Uhe(t,e){return!!((e==="v4"||!e)&&Rhe.test(t)||(e==="v6"||!e)&&Ohe.test(t))}class su extends Ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ce.string){const s=this._getOrReturnCtx(e);return te(s,{code:J.invalid_type,expected:ce.string,received:s.parsedType}),ke}const r=new Ki;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),te(i,{code:J.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),te(i,{code:J.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?te(i,{code:J.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&te(i,{code:J.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")The.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"email",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")OE||(OE=new RegExp(Phe,"u")),OE.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"emoji",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Ahe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"uuid",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Ehe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"nanoid",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xhe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"cuid",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")She.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"cuid2",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")khe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"ulid",code:J.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),te(i,{validation:"url",code:J.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"regex",code:J.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Fhe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Lhe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?jhe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{code:J.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Che.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"duration",code:J.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Bhe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"ip",code:J.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?$he(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"jwt",code:J.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Uhe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"cidr",code:J.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Mhe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"base64",code:J.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Dhe.test(e.data)||(i=this._getOrReturnCtx(e,i),te(i,{validation:"base64url",code:J.invalid_string,message:s.message}),r.dirty()):qe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:J.invalid_string,...ue.errToObj(r)})}_addCheck(e){return new su({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ue.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ue.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ue.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,...ue.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,...ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new su({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new su({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new su({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}su.create=t=>new su({checks:[],typeName:Ae.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...je(t)});function zhe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class Gv extends Ge{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)!==ce.number){const s=this._getOrReturnCtx(e);return te(s,{code:J.invalid_type,expected:ce.number,received:s.parsedType}),ke}let r;const i=new Ki;for(const s of this._def.checks)s.kind==="int"?qe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:J.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?zhe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:J.not_finite,message:s.message}),i.dirty()):qe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,i){return new Gv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(i)}]})}_addCheck(e){return new Gv({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&qe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Gv.create=t=>new Gv({checks:[],typeName:Ae.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...je(t)});class qv extends Ge{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)!==ce.bigint)return this._getInvalidInput(e);let r;const i=new Ki;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),te(r,{code:J.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):qe.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return te(n,{code:J.invalid_type,expected:ce.bigint,received:n.parsedType}),ke}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,i){return new qv({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(i)}]})}_addCheck(e){return new qv({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}qv.create=t=>new qv({checks:[],typeName:Ae.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...je(t)});class OL extends Ge{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ce.boolean){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.boolean,received:r.parsedType}),ke}return Cs(e.data)}}OL.create=t=>new OL({typeName:Ae.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...je(t)});class A1 extends Ge{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ce.date){const s=this._getOrReturnCtx(e);return te(s,{code:J.invalid_type,expected:ce.date,received:s.parsedType}),ke}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return te(s,{code:J.invalid_date}),ke}const r=new Ki;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),te(i,{code:J.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),te(i,{code:J.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):qe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new A1({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}A1.create=t=>new A1({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ae.ZodDate,...je(t)});class ML extends Ge{_parse(e){if(this._getType(e)!==ce.symbol){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.symbol,received:r.parsedType}),ke}return Cs(e.data)}}ML.create=t=>new ML({typeName:Ae.ZodSymbol,...je(t)});class DL extends Ge{_parse(e){if(this._getType(e)!==ce.undefined){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.undefined,received:r.parsedType}),ke}return Cs(e.data)}}DL.create=t=>new DL({typeName:Ae.ZodUndefined,...je(t)});class LL extends Ge{_parse(e){if(this._getType(e)!==ce.null){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.null,received:r.parsedType}),ke}return Cs(e.data)}}LL.create=t=>new LL({typeName:Ae.ZodNull,...je(t)});
vendor: 5,772 bytes, line 385
385class jL extends Ge{constructor(){super(...arguments),this._any=!0}_parse(e){return Cs(e.data)}}jL.create=t=>new jL({typeName:Ae.ZodAny,...je(t)});class FL extends Ge{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Cs(e.data)}}FL.create=t=>new FL({typeName:Ae.ZodUnknown,...je(t)});class Cu extends Ge{_parse(e){const n=this._getOrReturnCtx(e);return te(n,{code:J.invalid_type,expected:ce.never,received:n.parsedType}),ke}}Cu.create=t=>new Cu({typeName:Ae.ZodNever,...je(t)});class BL extends Ge{_parse(e){if(this._getType(e)!==ce.undefined){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.void,received:r.parsedType}),ke}return Cs(e.data)}}BL.create=t=>new BL({typeName:Ae.ZodVoid,...je(t)});class ho extends Ge{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ce.array)return te(n,{code:J.invalid_type,expected:ce.array,received:n.parsedType}),ke;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(te(n,{code:a?J.too_big:J.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(te(n,{code:J.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(te(n,{code:J.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new _u(n,a,n.path,o)))).then(a=>Ki.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new _u(n,a,n.path,o)));return Ki.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new ho({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new ho({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new ho({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}ho.create=(t,e)=>new ho({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...je(e)});function jf(t){if(t instanceof tn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=mu.create(jf(r))}return new tn({...t._def,shape:()=>e})}else return t instanceof ho?new ho({...t._def,type:jf(t.element)}):t instanceof mu?mu.create(jf(t.unwrap())):t instanceof yg?yg.create(jf(t.unwrap())):t instanceof Yd?Yd.create(t.items.map(e=>jf(e))):t}class tn extends Ge{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(),n=qe.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ce.object){const c=this._getOrReturnCtx(e);return te(c,{code:J.invalid_type,expected:ce.object,received:c.parsedType}),ke}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Cu&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||o.push(c);const l=[];for(const c of a){const h=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:h._parse(new _u(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Cu){const c=this._def.unknownKeys;if(c==="passthrough")for(const h of o)l.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if(c==="strict")o.length>0&&(te(i,{code:J.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const h of o){const d=i.data[h];l.push({key:{status:"valid",value:h},value:c._parse(new _u(i,d,i.path,h)),alwaysSet:h in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const h of l){const d=await h.key,f=await h.value;c.push({key:d,value:f,alwaysSet:h.alwaysSet})}return c}).then(c=>Ki.mergeObjectSync(r,c)):Ki.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new tn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ue.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new tn({...this._def,unknownKeys:"strip"})}passthrough(){return new tn({...this._def,unknownKeys:"passthrough"})}extend(e){return new tn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new tn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ae.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new tn({...this._def,catchall:e})}pick(e){const n={};for(const r of qe.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new tn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of qe.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new tn({...this._def,shape:()=>n})}deepPartial(){return jf(this)}partial(e){const n={};for(const r of qe.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new tn({...this._def,shape:()=>n})}required(e){const n={};for(const r of qe.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof mu;)s=s._def.innerType;n[r]=s}return new tn({...this._def,shape:()=>n})}keyof(){return ZV(qe.objectKeys(this.shape))}}tn.create=(t,e)=>new tn({shape:()=>t,unknownKeys:"strip",catchall:Cu.create(),typeName:Ae.ZodObject,...je(e)});
vendor: 4,761 bytes, line 385
385tn.strictCreate=(t,e)=>new tn({shape:()=>t,unknownKeys:"strict",catchall:Cu.create(),typeName:Ae.ZodObject,...je(e)});tn.lazycreate=(t,e)=>new tn({shape:t,unknownKeys:"strip",catchall:Cu.create(),typeName:Ae.ZodObject,...je(e)});class E1 extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new ha(o.ctx.common.issues));return te(n,{code:J.invalid_union,unionErrors:a}),ke}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},h=l._parseSync({data:n.data,path:n.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new ha(l));return te(n,{code:J.invalid_union,unionErrors:o}),ke}}get options(){return this._def.options}}E1.create=(t,e)=>new E1({options:t,typeName:Ae.ZodUnion,...je(e)});function CP(t,e){const n=Xl(t),r=Xl(e);if(t===e)return{valid:!0,data:t};if(n===ce.object&&r===ce.object){const i=qe.objectKeys(e),s=qe.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=CP(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===ce.array&&r===ce.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=CP(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ce.date&&r===ce.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _1 extends Ge{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(NL(s)||NL(a))return ke;const o=CP(s.value,a.value);return o.valid?((RL(s)||RL(a))&&n.dirty(),{status:n.value,value:o.data}):(te(r,{code:J.invalid_intersection_types}),ke)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_1.create=(t,e,n)=>new _1({left:t,right:e,typeName:Ae.ZodIntersection,...je(n)});class Yd extends Ge{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ce.array)return te(r,{code:J.invalid_type,expected:ce.array,received:r.parsedType}),ke;if(r.data.length<this._def.items.length)return te(r,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new _u(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Ki.mergeArray(n,a)):Ki.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Yd({...this._def,rest:e})}}Yd.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yd({items:t,typeName:Ae.ZodTuple,rest:null,...je(e)})};class $L extends Ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ce.map)return te(r,{code:J.invalid_type,expected:ce.map,received:r.parsedType}),ke;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new _u(r,o,r.path,[c,"key"])),value:s._parse(new _u(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,h=await l.value;if(c.status==="aborted"||h.status==="aborted")return ke;(c.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(c.value,h.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const c=l.key,h=l.value;if(c.status==="aborted"||h.status==="aborted")return ke;(c.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(c.value,h.value)}return{status:n.value,value:o}}}}$L.create=(t,e,n)=>new $L({valueType:e,keyType:t,typeName:Ae.ZodMap,...je(n)});class Kv extends Ge{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ce.set)return te(r,{code:J.invalid_type,expected:ce.set,received:r.parsedType}),ke;
vendor: 6,789 bytes, line 385
385const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(te(r,{code:J.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(te(r,{code:J.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const c=new Set;for(const h of l){if(h.status==="aborted")return ke;h.status==="dirty"&&n.dirty(),c.add(h.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>s._parse(new _u(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new Kv({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Kv({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Kv.create=(t,e)=>new Kv({valueType:t,minSize:null,maxSize:null,typeName:Ae.ZodSet,...je(e)});class UL extends Ge{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}UL.create=(t,e)=>new UL({getter:t,typeName:Ae.ZodLazy,...je(e)});class zL extends Ge{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return te(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}zL.create=(t,e)=>new zL({value:t,typeName:Ae.ZodLiteral,...je(e)});function ZV(t,e){return new mg({values:t,typeName:Ae.ZodEnum,...je(e)})}class mg extends Ge{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{expected:qe.joinValues(r),received:n.parsedType,code:J.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{received:n.data,code:J.invalid_enum_value,options:r}),ke}return Cs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return mg.create(e,{...this._def,...n})}exclude(e,n=this._def){return mg.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}mg.create=ZV;class VL extends Ge{_parse(e){const n=qe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ce.string&&r.parsedType!==ce.number){const i=qe.objectValues(n);return te(r,{expected:qe.joinValues(i),received:r.parsedType,code:J.invalid_type}),ke}if(this._cache||(this._cache=new Set(qe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=qe.objectValues(n);return te(r,{received:r.data,code:J.invalid_enum_value,options:i}),ke}return Cs(e.data)}get enum(){return this._def.values}}VL.create=(t,e)=>new VL({values:t,typeName:Ae.ZodNativeEnum,...je(e)});class C1 extends Ge{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ce.promise&&n.common.async===!1)return te(n,{code:J.invalid_type,expected:ce.promise,received:n.parsedType}),ke;const r=n.parsedType===ce.promise?n.data:Promise.resolve(n.data);return Cs(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}C1.create=(t,e)=>new C1({type:t,typeName:Ae.ZodPromise,...je(e)});class gg extends Ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{te(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return ke;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?ke:l.status==="dirty"||n.value==="dirty"?Ry(l.value):l});{if(n.value==="aborted")return ke;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?ke:o.status==="dirty"||n.value==="dirty"?Ry(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.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(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ke:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?ke:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!pg(a))return ke;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>pg(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):ke);qe.assertNever(i)}}gg.create=(t,e,n)=>new gg({schema:t,typeName:Ae.ZodEffects,effect:e,...je(n)});gg.createWithPreprocess=(t,e,n)=>new gg({schema:e,effect:{type:"preprocess",transform:t},typeName:Ae.ZodEffects,...je(n)});class mu extends Ge{_parse(e){return this._getType(e)===ce.undefined?Cs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mu.create=(t,e)=>new mu({innerType:t,typeName:Ae.ZodOptional,...je(e)});class yg extends Ge{_parse(e){return this._getType(e)===ce.null?Cs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yg.create=(t,e)=>new yg({innerType:t,typeName:Ae.ZodNullable,...je(e)});class TP extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}TP.create=(t,e)=>new TP({innerType:t,typeName:Ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...je(e)});class PP extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return k1(i)?i.then(s=>
385({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ha(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ha(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}PP.create=(t,e)=>new PP({innerType:t,typeName:Ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...je(e)});class HL extends Ge{_parse(e){if(this._getType(e)!==ce.nan){const r=this._getOrReturnCtx(e);return te(r,{code:J.invalid_type,expected:ce.nan,received:r.parsedType}),ke}return{status:"valid",value:e.data}}}HL.create=t=>new HL({typeName:Ae.ZodNaN,...je(t)});class Vhe extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class tI extends Ge{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ke:s.status==="dirty"?(n.dirty(),Ry(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ke:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new tI({in:e,out:n,typeName:Ae.ZodPipeline})}}class NP extends Ge{_parse(e){const n=this._def.innerType._parse(e),r=i=>(pg(i)&&(i.value=Object.freeze(i.value)),i);return k1(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}NP.create=(t,e)=>new NP({innerType:t,typeName:Ae.ZodReadonly,...je(e)});tn.lazycreate;var Ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));const eH=su.create;Cu.create;ho.create;tn.create;tn.strictCreate;E1.create;_1.create;Yd.create;mg.create;C1.create;mu.create;yg.create;const Hhe=eH().email("Please enter a valid email address"),Whe=eH().min(6,"Password must be at least 6 characters");function Ghe(){const[t,e]=A.useState(""),[n,r]=A.useState(""),[i,s]=A.useState(!1),[a,o]=A.useState(!1),[l,c]=A.useState(!1),[h,d]=A.useState({}),{user:f,isAdmin:p,isLoading:m,signIn:y,signUp:x,checkAdminStatus:v}=XV(),w=rf(),{toast:b}=Ag();A.useEffect(()=>{!m&&f&&p&&w("/admin/dashboard")},[f,p,m,w]);const k=()=>{const C={};try{Hhe.parse(t)}catch(P){P instanceof ha&&(C.email=P.errors[0].message)}try{Whe.parse(n)}catch(P){P instanceof ha&&(C.password=P.errors[0].message)}return d(C),Object.keys(C).length===0},_=async C=>{if(C.preventDefault(),!!k()){o(!0);try{let P;if(i){if(P=await x(t,n),!P.error){b({title:"Account created",description:"Please check with your administrator to get admin access."}),s(!1),o(!1);return}}else P=await y(t,n);if(P.error){let O=P.error.message;O.includes("Invalid login credentials")?O="Invalid email or password. Please try again.":O.includes("already registered")&&(O="This email is already registered. Please sign in instead."),b({title:"Error",description:O,variant:"destructive"}),o(!1);return}await v()?(b({title:"Welcome!",description:"Successfully logged in as admin."}),w("/admin/dashboard")):b({title:"Access Denied",description:"You do not have admin privileges. Please contact your administrator.",variant:"destructive"})}catch{b({title:"Error",description:"An unexpected error occurred. Please try again.",variant:"destructive"})}finally{o(!1)}}};return m?g.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:g.jsx(bl,{className:"h-8 w-8 animate-spin text-primary"})}):g.jsxs("div",{className:"min-h-screen bg-background relative overflow-hidden flex items-center justify-center px-4",children:[g.jsx(a1,{}),g.jsxs(ih,{className:"w-full max-w-md bg-white/5 backdrop-blur-sm border-white/10 relative z-10",children:[g.jsxs(qy,{className:"text-center",children:[g.jsx("div",{className:"mx-auto w-12 h-12 bg-primary/20 rounded-full flex items-center justify-center mb-4",children:g.jsx(HO,{className:"h-6 w-6 text-primary"})}),g.jsx(Ky,{className:"text-2xl text-white",children:i?"Create Admin Account":"Admin Login"}),g.jsx(v3,{className:"text-white/60",children:i?"Sign up for an account. Admin access must be granted separately.":"Sign in to access the admin dashboard"})]}),g.jsxs(sh,{children:[g.jsxs("form",{onSubmit:_,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"email",className:"text-white/80",children:"Email"}),g.jsxs("div",{className:"relative",children:[g.jsx(N$,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/40"}),g.jsx(yn,{id:"email",type:"email",placeholder:"[email protected]",value:t,onChange:C=>{e(C.target.value),h.email&&d({...h,email:void 0})},className:"pl-10 bg-white/10 border-white/20 text-white placeholder:text-white/40",disabled:a})]}),h.email&&g.jsx("p",{className:"text-sm text-red-400",children:h.email})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(ro,{htmlFor:"password",className:"text-white/80",children:"Password"}),g.jsxs("div",{className:"relative",children:[g.jsx(HO,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/40"}),g.jsx(yn,{id:"password",type:l?"text":"password",placeholder:"••••••••",value:n,onChange:C=>{r(C.target.value),h.password&&d({...h,password:void 0})},className:"pl-10 pr-10 bg-white/10 border-white/20 text-white placeholder:text-white/40",disabled:a}),g.jsx("button",{type:"button",onClick:()=>c(!l),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/60",children:l?g.jsx(H9,{className:"h-4 w-4"}):g.jsx(T$,{className:"h-4 w-4"})})]}),h.password&&g.jsx("p",{className:"text-sm text-red-400",children:h.password})]}),g.jsx(Ye,{type:"submit",className:"w-full bg-primary hover:bg-primary/90",disabled:a,children:a?g.jsxs(g.Fragment,{children:[g.jsx(bl,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Creating Account...":"Signing In..."]}):i?"Create Account":"Sign In"})]}),g.jsx("div",{className:"mt-4 text-center",children:g.jsx("button",{type:"button",onClick:()=>{s(!i),d({})},className:"text-sm text-white/60 hover:text-white transition-colors",disabled:a,children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})})]})]})]})}const tH=A.forwardRef(({className:t,...e},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:Ue("w-full caption-bottom text-sm",t),...e})}));tH.displayName="Table";const nH=A.forwardRef(({className:t,...e},n)=>g.jsx("thead",{ref:n,className:Ue("[&_tr]:border-b",t),...e}));nH.displayName="TableHeader";const rH=A.forwardRef(({className:t,...e},n)=>g.jsx("tbody",{ref:n,className:Ue("[&_tr:last-child]:border-0",t),...e}));rH.displayName="TableBody";const qhe=A.forwardRef(({className:t,...e},n)=>g.jsx("tfoot",{ref:n,className:Ue("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));qhe.displayName="TableFooter";const RP=A.forwardRef(({className:t,...e},n)=>g.jsx("tr",{ref:n,className:Ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));RP.displayName="TableRow";const Wl=A.forwardRef(({className:t,...e},n)=>g.jsx("th",{ref:n,className:Ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Wl.displayName="TableHead";const Gl=A.forwardRef(({className:t,...e},n)=>g.jsx("td",{ref:n,className:Ue("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Gl.displayName="TableCell";const Khe=A.forwardRef(({className:t,...e},n)=>g.jsx("caption",{ref:n,className:Ue("mt-4 text-sm text-muted-foreground",t),...e}));Khe.displayName="TableCaption";const Yhe=Ak("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 IP({className:t,variant:e,...n}){return g.jsx("div",{className:Ue(Yhe({variant:e}),t),...n})}function fa(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Xd(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const iH=6048e5,Xhe=864e5;let Qhe={};function oA(){return Qhe}function Yv(t,e){var o,l,c,h;
vendor: 4,318 bytes, line 385
385const n=oA(),r=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,i=fa(t),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function T1(t){return Yv(t,{weekStartsOn:1})}function sH(t){const e=fa(t),n=e.getFullYear(),r=Xd(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=T1(r),s=Xd(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=T1(s);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function WL(t){const e=fa(t);return e.setHours(0,0,0,0),e}function GL(t){const e=fa(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function Jhe(t,e){const n=WL(t),r=WL(e),i=+n-GL(n),s=+r-GL(r);return Math.round((i-s)/Xhe)}function Zhe(t){const e=sH(t),n=Xd(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T1(n)}function ede(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tde(t){if(!ede(t)&&typeof t!="number")return!1;const e=fa(t);return!isNaN(Number(e))}function nde(t){const e=fa(t),n=Xd(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const rde={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ide=(t,e,n)=>{let r;const i=rde[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ME(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const sde={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ade={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ode={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lde={date:ME({formats:sde,defaultWidth:"full"}),time:ME({formats:ade,defaultWidth:"full"}),dateTime:ME({formats:ode,defaultWidth:"full"})},cde={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ude=(t,e,n,r)=>cde[t];function ey(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[o]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const hde={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},dde={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fde={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pde={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
385ay","Saturday"]},mde={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gde={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},yde=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},vde={ordinalNumber:yde,era:ey({values:hde,defaultWidth:"wide"}),quarter:ey({values:dde,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ey({values:fde,defaultWidth:"wide"}),day:ey({values:pde,defaultWidth:"wide"}),dayPeriod:ey({values:mde,defaultWidth:"wide",formattingValues:gde,defaultFormattingWidth:"wide"})};function ty(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const a=s[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?bde(o,d=>d.test(a)):wde(o,d=>d.test(a));let c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const h=e.slice(a.length);return{value:c,rest:h}}}function wde(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function bde(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function xde(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(i.length);return{value:a,rest:o}}}const Sde=/^(\d+)(th|st|nd|rd)?/i,kde=/\d+/i,Ade={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ede={any:[/^b/i,/^(a|c)/i]},_de={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cde={any:[/1/i,/2/i,/3/i,/4/i]},Tde={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Pde={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nde={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Rde={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ide={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ode={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Mde={ordinalNumber:xde({matchPattern:Sde,parsePattern:kde,valueCallback:t=>parseInt(t,10)}),era:ty({matchPatterns:Ade,defaultMatchWidth:"wide",parsePatterns:Ede,defaultParseWidth:"any"}),quarter:ty({matchPatterns:_de,defaultMatchWidth:"wide",parsePatterns:Cde,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ty({matchPatterns:Tde,defaultMatchWidth:"wide",parsePatterns:Pde,defaultParseWidth:"any"}),day:ty({matchPatterns:Nde,defaultMatchWidth:"wide",parsePatterns:Rde,defaultParseWidth:"any"}),dayPeriod:ty({matchPatterns:Ide,defaultMatchWidth:"any",parsePatterns:Ode,defaultParseWidth:"any"})},Dde={code:"en-US",formatDistance:ide,formatLong:lde,formatRelative:ude,localize:vde,match:Mde,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lde(t){const e=fa(t);return Jhe(e,nde(e))+1}
vendor: 10,673 bytes, line 385
385function jde(t){const e=fa(t),n=+T1(e)-+Zhe(e);return Math.round(n/iH)+1}function aH(t,e){var h,d,f,p;const n=fa(t),r=n.getFullYear(),i=oA(),s=(e==null?void 0:e.firstWeekContainsDate)??((d=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,a=Xd(t,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=Yv(a,e),l=Xd(t,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=Yv(l,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Fde(t,e){var o,l,c,h;const n=oA(),r=(e==null?void 0:e.firstWeekContainsDate)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,i=aH(t,e),s=Xd(t,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Yv(s,e)}function Bde(t,e){const n=fa(t),r=+Yv(n,e)-+Fde(n,e);return Math.round(r/iH)+1}function rt(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const $l={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return rt(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):rt(n+1,2)},d(t,e){return rt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return rt(t.getHours()%12||12,e.length)},H(t,e){return rt(t.getHours(),e.length)},m(t,e){return rt(t.getMinutes(),e.length)},s(t,e){return rt(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return rt(i,e.length)}},wf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qL={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return $l.y(t,e)},Y:function(t,e,n,r){const i=aH(t,r),s=i>0?i:1-i;if(e==="YY"){const a=s%100;return rt(a,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):rt(s,e.length)},R:function(t,e){const n=sH(t);return rt(n,e.length)},u:function(t,e){const n=t.getFullYear();return rt(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return rt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return rt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return $l.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return rt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=Bde(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):rt(i,e.length)},I:function(t,e,n){const r=jde(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):rt(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):$l.d(t,e)},D:function(t,e,n){const r=Lde(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):rt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return rt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return rt(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return rt(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=wf.noon:r===0?i=wf.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=wf.evening:r>=12?i=wf.afternoon:r>=4?i=wf.morning:i=wf.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return $l.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):$l.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):rt(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):rt(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):$l.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):$l.s(t,e)},S:function(t,e){return $l.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return YL(r);case"XXXX":case"XX":return qu(r);case"XXXXX":case"XXX":default:return qu(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return YL(r);case"xxxx":case"xx":return qu(r);case"xxxxx":case"xxx":default:return qu(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+KL(r,":");case"OOOO":default:return"GMT"+qu(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+KL(r,":");case"zzzz":default:return"GMT"+qu(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return rt(r,e.length)},T:function(t,e,n){const r=t.getTime();return rt(r,e.length)}};function KL(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+e+rt(s,2)}function YL(t,e){return t%60===0?(t>0?"-":"+")+rt(Math.abs(t)/60,2):qu(t,e)}function qu(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=rt(Math.trunc(r/60),2),s=rt(r%60,2);return n+i+e+s}const XL=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oH=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},$de=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return XL(t,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",XL(r,e)).replace("{{time}}",oH(i,e))},Ude={p:oH,P:$de},zde=/^D+$/,Vde=/^Y+$/,Hde=["D","DD","YY","YYYY"];function Wde(t){return zde.test(t)}function Gde(t){return Vde.test(t)}function qde(t,e,n){const r=Kde(t,e,n);if(console.warn(r),Hde.includes(t))throw new RangeError(r)}function Kde(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Yde=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xde=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qde=/^'([^]*?)'?$/,Jde=/''/g,Zde=/[a-zA-Z]/;function lH(t,e,n){var h,d,f,p;const r=oA(),i=r.locale??Dde,s=r.firstWeekContainsDate??((d=(h=r.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??1,a=r.weekStartsOn??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,o=fa(t);
vendor: 11,545 bytes, line 385
385if(!tde(o))throw new RangeError("Invalid time value");let l=e.match(Xde).map(m=>{const y=m[0];if(y==="p"||y==="P"){const x=Ude[y];return x(m,i.formatLong)}return m}).join("").match(Yde).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const y=m[0];if(y==="'")return{isToken:!1,value:efe(m)};if(qL[y])return{isToken:!0,value:m};if(y.match(Zde))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const y=m.value;(Gde(y)||Wde(y))&&qde(y,e,String(t));const x=qL[y[0]];return x(o,y,i.localize,c)}).join("")}function efe(t){const e=t.match(Qde);return e?e[1].replace(Jde,"'"):t}function tfe({submissions:t,onViewDetails:e,onDownloadPitchDeck:n}){return g.jsx("div",{className:"overflow-x-auto",children:g.jsxs(tH,{children:[g.jsx(nH,{children:g.jsxs(RP,{className:"border-white/10 hover:bg-transparent",children:[g.jsx(Wl,{className:"text-white/60",children:"Name"}),g.jsx(Wl,{className:"text-white/60",children:"Startup"}),g.jsx(Wl,{className:"text-white/60",children:"VFTI Code"}),g.jsx(Wl,{className:"text-white/60",children:"Profile"}),g.jsx(Wl,{className:"text-white/60",children:"Pitch"}),g.jsx(Wl,{className:"text-white/60",children:"Date"}),g.jsx(Wl,{className:"text-white/60 text-right",children:"Actions"})]})}),g.jsx(rH,{children:t.map(r=>g.jsxs(RP,{className:"border-white/10 hover:bg-white/5",children:[g.jsx(Gl,{children:g.jsxs("div",{children:[g.jsxs("p",{className:"text-white font-medium",children:[r.first_name," ",r.last_name]}),g.jsx("p",{className:"text-white/50 text-sm",children:r.email})]})}),g.jsx(Gl,{className:"text-white",children:r.startup_name}),g.jsx(Gl,{children:g.jsx(IP,{variant:"outline",className:"border-primary/50 text-primary font-mono",children:r.vfti_code})}),g.jsx(Gl,{children:g.jsx(IP,{variant:"secondary",className:"bg-white/10 text-white/80 text-xs",children:r.personality_label})}),g.jsx(Gl,{children:g.jsxs("div",{className:"flex items-center gap-2",children:[r.pitch_pdf_path&&g.jsx("button",{onClick:()=>n(r.id),className:"text-primary hover:text-primary/80 transition-colors",title:"Download Pitch Deck",children:g.jsx(Ek,{className:"h-4 w-4"})}),r.pitch_link&&g.jsx("a",{href:r.pitch_link,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 transition-colors",title:"View Pitch Link",children:g.jsx(FN,{className:"h-4 w-4"})}),!r.pitch_pdf_path&&!r.pitch_link&&g.jsx("span",{className:"text-white/30 text-sm",children:"—"})]})}),g.jsx(Gl,{className:"text-white/60 text-sm",children:lH(new Date(r.created_at),"MMM d, yyyy")}),g.jsx(Gl,{className:"text-right",children:g.jsx(Ye,{variant:"ghost",size:"sm",onClick:()=>e(r),className:"text-white/60 hover:text-white hover:bg-white/10",children:g.jsx(T$,{className:"h-4 w-4"})})})]},r.id))})]})})}function nfe(t,e){const n=A.createContext(e),r=s=>{const{children:a,...o}=s,l=A.useMemo(()=>o,Object.values(o));return g.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(s){const a=A.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function rfe(t,e=[]){let n=[];function r(s,a){const o=A.createContext(a),l=n.length;n=[...n,a];const c=d=>{var v;const{scope:f,children:p,...m}=d,y=((v=f==null?void 0:f[t])==null?void 0:v[l])||o,x=A.useMemo(()=>m,Object.values(m));return g.jsx(y.Provider,{value:x,children:p})};c.displayName=s+"Provider";function h(d,f){var y;const p=((y=f==null?void 0:f[t])==null?void 0:y[l])||o,m=A.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,h]}const i=()=>{const s=n.map(a=>A.createContext(a));return function(o){const l=(o==null?void 0:o[t])||s;return A.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,ife(i,...e)]}function ife(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...o,...d}},{});return A.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var DE="focusScope.autoFocusOnMount",LE="focusScope.autoFocusOnUnmount",QL={bubbles:!1,cancelable:!0},sfe="FocusScope",cH=A.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[o,l]=A.useState(null),c=ai(i),h=ai(s),d=A.useRef(null),f=Sn(e,y=>l(y)),p=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let y=function(b){if(p.paused||!o)return;const k=b.target;o.contains(k)?d.current=k:ql(d.current,{select:!0})},x=function(b){if(p.paused||!o)return;const k=b.relatedTarget;k!==null&&(o.contains(k)||ql(d.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&ql(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const w=new MutationObserver(v);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),w.disconnect()}}},[r,o,p.paused]),A.useEffect(()=>{if(o){ZL.add(p);const y=document.activeElement;if(!o.contains(y)){const v=new CustomEvent(DE,QL);o.addEventListener(DE,c),o.dispatchEvent(v),v.defaultPrevented||(afe(hfe(uH(o)),{select:!0}),document.activeElement===y&&ql(o))}return()=>{o.removeEventListener(DE,c),setTimeout(()=>{const v=new CustomEvent(LE,QL);o.addEventListener(LE,h),o.dispatchEvent(v),v.defaultPrevented||ql(y??document.body,{select:!0}),o.removeEventListener(LE,h),ZL.remove(p)},0)}}},[o,c,h,p]);const m=A.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const w=y.currentTarget,[b,k]=ofe(w);b&&k?!y.shiftKey&&v===k?(y.preventDefault(),n&&ql(b,{select:!0})):y.shiftKey&&v===b&&(y.preventDefault(),n&&ql(k,{select:!0})):v===w&&y.preventDefault()}},[n,r,p.paused]);return g.jsx(St.div,{tabIndex:-1,...a,ref:f,onKeyDown:m})});cH.displayName=sfe;function afe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ql(r,{select:e}),document.activeElement!==n)return}function ofe(t){const e=uH(t),n=JL(e,t),r=JL(e.reverse(),t);return[n,r]}function uH(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function JL(t,e){for(const n of t)if(!lfe(n,{upTo:e}))return n}function lfe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function cfe(t){return t instanceof HTMLInputElement&&"select"in t}function ql(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&cfe(t)&&e&&t.select()}}var ZL=ufe();function ufe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=ej(t,e),t.unshift(e)},remove(e){var n;t=ej(t,e),(n=t[0])==null||n.resume()}}}function ej(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function hfe(t){return t.filter(e=>e.tagName!=="A")}function dfe(t,e){return A.useReducer((n,r)=>e[n][r]??n,t)}var lA=t=>{const{present:e,children:n}=t,r=ffe(e),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),s=Sn(r.ref,pfe(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:s}):null};lA.displayName="Presence";function ffe(t){const[e,n]=A.useState(),r=A.useRef({}),i=A.useRef(t),s=A.useRef("none"),a=t?"mounted":"unmounted",[o,l]=dfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=Zb(r.current);s.current=o==="mounted"?c:"none"},[o]),qi(()=>{const c=r.current,h=i.current;if(h!==t){const f=s.current,p=Zb(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),qi(()=>{if(e){let c;const h=e.ownerDocument.defaultView??window,d=p=>{const y=Zb(r.current).includes(p.animationName);if(p.target===e&&y&&(l("ANIMATION_END"),!i.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",c=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},f=p=>{p.target===e&&(s.current=Zb(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{h.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Zb(t){return(t==null?void 0:t.animationName)||"none"}function pfe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var jE=0;function mfe(){A.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??tj()),document.body.insertAdjacentElement("beforeend",t[1]??tj()),jE++,()=>{jE===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jE--}},[])}function tj(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ao=function(){return ao=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ao.apply(this,arguments)};function hH(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function gfe(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var yS="right-scroll-bar-position",vS="width-before-scroll-bar",yfe="with-scroll-bars-hidden",vfe="--removed-body-scroll-bar-size";function FE(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function wfe(t,e){var n=A.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var bfe=typeof window<"u"?A.useLayoutEffect:A.useEffect,nj=new WeakMap;function xfe(t,e){var n=wfe(null,function(r){return t.forEach(function(i){return FE(i,r)})});return bfe(function(){var r=nj.get(n);if(r){var i=new Set(r),s=new Set(t),a=n.current;
vendor: 4,183 bytes, lines 385-400
385i.forEach(function(o){s.has(o)||FE(o,null)}),s.forEach(function(o){i.has(o)||FE(o,a)})}nj.set(n,t)},[t]),n}function Sfe(t){return t}function kfe(t,e){e===void 0&&(e=Sfe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var a=e(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var l=function(){var h=a;a=[],h.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(h){a.push(h),c()},filter:function(h){return a=a.filter(h),n}}}};return i}function Afe(t){t===void 0&&(t={});var e=kfe(null);return e.options=ao({async:!0,ssr:!1},t),e}var dH=function(t){var e=t.sideCar,n=hH(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,ao({},n))};dH.isSideCarExport=!0;function Efe(t,e){return t.useMedium(e),dH}var fH=Afe(),BE=function(){},cA=A.forwardRef(function(t,e){var n=A.useRef(null),r=A.useState({onScrollCapture:BE,onWheelCapture:BE,onTouchMoveCapture:BE}),i=r[0],s=r[1],a=t.forwardProps,o=t.children,l=t.className,c=t.removeScrollBar,h=t.enabled,d=t.shards,f=t.sideCar,p=t.noIsolation,m=t.inert,y=t.allowPinchZoom,x=t.as,v=x===void 0?"div":x,w=t.gapMode,b=hH(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,_=xfe([n,e]),C=ao(ao({},b),i);return A.createElement(A.Fragment,null,h&&A.createElement(k,{sideCar:fH,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:w}),a?A.cloneElement(A.Children.only(o),ao(ao({},C),{ref:_})):A.createElement(v,ao({},C,{className:l,ref:_}),o))});cA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cA.classNames={fullWidth:vS,zeroRight:yS};var _fe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Cfe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=_fe();return e&&t.setAttribute("nonce",e),t}function Tfe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Pfe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Nfe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Cfe())&&(Tfe(e,n),Pfe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Rfe=function(){var t=Nfe();return function(e,n){A.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},pH=function(){var t=Rfe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Ife={left:0,top:0,right:0,gap:0},$E=function(t){return parseInt(t||"",10)||0},Ofe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[$E(n),$E(r),$E(i)]},Mfe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Ife;var e=Ofe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Dfe=pH(),vp="data-scroll-locked",Lfe=function(t,e,n,r){var i=t.left,s=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),`
386  .`.concat(yfe,` {
387   overflow: hidden `).concat(r,`;
388   padding-right: `).concat(o,"px ").concat(r,`;
389  }
390  body[`).concat(vp,`] {
391    overflow: hidden `).concat(r,`;
392    overscroll-behavior: contain;
393    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
394    padding-left: `.concat(i,`px;
395    padding-top: `).concat(s,`px;
396    padding-right: `).concat(a,`px;
397    margin-left:0;
398    margin-top:0;
399    margin-right: `).concat(o,"px ").concat(r,`;
400    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";
400")].filter(Boolean).join(""),`
401  }
402  
403  .`).concat(yS,` {
404    right: `).concat(o,"px ").concat(r,`;
405  }
406  
407  .`).concat(vS,` {
408    margin-right: `).concat(o,"px ").concat(r,`;
409  }
410  
411  .`).concat(yS," .").concat(yS,` {
412    right: 0 `).concat(r,`;
413  }
414  
415  .`).concat(vS," .").concat(vS,` {
416    margin-right: 0 `).concat(r,`;
417  }
418  
419  body[`).concat(vp,`] {
420    `).concat(vfe,": ").concat(o,`px;
421  }
422`)},rj=function(){var t=parseInt(document.body.getAttribute(vp)||"0",10);return isFinite(t)?t:0},jfe=function(){A.useEffect(function(){return document.body.setAttribute(vp,(rj()+1).toString()),function(){var t=rj()-1;t<=0?document.body.removeAttribute(vp):document.body.setAttribute(vp,t.toString())}},[])},Ffe=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;jfe();var s=A.useMemo(function(){return Mfe(i)},[i]);return A.createElement(Dfe,{styles:Lfe(s,!e,i,n?"":"!important")})},OP=!1;if(typeof window<"u")try{var ex=Object.defineProperty({},"passive",{get:function(){return OP=!0,!0}});window.addEventListener("test",ex,ex),window.removeEventListener("test",ex,ex)}catch{OP=!1}var bf=OP?{passive:!1}:!1,Bfe=function(t){return t.tagName==="TEXTAREA"},mH=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Bfe(t)&&n[e]==="visible")},$fe=function(t){return mH(t,"overflowY")},Ufe=function(t){return mH(t,"overflowX")},ij=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gH(t,r);if(i){var s=yH(t,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zfe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Vfe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},gH=function(t,e){return t==="v"?$fe(e):Ufe(e)},yH=function(t,e){return t==="v"?zfe(e):Vfe(e)},Hfe=function(t,e){return t==="h"&&e==="rtl"?-1:1},Wfe=function(t,e,n,r,i){var s=Hfe(t,window.getComputedStyle(e).direction),a=s*r,o=n.target,l=e.contains(o),c=!1,h=a>0,d=0,f=0;do{var p=yH(t,o),m=p[0],y=p[1],x=p[2],v=y-x-s*m;(m||v)&&gH(t,o)&&(d+=v,f+=m),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(h&&(Math.abs(d)<1||!i)||!h&&(Math.abs(f)<1||!i))&&(c=!0),c},tx=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},sj=function(t){return[t.deltaX,t.deltaY]},aj=function(t){return t&&"current"in t?t.current:t},Gfe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},qfe=function(t){return`
423  .block-interactivity-`.concat(t,` {pointer-events: none;}
424  .allow-interactivity-`).concat(t,` {pointer-events: all;}
425`)},Kfe=0,xf=[];function Yfe(t){var e=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(Kfe++)[0],s=A.useState(pH)[0],a=A.useRef(t);A.useEffect(function(){a.current=t},[t]),A.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var y=gfe([t.lockRef.current],(t.shards||[]).map(aj),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=A.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var v=tx(y),w=n.current,b="deltaX"in y?y.deltaX:w[0]-v[0],k="deltaY"in y?y.deltaY:w[1]-v[1],_,C=y.target,P=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var R=ij(P,C);if(!R)return!0;if(R?_=P:(_=P==="v"?"h":"v",R=ij(P,C)),!R)return!1;if(!r.current&&"changedTouches"in y&&(b||k)&&(r.current=_),!_)return!0;var O=r.current||_;return Wfe(O,x,y,O==="h"?b:k,!0)},[]),l=A.useCallback(function(y){var x=y;if(!(!xf.length||xf[xf.length-1]!==s)){var v="deltaY"in x?sj(x):tx(x),w=e.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&Gfe(_.delta,v)}
vendor: 9,078 bytes, lines 425-429
425)[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(aj).filter(Boolean).filter(function(_){return _.contains(x.target)}),k=b.length>0?o(x,b[0]):!a.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),c=A.useCallback(function(y,x,v,w){var b={name:y,delta:x,target:v,should:w,shadowParent:Xfe(v)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(k){return k!==b})},1)},[]),h=A.useCallback(function(y){n.current=tx(y),r.current=void 0},[]),d=A.useCallback(function(y){c(y.type,sj(y),y.target,o(y,t.lockRef.current))},[]),f=A.useCallback(function(y){c(y.type,tx(y),y.target,o(y,t.lockRef.current))},[]);A.useEffect(function(){return xf.push(s),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,bf),document.addEventListener("touchmove",l,bf),document.addEventListener("touchstart",h,bf),function(){xf=xf.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,bf),document.removeEventListener("touchmove",l,bf),document.removeEventListener("touchstart",h,bf)}},[]);var p=t.removeScrollBar,m=t.inert;return A.createElement(A.Fragment,null,m?A.createElement(s,{styles:qfe(i)}):null,p?A.createElement(Ffe,{gapMode:t.gapMode}):null)}function Xfe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Qfe=Efe(fH,Yfe);var vH=A.forwardRef(function(t,e){return A.createElement(cA,ao({},t,{ref:e,sideCar:Qfe}))});vH.classNames=cA.classNames;var Jfe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Sf=new WeakMap,nx=new WeakMap,rx={},UE=0,wH=function(t){return t&&(t.host||wH(t.parentNode))},Zfe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=wH(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},epe=function(t,e,n,r){var i=Zfe(e,Array.isArray(t)?t:[t]);rx[n]||(rx[n]=new WeakMap);var s=rx[n],a=[],o=new Set,l=new Set(i),c=function(d){!d||o.has(d)||(o.add(d),c(d.parentNode))};i.forEach(c);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",y=(Sf.get(f)||0)+1,x=(s.get(f)||0)+1;Sf.set(f,y),s.set(f,x),a.push(f),y===1&&m&&nx.set(f,!0),x===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return h(e),o.clear(),UE++,function(){a.forEach(function(d){var f=Sf.get(d)-1,p=s.get(d)-1;Sf.set(d,f),s.set(d,p),f||(nx.has(d)||d.removeAttribute(r),nx.delete(d)),p||d.removeAttribute(n)}),UE--,UE||(Sf=new WeakMap,Sf=new WeakMap,nx=new WeakMap,rx={})}},tpe=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Jfe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),epe(r,i,n,"aria-hidden")):function(){return null}},nI="Dialog",[bH,Ppe]=rfe(nI),[npe,pa]=bH(nI),xH=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,o=A.useRef(null),l=A.useRef(null),[c=!1,h]=MN({prop:r,defaultProp:i,onChange:s});return g.jsx(npe,{scope:e,triggerRef:o,contentRef:l,contentId:GA(),titleId:GA(),descriptionId:GA(),open:c,onOpenChange:h,onOpenToggle:A.useCallback(()=>h(d=>!d),[h]),modal:a,children:n})};xH.displayName=nI;var SH="DialogTrigger",rpe=A.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=pa(SH,n),s=Sn(e,i.triggerRef);return g.jsx(St.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sI(i.open),...r,ref:s,onClick:st(t.onClick,i.onOpenToggle)})});rpe.displayName=SH;var rI="DialogPortal",[ipe,kH]=bH(rI,{forceMount:void 0}),AH=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=pa(rI,e);return g.jsx(ipe,{scope:e,forceMount:n,children:A.Children.map(r,a=>g.jsx(lA,{present:n||s.open,children:g.jsx(uU,{asChild:!0,container:i,children:a})}))})};AH.displayName=rI;var P1="DialogOverlay",EH=A.forwardRef((t,e)=>{const n=kH(P1,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=pa(P1,t.__scopeDialog);return s.modal?g.jsx(lA,{present:r||s.open,children:g.jsx(spe,{...i,ref:e})}):null});EH.displayName=P1;var spe=A.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=pa(P1,n);return g.jsx(vH,{as:og,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(St.div,{"data-state":sI(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Qd="DialogContent",_H=A.forwardRef((t,e)=>{const n=kH(Qd,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=pa(Qd,t.__scopeDialog);return g.jsx(lA,{present:r||s.open,children:s.modal?g.jsx(ape,{...i,ref:e}):g.jsx(ope,{...i,ref:e})})});_H.displayName=Qd;var ape=A.forwardRef((t,e)=>{const n=pa(Qd,t.__scopeDialog),r=A.useRef(null),i=Sn(e,n.contentRef,r);return A.useEffect(()=>{const s=r.current;if(s)return tpe(s)},[]),g.jsx(CH,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:st(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:st(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:st(t.onFocusOutside,s=>s.preventDefault())})}),ope=A.forwardRef((t,e)=>{const n=pa(Qd,t.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return g.jsx(CH,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),CH=A.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,o=pa(Qd,n),l=A.useRef(null),c=Sn(e,l);return mfe(),g.jsxs(g.Fragment,{children:[g.jsx(cH,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:g.jsx($N,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":sI(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(lpe,{titleId:o.titleId}),g.jsx(upe,{contentRef:l,descriptionId:o.descriptionId})]})]})}),iI="DialogTitle",TH=A.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=pa(iI,n);return g.jsx(St.h2,{id:i.titleId,...r,ref:e})});TH.displayName=iI;var PH="DialogDescription",NH=A.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=pa(PH,n);return g.jsx(St.p,{id:i.descriptionId,...r,ref:e})});NH.displayName=PH;var RH="DialogClose",IH=A.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=pa(RH,n);return g.jsx(St.button,{type:"button",...r,ref:e,onClick:st(t.onClick,()=>i.onOpenChange(!1))})});IH.displayName=RH;function sI(t){return t?"open":"closed"}var OH="DialogTitleWarning",[Npe,MH]=nfe(OH,{contentName:Qd,titleName:iI,docsSlug:"dialog"}),lpe=({titleId:t})=>{const e=MH(OH),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
426
427If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
428
429For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return A.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},cpe="DialogDescriptionWarning",upe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MH(cpe).contentName}}.`;return A.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},hpe=xH,dpe=AH,DH=EH,LH=_H,jH=TH,FH=NH,fpe=IH;const ppe=hpe,mpe=dpe,BH=A.forwardRef(({className:t,...e},n)=>g.jsx(DH,{ref:n,className:Ue("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",t),...e}));BH.displayName=DH.displayName;const $H=A.forwardRef(({className:t,children:e,...n},r)=>g.jsxs(mpe,{children:[g.jsx(BH,{}),g.jsxs(LH,{ref:r,className:Ue("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",t),...n,children:[e,g.jsxs(fpe,{className:"absolute right-4 top-4 roun
429ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(lg,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$H.displayName=LH.displayName;const UH=({className:t,...e})=>g.jsx("div",{className:Ue("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});UH.displayName="DialogHeader";const zH=A.forwardRef(({className:t,...e},n)=>g.jsx(jH,{ref:n,className:Ue("text-lg font-semibold leading-none tracking-tight",t),...e}));zH.displayName=jH.displayName;const VH=A.forwardRef(({className:t,...e},n)=>g.jsx(FH,{ref:n,className:Ue("text-sm text-muted-foreground",t),...e}));VH.displayName=FH.displayName;function gpe({submission:t,onClose:e,onDownloadPitchDeck:n}){return g.jsx(ppe,{open:!0,onOpenChange:e,children:g.jsxs($H,{className:"bg-[#0a0a0f] border-white/10 text-white max-w-2xl max-h-[90vh] overflow-y-auto",children:[g.jsxs(UH,{children:[g.jsxs(zH,{className:"text-xl text-white flex items-center gap-3",children:[g.jsxs("span",{children:[t.first_name," ",t.last_name]}),g.jsx(IP,{variant:"outline",className:"border-primary/50 text-primary font-mono",children:t.vfti_code})]}),g.jsx(VH,{className:"text-white/60",children:t.startup_name})]}),g.jsxs("div",{className:"space-y-6 mt-4",children:[g.jsxs("div",{className:"bg-white/5 rounded-lg p-4 space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-white/80 uppercase tracking-wide",children:"Profile Summary"}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xs text-white/50",children:"Personality Type"}),g.jsx("p",{className:"text-white",children:t.personality_label})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xs text-white/50",children:"HHH Classification"}),g.jsx("p",{className:"text-white",children:t.hhh_classification})]})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xs text-white/50 mb-1",children:"Narrative Description"}),g.jsx("p",{className:"text-white/80 text-sm",children:t.narrative_description})]})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-white/80 uppercase tracking-wide",children:"Contact Information"}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-3 text-white/80",children:[g.jsx(N$,{className:"h-4 w-4 text-white/40"}),g.jsx("a",{href:`mailto:${t.email}`,className:"hover:text-primary transition-colors",children:t.email})]}),g.jsxs("div",{className:"flex items-center gap-3 text-white/80",children:[g.jsx(G9,{className:"h-4 w-4 text-white/40"}),g.jsx("a",{href:t.primary_profile_url,target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors truncate",children:t.primary_profile_url})]})]})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-white/80 uppercase tracking-wide",children:"Pitch Materials"}),g.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.pitch_pdf_path&&g.jsxs(Ye,{variant:"outline",size:"sm",onClick:()=>n(t.id),className:"border-primary/50 text-primary hover:bg-primary/10",children:[g.jsx(C$,{className:"h-4 w-4 mr-2"}),"Download Pitch Deck"]}),t.pitch_link&&g.jsxs(Ye,{variant:"outline",size:"sm",onClick:()=>window.open(t.pitch_link,"_blank"),className:"border-white/20 text-white hover:bg-white/10",children:[g.jsx(FN,{className:"h-4 w-4 mr-2"}),"Open Pitch Link"]}),!t.pitch_pdf_path&&!t.pitch_link&&g.jsx("p",{className:"text-white/40 text-sm",children:"No pitch materials provided"})]})]}),t.answers&&Object.keys(t.answers).length>0&&g.jsxs("div",{className:"space-y-3",children:[g.jsx("h3",{className:"text-sm font-medium text-white/80 uppercase tracking-wide",children:"Quiz Answers"}),g.jsx("div",{className:"bg-white/5 rounded-lg p-4 max-h-48 overflow-y-auto",children:g.jsx("pre",{className:"text-xs text-white/70 whitespace-pre-wrap",children:JSON.stringify(t.answers,null,2)})})]}),g.jsxs("div",{className:"flex items-center gap-2 text-white/40 text-sm pt-4 border-t border-white/10",children:[g.jsx($9,{className:"h-4 w-4"}),g.jsxs("span",{children:["Submitted on ",lH(new Date(t.created_at),"MMMM d, yyyy 'at' h:mm a")]})]})]})]})})}function ype(){const{user:t,session:e,isAdmin:n,isLoading:r,signOut:i}=XV(),s=rf(),{toast:a}=Ag(),[o,l]=A.useState([]),[c,h]=A.useState(!0),[d,f]=A.useState(""),[p,m]=A.useState(1),[y,x]=A.useState(1),[v,w]=A.useState(0),[b]=A.useState(10),[k,_]=A.useState(null),[C,P]=A.useState(!1),R=A.useCallback(async()=>
429{if(e!=null&&e.access_token){h(!0);try{const U=new URLSearchParams({page:p.toString(),limit:b.toString()});d&&U.append("search",d);const B=await Zr.functions.invoke(`admin-submissions?${U.toString()}`,{headers:{Authorization:`Bearer ${e.access_token}`}});if(B.error)throw new Error(B.error.message);l(B.data.submissions||[]),w(B.data.total||0),x(B.data.totalPages||1)}catch(U){console.error("Error fetching submissions:",U),a({title:"Error",description:"Failed to fetch submissions",variant:"destructive"})}finally{h(!1)}}},[e==null?void 0:e.access_token,p,b,d,a]);A.useEffect(()=>{!r&&(!t||!n)&&s("/admin")},[t,n,r,s]),A.useEffect(()=>{e!=null&&e.access_token&&n&&R()},[e==null?void 0:e.access_token,n,R]);const O=U=>{U.preventDefault(),m(1),R()},M=async()=>{if(e!=null&&e.access_token){P(!0);try{const U=await Zr.functions.invoke("admin-submissions/export",{headers:{Authorization:`Bearer ${e.access_token}`}});if(U.error)throw new Error(U.error.message);const B=new Blob([U.data],{type:"text/csv"}),z=window.URL.createObjectURL(B),$=document.createElement("a");$.href=z,$.download=`founder_submissions_${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild($),$.click(),document.body.removeChild($),window.URL.revokeObjectURL(z),a({title:"Export Complete",description:"CSV file downloaded successfully"})}catch(U){console.error("Error exporting CSV:",U),a({title:"Export Failed",description:"Failed to export submissions",variant:"destructive"})}finally{P(!1)}}},D=async U=>{if(e!=null&&e.access_token)try{const B=await Zr.functions.invoke(`admin-submissions/${U}/pitch-deck`,{headers:{Authorization:`Bearer ${e.access_token}`}});if(B.error)throw new Error(B.error.message);window.open(B.data.signedUrl,"_blank")}catch(B){console.error("Error downloading pitch deck:",B),a({title:"Download Failed",description:"Failed to download pitch deck",variant:"destructive"})}},j=async()=>{await i(),s("/admin")};return r?g.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:g.jsx(bl,{className:"h-8 w-8 animate-spin text-primary"})}):g.jsxs("div",{className:"min-h-screen bg-background relative overflow-hidden",children:[g.jsx(a1,{}),g.jsxs("div",{className:"relative z-10 p-4 md:p-8",children:[g.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between mb-8 gap-4",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white",children:"Admin Dashboard"}),g.jsx("p",{className:"text-white/60 mt-1",children:"Manage founder quiz submissions"})]}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsxs(Ye,{onClick:M,variant:"outline",className:"border-white/20 text-white hover:bg-white/10",disabled:C,children:[C?g.jsx(bl,{className:"h-4 w-4 animate-spin mr-2"}):g.jsx(C$,{className:"h-4 w-4 mr-2"}),"Export CSV"]}),g.jsxs(Ye,{onClick:j,variant:"ghost",className:"text-white/60 hover:text-white hover:bg-white/10",children:[g.jsx(K9,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[g.jsxs(ih,{className:"bg-white/5 backdrop-blur-sm border-white/10",children:[g.jsx(qy,{className:"pb-2",children:g.jsx(Ky,{className:"text-sm text-white/60 font-normal",children:"Total Submissions"})}),g.jsx(sh,{children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(R$,{className:"h-5 w-5 text-primary"}),g.jsx("span",{className:"text-2xl font-bold text-white",children:v})]})})]}),g.jsxs(ih,{className:"bg-white/5 backdrop-blur-sm border-white/10",children:[g.jsx(qy,{className:"pb-2",children:g.jsx(Ky,{className:"text-sm text-white/60 font-normal",children:"With Pitch Deck"})}),g.jsx(sh,{children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ek,{className:"h-5 w-5 text-primary"}),g.jsx("span",{className:"text-2xl font-bold text-white",children:o.filter(U=>U.pitch_pdf_path).length})]})})]}),g.jsxs(ih,{className:"bg-white/5 backdrop-blur-sm border-white/10",children:[g.jsx(qy,{className:"pb-2",children:g.jsx(Ky,{className:"text-sm text-white/60 font-normal",children:"With Pitch Link"})}),g.jsx(sh,{children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(FN,{className:"h-5 w-5 text-primary"}),g.jsx("span",{className:"text-2xl font-bold text-white",children:o.filter(U=>U.pitch_link).length})]})})]})]}),g.jsx("form",{onSubmit:O,className:"mb-6",children:g.jsxs("div",{className:"flex gap-2",children:[g.jsxs("div",{className:"relative flex-1 max-w-md",children:[g.jsx(J9,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/40"}),g.jsx(yn,{placeholder:"Search by name, email, startup, or VFTI code...",value:d,onChange:U=>f(U.target.value),className:"pl-10 bg-white/10 border-white/20 text-white placeholder:text-white/40"})]}),g.jsx(Ye,{type:"submit",className:"bg-primary hover:bg-primary/90",children:"Search"}),d&&g.jsx(Ye,{type:"button",variant:"ghost",onClick:()=>{f(""),m(1)},className:"text-white/60 hover:text-white",children:"Clear"})]})}),g.jsx(ih,{className:"bg-white/5 backdrop-blur-sm border-white/10 overflow-hidden",children:g.jsx(sh,{className:"p-0",children:c?g.jsx("div",{className:"flex items-center justify-center py-20",children:g.jsx(bl,{className:"h-8 w-8 animate-spin text-primary"})}):o.length===0?g.jsx("div",{className:"text-center py-20 text-white/60",children:d?"No submissions match your search":"No submissions yet"}):g.jsx(tfe,{submissions:o,onViewDetails:_,onDownloadPitchDeck:D})})}),y>1&&g.jsxs("div",{className:"flex items-center justify-between mt-4",children:[g.jsxs("p",{className:"text-sm text-white/60",children:["Showing ",(p-1)*b+1," to ",Math.min(p*b,v)," of ",v]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ye,{variant:"outline",size:"sm",onClick:()=>m(U=>Math.max(1,U-1)),disabled:p===1,className:"border-white/20 text-white hover:bg-white/10",children:g.jsx(U9,{className:"h-4 w-4"})}),g.jsxs("span",{className:"text-white px-2",children:["Page ",p," of ",y]}),g.jsx(Ye,{variant:"outline",size:"sm",onClick:()=>m(U=>Math.min(y,U+1)),disabled:p===y,className:"border-white/20 text-white hover:bg-white/10",children:g.jsx(z9,{className:"h-4 w-4"})})]})]}),k&&g.jsx(gpe,{submission:k,onClose:()=>_(null),onDownloadPitchDeck:D})]})]})}const vpe=new S7,Bu=({children:t})=>g.jsxs("div",{className:"min-h-screen bg-background",children:[g.jsx(E7,{}),g.jsx("main",{className:"pt-20",children:t}),g.jsx(_7,{}),g.jsx(T7,{})]}),wpe=()=>g.jsx(A7,{client:vpe,children:g.jsx(e7,{children:g.jsxs(yhe,{children:[g.jsx($q,{}),g.jsx(mK,{}),g.jsxs(aG,{children:[g.jsx(Sa,{path:"/admin",element:g.jsx(Ghe,{})}),g.jsx(Sa,{path:"/admin/dashboard",element:g.jsx(ype,{})}),g.jsx(Sa,{path:"/",element:g.jsx(Bu,{children:g.jsx(Fee,{})})}),g.jsx(Sa,{path:"/team",element:g.jsx(Bu,{children:g.jsx(Bee,{})})}),g.jsx(Sa,{path:"/blog",element:g.jsx(Bu,{children:g.jsx(zee,{})})}),g.jsx(Sa,{path:"/imprint",element:g.jsx(Bu,{children:g.jsx(Vee,{})})}),g.jsx(Sa,{path:"/privacy",element:g.jsx(Bu,{children:g.jsx(Hee,{})})}),g.jsx(Sa,{path:"/vfti-quiz",element:g.jsx(Bu,{children:g.jsx(mte,{})})}),g.jsx(Sa,{path:"/assessment",element:g.jsx(Bu,{children:g.jsx(ghe,{})})})]})]})})});PB(document.getElementById("root")).render(g.jsx(qB,{children:g.jsx(fG,{children:g.jsx(wpe,{})})}));

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.